Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - prisoner

Pages: [1]
1
Items / New Item "Set Leve xxxl" (Set Posts)
« on: October 25, 2006, 12:20:08 am »
Hi,

i have modified the DecrasePost.php like this:

Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: SetPost.php
//      Item

//VERSION: 1.0 (Build 1)
//DATE: 24th October 2006
//Author: Prisoner/Darkshadow !!!

class item_SetPost extends itemTemplate {
    function getItemDetails() {
        $this->name "Set Posts to 500";
        $this->desc "Sets <i>Someone else's</i> post count to 500!!";
        $this->price 200;
    }

    function getUseInput() {
global $context$scripturl$settings$txt;
        return "Member's Name: <input type='text' name='username'>
        <a href='
{$scripturl}?action=findmember;input=username;quote=0;sesc={$context['session_id']}' onclick='return reqWin(this.href, 350, 400);'><img src='{$settings['images_url']}/icons/assist.gif' border='0' alt='{$txt['find_members']}' /> Find Member</a><br>";
    }

    function onUse() {
        global $db_prefix$ID_MEMBER;

        $result db_query("UPDATE {$db_prefix}members
                            SET posts = posts - posts
                            WHERE memberName = '
{$_POST['username']}'",
                            __FILE____LINE__);

        $result db_query("UPDATE {$db_prefix}members
                            SET posts = posts + 500
                            WHERE memberName = '
{$_POST['username']}'",
                            __FILE____LINE__);

        return "Successfully set {$_POST['username']}'s posts to 500!";
    }

}

?>

In the first step it will decrase the posts from a choosen user to zero and then to 500 in this case.

What can you do with this ?
Well, i have a Forum with many posts related membergroups, the users will become more rights in a higher membergroup with more posts, i use 70 post releated usergroups. So my intention was an item to increase postcounter to a specified number of posts, this will enable a specified automatic "Level Up" for the users. Maybe in this case the next membergroups is at 501 posts, so the users have to do one more post and is in the next membergroup. When users buy an item "SetLevel_01" a user with higher "Level" is in danger...hehehe

You have to adjust the among of posts in this file (500) related to your settings in the membergroups and name it correct related to the affected membergroup. Here is the code that will reflect my membergroup "Level 03"

Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: SetLevel_03.php
//      Item

//VERSION: 1.0 (Build 1)
//DATE: 24th October 2006
// $Id: SetLevel_03.php

class item_SetLevel_03 extends itemTemplate {
    function getItemDetails() {
        $this->name "Set User to Level 3 after 1 more Post";
        $this->desc "Sets <i>Someone else's</i> Level 3 after 1 more Post!";
        $this->price 200;
    }

    function getUseInput() {
global $context$scripturl$settings$txt;
        return "Member's Name: <input type='text' name='username'>
        <a href='
{$scripturl}?action=findmember;input=username;quote=0;sesc={$context['session_id']}' onclick='return reqWin(this.href, 350, 400);'><img src='{$settings['images_url']}/icons/assist.gif' border='0' alt='{$txt['find_members']}' /> Find Member</a><br>";
    }

    function onUse() {
        global $db_prefix$ID_MEMBER;

        $result db_query("UPDATE {$db_prefix}members
                            SET posts = posts - posts
                            WHERE memberName = '
{$_POST['username']}'",
                            __FILE____LINE__);

        $result db_query("UPDATE {$db_prefix}members
                            SET posts = posts + 29
                            WHERE memberName = '
{$_POST['username']}'",
                            __FILE____LINE__);

        return "Successfully set {$_POST['username']}'s posts to end of Level 2";
    }

}

?>

Maybe someone can edit it so that it will automatic change the membergroup without to do a 1 more post, i assume you have called the script post.php ????



2
Coding / Some Items Ideas
« on: October 22, 2006, 05:37:00 am »

Hello,

i never have coded in PHP, but i have some ideas for items and shop modifications, maybe someone does the job ?

1. it will be nice when the admin can edit a message for every item. The message should apear when the item is used, so the admin can made item like This: Item Name: "unidentified item", after use the user will receive the message for this item like this: "Ups, your posts are now decrased by 10" or what ever the admin have typed in...

2. Enter the amount of given credits for every board seperatly

3. A pesonal Armageddon item (the user to harm are choosable from a list...)

4. A protection Item for all the harmfull items (protection item for steal credits, annother protection item for armageddon and so on...)

5. Time properties for the items... maybe the items lost from day to day power...

6. An pm to the member which was targeted by a bad item like steal credits with the information which member has done this...

7.An info under the avatar picture how strong a member is protected with protection items

8. Auktion for items in the trade center, for example: a member put a item in the tradecenter for a specified time (hours/days), the other members can bet, after the specified time, the member with the highest bet will receive the item

9. Item to bann a member from a specified among of time fom the trade center...

10. item to bann a member from a specified among of time from a choosen board...

I have a lot of more ideas but i think this time is enough....


Excuse my bad english, hope you understand...

Prisoner



3
Hello,

i have successfull setup smf shop 2.2 with standard Theme, works well, than i changed to aA_New_Damage Theme, makes the source changes to get the shop button to work -> no problem, but: the credits no longer shown under the avatars image, in inventory the credits will hadled right, please help

I love the shop with this awesome theme...

Pages: [1]