MozyMac
08-21-2009, 11:29 AM
hello,
I have made quire to find number of users in a usergroup and code to display number, but when i add the code to my custom vb page it won't display it:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'imamac'); // change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);
// get special data templates from the datastore
$specialtemplates = array(
);
// pre-cache templates used by all actions
$globaltemplates = array(
'imamac',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$res = mysql_query("SELECT username FROM user WHERE usergroupid = 2") or die("Error: ".mysql_error());
$numRows = mysql_num_rows($res); // Here you get the number of rows returned
echo "There are currently $numRows users";
$navbits = array();
$navbits[$parent] = 'Im a Mac';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('imamac') . '");');
?>
I have made quire to find number of users in a usergroup and code to display number, but when i add the code to my custom vb page it won't display it:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'imamac'); // change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(
);
// get special data templates from the datastore
$specialtemplates = array(
);
// pre-cache templates used by all actions
$globaltemplates = array(
'imamac',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$res = mysql_query("SELECT username FROM user WHERE usergroupid = 2") or die("Error: ".mysql_error());
$numRows = mysql_num_rows($res); // Here you get the number of rows returned
echo "There are currently $numRows users";
$navbits = array();
$navbits[$parent] = 'Im a Mac';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('imamac') . '");');
?>