Welcome to Geeklog Friday, May 24 2019 @ 06:52 am EDT

Geeklog Forums

PHP/Geeklog noob question


Status: offline

wyccad

Forum User
Newbie
Registered: 03/07/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

Dirk

Site Admin
Admin
Registered: 12/01/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

Blaine

Forum User
Full Member
Registered: 16/07/02
Posts: 1233
Location:Canada
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 06:52 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