vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   parameters (https://vborg.vbsupport.ru/showthread.php?t=42787)

Link14716 08-27-2002 12:23 AM

parameters
 
I wanna know how to set parameters and get them to work! :) Here is part of the file I am using.....
Code:

if ($action == "play") {
    if (!$game) {
    $game = tetris;
    }

// Variable copying
$username = $bbuserinfo[username];
$userid = $bbuserinfo[userid];

// If someone tries to input a security code via any method, the no permission page will show
if ($_REQUEST['sec_no']) {
  show_nopermission();
}

// Random security code generation
$lower = 100000000;
$higher = 999999999;
$sec_no = rand($lower, $higher);

// Date var
$date = mktime();

// New record inserted into the database, with new security code
$input_code = $DB_site->query("INSERT INTO arcade (userid, sec_no, game, comment, date) VALUES ('$userid', '$sec_no', '$game', '', '$date')");

// Fetches the high score for use in the game
$scoring = $DB_site->query("SELECT * FROM arcade WHERE game='$game' ORDER BY score DESC LIMIT 1");
$scoring_array=$DB_site->fetch_array($scoring);
$cur_high = $scoring_array['score'];

// Gets the "$game" template
        eval("dooutput(\"".gettemplate('$game')."\");");

It doesn't get the template, so I am guessing that doesn't work ;)

g-force2k2 08-27-2002 02:15 PM

did you make sure that you did the {filename here}.php?s=&action=play in the browser?

regards...

g-force2k2

Link14716 08-27-2002 09:08 PM

it was. it was simply not calling the templates.

Scott MacVicar 08-27-2002 09:29 PM

you have singlequotes around $game this will stop the variable from being changed and it will actually attempt to load the template $game

change them to doublequotes around game so its

"$game" and not '$game'

Link14716 08-27-2002 09:34 PM

ahh, see, I'm learning ;)

that is the whole point of making, modding, and installing hacks for me, PHP is cool. Thanks PPN.

g-force2k2 08-27-2002 09:48 PM

yeah thanks PPN... see i leanred someting new too ;) i didn't know the reason why in some files double quotes were used for eval() templates and for other ones single quotes ;) but i think you just helped me in the long run... :) a question though is there anything wrong with having all the templates incased in double quotes? regards...

g-force2k2

Scott MacVicar 08-27-2002 10:21 PM

Its less efficent, php tries to replace all variables in double quotes among other things.

Thats why in vB3 everything uses single quotes where possible in all the coding. You also dont have to escape double quotes within singlequotes.

PHP Code:

$test '<a href="http://www.vbulletin.com/">vBulletin</a>'



All times are GMT. The time now is 07:00 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.01013 seconds
  • Memory Usage 1,724KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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