DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:hidingip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:hidingip [2018-10-24 10:08] – Updated hokkaidopersonplugin:hidingip [2020-07-14 10:08] (current) – Compatible with hogfather hokkaidoperson
Line 5: Line 5:
 author     : Hokkaidoperson  author     : Hokkaidoperson 
 email      : dosankomali@yahoo.co.jp  email      : dosankomali@yahoo.co.jp 
-type       : Action +type       : Action, Helper 
-lastupdate : 2018-10-24 +lastupdate : 2018-11-05 
-compatible : Greebo, 2018-04-22+compatible : Greebo, Hogfather
 tags       : ip, anonymous tags       : ip, anonymous
  
Line 45: Line 45:
  
 The plugin will rewrite only superficial data, core data won't be overwritten. The plugin will rewrite only superficial data, core data won't be overwritten.
 +
 +When to run this plugin can be specified on the config (see [[#Configuration and Settings]]).
 +
 +==== Helper Plugin Option ====
 +You can use the localization of the alternative text used by this plugin.\\
 +Here is a sample of the code:
 +<code PHP>
 +if (!isset($_SERVER['REMOTE_USER'])) {
 +    if(!plugin_isdisabled('hidingip')) {
 +        $hidingip = plugin_load('helper', 'hidingip');
 +        $user = $hidingip->altText();  // "$hidingip->getLang('notloggedin')" works similarly
 +}
 +</code>
 +
 +A practical sample can be seen in the program of my [[plugin:autotweet2|Autotweet2 plugin]] ([[https://github.com/hokkaidoperson/DokuWiki-AutoTweet2-Plugin/blob/master/action.php#L71|Here]]).
  
 ==== How IPs are Replaced ==== ==== How IPs are Replaced ====
Line 60: Line 75:
 If ''%%$event->data['username']%%'' is likely to be an IP, the plugin will write ''%%$event->data['name']%%''.\\ If ''%%$event->data['username']%%'' is likely to be an IP, the plugin will write ''%%$event->data['name']%%''.\\
 :!: You can't use the user name like IPs (that'll be accidentally replaced. e.g.: 3.57.2.13 ).((though I think that the case is rare)) :!: You can't use the user name like IPs (that'll be accidentally replaced. e.g.: 3.57.2.13 ).((though I think that the case is rare))
 +
 +===== Configuration and Settings =====
 +You can change the following setting by using the [[plugin:config|Configuration Manager]].
 +
 +^Option^Description^Value Type^Default Value^
 +|''whenToHide''|When to run the plugin (In the text box, you can specify when to run if you'll use Hidingip Helper plugin in other plugins.)|multiple choice from ''revision'' (Old revisions), ''recent'' (Recent changes), ''diff'' (Showing diffs), and ''userlink'' (COMMON_USER_LINK event (such as page locking and showing "last modified"))|''revision,recent,diff,userlink''|
 +|''rightToSeeIP''|Who can see IP addresses? (see config "[[config:manager]]" and "[[config:superuser]]|pull-down choice from ''sp'' (Superusers) or ''mg'' (Managers (including superusers))|''sp''|
  
 ===== Development ===== ===== Development =====
Line 71: Line 93:
   * **2018-10-24**   * **2018-10-24**
     * Update with bug fixing (The problem about WARNING level errors, and the problem that the plugin didn't work well if [[config:showuseras|the config Showuseras]] was ''username_link'' or ''email_link'')     * Update with bug fixing (The problem about WARNING level errors, and the problem that the plugin didn't work well if [[config:showuseras|the config Showuseras]] was ''username_link'' or ''email_link'')
 +  * **2018-10-30**
 +    * Adding some options (configs and the helper plugin section)
 +  * **2018-11-05**
 +    * Fixed invalid syntax
  
 === Known Bugs and Issues === === Known Bugs and Issues ===
plugin/hidingip.txt · Last modified: 2020-07-14 10:08 by hokkaidoperson

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki