Posted on: 07/05/03 06:09pm
By: wyccad
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;
}
Re:PHP/Geeklog noob question
Posted on: 07/05/03 06:19pm
By: Dirk
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
Re:PHP/Geeklog noob question
Posted on: 07/05/03 09:17pm
By: Blaine
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