Welcome to Geeklog, Anonymous Monday, May 20 2024 @ 07:26 am EDT

Geeklog Forums

PHP/Geeklog noob question

Status: offline


Forum User
Registered: 07/03/03
Posts: 5
I want to add a New User block to my site, but I am new to both PHP and Geeklog and am unsure how to do this. I found the PHP for it in another post (shown below) So, where do I put it? And how do I call the function from the new block? Thanks function phpblock_whos_new() { global $_CONF,$_TABLES; // Set the number of new members to show $numToShow = 5; $result = DB_query(\"SELECT uid,username,photo FROM ORDER BY regdate DESC limit $numToShow\"; $nrows = DB_numRows($result); for ($i = 1; $i \' . $A[\'username\'] . \'\'; if (!empty($A[\'photo\']) AND $_CONF[\'allow_user_photo\'] == 1) { $retval .= \' \'; } $retval .= \'
\'; } return $retval; }

Status: offline


Site Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The functions goes into your lib-custom.php file. To call it, create a new block of type "PHP block" and enter the name of your function as the block function.

bye, Dirk

Status: offline


Forum User
Registered: 07/16/02
Posts: 1232
You may want to look at first installing a small contributed block like this one here This will get you familiar with adding a custom PHP block and not worry about your PHP code. With respect to the code you posted, I don\'t believe (unless this was not the actual code) it will do as you want or even display anything Rolling Eyes
Geeklog components by PortalParts -- www.portalparts.com

All times are EDT. The time is now 07:26 am.

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