Re: Cash Mod 1.0.0

Mohit wrote:

Warning: ob_start(): output handler 'ob_gzhandler' cannot be used twice in /home/mastilan/public_html/forum/include/functions.php on line 1004

An error was encountered
Error: Unable to update config.

I get this error

Please don't post this twice, I can read fine...

I'm not sure why this is happening. It looks like a problem with the including the cache files again...
Disable gzip and tell me the results.

pkeod wrote:

I was sort of playing around with the mysql data... well I didn't ruin anything tongue But I noticed that in the bank tab I added there was interest saying "290382309423E-6" interest waiting... so I thought that was sort of weird neutral Going to the sql data I see that the default number is something huuuugggeeee... so I change it... so something smaller... like 2


Now the interest is about .0000000032823       >__>

What's up with this? What should I change the default value back to? yikes

You must have changed the cm_interest.
This value doesn't hold the amount of interest you will be getting, but rather the last time that user received interest.
Get a timestamp of the machine you are running PunBB on (make a new PHP file and put <?PHP echo time(); ?> in it), then set the feild to that.
Tell me if this doesn't work.


erissiva wrote:

Ok...a few issues I've noticed:

1) Perhaps auto-refill the lottery pot? Or even disable it while an announcement is made so that someone will see it to refill it.
On that note....

2) Announcement of lottery winner. This needs to be dome in some form so that someone will see that its been won. Hiding it away in the plugin system to never be found again isn't too helpful.

3) Bugish thing: When someone wins, the place under plugin where the value of the pot should be is grammatically incorrect. It says something like "User is pot win the user win pot has been won" or something of this sort.

4) Better layout for lottery, bank, and donate. They're a bit crowded.

Cheers!

1) Auto refil? The point is people put money in the pot, then someone can win what other people put in it..
2) There is a setting in the plugin to show the last winner of the lottery everytime someone loses.
3) "User is pot win the user win pot has been won".... Umm... WTF?
4) They're crowded 'cause my HTML skills suck tongue
If someone else feels up to making it look nicer, it would be appreciated a lot smile


HORRORel wrote:

No ... I want the files need to be changed ... some as viewtopic.php etc.

Read the file readme.txt





Just an update. 1.0.1 has been released.
It's a small release, so it doesn't get a topic of it's own. All that was changed was the ability to edit the amount of cash/bank that a user has. In my rush to get it out, I forgot that to add it.
If you installed 1.0.0, follow the instructions below to add this function.

#
#---------[ 16. OPEN ]---------------------------------------------------
#

profile.php

#
#---------[ 17. FIND (line:698) ]---------------------------------------------------
#

                // We only allow administrators to update the post count
                if ($pun_user['g_id'] == PUN_ADMIN)
                    $form['num_posts'] = intval($_POST['num_posts']);

#
#---------[ 18. REPLACE WITH ]---------------------------------------------------
#

                // We only allow administrators to update the post count
                if ($pun_user['g_id'] == PUN_ADMIN) {
                    $form['num_posts'] = intval($_POST['num_posts']);
                    $form['cm_cash'] = intval($_POST['cm_cash']);
                    $form['cm_bank'] = intval($_POST['cm_bank']);
                }
#
#---------[ 19. FIND (line:~888) ]---------------------------------------------------
#

$result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());

#
#---------[ 20. REPLACE WITH ]---------------------------------------------------
#


$result = $db->query('SELECT u.cm_cash, u.cm_bank, u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());


#
#---------[ 21. FIND (line:~1057) ]---------------------------------------------------
#

        if ($pun_user['g_id'] == PUN_ADMIN)
            $posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
        else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
            $posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
        else
            $posts_field = '<p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";


#
#---------[ 22. REPLACE WITH ]---------------------------------------------------
#

        if ($pun_user['g_id'] == PUN_ADMIN) {
            $posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
            $posts_field .= '<label>'.ucwords($pun_config['cm_cur_name']).'<br /><input type="text" name="cm_cash" value="'.$user['cm_cash'].'" size="8" maxlength="8" /><br /></label>'."\n";
            $posts_field .= ($pun_config['cm_bank'] == 1) ? '<label>Bank<br /><input type="text" name="cm_bank" value="'.$user['cm_bank'].'" size="8" maxlength="8" /><br /></label>'."\n" : '';
        } else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) {
            $posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
            $posts_field .= '<p>'.ucwords($pun_config['cm_cur_name']).': '.$user['cm_cash'].'</p>'."\n";
            $posts_field .= ($pun_config['cm_bank'] == 1) ? '<p>Bank: '.$user['cm_bank'].'</p>'."\n" : '';
        } else
            $posts_field = '<p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";

#
#---------[ 15. SAVE/UPLOAD ]---------------------------------------------------
#

profile.php

The line numbers will probably be off a bit...

Indocron
$theQuestion = (2*b) || !(2*b);

Re: Cash Mod 1.0.0

1) Auto refil? The point is people put money in the pot, then someone can win what other people put in it..
2) There is a setting in the plugin to show the last winner of the lottery everytime someone loses.
3) "User is pot win the user win pot has been won".... Umm... WTF?
4) They're crowded 'cause my HTML skills suck tongue
If someone else feels up to making it look nicer, it would be appreciated a lot

1) No....I mean, to auto-restart the pot. Sorry if I was confusing. So that people won't come to the pot and see this 0 there and the choice to still buy a ticket. So, if the pot is 45 and someone wins, and I have the minimum at 10, it automatically goes back to 10.
Right now people can still buy a ticket when the pot is 0.
That doesn't really make sense, but it could happen.

2) I see that - but where does it announce it? After someone wins, only the Admins see it - and only if they go all the way into the plugins menu, click Cash Mod, then click on General Options. How else do they know to go there?

3) I know...WTF? This is a direct quote: "erissiva last won the lottery and won erissiva last won the lottery and won 2 dollars. dollars." Sometimes its just "erissiva last won the lottery and won 2 dollars.", but it seems to vary randomly. Oh, and the 2 dollar pot was just for testing purposes.

4) Heh...I'll whip something up ASAP

28 (edited by Photics 2005-10-07 14:15)

Re: Cash Mod 1.0.0

Gary13579 wrote:

Just an update. 1.0.1 has been released.
It's a small release, so it doesn't get a topic of it's own. All that was changed was the ability to edit the amount of cash/bank that a user has. In my rush to get it out, I forgot that to add it.
If you installed 1.0.0, follow the instructions below to add this function.

I tried to update the profile.php, but I got this error...

Parse error: parse error, unexpected T_CASE in ../forum/profile.php on line 726

Line 726 says...

        case 'personal':
        {
            $form = extract_elements(array('realname', 'url', 'location'));

            if ($pun_user['g_id'] == PUN_ADMIN)
                $form['title'] = trim($_POST['title']);
            else if ($pun_user['g_set_title'] == '1')
            {
                $form['title'] = trim($_POST['title']);

                if ($form['title'] != '')
                {
                    // A list of words that the title may not contain
                    // If the language is English, there will be some duplicates, but it's not the end of the world
                    $forbidden = array('Member', 'Moderator', 'Administrator', 'Banned', 'Guest', $lang_common['Member'], $lang_common['Moderator'], $lang_common['Administrator'], $lang_common['Banned'], $lang_common['Guest']);

                    if (in_array($form['title'], $forbidden))
                        message($lang_profile['Forbidden title']);
                }
            }
Michael Garofalo
Webmaster - Photics.com

Re: Cash Mod 1.0.0

erissiva wrote:

1) No....I mean, to auto-restart the pot. Sorry if I was confusing. So that people won't come to the pot and see this 0 there and the choice to still buy a ticket. So, if the pot is 45 and someone wins, and I have the minimum at 10, it automatically goes back to 10.
Right now people can still buy a ticket when the pot is 0.
That doesn't really make sense, but it could happen.

2) I see that - but where does it announce it? After someone wins, only the Admins see it - and only if they go all the way into the plugins menu, click Cash Mod, then click on General Options. How else do they know to go there?

3) I know...WTF? This is a direct quote: "erissiva last won the lottery and won erissiva last won the lottery and won 2 dollars. dollars." Sometimes its just "erissiva last won the lottery and won 2 dollars.", but it seems to vary randomly. Oh, and the 2 dollar pot was just for testing purposes.

4) Heh...I'll whip something up ASAP

1) Sounds good, but more work for me tongue. I'll see what I can do.
2) Not only the admins see it. After you buy a ticket, and lose, it shows who last won the topic. It doesn't really "announce" it anywhere, it just shows it.
3) I have no clue why this happens, and have never gotten it before hmm
4) Great big_smile

Photics wrote:

I tried to update the profile.php, but I got this error...

Parse error: parse error, unexpected T_CASE in ../forum/profile.php on line 726

What version of PunBB are you running?
I don't see anything in that code that would cause this error.

Indocron
$theQuestion = (2*b) || !(2*b);

30 (edited by Smartys 2005-10-07 22:46)

Re: Cash Mod 1.0.0

I think I know the cause smile
from lottery.php

$db->query('UPDATE '.$db->prefix.'config SET conf_value=\''.$pun_user['username'].' last won the lottery and won '.$pun_config['cm_lottery_pot'].' '.$pun_config['cm_cur_name'].'.\' WHERE conf_name=\'cm_lottery_pot\' LIMIT 1');

So, if someone won and then immediately won again, they would get that freaky message tongue
And it makes sense that it's at random: the if statement uses rand tongue

Re: Cash Mod 1.0.0

I don't get it..

I just looked at the code, and right now I have no clue what I was thinking.
I will fix this tonight, if I can even read it :S

Indocron
$theQuestion = (2*b) || !(2*b);

Re: Cash Mod 1.0.0

Gary , please give me viewtopic.php and other else files changed because I don't know changin' files ! Pleaseee !

PunBB Romania HERE !

Re: Cash Mod 1.0.0

I can see the point of a cash mod and a shop mod sounds great but can someone explain in a little more detail what the RPG mod will be? Since it is related to this cash mod I thought I'd ask here. I know RPG stands for role playing game but what kind of rpg can be played on a message board?

Re: Cash Mod 1.0.0

downliner wrote:

I can see the point of a cash mod and a shop mod sounds great but can someone explain in a little more detail what the RPG mod will be? Since it is related to this cash mod I thought I'd ask here. I know RPG stands for role playing game but what kind of rpg can be played on a message board?

There are many instances of board-based RPGs. Its not so much a full RPG system, it just adds a little excitement to everyday posting.
It allows stuff such as random events (like any RPG videogame...monsters and whatnot jumping out of nowhere), user-based stats such as MP/HP/etc, fighting, collecting/buying/selling/trading items which allow certain forum or RPG based events or permissions, etc.

35 (edited by Photics 2005-10-10 15:40)

Re: Cash Mod 1.0.0

Gary13579 wrote:

What version of PunBB are you running?
I don't see anything in that code that would cause this error.

Well... it works now. I'm not sure why it happened.

I deleted my old profile.php... and I worked from the cashmod.zip text file. The install worked perfectly this time around.

I think I'll give myself 50,000 gold. lol

downliner wrote:

I can see the point of a cash mod and a shop mod sounds great but can someone explain in a little more detail what the RPG mod will be? Since it is related to this cash mod I thought I'd ask here. I know RPG stands for role playing game but what kind of rpg can be played on a message board?

Are you kidding? RPG systems are awesome... especially if you run a video game based website. At Photics.com, I've been running punBB for a while now. I only have 400 users. Yet, there are thousands of players of my RPG game Guild Wars: rogueBATTLE. Currently it's at 2753.

http://games.photics.com/rogueBATTLE

The referral system in rogueBATTLE made it incredibily popular. Some players said they enjoyed the text based game more than Guild Wars itself. That's why I'm thinking adding an RPG Mod to punBB would dramatically increase the popularity of my forum. I'm looking forward to the Shop MOD too.

Michael Garofalo
Webmaster - Photics.com

Re: Cash Mod 1.0.0

Theres kind off some conflict with attachment mod... idk if i installed it correctly

Re: Cash Mod 1.0.0

when i post it says i have dollars but then what am i supposed to do with them? i cant see the lottery or bank thingy? am i supposed 2

Re: Cash Mod 1.0.0

ross3093 wrote:

when i post it says i have dollars but then what am i supposed to do with them? i cant see the lottery or bank thingy? am i supposed 2

You have to add the links to 'lottery.php', 'donate.php', and 'bank.php' into your menu by using the Admin panel.

Re: Cash Mod 1.0.0

How can I make it so ranks go up when a certain amount of money is reached rather than amount of posts?

Free games/arcade at dlngle.com

Re: Cash Mod 1.0.0

I got it now works like a charm big_smile

Re: Cash Mod 1.0.0

On your latest readme it seems to be cut off half way through the edits that need to be done ...

And on the 2 older versions the readme is scrambled ... Could you repost the full readme

This is the readme i see:

##
##
##        Mod title:  Cash Mod 1.1.0 
##
##      Mod version:  1.2.0 
##   Works on PunBB:  1.2.10 
##     Release date:  10-01-05 
##           Author:  Apache Kof (Pandark) + Gary(13579) Schilling
##
##      Description:  This mod is the Cash Mod 1.0.1 made by Gary(13579) Schilling + a localisation of its made by Apache Kof (Pandark).
##                     This mod gives people "cash" for their posts, and is a start towards the RPG mod that Connorhd wants made.
##                     Nearly everything is configurable..
##
##       Affects DB:  Yes 
##
##   Affected files:  post.php 
##                    viewtopic.php 
##
##            Notes:  Thanks to Connorhd for the inspiration (if you call yelling at me for 2 weeks on IRC inspiration :P) and the money..
##                      Thanks to Mediator for the awesome Auto Read-me program.
##                      And most of all, thanks to Rickard for PunBB :D 
##
##     Generated By:  Auto Read-Me(by Caleb Champlin) - http://www.rscheatnet.com/Auto_Readme.zip
##
##       DISCLAIMER:  Please note that 'mods' are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##


#
#---------[ 1. UPLOAD ]---------------------------------------------------
#

install_mod.php to ./
donate.php to ./
bank.php to ./
lottery.php to ./
AP_Cash_Mod.php to ./plugins/
English/cash.php to ./lang/English/

#
#---------[ 2. RUN ]---------------------------------------------------
#

install_mod.php

#
#---------[ 3. DELETE ]---------------------------------------------------
#

install_mod.php



#
#---------[ 4. OPEN ]---------------------------------------------------
#

viewtopic.php

#
#---------[ 5. FIND (line:186) ]---------------------------------------------------
#

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());


#
#---------[ 6. REPLACE WITH ]---------------------------------------------------
#

$result = $db->query('SELECT u.cm_cash, u.cm_bank, u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

#
#---------[ 7. FIND (line:235) ]---------------------------------------------------
#

                $user_info[] = '<dd>'.$lang_common['Posts'].': '.$cur_post['num_posts'];

#
#---------[ 8. AFTER, ADD ]---------------------------------------------------
#

            $user_info[] = '<dd>'.ucwords($pun_config['cm_cur_name']).': '.number_format($cur_post['cm_cash']);
            if ($pun_config['cm_bank'] == 1)
                $user_info[] = '<dd>'.$lang_common['Bank'].': '.number_format($cur_post['cm_bank']);


#
#---------[ 9. SAVE/UPLOAD ]---------------------------------------------------
#

viewtopic.php

#
#---------[ 10. OPEN ]---------------------------------------------------
#

post.php

#
#---------[ 11. FIND (line:39) ]---------------------------------------------------
#

// Fetch some info about the topic and/or the forum
if ($tid)
    $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());


#
#---------[ 12. REPLACE WITH ]---------------------------------------------------
#

// Fetch some info about the topic and/or the forum
if ($tid)
    $result = $db->query('SELECT f.cm_cpp, f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT f.cm_cpt, f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());



#
#---------[ 13. FIND (line:317) ]---------------------------------------------------
#

        if (!$pun_user['is_guest'])
        {
            $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
            $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
        }

        redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);


#
#---------[ 14. REPLACE WITH ]---------------------------------------------------
#

        if (!$pun_user['is_guest'])
        {
            $low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
            $db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
            // Update the user's cash..
            if ($tid) {
                $db->query('UPDATE '.$low_prio.$db->prefix.'users SET cm_cash=cm_cash+'.$cur_posting['cm_cpp'].' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
                redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect'].'<br />You have gained '.$cur_posting['cm_cpp'].' '.$pun_config['cm_cur_name'].'.');
            } else if($fid) {
                $db->query('UPDATE '.$low_prio.$db->prefix.'users SET cm_cash=cm_cash+'.$cur_posting['cm_cpt'].' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
                redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect'].'<br />You have gained '.$cur_posting['cm_cpt'].' '.$pun_config['cm_cur_name'].'.');
            }
        } else
                redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);


#
#---------[ 15. SAVE/UPLOAD ]---------------------------------------------------
#

post.php


#
#---------[ 16. OPEN ]---------------------------------------------------
#

profile.php

#
#---------[ 17. FIND (line:698) ]---------------------------------------------------
#

                // We only allow administrators to update the post count
                if ($pun_user['g_id'] == PUN_ADMIN)
                    $form['num_posts'] = intval($_POST['num_posts']);

#
#---------[ 18. REPLACE WITH ]---------------------------------------------------
#

                // We only allow administrators to update the post count
                if ($pun_user['g_id'] == PUN_ADMIN) {
                    $form['num_posts'] = intval($_POST['num_posts']);
                    $form['cm_cash'] = intval($_POST['cm_cash']);
                    $form['cm_bank'] = intval($_POST['cm_bank']);
                }
#
#---------[ 19. FIND (line:~888) ]---------------------------------------------------
#

$result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());

#
#---------[ 20. REPLACE WITH ]---------------------------------------------------
#


$result = $db->query('SELECT u.cm_cash, u.cm_bank, u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());


#
#---------[ 21. FIND (line:~1057) ]---------------------------------------------------
#

        if ($pun_user['g_id'] == PUN_ADMIN)
            $posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
        else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
            $posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
        else
            $posts_field = '<p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";


#
#---------[ 22. REPLACE WITH ]---------------------------------------------------
#

        if ($pun_user['g_id'] == PUN_ADMIN) {
            $posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
            $posts_field .= '<label>'.ucwords($pun_config['cm_cur_name']).'<br /><input type="text" name="cm_cash" value="'.$user['cm_cash'].'" size="8" maxlength="8" /><br /></label>'."\n";
            $posts_field .= ($pun_config['cm_bank'] == 1) ? '<label>'.$lang_common['Bank'].'<br /><input type="text" name="cm_bank" value="'.$user['cm_bank'].'" size="8" maxlength="8" /><br /></label>'."\n" : '';
        } else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) {
            $posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
            $posts_field .= '<p>'.ucwords($pun_config['cm_cur_name']).': '.$user['cm_cash'].'</p>'."\n";
            $posts_field .= ($pun_config['cm_bank'] == 1) ? '<p>'.$lang_common['Bank'].': '.$user['cm_bank'].'</p>'."\n" : '';
        } else
            $posts_field = '<p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";

#
#---------[ 23. SAVE/UPLOAD ]---------------------------------------------------
#

profile.php

#
#---------[ 24. OPEN ]---------------------------------------------------
#

lang/English/common.php

#
#---------[ 25. FIND (line:698) ]---------------------------------------------------
#

'Show new posts'        =>    'Show new posts since last visit',
'Mark all as read'        =>    'Mark all topics as read',
'Link separator'        =>    '',    // The text that separates links in the navigator

#
#---------[ 26. AFTER, ADD ]---------------------------------------------------
#

// Cash Mod
'Bank'                =>    'Bank',
'Lottery'                =>    'Lottery',
'Donate'                =>    'Donate',

Re: Cash Mod 1.0.0

I'm not sure but that might actually be the last edit anyway, does it work as it is?

Re: Cash Mod 1.0.0

the mod does work yes, but the last edit does nothing as it is.

im not 100% sure but isnt the cash supposed to eb shown under your other details such as post count etc?

I just get the feeling its missing some

ive worked around it, but im just saying..

Scrubz

44 (edited by Dr.Jeckyl 2006-01-13 16:00)

Re: Cash Mod 1.0.0

i get a blank page when i visit a profile after i do this edit:

#
#---------[ 18. REPLACE WITH ]---------------------------------------------------
#

                // We only allow administrators to update the post count
                if ($pun_user['g_id'] == PUN_ADMIN) {
                    $form['num_posts'] = intval($_POST['num_posts']);
                    $form['cm_cash'] = intval($_POST['cm_cash']);
                    $form['cm_bank'] = intval($_POST['cm_bank']);
                }

i've narrowed it down to this because i did all the other edits one at a time and uploaded after each edit and that one causes a blank profile.php?id= page. any thoughts? if i post my profile.php would someone double check my edits please?

http://www.thehangout.us/profile.php?id=2


edit: i forgot to mention i'm using the frontpage mod so i'm sure my profile.php is far from stock but was able to find the spots i had to edit.

~James
FluxBB - Less is more

45 (edited by Dr.Jeckyl 2006-01-13 16:14)

Re: Cash Mod 1.0.0

i think i found the problem...

#
#---------[ 18. REPLACE WITH ]---------------------------------------------------
#

                // We only allow administrators to update the post count
                if ($pun_user['g_id'] == PUN_ADMIN) { <---------------------------------- this here
                    $form['num_posts'] = intval($_POST['num_posts']);
                    $form['cm_cash'] = intval($_POST['cm_cash']);
                    $form['cm_bank'] = intval($_POST['cm_bank']);
                }

that isn't supposed to be there is it? i compared this file to a stock punbb profile.php and it's not there.

stock:

                // We only allow administrators to update the post count
                if ($pun_user['g_id'] == PUN_ADMIN)
                    $form['num_posts'] = intval($_POST['num_posts']);
            }

another question, how do you use the lottery and donate?

~James
FluxBB - Less is more

Re: Cash Mod 1.0.0

Lottery is simple enough, goto the lottery page and click buy ticket, when you buy ticket you either win or lose, simple as that, the money paid to buy a ticket goes into the pot, if the pot isnt won then the money keeps growing each time som1 buy a ticket and fails to win.

the donate also simple enough, when your on the donate page you type in the user you ant to donate to and enter the amount you wish to donate.

If you cant see a link to these pages its because the last edits are missed off on the readme (at least i think so) but it can be overcome easily by adding menu items with the URL: www.your-domain.com/lottery.php or www.your-domain.com/donate.php - where "your-domain" is your website.

Scrubz

Re: Cash Mod 1.0.0

ok, something is goofed then. i get blank pages when i goto  www.thehangout.us/lottery.php and www.thehangout.us/donate.php

~James
FluxBB - Less is more

48 (edited by Scrubzz 2006-01-13 16:49)

Re: Cash Mod 1.0.0

have you uploaded the lottery.php, donate.php and bank.php?

I dont think that they are included in the latest version of Cash Mod - but if you download the version before you can copy the lottery.php, bank.php and donate.php into the latest folder and upload them

Scrubz

Re: Cash Mod 1.0.0

yes i have. i did notice that when i downloaded the latest release of the mod too but did upload the file from a previous version.

~James
FluxBB - Less is more

50 (edited by Scrubzz 2006-01-13 16:58)

Re: Cash Mod 1.0.0

hm, the fact its not even bring up an error suggests the files arnt there - but the fact that the page isnt a 404 error suggests otherwise. ... are you sure they are uploaded into the root folder?

Scrubz