SMF Shop
SMFShop => Items => Topic started by: jewropa on March 15, 2007, 05:26:51 am
-
Hello dear Item developers,
i need the following Item:
The user has to buy "1x Upload avatar"
For regular users I have forbidden to edit their "Edit additional profile settings"
I want the Avatar as a "premium" permission which a user can buy
Can somebody help me?
-
using the add membergroup item would be a quick solution
-
hmm, it would change only the grpup of the members.
its posibble to clone the regular user group.
But after than the user can change all his configs himself without paying money. :(
The idea was, to let the users earn money and step by step build their Profile.
The effect:
New users have a very small and ugly profile.
The longer avaible and active users have a profile with lot of fields, avatar, signature
-
the problem is i wish that the "Edit additional profile settings"
stay disabled , but if i let the user change another group to upload a avatar, i have to activate the "Edit additional profile settings"
-
im not entirely sure what you mean, but the buy membergroup function, depending on which one you use, only adjusts the additional group field.
now the permission "Edit additional profile settings" i suppose is a bit to open for what you are after, but how SMF is designed i suppose its a small limitation.
you could by all means add 1 more permission to SMF called allot upload avatar, then adjust your source files accordingly, which is a little more complicated.
the question on how to do that would probably be best placed in the SMF community forums (http://www.simplemachines.org/community/)
daniel15 might be able to give you a run down on it, but I wont since i dont know if it will go against any guidelines in place by SMF
-
another option is to modify the flag item...then instead of flags give them a selection of avatar to choose from.... and the modify the code to change the avatar field in the database.
-
its posibble to make a Item with a wrapper inside them ?
Like the example i uploaded?
I try to explain.
My users will be able to "pimp" their Profiles but they have to pay for it.
In the premissions i have forbidden for the user to EDIT the "Forum Profile Information" in their profile options
Every part of the Forum Profile Information will be sold in the shop.
Also you can buy a Signature for you, you can buy a avatar function, you can buy the Custom Title:
Can you understand? sry my english is very bad.
-
nobody an idea?
Item = 1x Uplad Avatar
-
try this one. Its a modified version of Change DisplayName item. What it does is that it gives the user the ability to specify the remote/external location of the image file to be use as avatar, and only usable one time. past the code below to ChangeAvatar.php file and place inside your shop item folder.
<?php
/**********************************************************************************
* SMFShop item *
***********************************************************************************
* SMFShop: Shop MOD for Simple Machines Forum *
* =============================================================================== *
* Software Version: SMFShop 3.0 (Build 12) *
* $Date:: 2007-01-18 19:26:55 +1100 (Thu, 18 Jan 2007) $ *
* $Id:: ChangeAvatar.php 79 2007-01-18 08:26:55Z daniel15 $ *
* 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_ChangeAvatar extends itemTemplate
{
function getItemDetails()
{
$this->authorName = 'Azahari Zaman';
$this->authorWeb = 'http://www.zianafolks.net/';
$this->authorEmail = 'azaharizaman{at}gmail{dot}com';
$this->name = 'Change Avatar';
$this->desc = 'Change your avatar!';
$this->price = 50;
$this->require_input = true;
$this->can_use_item = true;
$this->addInput_editable = true;
}
function getAddInput()
{
global $item_info;
if ($item_info[1] == 0) $item_info[1] = 5;
return 'Minimum length of avatar: <input type="text" name="info1" value="' . $item_info[1] . '" />';
}
function getUseInput()
{
// Use length of 5 as default
if (!isset($item_info[1]) || $item_info[1] == 0) $item_info[1] = 5;
return 'New Avatar: <input type="text" name="newAvatar" size="50" /><br />
Please enter avatar new location at least ' . $item_info[1] . ' characters long.';
}
function onUse()
{
global $db_prefix, $ID_MEMBER, $item_info;
// Use a length of 5 as default
if (!isset($item_info[1]) || $item_info[1] == 0) $item_info[1] = 5;
if (strlen($_POST['newAvatar']) < $item_info[1])
die('ERROR: The Avatar you chose was not long enough! Please go back and enter an avatar which is at least '
. $item_info[1] . ' characters long.');
$result = db_query("
UPDATE {$db_prefix}members
SET avatar = '{$_POST['newAvatar']}'
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return 'Successfully changed your Avatar to ' . $_POST['newAvatar'];
}
}
?>
-
I am looking for something like this as well. See, I am currently using the egg avatar item but all the egged user has to do is re-upload his avatar and it's fixed. I would like the egged user to have to purchase the right to upload a new avatar in order to fix it. Now I tried the given changeavatar.php and it works fine but it only allows for them to use a remote avatar. Is there anyway to make it so they can upload as well?
-
this item should be sufficent for what you are looking for
http://www.daniel15.com/forum/index.php/topic,940.0.html
-
Yes that is it, thank you very much.