vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   uCash & uShop (https://vborg.vbsupport.ru/forumdisplay.php?f=100)
-   -   Theif Mod (https://vborg.vbsupport.ru/showthread.php?t=73915)

MajorFm.com 01-06-2005 10:37 PM

Theif Mod
 
Can it be set so you can't steal from a particuler usergroup?

Link14716 01-06-2005 11:28 PM

Not yet, but it is set up on my dev board, and will be in the next major release.

MajorFm.com 01-07-2005 01:07 PM

look forward to this...

fly 01-11-2005 03:47 PM

I added that to my board with a file edit. Is it cool to post what I did?

Zachery 01-11-2005 04:05 PM

You are more than welcome to share your mdos / addons :)

fly 01-11-2005 04:40 PM

Okay, here's what I did to prevent theives from stealing from mods/admins. Never posted anything I hacked up, so hopefully this is the right format...

In /uttstore/action.theif.php find:
PHP Code:

$thefted $DB_site->query_first("SELECT userid, username, ".$vboptions['uttpoints_pointsfield']." AS points FROM ".TABLE_PREFIX."user WHERE ".$field."='".addslashes($data)."'"); 

REPLACE it with:
PHP Code:

$thefted $DB_site->query_first("SELECT userid, usergroupid, username, ".$vboptions['uttpoints_pointsfield']." AS points FROM ".TABLE_PREFIX."user WHERE ".$field."='".addslashes($data)."'"); 

find:
PHP Code:

if (!isset($thefted['userid'])) {
        
$message "User does not exist.";
        
uttstore_print_end_message($message);
    } 

ADD underneath:
PHP Code:

if ($thefted[usergroupid]==|| $thefted[usergroupid]==7) {
        
$message "Cannot steal from staff, asshat. You have been banned.";
        
uttstore_print_end_message($message);
    } 

Change the message to whatever you want, the script doesn't really ban them for that. I just thought it was funny.

This will prevent anyone from stealing from mods or admins.

docvader 01-11-2005 05:07 PM

Doesn't work. But I like the idea.

fly 01-11-2005 05:16 PM

Quote:

Originally Posted by docvader
Doesn't work. But I like the idea.

OH! I think I know what I forgot. Hang on...

edit: Should be fixed now. I did this a while ago and forgot exactly what I had done...

MajorFm.com 01-11-2005 07:24 PM

can you set this to usergroups to? instead of just mods and admin?

Link14716 01-11-2005 07:24 PM

Quote:

Originally Posted by flypaper
OH! I think I know what I forgot. Hang on...

edit: Should be fixed now. I did this a while ago and forgot exactly what I had done...

This will be in 0.96 actually whenever it is released. I'll be an option for Thief and Change Other User's Custom Title.

fly 01-11-2005 07:56 PM

Quote:

Originally Posted by MajorFm.com
can you set this to usergroups to? instead of just mods and admin?

Yeah, just follow the format in that IF statement...

Add another: || $thefted[usergroupid]==????????

MajorFm.com 01-11-2005 08:10 PM

Great, thank you for shareing this!

Lionel 04-29-2005 04:04 PM

Thanks. I automatically give 200 points to new users and they are being ripped off. Can it also be made that you cannot steal from anyone with less than 10 posts?

fly 04-29-2005 04:44 PM

Quote:

Originally Posted by Lionel
Thanks. I automatically give 200 points to new users and they are being ripped off. Can it also be made that you cannot steal from anyone with less than 10 posts?

Yeah, that should be pretty easy to do. I'll try to remember to look at it after work, unless someone else posts it before that.

fly 05-02-2005 06:10 PM

Quote:

Originally Posted by Lionel
Thanks. I automatically give 200 points to new users and they are being ripped off. Can it also be made that you cannot steal from anyone with less than 10 posts?

This hack assumes that you haven't installed the code I posted above...

In action.thief.php find:
PHP Code:

$thefted $DB_site->query_first("SELECT userid, username, ".$vboptions['uttpoints_pointsfield']." AS points FROM ".TABLE_PREFIX."user WHERE ".$field."='".addslashes($data)."'"); 

REPLACE with:

PHP Code:

$thefted $DB_site->query_first("SELECT userid, username, posts, ".$vboptions['uttpoints_pointsfield']." AS points FROM ".TABLE_PREFIX."user WHERE ".$field."='".addslashes($data)."'"); 

find:
PHP Code:

if ($userid == $bbuserinfo['userid']) {
        
$message "You may not steal from yourself!";
        
uttstore_print_end_message($message);
    } 

Add under:
PHP Code:

if ($thefted[posts]<=10) {
        
$message "Leave the little ones alone now!";
        
uttstore_print_end_message($message);
    } 

Lemme know if you also used the code I posted earlier in this thread and I'll adjust it...

btw, I can't test this right now, but the code is simple. It should work without issue.

Lionel 05-03-2005 02:15 AM

Thanks. This is how I did it earlier.


Quote:

$thefted = $DB_site->query_first("SELECT userid, usergroupid, username, ".$vboptions['uttpoints_pointsfield']." AS points FROM ".TABLE_PREFIX."user WHERE posts > 0 AND ".$field."='".addslashes($data)."'");
if (!isset($thefted['userid'])) {
$message = "User does not exist <br />or, You may not steal from users with less than 10 posts.";
uttstore_print_end_message($message);
}

fly 05-03-2005 11:16 AM

:cool:


All times are GMT. The time now is 10:01 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.01402 seconds
  • Memory Usage 1,769KB
  • 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
  • (8)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)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