Wikka Menulets

Last edited by BrianKoontz:
Replaces old-style internal links with new pipe-split links.
Fri, 20 May 2016 07:38 UTC [diff]


In the trac as Ticket:28.

As part of my proposal for a general overhaul of the menu management system in WikkaWiki, I suggest we replace the current system-generated items that occur in the main menu and footer menu with a series of menulets, i.e. mini-actions generating content for menu items.
Any of these mini-actions can of course be used in the page body as well.

Here's a list of potential menulets and their output, that I've uploaded to this server.
Suggestions/modifications are welcome.


{{acls}}

Prints a link to CurrentPage/acls if the user has access to the ACLs:

<?php
if ($this->page){
    if ($owner = $this->GetPageOwner()){
        if ($owner == "(Public)"){
            print $this->IsAdmin() ? "<a href=\"".$this->href("acls")."\">(Edit ACLs)</a>\n" : ""; #i18n
        } elseif ($this->UserIsOwner()){
            print "<a href=\"".$this->href("acls")."\">Edit ACLs</a>\n"; #i18n
        }
    } else {
        print ($this->GetUser()) ? " (<a href=\"".$this->href("claim")."\">Take Ownership</a>)\n" : ""; #i18n
    }
}
?>



{{attachments}}

Prints a link to the FilesHandler differently depending if there are attached documents to the current page or not: Attachments .

<?php
    // this is a menulet action relying on the files handler
    // upload path
    $upload_path = $this->config['upload_path'].'/'.$this->GetPageTag();
    $AttachmentClass = "";
        if(is_dir($upload_path) ){
            $handle = opendir($upload_path);
            while( (gettype( $name = readdir($handle)) != "boolean")){
                $name_array[] = $name;
            }
            foreach($name_array as $temp) $folder_content .= $temp;
            closedir($handle);
            if($folder_content == "...") {
                $AttachmentClass ="emptyfolder"; // the upload path is empty
            } else {
                $AttachmentClass = "fullfolder"; // the upload path contains attachments
            }
        }
        else $AttachmentClass = "inexistingfolder"; // the upload path does not exist
       
    echo  "<a href=\"".$this->href("files")."\" title=\"Click to manage attachments\" class=\"".$AttachmentClass."\">Attachments</a>\n"; #i18n
?>


Add something like this to the .css file:
.fullfolder {
    font-weight: bold;
    border: 1px solid red;
}
.emptyfolder {
}
.inexistingfolder {
}



{{contact}}

Prints a mailto: link to the Wikka administrator's address: Contact
Note: plain mailto links are a common source of spam.

<?php
/**
 * Print a spam-safe mailto: link to the administrator's email address.
 *
 * Note: plain mailto links are a common source of spam.
 */

$email = $this->GetConfigValue("admin_email");

// print spam-safe mailto link
$patterns = array("'@'", "'\.'");
$replace = array("[at]", "[dot]");
echo "<a href=\"mailto:".preg_replace($patterns, $replace, $email)."\" title=\"Send us your feedback\">Contact</a>"; #i18n

// print plain mailto link
//echo "<a href=\"mailto:".$email."\" title=\"Send us your feedback\">Contact</a>"; #i18n

// print contact link only to registered users
// echo ($this->GetUser()) ? "<a href=\"mailto:".$email."\" title=\"Send us your feedback\">Contact</a>" : ""; #i18n

?>



{{countcomments}}

Prints the total number of comments: 4268

<?php
/**
 * Print total number of comments in this wiki.
 */

$commentsdata = $this->LoadSingle("SELECT count(*) as num FROM ".$this->config["table_prefix"]."comments");
echo $commentsdata["num"];
?>


Compact version using the getCount() method:

<?php
/**
 * Print total number of comments in this wiki.
 */

echo $this->getCount('comments');
?>



{{countowned}}

Prints the number of pages owned by the current user: MyPages

<?php
/**
 * Print number of pages owned by the current user.
 */

$str = 'SELECT COUNT(*) FROM '.$this->config["table_prefix"].'pages WHERE `owner` ';
$str .= "= '" . $this->GetUserName() . "' AND `latest` = 'Y'";
$countquery = $this->Query($str);
$count  = mysql_result($countquery, 0);
echo $this->Link('MyPages', '', $count,'','','Display a list of the pages you currently own');
?>


Compact version using the getCount() method:

<?php
/**
 * Print number of pages owned by the current user.
 */

$where = "`owner` = '".$this->GetUserName()."' AND `latest` = 'Y'";
$count = $this->getCount('pages', $where);
echo $this->Link('MyPages', '', $count,'','','Display a list of the pages you currently own');
?>




{{countpages}}

Prints the total number of pages: 1733

<?php
/**
 * Print the total number of pages in this wiki.
 */

$pagedata = $this->LoadSingle("SELECT count(*) as num FROM ".$this->config["table_prefix"]."pages WHERE latest = 'Y'");
echo $this->Link('PageIndex', '', $pagedata['num'],'','','Display an alphabetical page index');
?>


Compact version using the getCount() method:

<?php
/**
 * Print the total number of pages in this wiki.
 */

$where = "`latest` = 'Y'";
$count = $this->getCount('pages', $where);
echo $this->Link('PageIndex', '', $count,'','','Display an alphabetical page index');
?>



{{countreferrers}}

Prints the total number of referrers to the wiki: 20324

Compact version using the getCount() method:

<?php
/**
 * Print number of referrers to this site.
 */

echo $this->getCount('referrers');
?>



{{countusers}}

Prints the number of registered users: 4605

<?php
/**
 * Print number of registered users.
 */

$userdata = $this->LoadSingle("SELECT count(*) as num FROM ".$this->config["table_prefix"]."users ");
echo $userdata["num"];
?>


Compact version using the getCount() method:

<?php
/**
 * Print number of registered users.
 */

echo $this->getCount('users');
?>




{{delete}}

Prints a link to CurrentPage/delete if the user has delete privileges:

<?php
echo  ($this->IsAdmin())? "<a href=\"".$this->href("delete")."\" title=\"Click to delete this page\">Delete this page</a>\n" : "";  #i18n
?>



{{edit}}

Prints a link to CurrentPage/edit: Show code

<?php
if ($this->HasAccess("write")) {
        echo  "<a href=\"".$this->href("edit")."\" title=\"Click to edit this page\">Edit this page</a>\n"; #i18n
} else {
        echo  "<a href=\"".$this->href("showcode")."\" title=\"Click to display the page source\">Show code</a>\n"; #i18n
}
?>



{{history}}

Prints a link to CurrentPage/history: Page History

<?php
        echo "<a href=\"".$this->href("history")."\" title=\"Click to view recent edits to this page\">Page History</a>\n"; #i18n
?>



{{homepage}}

Prints a link to the wiki homepage specified in the config file: HomePage

<?php
echo $this->Link($this->config['root_page']);
?>



{{lasteditauthor}}

Prints the author of the last page version: BrianKoontz

<?php
$page = $this->LoadSingle("SELECT * FROM ".$this->config['table_prefix']."pages WHERE tag='".$this->GetPageTag()."' AND latest = 'Y'");
$user = ($this->LoadUser($page["user"]))? $this->Link($page["user"]) : "anonymous";
echo $user;
?>



{{linkcount}}

Count (and display) the number of Wikka-formatted links ([[http:...]]) in a page. Needs some optimization work.

actions/linkcount.php
<?php
/**
 * Link count action
 *
 * Maintain a count of links on a page (could be extended to track
 * other entities)
 *
 * Usage:
 * {{linkcount preformatted="0"}}
 * ...
 * {{linkcount start="1"}}
 * link1
 * link2
 * ...
 * linkn
 * {{linkcount stop="1"}}
 *
 * Optionally: {{linkcount preformatted="1"
 *                        pretext="Some pretext"
 *                        posttext="Some posttext"}}
 *
 * where preformatted = "1" produces "+++Link count: 9999 link(s)+++"
 *     pretext is the text to precede the link count (overrides
 *     preformatted)
 *     posttest is the text to follow the link count (overrides
 *     preformatted)
 *
 * TODO: Performance is miserable beyond a couple hundred links, so
 * the next step would be to optimize it.
 *
 *
 * @author      {@link http://wikkawiki.org/BrianKoontz Brian Koontz}
 * @copyright   Copyright (c) 2006, Brian Koontz <brian@pongonova.net>
 * @name        LinkcountAction
 * @package     Actions
 * @license     http://www.gnu.org/copyleft/gpl.html
 * @since       Wikka 1.1.7
 * @uses        /actions/linkcount.php
 * @version     $Id: linkcount.php,v 1.1.1.1 2006/10/07 16:30:42 brian Exp brian $
 *
 */


// Necessary to prevent "already defined" errors when the Wikka parser
// comes across a "start" or "stop" action tag
include_once("actions/linkcount.inc.php");

if(isset($vars['start']) || isset($vars['stop'])) {
    return;
}

$preformatted = $vars['preformatted'];
$pretext = $vars['pretext'];
$posttext = $vars['posttext'];

if( isset($pretext) || isset($posttext)) {
    $pretext ? 1 : $pretext = '';
    $posttext ? 1 : $posttext = '';
} else if(isset($preformatted)) {
    $pretext = "+++Link count: ";
    $posttext = " link(s)+++";
}

$body = explode("\n", $this->page['body']);
parse($body);

?>


actions/linkcount.inc.php
<?php
/**
 * Link count action
 *
 * Maintain a count of links on a page (could be extended to track
 * other entities)
 *
 * @see LinkcountAction
 * @see actions/linkcount.php
 *
 *
 * @author      {@link http://wikkawiki.org/BrianKoontz Brian Koontz}
 * @copyright   Copyright (c) 2006, Brian Koontz <brian@pongonova.net>
 * @name        LinkcountAction
 * @package     Actions
 * @license     http://www.gnu.org/copyleft/gpl.html
 * @since       Wikka 1.1.7
 * @uses        /actions/linkcount.inc.php
 * @version     $Id: linkcount.inc.php,v 1.1.1.1 2006/10/07 16:32:17 brian Exp brian $
 *
 */

function parse(&$body) {
    $linkcount = 0;
    if(!$body) {
        return;
    }
    $state = null; #null, start
    foreach($body as $line) {
        switch($state) {
            case null:
                if(preg_match('/\{\{linkcount[\s]+start.*\}\}/', $line)) {
                    $state = 'start';
                }
                break;
            case 'start':
                if (preg_match('/\{\{linkcount[\s]+stop.*\}\}/', $line)) {
                    $state = null;
                } elseif (preg_match('/\[\[http:.*\]\]/', $line)) {
                    $linkcount++;
                }
                break;
        }
    }
    echo $pretext.$linkcount.$posttext;
}
?>



{{lasteditnotes}}

Prints the last edit notes: Replaces old-style internal links with new pipe-split links.

<?php
$page = $this->LoadSingle("SELECT * FROM ".$this->config['table_prefix']."pages WHERE tag='".$this->GetPageTag()."' AND latest = 'Y'");
echo ($page["note"])? $this->Format("//".$page["note"]."//") : "";
?>




Displays a wikka logo set by admins (in the future the path should be set in the config file):
logo

<?php
echo $this->Format('{{image alt="logo" title="'.$this->config['wakka_name'].'" url="images/wizard.gif" link="'.$this->config['root_page'].'"}}');
?>


My version (which needs the config entry: "wiki_logo => "yourlogo.jpg" [must be on the same server]):
<?php
//UI defines (i18n)
define('LOGO_ALT_TEXT', "logo");    # alt-text for the logo image

//print the image
if ($this->config['wiki_logo'] && file_exists($this->config['wiki_logo'])) echo $this->Format('{{image alt="LOGO_ALT_TEXT" title="'.$this->config['wakka_name'].'" url="'.$this->config['wiki_logo'].'" link="'.$this->config['root_page'].'"}}');
else echo $this->Format('{{image alt="LOGO_ALT_TEXT" title="'.$this->config['wakka_name'].'" url="images/wizard.gif" link="'.$this->config['root_page'].'"}}');
?>

--NilsLindenberg


{{mysqlversion}}

Displays the current MySQL version: n/a

<?php
/**
 * Print current MySQL version.
 */

echo mysql_get_server_info();
?>



{{owner}}

Displays page ownership infos: Owner: DarTar

<?php
if ($this->page) {
    if ($owner = $this->GetPageOwner()){
        if ($owner == "(Public)"){
            print "Public page"; #i18n
        }
        elseif ($this->UserIsOwner()) {
            if ($this->IsAdmin()) {
                print "Owner: ".$this->Link($owner, "", "", 0)."\n"; #i18n
                } else {
                print"You own this page.\n"; #i18n
            }
        } else {
            print "Owner: ".$this->Link($owner, "", "", 0)."\n"; #i18n
        }
    } else {
        print "Nobody\n"; #i18n
    }
}
?>



{{phpversion}}

Displays the current php version: n/a

<?php
/**
 * Print current PHP version.
 */

echo phpversion();
?>



{{recentchangesrss}}

Prints a link (RSS feed for recent changes) to CurrentPage/recentchanges.xml: XML

<?php
echo "<a href=\"".$this->href("recentchanges.xml")."\" title=\"Click to view recent changes in XML format.\"><img src=\"images/xml.png\" width=\"36\" height=\"14\" align=\"middle\" style=\"border : 0px;\" alt=\"XML\" /></a>"; #i18n
?>



{{referrers}}

Prints a link to CurrentPage/referrers:

<?php
if ($this->GetUser()) {
    echo "<a href='".$this->href("referrers")."' title='Click to view a list of URLs referring to this page.'>Referrers</a>\n";  #i18n
}
?>



{{revisions}}

Prints a link to CurrentPage/revisions: 2016-05-20 07:38:48

<?php
if ($this->GetPageTime()) {
        echo "<a href=\"".$this->href("revisions")."\" title=\"Click to view recent revisions list for this page\">".$this->GetPageTime()."</a>\n"; #i18n
}
?>



{{revisionsrss}}

Prints a link (RSS feed for page revisions) to CurrentPage/revisions.xml: XML

<?php
if ($this->GetPageTime()) {
    echo "<a href=\"".$this->href("revisions.xml")."\" title=\"Click to view recent page revisions in XML format.\"><img src=\"images/xml.png\" width=\"36\" height=\"14\" align=\"middle\" style=\"border : 0px;\" alt=\"XML\" /></a>"; #i18n 
}
?>




Prints a searchbox:
Search:


<?php
echo $this->FormOpen("", "TextSearch", "get");
echo 'Search: <input name="phrase" size="15" class="searchbox" />'; #i18n
echo $this->FormClose();
?>



{{skin}}

Displays a clickable link to the current skin: {{skin}}

<?php
#$skin = ($this->GetCookie("wikiskin"))? $this->GetCookie("wikiskin") : $this->GetConfigValue("stylesheet");
$defaultskin = $this->config['stylesheet'];
$skin = (!$this->GetCookie('wikiskin')) ? $defaultskin : $this->GetCookie('wikiskin'); # JW 2005-07-08 FIX possibly undefined cookie
echo '<a href="'.$this->config['base_url'].'css/'.$skin.'" title="Display stylesheet">'.$skin.'</a>';
?>



{{time}}

Prints the current time: 06:57

<?php
echo date("H:i");
?>



{{title}}

Prints the title of the current page: WikkaMenulets

<?php
echo $this->PageTitle();
?>



{{today}}

Prints the current date: December 16, 2017

<?php
echo date("F j, Y");
?>



{{url}}

Prints the complete URL of the current page: http://wikkawiki.org/WikkaMenulets

<?php
echo $this->href("", $this->GetPageTag());

//clickable link
//echo $this->Link($this->href("", $this->GetPageTag()));
?>




{{who}}

Prints the name of the current user:

<?php
if ($this->GetUser()) {
        echo "You are ".$this->Format($this->GetUserName()); #i18n
}
?>



{{wikkaname}}

Prints the name of the current Wikka: Wikka

<?php
echo $this->config['wakka_name'];
?>



{{wikkaversion}}

Prints the current wikka version: n/a

<?php
/**
 * Print current Wikka version.
 */

echo $this->VERSION;
?>


...


{{system}}

Prints system information about the system Wikka is running on:
{{system show="os"}} - prints the operating system information
{{system show="machine"}} - prints information about the machine
{{system show="host"}} - prints information about the host
{{system}} - prints all of the above


<?php
/**
 * Prints information about the system Wikka is running on.
 *
 * Syntax:
 *  {{system [show="OS|machine|host"]}}
 *
 * @package     Actions
 * @subpackage  SysInfo
 * @name        Systedm
 *
 * @author      {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
 * @copyright   Copyright � 2005, Marjolein Katsma
 * @license     http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
 * @since       Wikka 1.1.6.0 ???
 *
 * @input       string  $show   optional: what type of system info to show (OS, machine or host);
 *              default: empty, shows all information
 */


// default
$show = '';

// get param and validation
$valid_show = array('os','machine','host');
if (is_array($vars))
{
    foreach ($vars as $param => $value)
    {
        switch ($param)
        {
            case 'show':
                if (in_array($value, $valid_show)) $show = strtolower($value);
                break;
        }
    }
}

// get data
$host       = php_uname('n');
$os         = php_uname('s');
$release    = php_uname('r');
$version    = php_uname('v');
$machine    = php_uname('m');

// build output
$out = '';
switch ($show)
{
    case '':
        if (isset($os)) $out .= $os.' ';
        if (isset($release)) $out .= $release.' ';
        if (isset($version)) $out .= $version.' ';
        if (isset($machine)) $out .= $machine.' ';
        if (isset($host)) $out .= '('.$host.')';
        break;
    case 'os':
        if (isset($os)) $out .= $os.' ';
        if (isset($release)) $out .= $release.' ';
        if (isset($version)) $out .= $version.' ';
        break;
    case 'machine':
        if (isset($machine)) $out .= $machine.' ';
        break;
    case 'host':
        if (isset($host)) $out .= $host.' ';
        break;
}

// show result
echo trim($out);
?>


Installed as a beta feature on this site.

--JavaWoman


{{randompage}}
like the "Random Article" on wikipedia...
{{randompage}}
Prints a link to a random page on this wiki. e.g. RandomPage
{{randompage title="Random"}}
Change the title, use {{randompage title=""}} to display the real pagename.
{{randompage pos="ActionInfo, HandlerInfo, FunctionInfo"}}
Make a positive list to choose from, don't use all pages. (note the default neg list)
{{randompage neg="HomePage, PageIndex"}}
Use all pages exept the ones used in this negative list / override the default neg list in $neg_list_default
{{randompage title="Random Link" pos="ActionInfo, HandlerInfo, FunctionInfo" neg=""}}
Clear the default negative list, use only pages from the pos list and use "Random Link" as title.
{{randompage pos="HomePage|DonateNow|DonateNow|DonateNow"}}
You can influence the random ratio... (+other way of defining the list)

<?php
/**
 * Prints a link to a random page.
 *
 * syntax:
 *      {{randompage [title="string"] [pos="PageName, PageName2"] [neg="PageName3, PageName4"]}}
 *
 * @package     Actions
 * @subpackage  Menulets
 * @name        RandomPage
 *
 * @author      {@link http://wikkawiki.org/OnegWR OnegWR}
 * @copyright   Copyright � 2006, OnegWR
 * @license     http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
 * @since       Wikka 1.1.6.0
 *
 * @input       string  $title  optional: alternative for "RandomPage"
 *                              if set to "" the real pagename is used
 * @input       string  $pos    optional: comma separated list of pages
 *                              only pages out of this list will be chosen
 *                              default: all pages
 * @input       string  $neg    optional: comma separated list of pages
 *                              pages in this list will not be used
 *                              exeption: if the errorpage is in the list
 *                              default: defined by $neg_list_default array
 * If no match could be found, HomePage/config["root_page"] is returned.
 * @ToDo        Get list of pages from the tagCache of the ExistsPage function by IanAndolina
 */


$errorpage = $this->config["root_page"];
$neg_list_default = array("HomePage","UserSettings","TextSearch","TextSearchExpanded","PageIndex");
$title = isset($vars['title']) ? $this->htmlspecialchars_ent($vars['title']) : "RandomPage"; //i18n

foreach( $this->LoadAll("select distinct tag from ".$this->config["table_prefix"]."pages") as $key => $val ){
        $all[]=$val['tag'];
}
$pos_list = isset($vars['pos']) ? split('[|,]', ereg_replace( "[\ ]", '', $vars['pos'] ) ) : $all ;
$neg_list = isset($vars['neg']) ? split('[|,]', ereg_replace( "[\ ]", '', $vars['neg'] ) ) : $neg_list_default ;

$try = 0;
while ( $try < 5 ) {
        $try++;
        $page = $pos_list[array_rand($pos_list)];
        if( !in_array($page, $all) ) continue;
        if( in_array($page, $neg_list) ) continue;
        break;
}
if( $try > 4 ) $page = $errorpage;
if( $title=='' ) $title = $page;
print $this->Link( $page, '', $title, FALSE, TRUE, "$page, a random page on this site" ); //i18n
?>

-- OnegWR


{{contributors}}
Prints a space separated list of all users that have edited the current page, the most active user first.
A bit like {{lasteditauthor}}, but with all editing authors...
<?php
/**
 * Shows the contributors of this page, most active user first.
 *
 * syntax:      {{contributors}}
 *
 * @package     Actions
 * @subpackage  Menulets
 * @name        Contributors
 * @author      {@link http://wikkawiki.org/OnegWR OnegWR}
 * @copyright   Copyright © 2006, OnegWR
 * @license     http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
 * @since       Wikka 1.1.6.0
 */

$q = 'SELECT Count(*) AS cnt, `user` FROM '.$this->config["table_prefix"].'pages '.
		'WHERE `tag`="'.$this->tag.'" GROUP BY user ORDER BY cnt DESC;';
$all = $this->LoadAll( $q );

foreach($all as $key=>$val)
{
		print $this->Link($val['user'],'',$val['user'], FALSE, TRUE, '('.$val['cnt'].')') ." \n";
}
?>

-- OnegWR


{{wordcount}}

Inserts a wordcount (my format, your format, or no format) into a document. Needed something quick and dirty, so there's some refinement yet to be done.

+++Word count: 9999 word(s)+++

actions/wordcount.php
<?php
/*
 * Word count action
 * Author: Brian Koontz <brian@pongonova.net>
 *
 * Replace instances of {{wordcount}} with the number of words in the
 * text
 *
 * Optionally: {{wordcount preformatted="1"
 *                          pretext="Some pretext"
 *                          posttext="Some posttext"}}
 *
 * where preformatted = "1" produces "+++Word count: 9999 word(s)+++"
 *       pretext is the text to precede the word count (overrides preformatted)
 *       posttest is the text to follow the word count (overrides preformatted)
 *
 * @package     Actions
 * @subpackage  Menulets
 * @name        Contributors
 * @author      {@link http://wikkawiki.org/BrianKoontz Brian Koontz}
 * @copyright   Copyright � 2006, Brian Koontz <brian@pongonova.net>
 * @license     http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
 * @since       Wikka 1.1.6.2
 *
 * TODO: Probably counts a lot of things it should, and a lot of
 * things it shouldn't.  Probably shouldn't count actions or other
 * special items.
 */


$preformatted = $vars['preformatted'];
$pretext = $vars['pretext'];
$posttext = $vars['posttext'];

if( $pretext || $posttext) {
    $pretext ? 1 : $pretext = '';
    $posttext ? 1 : $posttext = '';
} else if($preformatted) {
    $pretext = "+++Word count: ";
    $posttext = " word(s)+++";
}

$wc = str_word_count($this->page['body']);
echo $pretext.$wc.$posttext;

?>



CategoryDevelopmentActions CategoryDevelopmentTest
Comments [Hide comments]
2004-12-19 22:16:45
How would we ensure that the search textfield doesnt add a break-line when used as a miniaction ( {{search}} )?
2004-12-19 23:24:58
Also would it be possible to create an OnlineUsers action at some point ?
It could be a nice feature to see at the HomePage/Header/Footer as there is in forums ...
It may also show the total number of registered users and total number of pages in the wiki ...
Comment by JavaWoman
2004-12-19 23:54:59
@George:
"How would we ensure that the search textfield doesnt add a break-line"
The same way I prevented wrapping in my version of {{who}}: by using &nbsp; in the (ultimate) output rather than a normal space. In fact this is one of the improvements I had in mind for this - the other is to make the form accessible by adding a label tag.
Comment by DarTar
2004-12-20 13:23:00
@George on OnlineUsers
It's a nice idea but I'm wondering what is the best way to implement it. As for registered users and wiki pages, take a look at the above {{countusers}}, {{countpages}} and {{countcomments}} menulets.
2004-12-20 13:34:14
I am developing an action as we speak .. it is 75% done ( just some bug hunting ..)
It requires a function inside the core thought :/ ... I'll post as soon its ready .. prolly this evening ...
2004-12-20 13:55:29
There is such an action user_online.php in another WakkaWiki fork: comawiki at http://comawiki.org/CoMa.php?CoMa=HomePage
2004-12-20 14:39:46
the way I went for uses a var loggedInUsers = array(); inside the class Wakka of the wikka.php ...

this way I dont need to do all the stuff that Coma is doing ... much more convienient to code/ maintain ..
Comment by NilsLindenberg
2004-12-20 15:23:09
and don't forget that comawiki has another licence. You can look on his page, how his action(s) look, but you can't use his code!
Comment by JavaWoman
2004-12-20 15:39:48
There are lots of implementations of "users online" - no need to even look at what comawiki is doing. :)
For a start, look at: http://tinyurl.com/3pkug (replacing a humungously-long URL)
2004-12-20 16:36:21
uhm... the loggedInUsers array I wanted to use is getting another face with every user. I've tried moving it outside the class Wakka,... putting it in static, public and all the rest visibility keywords but none of them works .. my next guess is a mysql table ;(
is there something I could do that I am missing ?
Comment by JavaWoman
2004-12-20 18:02:48
George, did you look at what my suggested search comes up with? Probably some inspiration in there somewhere (but you'd have to dig in the code). BTW, to look at or download (most) files at the PHP Classes site you need a (free) registration - something I highly recommend; there's a lot of good-quality PHP programming to be found there (not everything, but a lot).
Comment by DarTar
2004-12-21 00:36:24
There are also several GPL-licensed "online users" classes on Hotscripts.com:

http://www.hotscripts.com/CGI_and_Perl/Scripts_and_Programs/Counters/Real-Time/
Comment by DarTar
2004-12-21 10:19:54
JavaWoman, It would be nice if you explained somewhere your approach to i18n and why you think it is better (if it is) than those proposed so far.
Comment by GmBowen
2005-01-04 12:51:31
Okay, now that's a whole pile of little tiny files to "make".....is there anybody who has already got them all created interested in zipping/tarring all of them together and adding a link to the zip to make mine (and others) lives easier? Thanks. ;)
Comment by JavaWoman
2005-01-04 23:26:16
Mike, I think most need to be optimized a little first, before "packaging" them. That's why the code is all up here on a page so we can eyeball it first!
Comment by MasinAlDujaili
2007-01-22 08:47:55
Is anything of this page to be in the next release? I like the idea very much, I am just missing one very simple action: {{thisrevision title="Cite this page"}} with title defaulting to the current revision's timestamp.
Comment by DarTar
2007-01-22 16:21:13
Masin, yes I think we should add a few of these in 1.1.7, they're simple, useful and undemanding (and mostly coded). They are also useful as proof-of-concept for people willing to develop their own Wikka actions.
Comment by WillyPs
2008-10-12 10:37:19
I did something a little differant with mine... I added feilds to the config, for menu items. I also added the main categories to the menu. See it at www.prepare4descent.net/DescentiaPedia. It's very easy to make changes this way, and I have different menus for different users, for example the admin pages and admin users pages are in the menu for admins only.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki