vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Don't know where to ask this, but.... Variables (https://vborg.vbsupport.ru/showthread.php?t=40204)

Link14716 06-23-2002 11:07 PM

Don't know where to ask this, but.... Variables
 
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


All times are GMT. The time now is 09:57 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00977 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete