[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

CobraCards
Registered User
Posts: 15
Joined: Sun Jul 10, 2005 9:02 pm
Location: Austin, TX
Contact:

Post by CobraCards »

Solved the flood control problem, simply by removing the chunk of flood control code (very easy to spot) from the private-message section of includes/functions_cash.php. It's not really necessary to stop people from giving money away too often, now is it? :lol:

Still working on profile display... it's not an error message, just nothing.
Arglwydd
Registered User
Posts: 133
Joined: Tue Dec 06, 2005 7:58 pm
Location: Wales, UK
Contact:

Post by Arglwydd »

I'm looking to automatically exchange all users cash from one currency to another. Basically, at the moment people have some of their cash in a currency called user_points and some in a currency called user_dollars and I'm looking to move all the money from the user_dollars currency to the user_points currency. For instance, somebody with 100 dollars and 35 points would end up with 135 points. Is this feasable, perhaps by way of an SQL command?

Edit: Okay, this is sorted now. Somebody provided me with the SQL command.
Last edited by Arglwydd on Sat Jul 08, 2006 10:15 pm, edited 1 time in total.
MythicalRealmRPG.net! A roleplaying site for adult writers!
LCNA - A mafia-themed text-based roleplaying game for all ages!
miltownkid
Registered User
Posts: 17
Joined: Sat Dec 21, 2002 12:56 pm
Location: Taipei, Taiwan
Contact:

Post by miltownkid »

EDIT: PROBLEM SOLVED SEE BELOW

I just (today) installed phpBB v2.0.21 and installed the Cash mod briefly after that. I did all the modding by hand. Uploaded all the cash files. Uploaded the modded files. Ran the SQL thing (all success.)

When I went into the Cash Admin Panel, I got this:
General Error
functions_cash.php has not been included.

Please make sure you have properly installed Cash Mod, including all the necessary file edits as found in cm_install_22x.txt


functions_cash.php is where it's suppose to be. I'm not sure what to try next (except going through the install again and see if I missed anything.)

---

I'm embarrased to say that it was human error. This is what pointed me in the right direction:
Fatal error: Cannot instantiate non-existent class: cash_menucat

Problem: This class is defined in functions_cash.php, which should be included via common.php (which is included into admin panels via pagestart.php, which most likely means functions_cash.php isn't being included in common.php (or properly)
Fix: Check your install instructions, Find the instructions for common.php and apply the edits properly


I was missing one of these: }
:oops:

Thanks for having good troubleshooting material :D
wideawake
Registered User
Posts: 124
Joined: Thu May 04, 2006 10:35 am

Post by wideawake »

love this mod. but is there any way to make it give members a certain amount for joining automatically?
~mike
CobraCards
Registered User
Posts: 15
Joined: Sun Jul 10, 2005 9:02 pm
Location: Austin, TX
Contact:

Post by CobraCards »

Heh, that's ironic.

My forum is giving 50 points automatically to each new member, and I want it to stop. :lol:

----

EDIT:
I solved this by going into phpMyAdmin and looking at the phpbb_users table. Sure enough, the user_points field had a default value of 50. Not sure why changing it back to 0 from admin didn't do anything, but changing it manually solved the problem.

You can probably do the same thing, changing the default value of the user_[currency name] field to whatever you want.


----

While I'm here, here's a VERY quick mod I'm finding useful...

NEW FILE: admin/cash_by_user.php
Replace "user_points" with the name of the cash field in your DB.

Code: Select all

<?php
define('IN_PHPBB', 1);
define('IN_CASHMOD', 1);

//
// Let's set the root dir for phpBB
//
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);

if ( $board_config['cash_adminnavbar'] )
{
	$navbar = 1;
	include('./admin_cash.'.$phpEx);
}
//
// Start page proper
//

		$sql = "SELECT * FROM phpbb_users ORDER BY user_points DESC";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, "Could not obtain user cash information", '', __LINE__, __FILE__, $sql);
		}

echo '<table>';
		while ( $row = $db->sql_fetchrow($result) )
		{
			echo "<tr><td>" . $row['username'] . "</td><td>" . $row['user_points'] . "</td></tr>";
		}
echo '</table>';

include('./page_footer_admin.'.$phpEx);

?>
FIND in admin/admin_cash.php:

Code: Select all

		$menu[$i]->additem(new cash_menuitem($j,		'Cash_Groups',			'cash_groups',		$lang['Cmenu_cash_groups']));
AFTER, ADD:

Code: Select all

		$menu[$i]->additem(new cash_menuitem($j,	'Cash_By_User',			'cash_by_user',		'View a listing of each user with their cash amounts'));
(You may want comment out one or two menu items you don't use, for a better screen fit.)

All this does is give you an admin page that lists all of your forum users and their amounts of cash, in order from most to least. Useful for observing how quickly people are earning -- for example, it has helped me price shop items appropriately.
crazywaste
Registered User
Posts: 125
Joined: Sun Jun 25, 2006 1:16 pm

Post by crazywaste »

I installed cash mod and I don't understand this line.

Code: Select all

Parse error: syntax error, unexpected T_VARIABLE in /home/link/public_html/viewtopic.php on line 1212
wideawake
Registered User
Posts: 124
Joined: Thu May 04, 2006 10:35 am

Post by wideawake »

crazywaste sounds like u made a mistake in ur edit of the viewtopic.php. I suggest looking back over changes u made.
christiansongwriter
Registered User
Posts: 102
Joined: Tue May 24, 2005 2:53 am

Post by christiansongwriter »

Installed this mod tonight, and it went well (just had to manually edit two files, probably due to previous mods that threw EM off). BTW, my site's Christian and related to songwriting, so my currency is 'talents', of course (double meaning intended) :) .

Anyway, this is fun as is, but I'd like to be able to require a minimum number of 'talents' before a user can post in a particular forum...is this possible? And, are there any neat cash mod addons that are neither gambling or RPG related?

Thanks!
James
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10965
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Post by battye »

christiansongwriter wrote: Anyway, this is fun as is, but I'd like to be able to require a minimum number of 'talents' before a user can post in a particular forum...is this possible?


It's been a while since I've looked through the settings of this MOD, but if there isn't a setting for this, I will write a small MOD for you to do this.. that's no problem at all :)
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
christiansongwriter
Registered User
Posts: 102
Joined: Tue May 24, 2005 2:53 am

Post by christiansongwriter »

That'd be awesome - but actually, I should've been more specific...I'd like the option of deducting points ('talents') for posting a new topic in a particular forum (so if they don't have enough points, oh well :twisted: ). In other words, it would cost to post a new topic in this forum, rather than create income. However, replies should still produce income. Would that also be easy to do, with configurable amounts in the ACP? :D

Thanks very much,
James
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10965
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Post by battye »

christiansongwriter wrote: That'd be awesome - but actually, I should've been more specific...I'd like the option of deducting points ('talents') for posting a new topic in a particular forum (so if they don't have enough points, oh well :twisted: ). In other words, it would cost to post a new topic in this forum, rather than create income. However, replies should still produce income. Would that also be easy to do, with configurable amounts in the ACP? :D

Thanks very much,
James


When you start adding ACP functions it becomes more complicated :)
Having said that, if it is one value it would be okay (ie. it will always be 5 points deducted if you post a topic in a particular forum).
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
Shadow316
Registered User
Posts: 133
Joined: Thu Jul 06, 2006 2:15 am

Post by Shadow316 »

Are there any good shops for this?

I dont want to use an old one because there might be holes in them,

Anyone have a suggestion?
hitemuprobbo
Registered User
Posts: 213
Joined: Thu Apr 21, 2005 3:07 pm
Location: Tha UK!

Post by hitemuprobbo »

what can users do with this cash?????????

thanks!
Shadow316
Registered User
Posts: 133
Joined: Thu Jul 06, 2006 2:15 am

Post by Shadow316 »

You can use this with the arcade mod or have a store

and please can some one tell me where to find a good shop
christiansongwriter
Registered User
Posts: 102
Joined: Tue May 24, 2005 2:53 am

Post by christiansongwriter »

battye wrote: When you start adding ACP functions it becomes more complicated :)
Having said that, if it is one value it would be okay (ie. it will always be 5 points deducted if you post a topic in a particular forum).


OK, can live w/o ACP functionality...and thinking further there are three total forums where I would like the capability to 'charge' for new posts, yet replies would 'pay'. At this point I'm thinking the amount charged for new posts can be 5, and the amount paid for replies can be 10. What this essentially does for my forum is that every song/lyric critique (reply) gains a user the ability to create two new posts (requests for critique) in our songcrafting forums. Mods would need to be excluded from this arrangement, but I think that's a given...

EDITS/AFTERTHOUGHTS:

1) A reply to one's own post should not earn any credit (just thought of that)!

2) New users need to get 10 'talents' on registration.

Is any of this doable? :)

Thanks so much for any help!
James
Post Reply

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