68 Classifieds Forums
Go Back   68 Classifieds Forums > v3.0.x Help & Support > v3.0 Modifications > Display Total Number of Users
 
Thread Tools Search this Thread Display Modes
(#1)
suzkaw suzkaw is offline
Staff
suzkaw is on a distinguished road
 
Posts: 1,232
Join Date: Mar 2006
Location: Belmont, NC
Default Display Total Number of Users - 03-30-2006, 08:50 AM

Here is a smarty function to display the total number of users.
  1. Copy and paste this code in a new file and save it as: function.total_users.php
  2. Next upload it to includes/templates/plugins/ directory
  3. Finally to display the total add {total_users} to your template file.
Here is the code:

PHP Code:
<?php
/***********************************************************************
| 68 Classifieds developed by 68 Designs, LLC.
|-----------------------------------------------------------------------
| All source code & content (c) Copyright 2005, 68 Designs LLC
|   unless specifically noted otherwise.
|
|The contents of this file are protect under law as the intellectual property
| of 68 Designs, LLC. Any use, reproduction, disclosure or copying
| of any kind without the express and written permission of 68 Designs, LLC is forbidden.
|
| Author $Author: Eric Barnes $ (68 Classifieds)
| Version $Revision: 1.4 $
| Updated: $Date: 2005/09/16 17:31:44 $
| ______________________________________________________________________
|    http://www.68classifieds.com      http://www.68designs.com/
***********************************************************************/
function smarty_function_total_users($params, &$smarty)
{
    global
$db;

    
//get total active listings
    
$sSQL='SELECT COUNT(*) AS total FROM '.PREFIX.'users WHERE level <> 3';
    
$result=$db->query($sSQL);
    
$rs=$result->fetch();
    return
$rs['total'];
}
?>


--
Thanks,
Eric Barnes
68 Classifieds

Documentation - Bug Reports - Modifications - My Blog
(#2)
zman78 zman78 is offline
Member
zman78 is on a distinguished road
 
Posts: 74
Join Date: Mar 2006
Default How can i do this with version 3.1? - 05-09-2006, 06:39 PM

Hello,

I see the folder structure for the new 3.1 has changed. there is no includes/templates/plugin directory anymore. How can I make this work? can i make those folders and use it the same way?

Zack
(#3)
juven14's Avatar
juven14
Moderator
juven14 is on a distinguished road
 
Posts: 1,305
Join Date: Mar 2006
Location: NJ/NYC Area
Default 05-09-2006, 09:51 PM

The new path for 3.1 should be:

includes/classes/smarty/plugins

Just upload there and it will work the same.


Regards,

John
mods.auscity.com
v3.1.4 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
(#4)
sleepy sleepy is offline
Senior Member
sleepy is on a distinguished road
 
Posts: 109
Join Date: Mar 2006
Default 05-10-2006, 07:52 AM

Eric,

Is this able to be modified to display no. of members and/or no. of guests currently online?

sleepy
(#5)
suzkaw suzkaw is offline
Staff
suzkaw is on a distinguished road
 
Posts: 1,232
Join Date: Mar 2006
Location: Belmont, NC
Default 05-10-2006, 09:25 AM

Here is one for the total members:
http://www.68classifieds.com/forums/showthread.php?t=63

I haven't created one for number of guests but I think that one may be difficult.


--
Thanks,
Eric Barnes
68 Classifieds

Documentation - Bug Reports - Modifications - My Blog
(#6)
zman78 zman78 is offline
Member
zman78 is on a distinguished road
 
Posts: 74
Join Date: Mar 2006
Default 05-10-2006, 11:22 AM

Quote:
Originally Posted by juven14
The new path for 3.1 should be:

includes/classes/smarty/plugins

Just upload there and it will work the same.


That did it! Thanks!


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Year quickbiz v3.0 Modifications 2 04-21-2006 07:20 AM
Display Total Number of Listings suzkaw v3.0 Modifications 2 03-30-2006 02:29 PM
Area to display # of members and # of ads zman78 Template Design Questions 13 03-30-2006 08:51 AM



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2006, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com