vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Contest Hack -- Points hack addon (https://vborg.vbsupport.ru/showthread.php?t=40127)

ULTIMATESSJ 06-21-2002 11:36 PM

Quote:

Originally posted by Vivi Ornitier
hmmm . .. i tried those commands and it still brings up a blank page.
same with me

eiSecure 06-22-2002 12:49 AM

oh, whoop!

It's supposed to be contest.php?action=view

:bunny:

BigJohnson 06-22-2002 08:41 AM

Wow that doesn't work neither. What do we do now.

BigJohnson 06-22-2002 08:43 AM

Wait a sec. Where are the template edits? contest_main

Huh i see these in the php file but no where in the directions did it say to make templates. Something fishy is going on here. o_0

eiSecure 06-22-2002 02:32 PM

Oh, whoops... yeah, you need to create a template, sorry, my bad. ^_^

Here, just put this in as your template content...

Name the template contest_main :) :bunny:

BigJohnson 06-22-2002 07:23 PM

This hack works great but just one thing that is wierd about it. Is there any way you can only get into a contest once. Because i can click enter contest for the same contest and still be paying not even noing that i enter the contest. So if there could be an error screen or something that says you already have entered this contest please make something like that. Thanks so much. This hack is amazng. I love it. But with out this it seems pretty funny. Thanks ;)

eiSecure 06-22-2002 07:58 PM

To prevent someone from submitting more than one ticket, you can modify the code a little to have a while() loop that checks if the results from a SQL select statement return any results.

If you make it select the username, and the number of results is greater than 0, just popup an error.:)

BigJohnson 06-22-2002 08:02 PM

Thats the prob hehe. I don't no how to code hahaha. I am learning but please post the code that would help tremendously. Also where to put the code would help also hehe. Thanks.

eiSecure 06-22-2002 08:18 PM

Okay...

In contest.php, find:
PHP Code:

// ############################### start enter contest ##########################
if ($action=="enter") {
  include(
"./global.php");
  
//check usergroup of user to see if they can use Profile
  
if ($bbuserinfo[userid]==0) {
    
show_nopermission();
  }
  
$contestentry=$DB_site->query("SELECT id,name,price,open,winner FROM contest_contests WHERE id='$contestid'");
  while (
$contest=$DB_site->fetch_array($contestentry)) {
    
$giladd=$contest['price'];
    
$open=$contest['open'];
  }

  if (
$open=="NO") {
    
$contestbody .= "This contest has been concluded. Your entry has not been entered.";
    eval(
"dooutput(\"".gettemplate("contest_main")."\");");
  } else {

  
$pointfield="storep";
  
$gilstr=$DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
$gil=$gilstr[$pointfield];
$gilamt=$gilstr[$pointfield];
if (
$gil $giladd) {
$contestbody .= "You do not have enough points to enter.";
}
else {
$postgil = ($gilamt $giladd);
$DB_site->query("UPDATE user SET storep='$postgil' WHERE userid='$bbuserinfo[userid]'");
$DB_site->query("INSERT INTO contest_entries (id,userid,contestid) VALUES (NULL,$bbuserinfo[userid],$contestid)");
$contestbody .= "You have entered this contest.";
}
eval(
"dooutput(\"".gettemplate("contest_main")."\");");
}


Replace:
PHP Code:

// ############################### start enter contest ##########################
if ($action=="enter") {
  include(
"./global.php");
  
//check usergroup of user to see if they can use Profile
  
if ($bbuserinfo[userid]==0) {
    
show_nopermission();
  }
  
$contestentry=$DB_site->query("SELECT id,name,price,open,winner FROM contest_contests WHERE id='$contestid'");
  while (
$contest=$DB_site->fetch_array($contestentry)) {
    
$giladd=$contest['price'];
    
$open=$contest['open'];
  }
  
$contestcheck=$DB_site->query("SELECT * FROM contest_entries WHERE userid='$bbuserinfo[userid]'");
  if (
$open=="NO") {
    
$contestbody .= "This contest has been concluded. Your entry has not been entered.";
    eval(
"dooutput(\"".gettemplate("contest_main")."\");");
  } elseif (
$DB_site->num_rows($contestcheck)>0) {
    
$contestbody .= "Sorry, you can only enter this contest once.";
    eval(
"dooutput(\"".gettemplate("contest_main")."\");");
  } else {

  
$pointfield="storep";
  
$gilstr=$DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
$gil=$gilstr[$pointfield];
$gilamt=$gilstr[$pointfield];
if (
$gil $giladd) {
$contestbody .= "You do not have enough points to enter.";
}
else {
$postgil = ($gilamt $giladd);
$DB_site->query("UPDATE user SET storep='$postgil' WHERE userid='$bbuserinfo[userid]'");
$DB_site->query("INSERT INTO contest_entries (id,userid,contestid) VALUES (NULL,$bbuserinfo[userid],$contestid)");
$contestbody .= "You have entered this contest.";
}
eval(
"dooutput(\"".gettemplate("contest_main")."\");");
}


I haven't tested this, but it should work.:):bunny:

BigJohnson 06-22-2002 08:20 PM

O it worked great. This is a great hack. Thanks so much. I think you should update the first post for everyone with this update this is a great update thanks so much you are the greatest.


All times are GMT. The time now is 09:34 PM.

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.01388 seconds
  • Memory Usage 1,771KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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