Subject: who is new

Posted on: 29/11/03 09:39am
By: Sniper12

I get this error on top of my page after I have added this in my lib-custom, there is an error in the block to.
---------
Error in top of page

Parse error: parse error, unexpected $ in /customers/prideofvbk.dk/prideofvbk.dk/httpd.www/prideofvbk/geeklog/system/lib-custom.php on line 282

Warning: Cannot add header information - headers already sent by (output started at /customers/prideofvbk.dk/prideofvbk.dk/httpd.www/prideofvbk/geeklog/system/lib-custom.php:282) in /customers/prideofvbk.dk/prideofvbk.dk/httpd.www/prideofvbk/geeklog/system/lib-sessions.php on line 180

Warning: Cannot add header information - headers already sent by (output started at /customers/prideofvbk.dk/prideofvbk.dk/httpd.www/prideofvbk/geeklog/system/lib-custom.php:282) in /customers/prideofvbk.dk/prideofvbk.dk/httpd.www/prideofvbk/geeklog/system/lib-sessions.php on line 192
-------------
error in block

Error in PHP Block. Function, phpblock_whos_new, does not exist.

Re:who is new

Posted on: 29/11/03 05:13pm
By: destr0yr

I added the following to my /path/to/geeklog/system/lib-custom.php:
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 {$_TABLES['users']} users ORDER BY regdate DESC limit $numToShow");

$nrows = DB_numRows($result);
for ($i = 1; $i <= $nrows; $i++) {
$A = DB_fetchArray($result);
$retval .= '<a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' . $A['username'] .
'</a>';
if (!empty($A['photo']) AND $_CONF['allow_user_photo'] == 1) {
$retval .= ' <a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '"><img src="
' . $_CONF['layout_url'] . '/images/smallcamera.gif" border="0"></a>';
}
$retval .= '<br>';
}
return $retval;
}




Also, make sure you don't have any white-space after the closing ?> in the lib-common.php. (the ?> is the very last line, no empty lines after it)

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=27349