Display Total Number of Users -
03-30-2006, 08:50 AM
Here is a smarty function to display the total number of users.
Copy and paste this code in a new file and save it as: function.total_users.php
Next upload it to includes/templates/plugins/ directory
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']; } ?>
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?