The Arcive of vBulletin Modifications Site. |
|
parameters Details »»
|
|||||||||||||||||||||||||
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')."\");");
![]() Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
did you make sure that you did the {filename here}.php?s=&action=play in the browser?
regards... g-force2k2 |
|
#3
|
||||
|
||||
|
it was. it was simply not calling the templates.
|
|
#4
|
|||
|
|||
|
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' |
|
#5
|
||||
|
||||
|
ahh, see, I'm learning
![]() that is the whole point of making, modding, and installing hacks for me, PHP is cool. Thanks PPN. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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:
|
![]() |
|
|