[ABD] Shop Mod (0.4.1)

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.
moonlightkisu
Registered User
Posts: 150
Joined: Wed Dec 31, 2008 9:14 pm
Location: Connecticut, USA
Name: Miss Moonlight
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by moonlightkisu » Fri Jan 08, 2010 3:16 am

mitx wrote:Is it possible to make it so when users buy something, the cash goes into another users account. Instead of just vanishing in the air?
Yes, I would like this as well.

Also, these features would be nice as well:

- Place Custom usertitle on memberlist and viewprofile
- Send item directly to a specific user for points, and the user gets PM with item send.
- Items that are left with a comment are displayed in viewtopic and viewprofile

mitx
Registered User
Posts: 90
Joined: Thu Jul 24, 2008 7:51 am

Re: [ALPHA] Shop Mod (0.4.1)

Post by mitx » Fri Jan 08, 2010 3:18 am

moonlightkisu wrote:
mitx wrote:Is it possible to make it so when users buy something, the cash goes into another users account. Instead of just vanishing in the air?
Yes, I would like this as well.

Also, these features would be nice as well:

- Place Custom usertitle on memberlist and viewprofile
- Send item directly to a specific user for points, and the user gets PM with item send.
- Items that are left with a comment are displayed in viewtopic and viewprofile
Transfer Items and or when you buy something from the shop it makes the money actually go somewhere would be THE END ALL for this mod. Right now my economy has a serious hole in it from money vanishing.

User avatar
Phantom784
Registered User
Posts: 290
Joined: Wed Aug 08, 2007 3:09 am
Location: State College, PA
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by Phantom784 » Fri Jan 08, 2010 4:05 am

If there's a single user to whom you want to give all the money earned in the shop, it's easy enough to add. Open includes/functions_shop.php

find

Code: Select all

		if (!$shop->cash->charge_user($this->data['price']))
		{
			$db->sql_transaction('rollback');
			$meta_info = append_sid("{$phpbb_root_path}shop.$phpEx");
			meta_refresh(3, $meta_info);
			$message = $user->lang['SHOP_INSUFFICIENT_FUNDS'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $meta_info . '">', '</a>');
			trigger_error($message);
		}
after, add

Code: Select all

$shop->cash->deposit_user($this->data['price'], 2);
substitute '2' for the user id of the user to receive the money.

find

Code: Select all

$shop->cash->deposit_user($this->data['sell_price']);
after, add

Code: Select all

$shop->cash->charge_user($this->data['sell_price'], 2);
again, substituting '2' with the correct user id

The user you specify will receive funds from sales in the shop, and will be charged if an item is returned (for the same price the user gets). Note that if the specified user doesn't have sufficient funds to pay the refund, the item will still be returned/the refund given, but the money will again come 'from nothing' instead of from the specified user. If I ever get around to doing serious work on this mod again, I'll have a better system to handle that.

Hope this helps!
Want to contact me? Find out how at http://francisfisher.com/contact.php

mitx
Registered User
Posts: 90
Joined: Thu Jul 24, 2008 7:51 am

Re: [ALPHA] Shop Mod (0.4.1)

Post by mitx » Fri Jan 08, 2010 4:20 am

Phantom784 wrote:If there's a single user to whom you want to give all the money earned in the shop, it's easy enough to add. Open includes/functions_shop.php

find

Code: Select all

		if (!$shop->cash->charge_user($this->data['price']))
		{
			$db->sql_transaction('rollback');
			$meta_info = append_sid("{$phpbb_root_path}shop.$phpEx");
			meta_refresh(3, $meta_info);
			$message = $user->lang['SHOP_INSUFFICIENT_FUNDS'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $meta_info . '">', '</a>');
			trigger_error($message);
		}
after, add

Code: Select all

$shop->cash->deposit_user($this->data['price'], 2);
substitute '2' for the user id of the user to receive the money.

find

Code: Select all

$shop->cash->deposit_user($this->data['sell_price']);
after, add

Code: Select all

$shop->cash->charge_user($this->data['sell_price'], 2);
again, substituting '2' with the correct user id

The user you specify will receive funds from sales in the shop, and will be charged if an item is returned (for the same price the user gets). Note that if the specified user doesn't have sufficient funds to pay the refund, the item will still be returned/the refund given, but the money will again come 'from nothing' instead of from the specified user. If I ever get around to doing serious work on this mod again, I'll have a better system to handle that.

Hope this helps!
if this works, its EPIC on my forum. Ill go try. THANKS MAN!

User avatar
Phantom784
Registered User
Posts: 290
Joined: Wed Aug 08, 2007 3:09 am
Location: State College, PA
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by Phantom784 » Fri Jan 08, 2010 4:25 am

No problem. Note that I didn't really test any of that (although it's pretty simple), so let me know if it breaks stuff.
Want to contact me? Find out how at http://francisfisher.com/contact.php

mitx
Registered User
Posts: 90
Joined: Thu Jul 24, 2008 7:51 am

Re: [ALPHA] Shop Mod (0.4.1)

Post by mitx » Fri Jan 08, 2010 4:45 am

Phantom784 wrote:No problem. Note that I didn't really test any of that (although it's pretty simple), so let me know if it breaks stuff.
Well I cant even login now i get database errors!! Joking. Works perfect. And its EPIC! How will this work with lottery? winnings are taken from the account?

User avatar
Phantom784
Registered User
Posts: 290
Joined: Wed Aug 08, 2007 3:09 am
Location: State College, PA
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by Phantom784 » Fri Jan 08, 2010 4:47 am

Lottery winnings will still come from "nowhere." A similar change for the lottery item could specify a user for the winnings to come from, but then you'd have to make sure they actually have the money, or it'd be coming from nowhere again.
Want to contact me? Find out how at http://francisfisher.com/contact.php

mitx
Registered User
Posts: 90
Joined: Thu Jul 24, 2008 7:51 am

Re: [ALPHA] Shop Mod (0.4.1)

Post by mitx » Fri Jan 08, 2010 4:51 am

Phantom784 wrote:Lottery winnings will still come from "nowhere." A similar change for the lottery item could specify a user for the winnings to come from, but then you'd have to make sure they actually have the money, or it'd be coming from nowhere again.
I understand. This is done from lottery.php right?

mitx
Registered User
Posts: 90
Joined: Thu Jul 24, 2008 7:51 am

Re: [ALPHA] Shop Mod (0.4.1)

Post by mitx » Fri Jan 08, 2010 6:25 am

when I edited lottery.php with the following, it dont appear to work. it still pulls the winning out of the air.

Code: Select all

	function use_item()
	{
		global $shop;
		$this->remove_item();
		if (mt_rand(0,30) == 1)
		{
			$shop->cash->deposit_user(122);
			$shop->cash->charge_user($this->data[122], 2579);
			return "Congratulations, you won $122!";
		}
		else
		{
			return "Sorry, you didn't win. Play again!";
		}
	}
}

User avatar
Phantom784
Registered User
Posts: 290
Joined: Wed Aug 08, 2007 3:09 am
Location: State College, PA
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by Phantom784 » Fri Jan 08, 2010 8:35 pm

Just use

Code: Select all

$shop->cash->charge_user(122, 2579);
Want to contact me? Find out how at http://francisfisher.com/contact.php

User avatar
-CoS-
Registered User
Posts: 62
Joined: Tue Mar 20, 2007 7:59 pm

Re: [ALPHA] Shop Mod (0.4.1)

Post by -CoS- » Thu Jan 14, 2010 10:37 am

Hi! A few questions about this mod:

- Is there any live demo out there? Or at least any screenshots?
- Is it still being developed?
- Does it work with Advanced Points System? I've seen that is not included at first post, but maybe anyone has tested it...

I'll give it a try anyway when I finish updating to 3.0.6. Thanks!

User avatar
woody2k4
Registered User
Posts: 441
Joined: Fri Jul 11, 2008 9:16 am
Location: Esesx, UK
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by woody2k4 » Thu Jan 14, 2010 12:57 pm

Can this be used a an actual shop? is there a demo board?

User avatar
darkonia
Registered User
Posts: 1901
Joined: Tue May 13, 2008 1:10 pm
Location: Munich, Germany
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by darkonia » Thu Jan 14, 2010 1:38 pm

no live demos and this mod is long time abandoned and dont run on 3.0.6
MMOG-Heaven - Das Gaming Portal
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven.

User avatar
woody2k4
Registered User
Posts: 441
Joined: Fri Jul 11, 2008 9:16 am
Location: Esesx, UK
Contact:

Re: [ALPHA] Shop Mod (0.4.1)

Post by woody2k4 » Thu Jan 14, 2010 4:21 pm

darkonia wrote:no live demos and this mod is long time abandoned and dont run on 3.0.6
Thanks

neekee
Registered User
Posts: 45
Joined: Sun Jan 27, 2008 3:58 pm

Re: [ALPHA] Shop Mod (0.4.1)

Post by neekee » Sat Jan 16, 2010 12:43 pm

Damn it's too bad ... Anything similar ? =/

Locked

Return to “[3.0.x] Abandoned MODs”