PDA

View Full Version : I hate to get help but ok.....


flup
03-22-2003, 06:23 AM
I need some help.
I made a template: $adminnews

I want to display that on the /admin/index.php page.
What i thried is:


<?php
$adminnews = ".gettemplate[adminnews]."
?>

<?php
eval("$adminnews" = \".gettemplate[adminnews]."\;";")
?>


And some others.
After that i Tried:


<?php
print $adminnews
?>


Nothing showed up, so i tried:


<?php
$adminnews = mysql_query("SELECT * FROM template WHERE title<>"adminnews"")
?>
<?php
$adminnews = mysql_query("SELECT * FROM template WHERE title="adminnews"")
?>
<?php
$adminnews = mysql_query("SELECT * FROM template WHERE topic<>"adminnews"")
?>
<?php
$adminnews = mysql_query("SELECT * FROM template WHERE topic="adminnews"")
?>


These 4 i tried, and again after that truing to print $adminnews.
But i just can't get it. What am i doin' wrong?

Lesane
03-22-2003, 06:41 AM
Why do you hate it to get help? Did you never get any help before? (While you just learned php/mysql/vb)

Try:


eval("\$adminnews .= \"".gettemplate("adminnews")."\";");


Notice the .=

flup
03-22-2003, 06:53 AM
Ok i'll try.
I hate to get help just caus I know i won't learn anything from it, cause i just copy past it. :(

flup
03-22-2003, 07:01 AM
Doesn't work either :?
THe problem:

It shows me an table [with the withs I told 'm] but it doesn't display the content of the template

__________________________edit___
I'll be back in a few hours, goin' to play some soccer [football] :P
Ciao!
__________________________edit___

Lesane
03-22-2003, 07:35 AM
You can do this, place the following:


$gettemplate = $DB_site->query_first("SELECT title,template FROM template WHERE title='adminnews'");
$info=$gettemplate['template'];
echo "$info";


After this:


makenavoption("Add","announcement.php?action=add","|");
makenavoption("Modify","announcement.php?action=modify");
makenavselect("Announcements");


And if i have made a template named adminnews with: Hello there admin!

Then it display hello there admin on the page!