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 - speak121

Pages: [1]
1
Bugs / [SOLVED] Trade Center
« on: July 17, 2007, 10:00:23 am »
I have Trade Center enabled.

To put an item on Trade Center.. you must click on on Trade Center enabled (Admin section) and must go Inventory and bellow of the price must show "Trade Item" or anything similar not??

2
Items / Chame Theme User
« on: July 02, 2007, 12:28:41 am »
Hi!, This is the first item i do! Is very simple but.. it serves me.. ^^

This items change the theme used by user to another determinated by administrator.

Code: [Select]
<?php

/**********************************************************************************
* SMFShop item                                                                    *
***********************************************************************************
* SMFShop: Shop MOD for Simple Machines Forum                                     *
* =============================================================================== *
* Software Version:           SMFShop 3.0 (Build 12)                              *
* Software by:                DanSoft Australia (http://www.dansoftaustralia.net/)*
* Copyright 2005-2007 by:     DanSoft Australia (http://www.dansoftaustralia.net/)*
* Support, News, Updates at:  http://www.dansoftaustralia.net/                    *
*                                                                                 *
* Forum software by:          Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2007 by:     Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version of the license can always be found at                        *
* http://www.simplemachines.org.                                                  *
**********************************************************************************/

if (!defined('SMF'))
die('Hacking attempt...');

class 
item_ChangeTheme extends itemTemplate
{
function getItemDetails()
{
$this->authorName 'speak121';
$this->authorEmail 'speak121@gmail.com';
$this->name 'Change the Theme used by user to xxx by speak121';
$this->desc 'Change the Theme used by user to xxx';

$this->price 400;

$this->require_input false;
$this->can_use_item true;
$this->addInput_editable true;
}

function getAddInput()
{
global $db_prefix;

$selectBox '
<select name="info1">'
;

// Get all themes
$result db_query("SELECT ID_THEME, value
FROM 
{$db_prefix}themes
WHERE variable = 'name'"
__FILE____LINE__);

// For each theme, add it to the list
while ($row mysql_fetch_assoc($result))
$selectBox .= '
<option value="' 
$row['ID_THEME'] . '">' $row['value'] . '</option>';

$selectBox .= '
</select>'
;
return 'Theme selected: ' $selectBox;

}

function onUse()
{
global $db_prefix$ID_MEMBER,  $item_info;

$result db_query("UPDATE {$db_prefix}members
SET ID_THEME = 
{$item_info[1]}
WHERE ID_MEMBER = 
{$ID_MEMBER}"__FILE____LINE__);
return 'The change is done!!!';
}
}

?>



Put it in ChangeTheme.php!  ;)

3
Coding / Coding a item
« on: July 01, 2007, 08:02:02 pm »
Hi!, first sorry for my english... is poor.

I'm doing a item to SMFShop, i used the AddInput function to request a value to administrator.

The problem is when admin goes to edit the item in his SMFShop, the value put in the AddInput disappear.

How can I do to do this value permanent in the item?

Pages: [1]