Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 12:51 am EST
Geeklog Forums
who is new
Status: offline
Sniper12
Forum User
Regular Poster
Registered: 11/25/03
Posts: 81
Location:Denmark
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.
---------
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.
16
11
Quote
Status: offline
destr0yr
Forum User
Full Member
Registered: 07/06/02
Posts: 324
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)
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
Text Formatted Code
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)
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
15
12
Quote
All times are EST. The time is now 12:51 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