Advanced Search  :  Site Statistics  :  Directory  :  Web Resources  :  Forum  
    Plugins for Geeklog Geeklog Plugins    
 Welcome to Plugins for Geeklog
 Saturday, May 17 2008 @ 07:07 AM EDT

Staticpage Toy

   
Static Pages
This fairly useless code snippet, when placed in a PHP active static page, should produce a members listing.  It needs your loving care, as it will display all the currently registered users on a single page.  I couldn't figure out how to get it to display in chunks, but as we at Darja.net have less that a hundread users, it was easier to write this than a full blown plugin. Please let me know by posting here if you can imporve it.

--Maximus Co-Admin Darja.net

$color = "#C0C0C0"; // this set the background color of the switched row.

//get and prep array of user info
$membersprep = DB_query( "SELECT * FROM gl_users WHERE uid > 2 ORDER BY username" );
//$members = DB_fetchArray($membersprep);

//figure out haw many users we really have here
$limit = DB_count('gl_users') - 2;
$count = 1;

// tell folks how popular we really are
$putout .= "There are currently " . $limit . " members of the site!\n";

//Load up the first of the display
$putout .= "<table>";

//create our header row
$putout .= "<TR bgcolor=\"#FFFFFF\">\n";
$putout .= "<TD><B><H3>Name</H3></B></TD>\n";
$putout .= "<TD><B><H3>Home Page</H3></B></TD>\n";
$putout .= "<TD><B><H3>Join Date</H3></B></TD>\n";
$putout .= "</TR>\n";

//start spewing out information and switching the bkgrnd color
$switch = false;
while($count <= $limit){
$membersout = DB_fetcharray($membersprep);
switch ( $switch ) {
case true:
$switch = false; // alternating color
$putout .= "<TR bgcolor=\"" . $color . "\">\n";
break;
default:
$switch = true; // default, no back color
$putout .= "<TR bgcolor\"FFFFFF\">\n";
} // switch
$putout .= "<TD><a href=\"http://www.darja.net/users.php?mode=profile&uid=";
$putout .= $membersout['uid'] . "\">" . $membersout['username'] . "</a></TD>\n";
if ($membersout['homepage'] != '' and $membersout['username'] != 'NULL') {
$putout .= "<TD><a href=\"" . $membersout['homepage'] . "\">" . $membersout['homepage'] . "</a></TD>\n";
}else{
$putout .= "<TD>No Homepage.</TD>";
}
$putout .= "<TD>" . $membersout['regdate'] . "</TD>\n";
$putout .= "</TR>\n";
$count++;
} // while

//close out the table
$putout .= "</TABLE>";
return $putout;
 

Story Options

Staticpage Toy | 3 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Staticpage Toy
Authored by: gmon750 on Wednesday, August 25 2004 @ 06:28 AM EDT
This is exactly what I was looking for. Unfortunately, I'm having one problem that is not necessarily related to the code.

When I enter the code into the static pages window, all references to the backward slash "\" are being scrubbed out when I save the page.

Has anyone had this problem? I'm sure I'm not the only one and I hope it is just a setting problem.

WinXP, Apache, PHP, MySql
  • Staticpage Toy - Authored by: anonymous on Tuesday, February 21 2006 @ 04:31 PM EST
 Copyright © 2008 Plugins for Geeklog
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.16 seconds