vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   My Guessing Game Hack... (https://vborg.vbsupport.ru/showthread.php?t=40622)

Chris M 07-03-2002 06:48 PM

My Guessing Game Hack...
 
Ok...

Version 1.2 is working, as far as the php goes...

http://www.thelyceum.org/forum/guessword.php

There is the problem...

I cannot get the input form to appear...

I am using the variable $guess to call up the gg_guessword_guess template, which contains :

Code:

<form method="POST">
Type your guess here: <br>
<input type="text" name="guess" value="$yourguess">
<input type="hidden" name="num_triesgw" value="$num_triesgw">
<input type="submit" value="Submit">
</form>

I tried, as you can see, to add another variable, $yourguess, to the mix, which calls the template gg_guessword_guessbit. That contains :

Code:

$guess
The other variables are working as far as I can tell, but how do I make the input form appear on the template?

Satan

Velocd 07-03-2002 07:31 PM

Since you are trying to finish, I think you would find more help (not to mention it's appropriate for the category) here:

https://vborg.vbsupport.ru/forumdisp...p?s=&forumid=9

g-force2k2 07-03-2002 07:33 PM

hellsatan i don't believe that you can call a template from a variable that you're trying to call yet another variable ;p

g-force2k2

g-force2k2 07-03-2002 07:45 PM

The Coding of the Hack should be kinda like this then you just build on ;p

-------------------
guess_guessword template
-------------------

<form method="POST">
Type your guess here: <br>
<input type="text" name="guess" value="$yourguess">
<input type="hidden" name="num_triesgw" value="$num_triesgw">
<input type="submit" value="Submit">
</form>

thats something like the template you want to call ;)

now you want to make another template called:

----------------
guess template <--- this template should include the variable you want to call the other template
----------------

<html>
<head>
<title>[ Title here ]</title>
</head>
<body>

$header
<!-- the variable below -- hellsatan being the variable that calls the template -->
$guess

$footer

</body>
</html>

php file should look like this:

-----------------
guess.php file
-----------------

PHP Code:

<?php

require('./global.php');

error_reporting(7);

$templatesused="guess,guess_guessword";

if(
$action="start_guess") {
  eval(
"\$guess = \"".gettemplate('guess_guessword')."\";");
}

// Then You include what you want Here as well.

  
eval("eval("dooutput(\"".gettemplate('guess')."\");");

?>

g-force2k2

Chris M 07-03-2002 08:28 PM

Thats what I had...

It calls a blank screen:confused:

Satan

g-force2k2 07-03-2002 09:28 PM

did you call the main template at the end? if its possible let me see your coding...

g-force2k2

Chris M 07-04-2002 10:28 AM

Here is the coding :

PHP Code:

<?php
error_reporting
(7);
register_globals;

$templatesused='gg_guessword,gg_guessword_intro,gg_guessword_message,gg_guessword_guess,gg_guessword_guessbit,gg_guessword_tries';

require(
'./global.php');

if(
$action="start_guessword") {
  eval(
"\$guess = \"".gettemplate('gg_guessword_guess')."\";");
}

// Variables (start)
eval("$gwtries(\"".gettemplate('gg_guessword_tries')."\");");

//Start Guessword
$num = array( "blagh""whoo""whee""hello""testing" );
$num_nums rand(1,count($num)) - 1;
$nums $num[$num_nums];
$guessword == $nums;
$message "";
$num_triesgw= ( isset( $num_triesgw ) ) ? ++$num_triesgw 0;
if ( ! isset( 
$guess ) )
eval(
"$gwintro(\"".gettemplate('gg_guessword_intro')."\");");
elseif   ( 
$guess != $nums )
eval(
"$message(\"".gettemplate('gg_guessword_message')."\");");
else { 
//must be equal to
   
header"Location: hooray.php" );
   exit;
}
$guess = (int)$guess;

eval(
"dooutput(\"".gettemplate('gg_guessword')."\");");

?>

gg_guessword is the main template, and gg_guessword_guess is the Guess Template...

Satan

g-force2k2 07-04-2002 10:36 AM

hellsatan which template do you ahve the $guess variable in?

g-force2k2

Chris M 07-04-2002 11:35 AM

gg_guessword...

Satan

g-force2k2 07-04-2002 11:47 AM

duh :p *smacks myself... okay i figured it out hellsatan :D

Just take this coding:

PHP Code:

eval("\$guess = \"".gettemplate('gg_guessword_guess')."\";"); 

and replace it with:

PHP Code:

eval("\$fguess = \"".gettemplate('gg_guessword_guess')."\";"); 

then in your gg_guessword template replace:

$guess

with:

$fguess

that should do the trick :D

can't call the same variable if its manipulated as in this code:

PHP Code:

$guess = (int)$guess


thats all though :D

g-force2k2


All times are GMT. The time now is 11:16 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.01018 seconds
  • Memory Usage 1,756KB
  • 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
  • (2)bbcode_code_printable
  • (5)bbcode_php_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