DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:whoisonline

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:whoisonline [2013-06-21 01:26] – [whoisonline Plugin] millsdudeplugin:whoisonline [2022-07-17 22:20] (current) coastGNU
Line 7: Line 7:
 type       : syntax type       : syntax
 lastupdate : 2013-06-20 lastupdate : 2013-06-20
-compatible : 2013-05-10 "Weatherwax"+compatible : Hrun, Weatherwax, Greebo, !Hogfather, Igor 
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : users, ajax tags       : users, ajax
  
-downloadurl: http://github.com/millsdude/dokuwiki-plugin-whoisonline/zipball/master +downloadurl: https://github.com/millsdude/dokuwiki-plugin-whoisonline/zipball/master 
-bugtracker : http://github.com/millsdude/dokuwiki-plugin-whoisonline/issues +bugtracker : https://github.com/millsdude/dokuwiki-plugin-whoisonline/issues 
-sourcerepo : http://github.com/millsdude/dokuwiki-plugin-whoisonline/+sourcerepo : https://github.com/millsdude/dokuwiki-plugin-whoisonline
 donationurl:  donationurl: 
  
Line 21: Line 21:
 ---- ----
  
 +=== For Hogfather and Igor support ===
 +  * Edit ''lib/plugins/whoisonline/syntax.php'' and replace (line 108 & 123)<code>public function handle($match, $state, $pos, $handler) {
 +public function render($mode, $renderer, $data) {</code>
 +  * with<code>public function handle($match, $state, $pos, Doku_Handler $handler) {
 +public function render($mode, Doku_Renderer $renderer, $data) {</code>
 ===== Installation ===== ===== Installation =====
  
 Copy the whoisonline folder into the /lib/plugins folder and that should do it. Please keep the name the same since the ajax portion is specifically looking for that location. The plugin uses a file to store the active users, no database necessary. Copy the whoisonline folder into the /lib/plugins folder and that should do it. Please keep the name the same since the ajax portion is specifically looking for that location. The plugin uses a file to store the active users, no database necessary.
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
- 
-See the plugin in action [[www.demosite.com|here]]. The sample page shows all the styles available with the plugin. 
  
 For just a simple display of the online count add this: For just a simple display of the online count add this:
Line 39: Line 42:
   ~~whoisonline~~   ~~whoisonline~~
  
-The popup list can be customized in the admin configuration. The default is {username} but you can add all sorts of HTML to make it link to places. Here is what I use on my site...+The popup list can be customized in the admin configuration. The default is ''{username}'', but you can add all sorts of HTML to make it link to places. Here is what I use on my site...
  
   <a href="/users:{username}">{fullname}</a> - <a href="/{pageid}">{pageid}</a>   <a href="/users:{username}">{fullname}</a> - <a href="/{pageid}">{pageid}</a>
Line 45: Line 48:
 This will make the popup list have their fullname that links to their user page on the wiki, and then the current page they are looking at which you can click to. This will make the popup list have their fullname that links to their user page on the wiki, and then the current page they are looking at which you can click to.
  
-If you want to track the users but not show the count or the list just add the NOSHOW option on some footer to record their presence, then you can do the regular ~~whoisonline~~ on an admin page to view the results.+If you want to track the users but not show the count or the list just add the NOSHOW option on some footer to record their presence, then you can do the regular ''~~whoisonline~~'' on an admin page to view the results.
  
   ~~whoisonline:NOSHOW~~   ~~whoisonline:NOSHOW~~
Line 55: Line 58:
   ~~whoisonline:nolist~~   ~~whoisonline:nolist~~
   ~~whoisonline:noshow~~   ~~whoisonline:noshow~~
- 
  
 ===== Configuration and Settings ===== ===== Configuration and Settings =====
Line 67: Line 69:
 === Change Log === === Change Log ===
  
-  * **20013-06-20**+  * **2013-06-20**
     * Initial release      * Initial release 
  
Line 84: Line 86:
 The idea from this came from this link http://tutorialzine.com/2010/03/who-is-online-widget-php-mysql-jquery/  The idea from this came from this link http://tutorialzine.com/2010/03/who-is-online-widget-php-mysql-jquery/ 
 which had a great code example. I formatted it for my needs and made a Dokuwiki plugin out of it. which had a great code example. I formatted it for my needs and made a Dokuwiki plugin out of it.
 +
 +===== Adding Email to Substitution List ===== 
 +On line 48 of syntax.php, replace:
 +
 +<code php>
 +
 +if( isset($INFO['userinfo']) || ($this->getConf('ignoreAnonymous')==0)){ 
 + $userdisplay = str_replace( array( "{username}"
 + "{pageid}" ,
 + "{fullname}" ,
 + "{url}" ) ,
 + array( $INFO["client"] ,
 + $INFO["id"] ,
 + $INFO["userinfo"]["name"] ,
 + $_SERVER["REQUEST_URI"] ) ,
 + $displaypattern );
 +</code>
 +
 +with:
 +<code php>
 +
 +if( isset($INFO['userinfo']) || ($this->getConf('ignoreAnonymous')==0)){ 
 + $userdisplay = str_replace( array( "{username}"
 + "{pageid}" ,
 + "{fullname}" ,
 + "{email}" ,
 + "{url}" ) ,
 + array( $INFO["client"] ,
 + $INFO["id"] ,
 + $INFO["userinfo"]["name"] ,
 + $INFO["userinfo"]["mail"] ,
 + $_SERVER["REQUEST_URI"] ) ,
 + $displaypattern );
 +</code>
 +
 +on line 10 of settings.php
 +
 +replace:
 +<code php>
 +$lang['displayline'] = 'HTML to use when making the popup user list. Possible replacement strings are: {username}, {fullname}, {pageid}, {url}';
 +</code>
 +with:
 +<code php>
 +$lang['displayline'] = 'HTML to use when making the popup user list. Possible replacement strings are: {username}, {fullname}, {email}, {pageid}, {url}';
 +</code>
  
 ===== Discussion ===== ===== Discussion =====
  
plugin/whoisonline.1371770772.txt.gz · Last modified: 2013-06-21 01:26 by millsdude

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