2007-05-05, 09:49 AM
Pages: 1 2
2007-05-18, 02:44 AM
zahers mo has this code:
what should i edit and where should i put this code? in a new file?
//total males
$tm_q = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid3 = '".$lang->male."'");
while($tm_f = $db->fetch_array($tm_q))
{
$tmale = $tm_f['fid'];
}
if($tmale > '1' || $tmale == '0')
{
$add_sex_ms = "s";
}
//total Undisclosed
$tu_q = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid3 = '".$lang->undisclosed."' OR fid3 = '".$lang->other."' ");
while($tu_f = $db->fetch_array($tu_q))
{
$tundi = $tu_f['fid'];
}
//total Females
$tf_q = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid3 = '".$lang->female."'");
while($tf_f = $db->fetch_array($tf_q))
{
$tfem = $tf_f['fid'];
}
if($tfem > '1' || $tfem == '0')
{
$add_sex_fs = $lang->s;
what should i edit and where should i put this code? in a new file?
2007-05-18, 03:05 AM
I don't know where Zaher went. He's been gone for a while.
2007-05-18, 03:13 AM
yes, but maybe someone else could help me?
2007-05-18, 07:59 AM
I've work out 1ex. Don't know what fid the select box has, but you probably need to change that "fid3" too.
$name = "Toyota Yaris";
//Total x Cars
$total = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid3 = '".$name."'");
$tot = $db->fetch_field($total, fid);
if($tot == 1)
{
$cars_x = $tot." ".$name." Car.";
}
else
{
$cars_x = $tot." ".$name." Cars.";
}
2007-05-18, 09:25 AM
LeX- Wrote:I've work out 1ex. Don't know what fid the select box has, but you probably need to change that "fid3" too.
that field has 1 ID (fid1) What else should I edit? and where should I put this code? in zaher's mod file or into separate one?
$name = "Toyota Yaris";
//Total x Cars
$total = $db->query("SELECT count( * ) AS fid FROM ".TABLE_PREFIX."userfields WHERE fid1 = '".$name."'");
$tot = $db->fetch_field($total, fid);
if($tot == 1)
{
$cars_x = $tot." ".$name." Car.";
}
else
{
$cars_x = $tot." ".$name." Cars.";
}
2007-05-18, 11:12 AM
Can you try the attached file ?
It's a "plugin", the only variable in the file is the $fid , but the $fid is 1 you've told me already so i've filled it in for you. Just upload to your inc/plugins/ folder and activate!
When activating, there will be a new template created, along with a templatechange in the stats page. So when you visit the Forum Statistics, you will see the "extra stats" from that customfield.
I've used the examples for filling the selectbox you gave in previous posts and selected one in my UCP - options. With result ... see the image above.
It's a "plugin", the only variable in the file is the $fid , but the $fid is 1 you've told me already so i've filled it in for you. Just upload to your inc/plugins/ folder and activate!
When activating, there will be a new template created, along with a templatechange in the stats page. So when you visit the Forum Statistics, you will see the "extra stats" from that customfield.
I've used the examples for filling the selectbox you gave in previous posts and selected one in my UCP - options. With result ... see the image above.
Pages: 1 2