sul mio forum (diciamo) ho un negozio a punti che ad ogni articolo che inserisco posso inserirci un file in php che ha diverse funzioni
ad esempio
Codice: Seleziona tutto
<?php
/**
*
* @package - phpbb3 UPS Easy Shop
* @version $Id: user_color_black.php 138 2010-02-22 10:39:40Z femu $
* @copyright (c) Wuerzi (http://spieleresidenz.de), (c) femu (http://die-muellers.org)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/*
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
class user_color_black extends item
{
function init()
{
}
function get_actions()
{
global $user;
$actions = array();
//In most cases, items that have an action with them should use the "use" action.
//To enable it, uncomment the following code:
$actions['use'] = array(
'name' => $user->lang['SHOP_ITEM_USE'],
'confirm' => sprintf($user->lang['SHOP_ITEM_CONFIRM_USE'], $this->data['name']),
'function' => 'use_item'
);
$actions = array_merge($actions, parent::get_actions());
return $actions;
}
function use_item()
{
global $user, $shop, $db, $phpEx, $phpbb_root_path;
$this->remove_item();
$color = $user->data['user_colour'] = '000000';
$sql_ary = array(
'user_colour' => $color,
);
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user->data['user_id'];
$db->sql_query($sql);
$message = sprintf($user->lang['SHOP_ITEM_NOW_USE'], $this->data['name']);
return $message;
}
}
?>
io vorrei inserirci invece questo
l'utente che acquista questo articolo con i punti, riceva un MP specifico...
quindi mi servivano sapere le istruzioni per creare un MP
non so se mi sono riuscito a spiegare dato che non so bene come dirlo xD
