Version: 1.00, by GenSec
Developer Last Online: Jun 2010
Version: 2.2.x
Rating:
Released: 05-06-2002
Last Update: Never
Installs: 32
No support by the author.
As promised It's new version of steal addon to the Lesane Store.
At last the crime on my board is under control.
I translated all templates, but It's not the best english version.
Hope the instruction is full and understandable.
Have a fun.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Originally posted by vdinh Hi GenSec,
One of my users actually uses the Back button to keep stealing until he is successful ... I already set up so that if a user's money is negative, he won't be allowed to steal. However, once this user was caught and his money was below 0, he keeps hitting the Back button to go back to steal and was able to do so ...
Is there a way to stop this? Thanks
It should to help:
PHP Code:
// ###################### Start Verify Stealing #######################
if ($action=="stealverify") {
$getrobber=$DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
If ($getrobber[storep]<0) {
eval("standarderror(\"".gettemplate('store_steal_cannot')."\");");
}
$getduser=$DB_site->query_first("SELECT userid,usertitle,username,storep FROM user WHERE username='".addslashes(htmlspecialchars($stealusername))."'");
$contest = $DB_site->query_first("SELECT * FROM store WHERE action='steal'");
$storeid=$contest[id];
As per Gensec, I used the following line (copy/paste) to make it so that people can't steal from Insurance or Godfather (it's ok to steal from admins though). I replaced his original line that he posted:
PHP Code:
if ($getduser[usergroupid]=="6" OR $getduser[userid]==$bbuserinfo[userid] OR $getduser[userid]=="GODFATHERid" OR $getduser[userid]=="INSURANCEid") {
With the ID #'s of the Godfather and Insurance. Here is the whole code.
PHP Code:
if $getduser[userid]==$bbuserinfo[userid] OR $getduser[userid]=="370" OR $getduser[userid]=="369") {
eval("standarderror(\"".gettemplate('store_nosteal')."\");");
}
370 = Godfatherid, and 239 = Insuranceid. I created a new template called "store_nosteal" that simplay says you can't steal from the Godfather or Insurance.
I get the following error:
Parse error: parse error, unexpected T_VARIABLE, expecting '(' in /home/apok/public_html/forums/store.php on line 1074
Also, Gensec, as per your instructions on how to make it so that members MUST have at least $5 to steal, I copied/pasted your code, but it didn't work EXACTLY the way it's supposed to. Here is my code:
PHP Code:
if ($bbuserinfo[posts]<100 AND $bbuserinfo[storep]>5) { // don't allow new users to steal -- Thief should have 100 posts
eval("standarderror(\"".gettemplate('store_steal_cannot')."\");");
}
If you have a negative balance it won't let you steal. But if you have $0 or more $$$, you CAN steal. Granted, it's just a few $$$ difference from $-1 to $5, but I'm just curious why it wouldn't work? It'd be nice to be able to control it...like making it be that even thiefs have to have $100 in the positive before they can steal. But it doesn't appear to work that way. It will only prevent theft if they are in the negative balance.
In the following code to prevent people from using the back button to steal:
PHP Code:
// ################ to prevent repeated attempts #################
if ($action=="stealverify") {
$getrobber=$DB_site->query_first("SELECT storep FROM user WHERE userid='$bbuserinfo[userid]'");
If ($getrobber[storep]<0) {
eval("standarderror(\"".gettemplate('store_steal_cannot')."\");");
}
$getduser=$DB_site->query_first("SELECT userid,usertitle,username,storep FROM user WHERE username='".addslashes(htmlspecialchars($stealusername))."'");
$contest = $DB_site->query_first("SELECT * FROM store WHERE action='steal'");
$storeid=$contest[id];
There is NO change for me when I use this code above, as opposed the the original code of:
PHP Code:
if ($action=="stealverify") {
$getduser=$DB_site->query_first("SELECT userid,usertitle,username,storep FROM user WHERE username='".addslashes(htmlspecialchars($stealusername))."'");
$contest = $DB_site->query_first("SELECT * FROM store WHERE action='steal'");
$storeid=$contest[id];
Thanks for your help Gensec...my members are getting ancy about me going "live" w/ this hack. I still have a few things I wanna tweak first.
Quote:
In your case members MUST have at least 100 posts and less than $5.
I used both OR and AND...and both allowed me to steal as long as I had $0 or more. No biggie though.
I'm more concerned w/ the "back button" bug that I listed above. Also, how do I put in html referrers so members aren't FORCED to use the back button to get back to the store, main page, or wherever they want to go. As of now...they have to use the back button which promotes the "bug" of redoing the steal over and over again.
Also, did you know that when they are penalized...they can still get around not being able to post...by simply using the Quick Reply box? Is there a code we can use to prevent them from using the Quick Reply box if they are being penalized (negative balance)?