PDA

View Full Version : set_file



DaDeViL
August 2nd, 2003, 06:26 PM
I have this code but i have no idea what it means..

I know the first line makes a new object of template and call is $t but i dont know what set_file and set_block do and im not familiar with this ( -> ) type of syntax..


$t = new Template(".", "keep");

$t->set_file('insert', "./templates/insert_todo.ihtml");

$t->set_block('insert', 'DATE_SELECT', 'date_select');

Thanks

eyezberg
August 3rd, 2003, 03:16 AM
these are functions defined in the template class, you'll have to look their functions up in there.

DaDeViL
August 3rd, 2003, 05:47 PM
lol i should have guessed :crazy:
but do you think the (->) syntax means its a pointer?

also another question... is there any way to get one specific name from a database...for example, I have a table named user_message
and a row called the_user which keeps track of which user posted the message, but what I want to do is compare the username of the CURRENT_user to the user that posted the message (ie. a user already in the row the_user)




$check_user_query = "select * from user_message where

the_user = \"CURRENT_user\"";

$check_user = mysql_query($check_user_query) or

die(mysql_error());

if(mysql_num_rows($check_user) != 0) {

return "TRUE";

} else {

return "FALSE";
}



When i use this, it always returns true...no matter what value i put in for CURRENT_user

Thanks:evil: