View Full Version : Don't know where to ask this, but.... Variables
Link14716
06-23-2002, 11:07 PM
Ok, I use a news ticker to show current up to date news in my header. I was wondering how I can edit the news on all templates via vBulletin Options. I have already added the setting for it with the variable $news, but I need to know how to actually get that variable to work in the header. Thanks...
Also, I will do a second one for a news fader on some templates in the newsfader template (fader_news) to show up on forumhome. If instructions for that would be different, please tell me. Thanks.
Link14716
06-24-2002, 07:12 PM
*Bump*
Can someone tell me? Please?
Xenon
06-24-2002, 07:53 PM
you have to define the $news-variable in the phpinclude-template, or in the global.php file.
Link14716
06-24-2002, 07:58 PM
The problem is that I don't know how to. Do I just put $news in it or something? And where would I put it in the global.php file?
Xenon
06-24-2002, 08:01 PM
it depends on how do you write your news.
your post is a bit unclear in this question.
normally if you put it into phpiclude use this way:
$news="Text of news in it";
Link14716
06-24-2002, 08:03 PM
well, I already made the $news variable in the settings table, so that I could edit it in the vBulletin Options part of the admin CP, and that is where I want to edit the news. Is there a way I can do that easily?
Xenon
06-24-2002, 08:11 PM
ahh, i see :)
ok, you have to edit your global.php
find this line:
// parse css, header & footer ##################
just before add this:
$news=$DB_site->query_first("SELECT * FROM setting WHERE settingid=x");
change the x to the settingid of your news-setting.
then you should be able to use $news[value] in your header template
Link14716
06-24-2002, 08:19 PM
Thanks. I will try it out.
:D
Link14716
06-24-2002, 08:33 PM
Nope, it didn't work :(
Everywhere I put the variable, it says "Array"
Link14716
06-24-2002, 08:37 PM
Oh, nevermind, I was stupid. LOL
Xenon
06-24-2002, 08:38 PM
have you put the variable $news, or have you put the variable $news[value]?
$news is an Array, $news[value] shouldn't be.
edit: i see you did ;)
Chris M
06-25-2002, 04:17 PM
A question...
If I am trying to make a variable editable in the Admin Cp, so you can input a list of random words to be chosen at random,
a.) How would you make the variable choose a word at random
b.) How would you make it so that the words can be defined in the Admin cp?
Satan
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.