dv6cougar
08-14-2003, 02:46 PM
so i have a page for car profiles, it's not of my forum, it' son the main pages... now i know mysql and i know php, but i've never actually used eval() in my own scripts, so i get a bit lost with it.
basically we're gonna make a Car Profile button next ot he profile button so i have this in showthread.php
//i adde carprofile as a template used
//at hte top of the page
$caruser = $post['userid'];
$get_car = mysql_query("SELECT * FROM prof WHERE userid='$caruser'") or die("
<font color=white>".mysql_error()."</font>");
if(mysql_num_rows($get_car) == "0") {
} else {
eval("\$post[showcar] = \"".fetch_template("carprofile")."\";");
}
//now i took ou the if statement,
//but that didn't do anything ether...
// i placed this right after the this statement:
if ($post['lastactivity'] > time() - $cookietimeout and !$post['invisible'] and $post['lastvisit'] != $post['lastactivity']) {
eval("\$post[onlinestatus] = \"".fetch_template("getinfo_online")."\";");
} else {
eval("\$post[onlinestatus] = \"".fetch_template("getinfo_offline")."\";");
}
//which does work...
now in my template postbit_buttons code i have this:
$post[showcar]
and i have the carprofile tempalte made looking like this:
<a href=../main/carprofile.php?id=$post[userid]>Car Profile</a>
but nothing shows up at all :(
any inf would be great guys, i'm thinking my problem is where i'm placing it in the showthread.php but then it's right under onlinestatus which is right below that.
or maybe am I missing something else i have to do to get it to work?
basically we're gonna make a Car Profile button next ot he profile button so i have this in showthread.php
//i adde carprofile as a template used
//at hte top of the page
$caruser = $post['userid'];
$get_car = mysql_query("SELECT * FROM prof WHERE userid='$caruser'") or die("
<font color=white>".mysql_error()."</font>");
if(mysql_num_rows($get_car) == "0") {
} else {
eval("\$post[showcar] = \"".fetch_template("carprofile")."\";");
}
//now i took ou the if statement,
//but that didn't do anything ether...
// i placed this right after the this statement:
if ($post['lastactivity'] > time() - $cookietimeout and !$post['invisible'] and $post['lastvisit'] != $post['lastactivity']) {
eval("\$post[onlinestatus] = \"".fetch_template("getinfo_online")."\";");
} else {
eval("\$post[onlinestatus] = \"".fetch_template("getinfo_offline")."\";");
}
//which does work...
now in my template postbit_buttons code i have this:
$post[showcar]
and i have the carprofile tempalte made looking like this:
<a href=../main/carprofile.php?id=$post[userid]>Car Profile</a>
but nothing shows up at all :(
any inf would be great guys, i'm thinking my problem is where i'm placing it in the showthread.php but then it's right under onlinestatus which is right below that.
or maybe am I missing something else i have to do to get it to work?