vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to read vbulletin->options from database? (https://vborg.vbsupport.ru/showthread.php?t=159796)

Lionel 10-08-2007 10:03 PM

How to read vbulletin->options from database?
 
I have a script that reads from database and write the data in a file.
What is the proper syntax for that please?

I tried putting in database:

Quote:

<Background backgroundColor=\"".$vbulletin->options['mybg']."\"
and
Quote:

<Background backgroundColor=\"".$GLOBALS['vbulletin']->options['mybg']."\"
They don't work.

Guest190829 10-08-2007 11:16 PM

Not sure exactly what you are asking... We need a little more than a single line to see what you are doing.

EnIgMa1234 10-08-2007 11:21 PM

I think he's trying to get a vbulletin option, to be added into a file, in the tag.

$vbulletin->options['mybg'] = #000000

So this would be added to the file:
<Background backgroundColor="#000000">

I think :D

Lionel 10-08-2007 11:22 PM

OK. I am writing to an xml. If I put in the php:

$xml=bgcolor=".$vbulletin->options['mybg']." That is fine. The xml gets written with the correct value.

Now, if I put those in the db and do a query_first to retrieve it, then in the php I do

$xml=$myquery[result];

the xml gets written with the unconverted value for the option. It just displays bgcolor=".$vbulletin->options['mybg']." I tried the first post codes with no success.

Same goes for $vbphrase.

the very hard way I am trying to avoid would be to do a str_replace before I write to the xml. But there are so many options and phrases involved ...

Analogpoint 10-09-2007 03:03 AM

Why are you manually writing options and phrases to a database? vB handles them all transparently. Just fire up a plugin for example and you can use $vbulletin->options without doing anything beforehand.

Lionel 10-09-2007 03:27 AM

It has to be in database.

--------------- Added at 02:12 ---------------

No one can help?

Marco van Herwaarden 10-09-2007 06:35 AM

Please show the full lines of code that is handling this, will be a lot easier to help you then.

Lionel 10-09-2007 06:52 AM

The idea: I am releasing this slideshow mod found in my homepage
which auto updates: install and forget about it.
It's a dynamic flash slideshow that reads from an XML.

I decided to release it with 3 different layouts options. All was fine the way I did it with database, until I thought it would be neat to allow users to customize it to their taste. So in vb options they have 3 choices of layout. Plus they can make it the colors they want plus it uses phrases for the non english members..

So the plugins for when creating/updating/deleting a thread create an xml whenever there are actions in preset forums.

the template in database (lots of lines) so I am putting only this. $vbphrase are also involved.

Quote:

etc... etc... <Background backgroundColor=\"".$vbulletin->options['cover_main_bg']."\" etc... etc...
So depending on user choice, I select appropriate template from db and create the XML on the fly.

And as described in first post, what gets written in the xml is the raw code, no matter what I try.

Marco van Herwaarden 10-09-2007 07:01 AM

What is the content of $template['template']?

Most likely the variable does not get parsed because of the stripslashes().

Lionel 10-09-2007 07:05 AM

It's a lot of contents. I am putting the beginning only

If I don't escape it I can't put in database. And if I don't remove the slashes, they get written in xml too.


All times are GMT. The time now is 07:07 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.01223 seconds
  • Memory Usage 1,744KB
  • 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
  • (3)bbcode_quote_printable
  • (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