SMF Shop

SMFShop => Items => Topic started by: chadk on September 27, 2006, 03:53:39 am

Title: Karmageddon
Post by: chadk on September 27, 2006, 03:53:39 am
Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: Karmageddon.php
//      RESETS all user's karma to ZERO

//VERSION: 1.0 (Build 1)
//DATE: Sep 26th, 2006
// $Id: Karmageddon.php chadk $

class item_Karmageddon extends itemTemplate {
    function 
getItemDetails() {
    
$this->authorName "Chad";
$this->authorWeb "http://www.aviary.info/";
$this->authorEmail "generalchad@gmail.com";
        
$this->name "KARMAGEDDON!";
        
$this->desc "This will reduce EVERYONES KARMA BACK TO ZERO!!";
        
$this->price 5000;
        
        
$this->require_input false;
        
$this->can_use_item true;
    }

    function 
onUse() {
        global 
$db_prefix$ID_MEMBER$item_info;
        
        
$pmfrom = array(
            
'id' => 1,
            
'name' => 'Chad',
            
'username' => 'Chad'
        
);
        
        
$pmto = array(
            
'to' => array(1),
            
'bcc' => array()
        );

            
$result db_query("UPDATE {$db_prefix}members
                                SET karmaBad = 0, karmaGood = 0"
__FILE____LINE__);
            
$result db_query("DELETE FROM smf_log_karma");
sendpm($pmto'KARMAGEDDON!'"{$ID_MEMBER} reset everyones karma."0$pmfrom);
                return 
"Everyone has a clean slate.";
        }
    }


?>
Title: Re: Karmageddon
Post by: TechnoDragon on September 28, 2006, 01:59:29 pm
I know of a few members that would like to use this Item!
Title: Re: Karmageddon
Post by: chadk on September 28, 2006, 10:20:52 pm
This one is popular after a couple bank robbery failures... -100 karma each time they fail, then a nice Karmageddon.
Title: Re: Karmageddon
Post by: TechnoDragon on September 30, 2006, 12:07:15 am
well, I have a mod that randomly puts a floating creature on the screen (mine is a dragon) and it not only randomly gives you money or items, but it also randomly give positive or negative karma!

I have a few members that have over 100 negative because of it!
Title: Re: Karmageddon
Post by: chadk on September 30, 2006, 09:12:03 am
hahahahahah Why don't you post that one?
Title: Re: Karmageddon
Post by: TechnoDragon on September 30, 2006, 01:26:42 pm
Mainly because it is not an item, but just the LLama mod posted over at SMF but extremely modified...the original mod only affected karma...but with the help of an admin at another site I was able to make it also give money and items from the shop!
Title: Re: Karmageddon
Post by: udeze on October 22, 2006, 10:22:59 am
This looks great, can we lay our hands on it?
Title: Re: Karmageddon
Post by: TechnoDragon on October 24, 2006, 09:31:23 am
I could make the zip available...but you will have to add a few things manually...first a new field in the items database and then categorize each item...


EDIT: ok I cannot attach zip files to the posts...I'll have to figure out another way!

EDIT EDIT: Ok...here is the complete package I used to install it on my forum...with all the edits.  if it does not work let me know...though it may be easier to install manully.

for the Database, if you install it through packlage manager the database fields should be created for you...if not open up the create_Gdragon_db.php file to see what needs to be made where.

The key is in the part of the modification that adds this code to the  Karma.php file:
Code: [Select]
// muhahahahahahahahaha, the Gdragon's have been set FREE!
function magicGdragon()
{

There i a lot of code after that but it is all to tell the mod how to choose whether to give an item and which one or money and whether it should be in the bank or in hand....any other questions just reply and I will do my best to help you guys out!
Title: Re: Karmageddon
Post by: Daniel15 on October 27, 2006, 06:49:13 pm
Quote
EDIT: ok I cannot attach zip files to the posts...I'll have to figure out another way!
Try it now :)
Title: Re: Karmageddon
Post by: TechnoDragon on October 27, 2006, 11:52:24 pm
Ok...thanks to Daniel I have attached the package that I had created to install this on my forum...read my post above for some basic instructions and let me know of any issues!
Title: Re: Karmageddon
Post by: checho_vacan on December 14, 2006, 11:52:24 pm
Thanks... cool item, works perfect n_n
Title: Re: Karmageddon
Post by: Lucid_Dream on December 19, 2006, 11:12:44 am
I was trying to install the dragon on SMF 1.1 RC3 today. but

2.   Execute Modification   ./Sources/Load.php   Test failed
3.   Execute Modification   ./Sources/Karma.php   Test successful
4.   Execute Modification   ./Sources/ModSettings.php   Test successful
5.   Execute Modification   ./Sources/Subs.php   Test successful
6.   Execute Modification   ./Themes/default/index.template.php   Test failed

with these mods installed:

   SMF 1.0.9 and 1.1 RC3-1 Security Patch   1.0.8/1.1 RC3 
   SMFShop   2.3     
   SMF Arcade   1.3.1-MOD-E1.5.1     
   Custom Action Mod   2.04     
   Googlebot & Spiders Mod   2.0.2     
   Location Mod   1.2     
   SMF Staff Page   1.3    
   Avatars at Index Mod   1.2     
   Media Center   1.0     
   Member Awards   1.0     
   MessagePreviewOnHover   1.4     
   Frequency Bar   1.0     
   Location Mod - Additional Maps   1.2     
   Karma Description Mod   2.2     
   Reg Bar   1.0     
   Signature Settings Mod   1.0

Any chance of a little help (embarrassed to ask)
Title: Re: Karmageddon
Post by: babylonking on January 22, 2007, 10:40:24 am
Mainly because it is not an item, but just the LLama mod posted over at SMF but extremely modified...the original mod only affected karma...but with the help of an admin at another site I was able to make it also give money and items from the shop!

Hi TechnoDragon

I have the llama mod installed in my forum, Can you please share the code that gives money  and item from the shop., Thanks !
Title: Re: Karmageddon
Post by: Sakuragi on January 22, 2007, 07:55:44 pm
For money it's very simple
on Karma.php
replace :
Code: [Select]
$field1 = ($Llamainfo['Type'] == 1) ? 'karmaGood' : 'karmaBad';
by
Code: [Select]
$field1 = ($Llamainfo['Type'] == 1) ? 'money' : 'money';
and go to Admin => Features and Options => Karma
set a negative amount for Minimum points for Evil Llama and Maximum points for Evil Llama
Title: Re: Karmageddon
Post by: babylonking on January 23, 2007, 08:00:12 am
For money it's very simple
on Karma.php
replace :
Code: [Select]
$field1 = ($Llamainfo['Type'] == 1) ? 'karmaGood' : 'karmaBad';
by
Code: [Select]
$field1 = ($Llamainfo['Type'] == 1) ? 'money' : 'money';
and go to Admin => Features and Options => Karma
set a negative amount for Minimum points for Evil Llama and Maximum points for Evil Llama

Thanks alot Sakuragi  O0
Title: Re: Karmageddon
Post by: Sakuragi on January 24, 2007, 05:10:12 am
you are welcom :)
Ps: your bbk chat look good, what script it is?
Title: Re: Karmageddon
Post by: babylonking on January 24, 2007, 01:45:23 pm
you are welcom :)
Ps: your bbk chat look good, what script it is?

The chat script name is BlaB, Check the link below !

http://hot-things.net/

Title: Re: Karmageddon
Post by: Sakuragi on January 25, 2007, 03:15:51 am
Thanks
Title: Re: Karmageddon
Post by: babylonking on January 25, 2007, 07:31:02 am
You're a very welcome.  :)