vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Store Redemption Hack v1.1 (https://vborg.vbsupport.ru/showthread.php?t=57096)

X-Fan 09-14-2003 10:00 PM

Store Redemption Hack v1.1
 
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,

kamu 09-14-2003 11:24 PM

Good idea, I'll be looking forward to more of your work :)

halo 09-14-2003 11:50 PM

cool hack yo.. im gonna go install it right away

lasto 09-14-2003 11:56 PM

i would install this x-fan but the warning hack is misisng from the orginal post so its a bit of a killer really

Like the hack though but cant use :(

X-Fan 09-15-2003 01:34 AM

Quote:

Originally Posted by kamu
Good idea, I'll be looking forward to more of your work :)

They'll be few and far between, as my RL job keeps me pretty busy, but I really wanted this add-on for the store and it looked like a fairly simple thing to do. Thanks to N9ne and Mist it was! :)

Glad you liked it, and hope it proves useful for you!

lasto 09-15-2003 08:37 PM

an addon to an hack that is no longer on vbull

did the author remove it or did the upgrade to vb3 destroy it?

Hobbes 09-16-2003 03:53 AM

nice hack..

I instlaled, but it isnt showing on my store list...o_O

X-Fan 09-16-2003 04:01 AM

Quote:

Originally Posted by Hobbes
nice hack..

I instlaled, but it isnt showing on my store list...o_O

Did you run the SQL query via phpMyAdmin?

Hobbes 09-16-2003 04:04 AM

yep, and added the templates and file edit O_O



EDIT: Nevermind.

I R TEH N00B *hits self* sorry lol :(

Hobbes 09-16-2003 04:10 AM

PHP Code:

 
Database error in vBulletin 2.2.6
:
Invalid SQLSELECT storecost FROM usergroup WHERE usergroupid=6
mysql error
Unknown column 'storecost' in 'field list'
mysql error number1054
Date
Tuesday 16th of September 2003 12:11:46 AM
Script
: [url="http://forums.squareultima.com/store.php?action=removewarn"]http://forums.squareultima.com/store.php?action=removewarn[/url]
Referer



....ish not works0rzing...:(

edit- also, when a user tries to, it just displays a normal DB error screen

X-Fan 09-16-2003 04:35 AM

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.

Hobbes 09-16-2003 04:40 AM

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 >=\

X-Fan 09-16-2003 04:48 AM

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! :)

Hobbes 09-16-2003 01:55 PM

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 :(

X-Fan 09-17-2003 08:28 AM

Did you add the templates correctly?

Hobbes 09-19-2003 02:25 AM

yeesh :(

X-Fan 09-19-2003 03:41 AM

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.

PixelFx 09-27-2003 12:39 PM

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


All times are GMT. The time now is 03:19 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.01098 seconds
  • Memory Usage 1,797KB
  • 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
  • (3)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete