[2.0.18] Cash Mod

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
1036
66%
Very Good
239
15%
Good
121
8%
Fair
36
2%
Poor
126
8%
 
Total votes: 1558

User avatar
Vampy
Registered User
Posts: 140
Joined: Mon May 12, 2003 4:25 pm

Post by Vampy »

Xore wrote:
Q-Zar wrote:Xore : the new cash.php you posted, is that to stop the empty information box ?


it was an attempt. I don't get the empty information box. If you do, perhaps you could assist me in figuring out what's wrong


I'm also getting the same empty info box after successful donation. I was using Cash mod 2.02 and then I upgraded to 2.21. I'm also using Shop MOD 2.6.0 and Slot Machine MOD and its add on.

Also, the code below found in classes_cash.php:

Code: Select all

if ($userdata['user_level'] != ADMIN && !$is_auth['auth_mod']) {
				return $this->cash_update($mode, $poster_id, $first_post, $old_message, $post_message, $forum_id, $topic_id, $post_id, $new_bbcode, $topic_starter, $old_bbcode);
			}
Am I right to say that only normal users will the cash of the user be updated. (i.e. admin and moderators will not have thier cash updated?) If this is so, then it doesn't seem to be correct cos' when I post as a moderator I get points added to my moderator account.
Julian
User avatar
Remix_88
Registered User
Posts: 46
Joined: Wed Apr 23, 2003 12:52 pm
Location: Hampshire, UK

Left Admin Panel - FIX

Post by Remix_88 »

busterblader103 wrote: i got a problem, i can install everything... but whenever i try to put in admin_cash.php this error comes up in my admin panel:

Code: Select all

Error retrieving cash data

DEBUG MODE

SQL Error : 1146 Table 'bustr103_xmb45.phpbb_cash' doesn't exist

SELECT * FROM phpbb_cash ORDER BY cash_order ASC

Line : 657
File : /home/bustr103/public_html/general/includes/functions_cash.php


I had the exact same problem, and after a bit of digging found a minor bug in /admin/admin_cash.php whereby the phpbb root dir and table prefix had not been set prior to requiring them.

Here is the fix...

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_cash.php

#
#-----[ FIND ]------------------------------------------ 
#
# Should be line 75.

if ( !empty($setmodules) )
{
    include($phpbb_root_path . 'includes/functions_cash.'.$phpEx);

    $menu = array();
    admin_menu($menu);

#
#-----[ REPLACE, WITH ]------------------------------------------ 
#

if ( !empty($setmodules) )
{
    $phpbb_root_path = "./../";
    include($phpbb_root_path . 'config.'.$phpEx);
    include($phpbb_root_path . 'includes/functions_cash.'.$phpEx);

    $menu = array();
    admin_menu($menu);
Regards, Remix_88.
Tellur
Registered User
Posts: 6
Joined: Sat Nov 15, 2003 5:47 pm
Contact:

Post by Tellur »

ok i replaced the cash.php whit that code you posted and it works fine now :D

thanks to you!

Edit: after replacing the code the excange didn't work anymore (it showed that excange isn't possible) So i replaced the last part of the edited cash.php whit (From

Code: Select all

//========================================[ Exchange Code ]===========================
//
on

Code: Select all

//
//========================================[ Exchange Code ]===========================
//
	case "exchange":
	default:
		//
		// Load templates
		//
		$template->set_filenames(array(
			'body' => 'cash_exchange.tpl')
		);

		//
		// Output page header
		//
		$page_title = $lang['Exchange'];
		include($phpbb_root_path . 'includes/page_header.'.$phpEx);

		$sql = "SELECT * FROM " . CASH_EXCHANGE_TABLE;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, "Could not obtain exchange information", '', __LINE__, __FILE__, $sql);
		}
		if ( !($row = $db->sql_fetchrow($result)) )
		{
			message_die(GENERAL_MESSAGE, $lang['Exchange_lack_of_currencies']);
		}
		$exchange_data = array();
		do
		{
			$exchange_data[$row['ex_cash_id1']][$row['ex_cash_id2']] = 1;
		}
		while ( $row = $db->sql_fetchrow($result) );

		if ( isset($HTTP_POST_VARS['exchange']) &&
			 isset($HTTP_POST_VARS['from_id']) &&
			 is_numeric($HTTP_POST_VARS['from_id']) &&
			 isset($HTTP_POST_VARS['to_id']) &&
			 is_numeric($HTTP_POST_VARS['to_id']) &&
			 isset($HTTP_POST_VARS['convert_amount']) &&
			 is_numeric($HTTP_POST_VARS['convert_amount']) )
		{
			$from_id = intval($HTTP_POST_VARS['from_id']);
			$to_id = intval($HTTP_POST_VARS['to_id']);
			$convert_amount = cash_floatval($HTTP_POST_VARS['convert_amount']);
			if ( ($to_id != $from_id) && $cash->currency_exists($to_id) && $cash->currency_exists($from_id) && isset($exchange_data[$from_id]) && is_array($exchange_data[$from_id]) && isset($exchange_data[$from_id][$to_id]) && $cash->currencies[$from_id]->mask(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) && $cash->currencies[$to_id]->mask(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
			{
				if ( $convert_amount < 0 )
				{
					qs($from_id,$to_id);
					$convert_amount = -$convert_amount;
				}
				$c_cur_from = $cash->currency($from_id);
				$c_cur_to = $cash->currency($to_id);

				$exchanger = new cash_user($userdata['user_id'],$userdata);
				if ( $exchanger->has($c_cur_from->id(),$convert_amount) )
				{
					$converted_amount = (($convert_amount/$c_cur_from->data('cash_exchange'))*$c_cur_to->data('cash_exchange'));
					$exchanger->remove_by_id_array(array($c_cur_from->id() => $convert_amount));
					$exchanger->give_by_id_array(array($c_cur_to->id() => $converted_amount));
				}
			}
		}

		$template->assign_vars(array(
			'S_EXCHANGE_ACTION' => append_sid("cash.$phpEx?mode=exchange"),
			'S_HIDDEN_FIELDS' => '<input type="hidden" name="exchange" value="1" />',
			'L_EXCHANGE' => $lang['Exchange'],
			'L_FROM' => $lang['From'],
			'L_TO' => $lang['To'],
			'L_CONVERT' => $lang['Convert'],
			'L_SELECT_ONE' => $lang['Select_one'],

			'L_SUBMIT' => $lang['Submit'],
			'L_RESET' => $lang['Reset'])
		    );

		$max_columns_per_row = 3;
		$columnwidth = intval(floor(100/$max_columns_per_row));
		$bresenham = 0;
		$numrows = intval(ceil(count($indices)/$max_columns_per_row));
		$i = 0;
		while ( $c_cur = &$cash->currency_next($cm_i,CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
		{
			$template->assign_block_vars("cashrow",array(
				'CASH_ID' => $c_cur->id(),
				'CASH_NAME' => $c_cur->name(true))
			    );
			if ( (($i * $numrows) / $cash->currency_count(CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE)) >= $bresenham )
			{
				$bresenham++;
				$template->assign_block_vars("rowrow",array());
			}
			$headercash = $c_cur->display($userdata[$c_cur->db()]);
			$template->assign_block_vars("rowrow.cashtable",array(	'CASH_ID' => $c_cur->id(),
																	'CASH_NAME' => $c_cur->name(),
																	'HEADER' => $lang['You_have'] . " " . $headercash,
																	'ONE_WORTH' => sprintf($lang['One_worth'],$c_cur->name()),
																	'NO_EXCHANGE' => sprintf($lang['Cannot_exchange'],$c_cur->name()))
										);
			$exchangecount = 0;
			if ( isset($exchange_data[$c_cur->id()]) && count($exchange_data[$c_cur->id()]) )
			{
				$template->assign_block_vars("rowrow.cashtable.switch_exon",array());
				while ( $c_cur_j = &$cash->currency_next($cm_j,CURRENCY_ENABLED | CURRENCY_EXCHANGEABLE) )
				{
					if ( ($c_cur->id() != $c_cur_j->id()) && isset($exchange_data[$c_cur->id()]) && isset($exchange_data[$c_cur->id()][$c_cur_j->id()]) )
					{
						$ratio = floor(($c_cur_j->data('cash_exchange')/$c_cur->data('cash_exchange'))*1000)/1000;
						$template->assign_block_vars("rowrow.cashtable.switch_exon.exchangeitem",array(	'EXCHANGE' => $c_cur_j->display($ratio)));
					}
				}
			}
			else
			{
				$template->assign_block_vars("rowrow.cashtable.switch_exoff",array());
			}
			$i++;
		}

		$template->pparse('body');

		include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
		
		break;
	}
?>
and now everything works fine
Angel Dreamz
Registered User
Posts: 17
Joined: Tue Nov 11, 2003 8:27 pm

Post by Angel Dreamz »

Hi... I posted this a couple days ago but no one answered me. I am running 2.0.6 and Cash Mod. I have seen forums that have a "donate" button under the avatar where users can donate from there to each other. Can you tell me how to do this? I dont wanna mess anything up. Any help is much appreciated. Thanks

Angel Dreamz
User avatar
thewizard
Registered User
Posts: 356
Joined: Sun Sep 29, 2002 7:46 am

Post by thewizard »

!) there needs to be a new bank made for the cash mod usage one that supports multiple currencies.

2) in the next version of the Store Mod from what Eric has said it will work with Xore's cash mod
hillbillyworm
Registered User
Posts: 31
Joined: Sun Sep 28, 2003 10:14 am

Post by hillbillyworm »

Bleh. Nevermind. Just delete.
User avatar
thewizard
Registered User
Posts: 356
Joined: Sun Sep 29, 2002 7:46 am

Post by thewizard »

Angel Dreamz wrote: Hi... I posted this a couple days ago but no one answered me. I am running 2.0.6 and Cash Mod. I have seen forums that have a "donate" button under the avatar where users can donate from there to each other. Can you tell me how to do this? I dont wanna mess anything up. Any help is much appreciated. Thanks

Angel Dreamz


make sure you have dontate ability enabled in the ACP
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore »

The Dover Demon wrote: Thanks for this great mod, it's really awesome except now I have two problems my users are unhappy with.

1. The bank mod no longer works.

2. The store/items mod no longer works.

How can I fix them?


You need to read the readme.txt

Mainly, you need to have a currency called user_points
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
swedevil
Registered User
Posts: 94
Joined: Wed Nov 05, 2003 7:10 am

Post by swedevil »

Q-Zar wrote: Swedevil, there is a fix which makes it impossible to earn money by editing posts.
Wouldn't that solve your problem ?


yes, that's what I'm asking for.. but where is the fix?
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore »

Esuomynona wrote: Hi,

Great mod, now I've got past the few hiccups.

I have a few questions though.

I read on one of the earlier pages youw ere thinking about somethign to do with allowing a certain usergroup to have its own currency. I was wanderign if that is supported yet? And if so, what am I doing wrong in gettign it to work. If not, it doesnt matter.


This should be possible by creating a currency, which gives out 0 to all users by default, then create an entry in Cash Groups for the usergroup in question.
Esuomynona wrote: The other query was about enabling the currency in certain forums.

I have the currency enabled in certain forums and not in others. However I noticed that when in the forums where the currency is enabled int he post you simply get:

Realm Beans (the name of the currency)

While in the forums where it's turned on you get:

3 Realm Beans (or whatever the amount is).

i was wondering if there was a way to work it so that you got the amount in all the forums, you just simply didnt earn any points when posting in certain forums?


Can you give me a link to your board, as well as a test account & password (pm me this if you feel this is necessary), and i'll check it out.
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore »

swedevil wrote:
Xore wrote:
swedevil wrote:swedevil wrote:
Request for next Update-
A couple of the members on my forums pointed out that once they reach their points limit, they can still go back and edit a post (adding words) and they get the points for the what they edited. Is there a way to make it so that once you reach you daily limit, you CAN NOT get anymore points unless given by an Admin??? maybe an extra option or something!!



There is no 'daily' limit. The "limit" is the maximum that can be earned on any single post. After that "limit" is reached for a post, no more can be earned.


That's what i'm asking is if you can set it so that they can't go back and edit a post to get the rest of the points...

Nevermind... don't worry about that...


Just so that you understand, i really don't think this could ever be a good idea. Consider what would happen if a user creates a post that entirely fills the text field in your database and maxes out the points, then edits it to some small message. Then they'd get credit for the entire spam, instead of just for the small amount they posted for.
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore »

Vampy wrote:
Xore wrote:
Q-Zar wrote:Xore : the new cash.php you posted, is that to stop the empty information box ?


it was an attempt. I don't get the empty information box. If you do, perhaps you could assist me in figuring out what's wrong


I'm also getting the same empty info box after successful donation. I was using Cash mod 2.02 and then I upgraded to 2.21. I'm also using Shop MOD 2.6.0 and Slot Machine MOD and its add on.


I'm working on trying to get this problem solved. I plan to release an update as soon as i find a fix to this problem, as well as any other problems, that people may be having.
Vampy wrote: Also, the code below found in classes_cash.php:

Code: Select all

if ($userdata['user_level'] != ADMIN && !$is_auth['auth_mod']) {
				return $this->cash_update($mode, $poster_id, $first_post, $old_message, $post_message, $forum_id, $topic_id, $post_id, $new_bbcode, $topic_starter, $old_bbcode);
			}
Am I right to say that only normal users will the cash of the user be updated. (i.e. admin and moderators will not have thier cash updated?) If this is so, then it doesn't seem to be correct cos' when I post as a moderator I get points added to my moderator account.


I am confused. This code is not in classes_cash.php
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore »

Angel Dreamz wrote: Hi... I posted this a couple days ago but no one answered me. I am running 2.0.6 and Cash Mod. I have seen forums that have a "donate" button under the avatar where users can donate from there to each other. Can you tell me how to do this? I dont wanna mess anything up. Any help is much appreciated. Thanks

Angel Dreamz


Do you have donation of points enabled? are your regular Cash amounts showing up? Is the donate button in the user profile but not in the post topic? Do you have a link to your site and a test account?
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
Q-Zar
Registered User
Posts: 779
Joined: Sun Nov 17, 2002 8:30 pm
Location: Brussels
Contact:

Post by Q-Zar »

swedevil wrote:
Q-Zar wrote:Swedevil, there is a fix which makes it impossible to earn money by editing posts.
Wouldn't that solve your problem ?


yes, that's what I'm asking for.. but where is the fix?

Q-Zar wrote: There is a fix to stop users from gaining money by editing posts. Check the support if that's what you mean.


Ah if only man had been given a set of eyes there would be no need to repeat oneself. And just for the hell of it, I'll make you look for it instead of giving a direct link :twisted: It isn't hard to find anyway.
Traductions : Cash Mod v2.2.2 (Getting Started) / Dice Mod v1.2.3 / Activity Mod Plus 1.0.8
Remember this. Please read the F.A.Q/Troubleshooting of a mod before asking questions.
Image
User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 »

I just noticed that a users cash does not show up in their profile.

Where have I gone wrong there?

I have {CASH} correctly placed in view_profile_body.tpl

I checked again in profile.php, and usercp_viewprofile.php, so I'm not sure...

I checked the Admin Options, so unless I missed something, anyone?
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )
Post Reply

Return to “[2.0.x] MOD Database Releases”