see http://phpdocu.sourceforge.net/ // +----------------------------------------------------------------------+ // | Author (TikiWiki): sQuare // | Reworked & Undoubtedly Screwed-Up for (Bitweaver) // | by: StarRider // | Reworked from: wikiplugin_userlist.php - see deprecated code below // +----------------------------------------------------------------------+ // $Id: data.userlist.php,v 1.9 2006/08/07 22:14:58 squareing Exp $ /** * definitions */ define( 'PLUGIN_GUID_DATAUSERLIST', 'datauserlist' ); global $gLibertySystem; $pluginParams = array ( 'tag' => 'USERLIST', 'auto_activate' => FALSE, 'requires_pair' => TRUE, 'load_function' => 'data_userlist', 'title' => 'UserList - This plugin is not yet functional.', // Remove this line when the plugin becomes operational // 'title' => 'UserList',, // and Remove the comment from the start of this line 'help_page' => 'DataPluginUserList', 'description' => tra("This plugin will displays an alphabetically sorted list of registered users. A Group Name can be included to filter Groups to be listed."), 'help_function' => 'data_userlist_help', 'syntax' => "{USERLIST num= userspage= alpha= total= email= }GroupName{USERLIST}", 'path' => LIBERTY_PKG_PATH.'plugins/data.userlist.php', 'security' => 'registered', 'plugin_type' => DATA_PLUGIN ); $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAUSERLIST, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAUSERLIST ); // Help Function function data_userlist_help() { $back = tra("^__Parameter Syntax:__ ") . "~np~{USERLIST" . tra("(key=>value)}~/np~\n"); $back.= tra("||__::key::__ | __::value::__ | __::Comments::__\n"); $back.= "::num::" . tra(" | ::boolean:: | if True then the listing is numbered. __Optional__ - can be omitted - the __Default = False__ (any value = True) .\n"); $back.= "::userspage::" . tra(" | ::boolean:: | if True then a link is provided to each user that has a personal userpage. __Optional__ - can be omitted - the __Default = True__ (any value = False).\n"); $back.= "::alpha::" . tra(" | ::boolean:: | if True then the listing is sectioned alphabetically - using the first letter in the users name. __Optional__ - can be omitted - the __Default = True__ (any value = False) .\n"); $back.= "::email::" . tra(" | ::boolean:: | shows the email address of each user - if their email address is public. __Optional__ - can be omitted - the __Default = False__ (any value = True).\n"); $back.= "::total::" . tra(" | ::boolean:: | shows the total number of users in list at the bottom of the listing. __Optional__ - can be omitted - the __Default = True__ (any value = False).||^"); $back.= tra("^__Example:__ ") . "~np~{USERLIST(num=>1,email=>1)}{USERLIST} ~/np~^"; return $back; } // Load Function function data_userlist($data, $params) { $ret = "This plugin has not been completed as yet. "; return $ret; } /****************************************************************************** The code below is from the deprecated USERLIST plugin. All comments and the help routines have been removed. - StarRider include_once( WIKI_PKG_PATH.'BitPage.php'); function wikiplugin_userprint($num,$user,$userspage,$email,$wp_user_count) { global $wikilib,$gBitUser, $gBitSystem; // alternate class of every row if ($wp_user_count % 2) { $class = 'even'; } else { $class = 'odd'; } $ret = (''); // get email address and check if it's public $user_info = $gBitUser->getUserInfo( array( 'login' => $user ) ); $eml = scrambleEmail($user_info['email']); $public = FALSE; // cheap hack from spiderr to get things working. $wikilib->get_user_preference($user,'users_is_email_public'); if ($num) { $ret .= ('__'.$wp_user_count.'__'); } if( $gBitSystem->isPackageActive( 'messages' ) ) { $messages_img = (''.tra('Send message').' '); } else { $messages_img = (''); } $ret .= (''.$messages_img.$user.''); // if you want to show all email addresses indstead of only public ones, uncomment following line $public = 'y'; if ($email) { if ($public == 'y' && $eml != '') { $ret .= '[mailto:'.$eml.'|'.$eml.']'; } else { $ret .= ' '; } } if ($userspage) { if ($wikilib->pageExists('userPage'.$user)) { $ret .= '((userPage'.$user.'|'.$user.' Homepage))'; } else { $ret .= ' '; } } $ret .= ("\r"); return $ret; } // function used to sort an array - NOT case-sensitive function wikiplugin_compare_users($a, $b) { return strcmp(strtolower($a), strtolower($b)); } function wikiplugin_userlist($data, $params) { global $gBitUser, $gBitSystem; extract ($params, EXTR_SKIP); $num = (isset($num)) ? True : False; // Default = False $userspage = (!isset($userspage)) ? True : False; // Default = True $alpha = (!isset($alpha)) ? True : False; // Default = True $total = (!isset($total)) ? True : False; // Default = True $email = (isset($email)) ? True : False; // Default = False $colcount = 1; $ret = ''; $ret .= ''; if ($num) { $ret .= ''; $colcount++; } $ret .= ''; if ($email) { $ret .= ''; $colcount++; } if ($userspage) { $ret .= ''; $colcount++; } $ret .= ''; if (!$data) { $userdata = $gBitUser->get_users(0); foreach ($userdata['data'] as $usertemp) { $users[] = $usertemp['login']; } } else { $users = $gBitUser->get_group_users($data); } usort($users, 'wikiplugin_compare_users'); // sort the users $wp_user_count = 0; foreach ($users as $user) { if ($wp_user_count >= 1) { $prev_user = $users[$wp_user_count-1]; } else { $prev_user = 0; } $wp_user_count++; if ($alpha) { if (strtolower($prev_user[0]) != strtolower($user[0])) { $ret .= ("\r"); } } $ret .= (wikiplugin_userprint($num,$user,$userspage,$email,$wp_user_count)); } if ($total) { $ret .= ("\r"); $ret .= ("\r"); } $ret .= ('
 '.tra('__UserName__').''.tra('__email Address__').''.tra('__UserPage__').'
__::Section - ".strtoupper($user[0])."::__
 
".tra('__Total number of users').": ".$wp_user_count."__
'); return $ret; } */ ?>