Author Topic: Avatar Upload Item  (Read 8004 times)

Offline jewropa

Avatar Upload Item
« 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?

Offline feeble

Re: Avatar Upload Item
« Reply #1 on: March 15, 2007, 06:59:14 am »
using the add membergroup item would be a quick solution

Offline jewropa

Re: Avatar Upload Item
« Reply #2 on: March 15, 2007, 07:31:05 am »
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

Offline jewropa

Re: Avatar Upload Item
« Reply #3 on: March 15, 2007, 07:58:26 am »
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"

Offline feeble

Re: Avatar Upload Item
« Reply #4 on: March 15, 2007, 09:58:37 am »
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

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

Offline TechnoDragon

Re: Avatar Upload Item
« Reply #5 on: March 15, 2007, 10:29:21 am »
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. 
Don't tell me to get into shape...I have a shape...It is round!


Offline jewropa

Re: Avatar Upload Item
« Reply #6 on: March 15, 2007, 08:38:54 pm »
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.
« Last Edit: March 15, 2007, 08:41:53 pm by jewropa »

Offline jewropa

Re: Avatar Upload Item
« Reply #7 on: March 16, 2007, 04:09:05 am »
nobody an idea?

Item = 1x Uplad Avatar
« Last Edit: March 16, 2007, 04:11:09 am by jewropa »

Offline renxokuken

Re: Avatar Upload Item
« Reply #8 on: May 21, 2007, 11:19:19 pm »
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.

Code: [Select]
<?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'];
}

}

?>



dork313

  • Guest
Re: Avatar Upload Item
« Reply #9 on: June 04, 2007, 12:05:01 pm »
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?

Offline feeble

Re: Avatar Upload Item
« Reply #10 on: June 05, 2007, 04:57:45 am »
this item should be sufficent for what you are looking for
http://www.daniel15.com/forum/index.php/topic,940.0.html

dork313

  • Guest
Re: Avatar Upload Item
« Reply #11 on: June 05, 2007, 12:51:49 pm »
Yes that is it, thank you very much.