[ABD] UPS Easy Shop 0.7.0

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] UPS Easy Shop 0.5.0

Post by femu »

jakk wrote:excellent femu, as always

have to think about uninstalling the mod shop to install this, but wait for something more advanced that :D
The Shop itself will not get that much enhancements. So donation and maybe the possibility to sell own items, but that's one, which is far away yet. So we just give the basics and it's up to the users to build useful items, which will then give the enhancement ;-)

I just created a special forum over here, where people can publish their items.
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by keith10456 »

femu wrote:... The Shop itself will not get that much enhancements. So donation and maybe the possibility to sell own items, but that's one, which is far away yet. So we just give the basics and it's up to the users to build useful items, which will then give the enhancement ;-)

I just created a special forum over here, where people can publish their items.
I added some Roses that admins can sell in their Easy Shop. The roses will make perfect gifts that members can buy to give to other members (once the Donate feature is added). In total there are 4. Below is a snapshot of one of them. The download link is in the Board that Femu setup.

Image
Last edited by keith10456 on Sat Feb 20, 2010 9:44 pm, edited 1 time in total.
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by keith10456 »

* Duplicate Post *

Moderators feel free to delete this.
Last edited by keith10456 on Sat Feb 20, 2010 9:44 pm, edited 1 time in total.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by Peter77sx »

How do i give an item to another member after buying the item?
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] UPS Easy Shop 0.5.0

Post by femu »

Peter77sx wrote:How do i give an item to another member after buying the item?
Did you read the first post? At the very bottom there's a small to-do list ....
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
IFRA
Registered User
Posts: 6
Joined: Sun Jan 17, 2010 7:26 am
Location: Thailand

Re: [Beta] UPS Easy Shop 0.5.0

Post by IFRA »

femu wrote:
woipi90 wrote: sorry to ask again but is there also some kind of permission buy tool included? i'm not aware of what had been included in the phantoms mod.... :(
Not included, but I'm pretty sure it's possible to set permissions, if you know, how it's done normally. I never tried it by myself, but if you know how to do it, you can simply create a plugin for it.

Edit

Ok. I just played arround. You may try following for example, if you like to give permissions (save as root/includes/shop/items/user_permission_XXXXX.php). The XXXXX should be replaced with the permission you like to give (name and also in the PHP below). The second XXXXX in the code is the ID of the permission. So you need check your phpbb_acl_options table and check, which permission you like to "sell". So lets say u_play_hangman with the ID 210 ... Then you :
  • save the file as user_permission_hangman
  • rename the below class name from user_permission_XXXXX to user_permission_hangman
  • change below $auth_id = XXXXX; to $auth_id = 210;
Then you should be able to "sell" the permission to play Hangman ;)

BUT: It's untested. If you like to see, if it works, please do it LOCALLY !!!! Not in a live enviorment !!!

Especially permissions are very delicate !!!

So below one checks first, if the permission is not already set for the user_id (doesn't matter if yes/no/never) and if not, performs what it should do. If it's set somehow, it shows the error message.

Code: Select all

<?php
/**
*
* @package - phpbb3 UPS Easy Shop
* @version $Id: user_posts_100.php 79 2010-02-09 08:12:15Z 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_permission_shop 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['ITEM_USE'],
			'confirm'	=> sprintf($user->lang['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();

		$auth_setting = 1;
		$auth_id = XXXX;

		$sql = 'SELECT *
			FROM ' . ACL_USERS_TABLE . '
			WHERE user_id = ' . (int) $user->data['user_id'] . '
				AND auth_option_id = ' . $auth_id;
		$result = $db->sql_query($sql);

		if ( !$result )
		{
			$sql_ary = array(
				'auth_setting '		=> $auth_setting,
				'auth_option_id'	=> $auth_id,
				'user_id'			=> (int) $user->data['user_id'],
			);

			$sql = 'UPDATE ' . ACL_USERS_TABLE  . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary);
			$db->sql_query($sql);
		}
		else
		{
			$meta_info = append_sid("{$phpbb_root_path}shop.$phpEx");
			meta_refresh(3, $meta_info);
			$message = $message . 'This permission is already set!<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $meta_info . '">', '</a>');
			trigger_error($message);		}
	}
}
?>
$auth_id = XXXXX;

where i can find permission id ?
Basement24
Registered User
Posts: 17
Joined: Wed Feb 17, 2010 8:23 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by Basement24 »

Usage: 9 basic colors users can buy to change their names.

i edit the user_color_black and made a basic color pack for my site,
so i thought i might share it.It just to save you guys time!

My first time.lol and it feels good..working on a couple more addons I hope all goes well, so far so good anyway. :D
http://area53.die-muellers.org/viewtopic.php?f=35&t=666
User avatar
woipi90
Registered User
Posts: 908
Joined: Mon Feb 16, 2009 5:32 pm
Location: Austria

Re: [Beta] UPS Easy Shop 0.5.0

Post by woipi90 »

IFRA wrote:
femu wrote:
woipi90 wrote: sorry to ask again but is there also some kind of permission buy tool included? i'm not aware of what had been included in the phantoms mod.... :(
Not included, but I'm pretty sure it's possible to set permissions, if you know, how it's done normally. I never tried it by myself, but if you know how to do it, you can simply create a plugin for it.

Edit

Ok. I just played arround. You may try following for example, if you like to give permissions (save as root/includes/shop/items/user_permission_XXXXX.php). The XXXXX should be replaced with the permission you like to give (name and also in the PHP below). The second XXXXX in the code is the ID of the permission. So you need check your phpbb_acl_options table and check, which permission you like to "sell". So lets say u_play_hangman with the ID 210 ... Then you :
  • save the file as user_permission_hangman
  • rename the below class name from user_permission_XXXXX to user_permission_hangman
  • change below $auth_id = XXXXX; to $auth_id = 210;
Then you should be able to "sell" the permission to play Hangman ;)

BUT: It's untested. If you like to see, if it works, please do it LOCALLY !!!! Not in a live enviorment !!!

Especially permissions are very delicate !!!

So below one checks first, if the permission is not already set for the user_id (doesn't matter if yes/no/never) and if not, performs what it should do. If it's set somehow, it shows the error message.

Code: Select all

<?php
/**
*
* @package - phpbb3 UPS Easy Shop
* @version $Id: user_posts_100.php 79 2010-02-09 08:12:15Z 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_permission_shop 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['ITEM_USE'],
			'confirm'	=> sprintf($user->lang['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();

		$auth_setting = 1;
		$auth_id = XXXX;

		$sql = 'SELECT *
			FROM ' . ACL_USERS_TABLE . '
			WHERE user_id = ' . (int) $user->data['user_id'] . '
				AND auth_option_id = ' . $auth_id;
		$result = $db->sql_query($sql);

		if ( !$result )
		{
			$sql_ary = array(
				'auth_setting '		=> $auth_setting,
				'auth_option_id'	=> $auth_id,
				'user_id'			=> (int) $user->data['user_id'],
			);

			$sql = 'UPDATE ' . ACL_USERS_TABLE  . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary);
			$db->sql_query($sql);
		}
		else
		{
			$meta_info = append_sid("{$phpbb_root_path}shop.$phpEx");
			meta_refresh(3, $meta_info);
			$message = $message . 'This permission is already set!<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $meta_info . '">', '</a>');
			trigger_error($message);		}
	}
}
?>
$auth_id = XXXXX;

where i can find permission id ?
you grab the data from your database?!

but if you use this function you have to know that something more has to be edited for the permission!

Code: Select all

class user_permission_shop extends item
you can find this in the beginning of the function so however you named the permission file the class has to have the same name....

f.e.

you have the permission test named the file test_permission.php then you have to write

Code: Select all

class test_permission extends item

mfg woipi
My mods: Ultimate Board Clubs
Support: only for the UBCS!
-----
function be_friends($uid, $u){return ($u == $user->['user_id']) ? false : true;}
$this->be_friends($uid, $user->['user_id']) ? $allow_pm : echo "You failed again";
skargon
Registered User
Posts: 32
Joined: Fri Nov 06, 2009 2:06 am

Re: [Beta] UPS Easy Shop 0.5.0

Post by skargon »

Eariler in this topic it was mentioned that the purchases should be logged, and we can find them in the log files.

Can someone direct me to these? I've checked all the logs I can think of, but cannot find where the item purchase log is
User avatar
Hotmetal33
Registered User
Posts: 88
Joined: Fri Nov 13, 2009 10:39 am

Re: [Beta] UPS Easy Shop 0.5.0

Post by Hotmetal33 »

What do the default plugins do and can I get more?

Also, (I hope this doesn't seem like a 'categories' thing) for the next update, can you have an option in ACP to put certain items on different "shelves" (or different pages).

One more thing, I get this when I try to go to a members profile.

Code: Select all

Fatal error: Cannot redeclare set_shop_config() (previously declared in /www/zxq.net/a/l/t/altapets/htdocs/includes/functions_shop.php:230) in /www/zxq.net/a/l/t/altapets/htdocs/includes/shop/functions_shop.php on line 42 
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by keith10456 »

I added a Heart that admins can sell in their Easy Shop. The heart will make a nice gift that members can buy to give to other members (once the Donate feature is added).

It's simple but nice :D

http://area53.die-muellers.org/viewtopic.php?f=35&t=670
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by Peter77sx »

femu wrote:
Peter77sx wrote:How do i give an item to another member after buying the item?
Did you read the first post? At the very bottom there's a small to-do list ....
:edit: I did Femu, when the topic came was released.
I decided to play with the demo on your site lastnight. So i forgotten about it. 8-)


Even tho Femu says no Categories, it might come in handy if you plan on having people contribute items... i mean it will look messy in the long-run, i think, to have random stuff all over the place.

Well this is directed to anyone who is willing to make such an add-on. ;)
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by keith10456 »

Peter77sx wrote: Even tho Femu says no Categories, it might come in handy if you plan on having people contribute items... i mean it will look messy in the long-run, i think, to have random stuff all over the place...
I agree... :idea:
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [Beta] UPS Easy Shop 0.5.0

Post by keith10456 »

These are flags that admins can sell in their Easy Shop. There are over 200... I also included a text file that lets you know what the abbreviations stand for (ex: us = United States). Below is a snapshot of 3 of the flags.

Admins probably wouldn't want to list all of the flags... There are too many. A good idea would be to sell the flags that represent the location of your members (registered at your site).

http://area53.die-muellers.org/viewtopic.php?f=35&t=671

Image

Image

Image
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [Beta] UPS Easy Shop 0.5.0

Post by femu »

keith10456 wrote:
Peter77sx wrote: Even tho Femu says no Categories, it might come in handy if you plan on having people contribute items... i mean it will look messy in the long-run, i think, to have random stuff all over the place...
I agree... :idea:
I'm not :mrgreen:

Categories are not that easy to program. And again: it's an EASY Shop!

So there will be NO categories. If you like to have a professional shop system, you might need an addon from professionals. There will be an option (already working in SVN) to donate own items to other users, but that's it. I'm thinking about selling own items, but currently not really hard. Might be a feature in v3.0 :mrgreen:
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]

Return to “[3.0.x] Abandoned MODs”