Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Tuesday, May 21 2013 @ 08:09 PM EDT


 Forum Index > Extensions > PHP Blocks New Topic Post Reply
 User list block
   
Anonymous: Anonymous
 04/09/03 08:47AM (Read 1551 times)  



Ieup!

I've done a function in lib_custom.php that allows a Geeklog webmaster to create a block that makes a list of all the users in the website. I use it for the "logged in" group, so they can view other user's profiles, even if they are not online. I think this feature is so useful, because in my weblog (http://bilboweb.dtdns.net/gente/kacikekola) there are so few users (9) and this way I can allow users know something about other users.

The function is here:

PHP Formatted Code

/***
*
* List Users()
*
* Php function to make user list and allow members to view not conected users' profiles.
*
**/


function phpblock_ListUsers()
{
    global $_CONF;
    $list = "";
    $quer = mysql_query ("SELECT uid,username,photo FROM gl_users ORDER BY uid");
    while ($line = mysql_fetch_array($quer)){
    $list = $list.'<a href="'.$_CONF["site_url"].'/users.php?mode=profile&uid='.$line["uid"].'">'.$line["username"];
    if ($line["photo"] != ""){
    $list = $list.' <img src="'.$_CONF["layout_url"].'/images/smallcamera.gif">';
    }
    $list = $list.'</a><br>';
    }
return $list;
}
 


I think its code is "standard" for any Geeklog, as I've used system paths and so on.

Finally, thank you all for making this wonderful piece of software, I'm enjoying it a lot Smile


 
 Quote
Content generated in: 0.27 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content