vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Using Eval (https://vborg.vbsupport.ru/showthread.php?t=59944)

Toneboy 01-09-2004 10:08 AM

Using Eval
 
As I'm probably going to upgrade to 3.0.0 when the full release comes along I'm letting my board members know what I'm up to, and doing my best to make it as easy for them to find out information as possible during the process.

With that in mind I thought I would add the board version and whether the board is open or not onto the front page of my site.

I've found where these details are (in the options template), but now I need to know how to get those details from that template and make them into strings. As I've not used the eval command before can someone tell me if I've got this right?

(Very rough code coming up)
PHP Code:

<?
mysql_query ("SELECT template FROM template WHERE title='options' LIMIT 1");

*/

I know that bit isn't quite right, but I know what I mean. :)

/*


$boardversion = "Board version: $templateversion";
eval("\$boardversion = \"$templateversion\";");

$boardstatus = "$bbactive";
eval("\$boardstatus =\"$bbactive\";");

if ($boardstatus == 1) {
// Set string to show board is open.
$boardmsg = "Board is open.";
} else {
// Set string to show board is closed.
$boardmsg = "Board is currently closed.";
}
echo "$boardversion/nBoard Status: $boardmsg";
?>


NTLDR 01-09-2004 10:38 AM

Note that once you have upgraded to vB3 that the query will no longer work as there isn't an options template in vB3.

However for what you want to do in vB2 look in global.php and you'll see how the eval and setup the options.

Toneboy 01-09-2004 11:45 AM

Quote:

Originally Posted by NTLDR
Note that once you have upgraded to vB3 that the query will no longer work as there isn't an options template in vB3.

Interesting. Might have to cheat a bit during the changeover then.

I don't want to get sidetracked on this, but where will the version details and bbactive move to?
Quote:

Originally Posted by NTLDR
However for what you want to do in vB2 look in global.php and you'll see how the eval and setup the options.

Will give it a go and let you know how I get on.

Xenon 01-09-2004 01:10 PM

in vb3 all settings are stored into an array rather then into different variables, and the setting is cached in the datastore as a serialized string.


All times are GMT. The time now is 03:45 AM.

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.01563 seconds
  • Memory Usage 1,718KB
  • 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)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete