Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2003, 12:50 PM
dv6cougar dv6cougar is offline
 
Join Date: Mar 2003
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default while statements, eval, and only one result showing :(

hey guys, i'm using the Template Hack, mucho props to whomever made that, it's a great hack!

however, i'm trying to make a raffle like hack with this, so far i'm not doign to bad

this would be my first attempt at a hack.

i have this in my code
PHP Code:
//check to see that $id is not set
if(!isset($id)) {
    
$raffle $DB_site->query("SELECT * FROM raffle_list WHERE status='current'");
        while(
$raffleql $DB_site->fetch_array($raffle)) {
        
        
$raftitle $raffleql['title'];
        
$rafid $raffleql['id'];
         eval(
"\$ticketid = \"".logiciangettemplate('ticketid')."\";");
        }
//end while
}//end $id is not set 
and then i have my template set to use $ticketid, which works great

but then the ticketid tempalte looks like this

PHP Code:
<a href="show.php?pg=raffle&id=$rafid">$raftitle</a
the $rafid and $raftitle work like a charm, however, if i have 2 raffles i want to show up it only shows one

how do you make the while statement work correctly? i know you can do it, since teh forumhome and forumdisplay does it

thanks alot
Reply With Quote
  #2  
Old 05-15-2003, 01:14 PM
colicab-d's Avatar
colicab-d colicab-d is offline
 
Join Date: Dec 2002
Location: Glasgow
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah ive had this prob before, with a simple shout box i made, when i eval`d i could only get 1 result showing
Reply With Quote
  #3  
Old 05-15-2003, 01:20 PM
JulianD's Avatar
JulianD JulianD is offline
 
Join Date: Jan 2002
Posts: 455
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After a quick look to your code, try to replace this:

PHP Code:
eval("\$ticketid = \"".logiciangettemplate('ticketid')."\";"); 
for this:

PHP Code:
eval("\$ticketid .= \"".logiciangettemplate('ticketid')."\";"); 
Reply With Quote
  #4  
Old 05-15-2003, 01:21 PM
dv6cougar dv6cougar is offline
 
Join Date: Mar 2003
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm ok i even tried it within my original raffle template and not using $ticketid and what not as seperate templates....


any help would be great here usually there will only be one raffle but there may be more then 1 sometimes thanks for your input
Reply With Quote
  #5  
Old 05-15-2003, 01:27 PM
dv6cougar dv6cougar is offline
 
Join Date: Mar 2003
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 03:20 PM JulianD said this in Post #3
After a quick look to your code, try to replace this:

PHP Code:
eval("\$ticketid = \"".logiciangettemplate('ticketid')."\";"); 
for this:

PHP Code:
eval("\$ticketid .= \"".logiciangettemplate('ticketid')."\";"); 

actually that would make sense .= so it takes more as needed

thanks!
Reply With Quote
  #6  
Old 05-15-2003, 01:28 PM
JulianD's Avatar
JulianD JulianD is offline
 
Join Date: Jan 2002
Posts: 455
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem
Reply With Quote
  #7  
Old 05-15-2003, 02:00 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Be uber-certain to either unset() or set to "" $ticketid first to avoid HTML injection.
Reply With Quote
  #8  
Old 05-15-2003, 02:16 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would this be the same thing then?

$pollrun = "";
unset($pollrun);

even though the variable hasn't been declared yet?
Reply With Quote
  #9  
Old 05-15-2003, 02:24 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Either:
PHP Code:
unset($pollrun); // i like because it happens to free memory too 
or
PHP Code:
$pollrun ""
works. Remember with vB2, register_globals is explicitly turned on which is the biggest security hole known to mankind.
Reply With Quote
  #10  
Old 05-15-2003, 02:26 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which one would you have to use with register_globals turned off?
Reply With Quote
Reply


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 10:06 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.03917 seconds
  • Memory Usage 2,264KB
  • 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
  • (8)bbcode_php
  • (1)bbcode_quote
  • (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