Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases

Reply
 
Thread Tools
Store Redemption Hack v1.1 Details »»
Store Redemption Hack v1.1
Version: 1.00, by X-Fan X-Fan is offline
Developer Last Online: Apr 2005 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 09-14-2003 Last Update: Never Installs: 6
Is in Beta Stage  
No support by the author.

G'day all,

This is my first released hack for vBulletin, so please be gentle with me! I'm not a hacker myself by any stretch of the imagination, as this hack is basically adapted from another. As always, back-up your files and your database before installing. It works on my heavily-hacked v2.3.0 board, and should (in theory) work on any board that Lesane's Store Hack works on, but better safe than sorry!

This hack is only useful for those boards that use both the Store and g-force2k2's Warning Hack v2.1, though I'm sure it could quite easily be adapted to work with other such warnings systems.

Hack Name: Store Redemption Hack v1.0 for vBulletin 2.x.x
Hack Author: X-Fan (x-fan@bigpond.net.au)
Inspired by: Dark Jim's More Private Messages Quota Hack
Thanks to: N9ne and Mist for their help in getting this hack working!
Required: g-force2k2's Warning Hack v2.1
First Release: 15 September 2003
Description: This add-on for Lesane's Store Hack will give users the opportunity to redeem themselves by paying for a warning point to be removed from their account.

Installation is pretty simple. There's one query to run, three templates to make, and one file to edit.

Here's hoping your users appreciate the opportunity to redeem themselves! If you use this hack, please don't forget to click install. Any questions, feel free to ask.

Cheers,

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 09-16-2003, 04:35 AM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, you don't have the Store Staff Discount hack installed.

Okay, in store.php, find:

PHP Code:
// ###################### Start Remove Warning Verify #######################
if ($action=="removewarn") {
$contest $DB_site->query_first("SELECT * FROM store WHERE action='removewarn'");
$storeid=$contest[id];
$costpercent=$DB_site->query_first("SELECT storecost FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");
$cost=round($contest[costs] * ($costpercent[storecost]/100));
$need=$points $cost;
 
if (
$cost>$points) {
    eval(
"standarderror(\"".gettemplate('store_error')."\");");
}
$warns $DB_site->query_first("SELECT warninglvl FROM user WHERE userid=$bbuserinfo[userid]");
if (
$warns['warninglvl'] < or empty($warns['warninglvl'])) {
    eval(
"standarderror(\"".gettemplate('store_removewarn_error')."\");");
}
$oldwarnings=$warns[warninglvl];
$newwarnings=$oldwarnings-1;
eval(
"dooutput(\"".gettemplate("store_removewarn_verify")."\");");
}
// ###################### Start Remove Warning #######################
if ($action=="removewarndo") {
$contest $DB_site->query_first("SELECT * FROM store WHERE action='removewarn'");
$title=$contest[title];
$costpercent=$DB_site->query_first("SELECT storecost FROM usergroup WHERE usergroupid=$bbuserinfo[usergroupid]");
$cost=round($contest[costs] * ($costpercent[storecost]/100));
 
if (
$cost>$points) {
    eval(
"standarderror(\"".gettemplate('store_error')."\");");
} else {
    
$DB_site->query("UPDATE user SET warninglvl=warninglvl-1,storep=storep-$cost WHERE userid='$bbuserinfo[userid]'");
    
$changestorenow $DB_site->query("UPDATE store SET sold=sold+1 WHERE action='removewarn'");
    
$moneycheck $DB_site->query_first("SELECT storep FROM user WHERE userid=$bbuserinfo[userid]");
    
$money $moneycheck[storep];
    eval(
"dooutput(\"".gettemplate("store_removewarn_done")."\");");
}

And replace with:

PHP Code:
// ###################### Start Remove Warning Verify #######################
if ($action=="removewarn") {
$contest $DB_site->query_first("SELECT * FROM store WHERE action='removewarn'");
$storeid=$contest[id];
$cost=$contest[costs];
$need=$points $cost;
 
if (
$cost>$points) {
    eval(
"standarderror(\"".gettemplate('store_error')."\");");
}
$warns $DB_site->query_first("SELECT warninglvl FROM user WHERE userid=$bbuserinfo[userid]");
if (
$warns['warninglvl'] < or empty($warns['warninglvl'])) {
    eval(
"standarderror(\"".gettemplate('store_removewarn_error')."\");");
}
$oldwarnings=$warns[warninglvl];
$newwarnings=$oldwarnings-1;
eval(
"dooutput(\"".gettemplate("store_removewarn_verify")."\");");
}
// ###################### Start Remove Warning #######################
if ($action=="removewarndo") {
$contest $DB_site->query_first("SELECT * FROM store WHERE action='removewarn'");
$title=$contest[title];
$cost=$contest[costs];
 
if (
$cost>$points) {
    eval(
"standarderror(\"".gettemplate('store_error')."\");");
} else {
    
$DB_site->query("UPDATE user SET warninglvl=warninglvl-1,storep=storep-$cost WHERE userid='$bbuserinfo[userid]'");
    
$changestorenow $DB_site->query("UPDATE store SET sold=sold+1 WHERE action='removewarn'");
    
$moneycheck $DB_site->query_first("SELECT storep FROM user WHERE userid=$bbuserinfo[userid]");
    
$money $moneycheck[storep];
    eval(
"dooutput(\"".gettemplate("store_removewarn_done")."\");");
}

That should work. I'll update the install instructions to take this into account as well.
Reply With Quote
  #13  
Old 09-16-2003, 04:40 AM
Hobbes's Avatar
Hobbes Hobbes is offline
 
Join Date: Dec 2002
Location: Cali
Posts: 230
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm....and teh page is now blank o_O..when trying with a register user


edit- and i get

Quote:
You do not have any warning points, and so do not need to remove one.
when trying with admin username


edit2- me go sleep >=\
Reply With Quote
  #14  
Old 09-16-2003, 04:48 AM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hobbes
hmmm....and teh page is now blank o_O..when trying with a register user
Not sure why that would be... did you try a SHIFT-refresh on the page?

Quote:
Originally Posted by Hobbes
edit- and i get

when trying with admin username
Well, if you don't have any warning points then that's the result you'll get!
Reply With Quote
  #15  
Old 09-16-2003, 01:55 PM
Hobbes's Avatar
Hobbes Hobbes is offline
 
Join Date: Dec 2002
Location: Cali
Posts: 230
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by X-Fan
Not sure why that would be... did you try a SHIFT-refresh on the page?
i refreshed hehe...still blank
Reply With Quote
  #16  
Old 09-17-2003, 08:28 AM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you add the templates correctly?
Reply With Quote
  #17  
Old 09-19-2003, 02:25 AM
Hobbes's Avatar
Hobbes Hobbes is offline
 
Join Date: Dec 2002
Location: Cali
Posts: 230
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeesh
Reply With Quote
  #18  
Old 09-19-2003, 03:41 AM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, sorry, but I had to ask. I can't think of any reason why it wouldn't be showing up. Just make sure you followed the steps in the txt file as listed and you shouldn't have any problems.
Reply With Quote
  #19  
Old 09-27-2003, 12:39 PM
PixelFx PixelFx is offline
 
Join Date: Dec 2002
Posts: 1,117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very cool idea, I don't have either hack installed yet, again, but I'll definaly add this when I do
Reply With Quote
Reply

Thread Tools

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 04:49 PM.


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.04785 seconds
  • Memory Usage 2,318KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_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