I've played around with inserting some random quotes just underneath my header. Having some problems in that no matter where I put the code, it always shows up at the very top of the page. Here's the function I defined in mainfile.php:
No matter how I try, I can't get a php function to call under header.html and if I try to call it in theme.php it displays at the top of the page. It displays it centered and italicized just as I wanted it to, so at least that bit looks good . Any thoughts?
bryan Nuke Cadet
Joined: Apr 28, 2003
Posts: 1
Posted:
Mon Apr 28, 2003 6:48 pm
I am VERY new to nuke programming and have almost no php experience but I have managed to write a script that generates a random quote like you are doing. I am using sql insted of a text file but the end result is the same. I was hoping someone would post a reply to this and spare me the pain of learning but oh well...
Instead of putting your php code in the header.html file put it in theme.php. Have it set a variable with your quote. You can then user $quote in the header.html file. You can see how this work with the $username in most header files. I hope this makes sense. You can see my poor example at www.my-thoughts.us.
With every page change or refresh the quote changes. It is the quote in the top/center of the page.
Ricon Nuke Cadet
Joined: Jun 28, 2003
Posts: 2
Posted:
Sat Jun 28, 2003 7:09 pm
I am not sure if this gonna work but i am creating a themeeditor i have functions all throughout it. I include the functions.php or whatever the file is called that holds the functions you create.
Inside that file i would insert:
You must replace echo's with a $yourvariable if more then one echo is called continue with:
Code:
$yourvariable .="text";
Then put in your global variables for themeheader() or wherever you are putting it the $yourvariable. Then insert into the header.html or html page you are using the $yourvariable whereever you want it to show up.
Sometimes you have to add at the end of the functions.php file that you function is located.
Code:
$yourvariable = yourfunction();
Sorry if i might be mistaken but it works on mine.
[/code]
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum