Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-03-2002, 06:48 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 07-03-2002, 07:31 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 07-03-2002, 07:33 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 07-03-2002, 07:45 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 07-03-2002, 08:28 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats what I had...

It calls a blank screen

Satan
Reply With Quote
  #6  
Old 07-03-2002, 09:28 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

g-force2k2
Reply With Quote
  #7  
Old 07-04-2002, 10:28 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 07-04-2002, 10:36 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

g-force2k2
Reply With Quote
  #9  
Old 07-04-2002, 11:35 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

gg_guessword...

Satan
Reply With Quote
  #10  
Old 07-04-2002, 11:47 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

duh *smacks myself... okay i figured it out hellsatan

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

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

PHP Code:
$guess = (int)$guess

thats all though

g-force2k2
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04541 seconds
  • Memory Usage 2,276KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete