, Guest!
Already a Member? Login or Register.

Menu



Showcase


Due to the volume of spam happening on our forums, posting is now restricted to verified members only.  If you're not verified, drop us a note with your username.

Home > FlexCMS Support Forum > User Help > Code Snippets > Total Members & Newest Member Block

FlexCMS Support Forum


Total Members & Newest Member Block
Started July 13, 2005 @ 11:36am by otter
Post Message 
otter
Administrator



Posts: 177
 
Total Members & Newest Member BlockJuly 13, 2005 @ 11:36am
Ever wanted to display the total number of members your FlexCMS site has registered? Or how about displaying the newest member in a block?

Here's how you can do both:

1. Create a new block
2. Cut and paste the following code into the Custom Block Contents area:


Code

$query = "select count(RecordNumber) as UsersCount from `core-Users`";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
print 'Members: '.$row['UsersCount'];

$query = "select * from `core-Users` order by RecordNumber desc limit 1";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
print '<br><br>Newest Member: <a href="'.$MainURL.'/profile/'.$row['Username'].'.html" class="BlockColors">'.$row['Username'].'</a>';


3. Check the Process PHP Code? box and save your block.

Enjoy!

otter


ONLINE TRAINING CLASSES FOR FLEXCMS IN MAY: FlexCMS Basics (101), Sat., May, 15, 2010 & FlexCMS Blocks (Mon., May 10, 2010).
 

Post Message 




Try & Buy FeedForAll - Easy to use RSS Feed Creator - great for iTunes users!

MEMBERS




All Contents, Code, Scripts and Technologies Copyright 2003-2009 FlexCMS.
All Rights Reserved. Software License Agreement

Processing Time: 0.08906 seconds.
 
Management Login

Powered By FlexCMS
Powered By FlexCMS