[BETA]Cash on Index page(for Cash/Points) 0.6.3

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
eXa
Registered User
Posts: 8
Joined: Fri Aug 06, 2004 8:10 pm

Post by eXa »

yeah i get the same error....cant anyone send it to me plz?
DrMistry
Registered User
Posts: 1
Joined: Thu Aug 12, 2004 11:25 am
Location: Maidstone, UK
Contact:

Has this Mod been withdrawn?

Post by DrMistry »

I'll be damned if I can download the mod ZIP file from the 1st page, and I can't find it anywhere else - has this been withdrawn?

Alll I want anyway is to have the logged-in user's balance (user_points field) displayed in the main board menu (overall_header.tpl I guess) - if anyone's got a quick and dirty way of displaying a given field in the header file, could you let me know? Using Cash Mod, activities mod, bookies mod, and a few others. phpbb 2.0.10, ms sql.
Bags of love,
DrMistry
User avatar
naderman
Consultant
Consultant
Posts: 3754
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann
Contact:

Post by naderman »

Sorry, the download link is broken. I will update this on the weekend and fix the link then.
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
User avatar
naderman
Consultant
Consultant
Posts: 3754
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann
Contact:

Post by naderman »

Hi everybody. I finished a new version which only updates the admin page and makes the install file work with all DBMS. In order to release an other version fixing more bugs, I created a little script which can be found here: http://www.naderman.de/mods/analyse.zip If you would like to help this mod extract the archive and copy the analyse.php file to your phpbb root. Then open it with your browser (http://www.yourdomain.com/your/path/to/ ... nalyse.php) and send its output to [email protected] or write me a pm or post it here. If you experienced any problems with this mod it would be nice if you could add a little description of the problem. This doesn't mean that users with no problems shouldn't send there info. The more the better.

Thank you for helping me out with developing this Mod :)

naderman
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
User avatar
sean007
Registered User
Posts: 13
Joined: Mon Jun 14, 2004 6:16 am

Post by sean007 »

I get this message after installing


DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5

SELECT user_id, username , user_points FROM phpbb_users WHERE (user_id <> -1 ) ORDER BY ( user_points + 0) DESC LIMIT

Line : 345
File : /*********/phpBB2/index.php

there was no mysql install thingy there was a cio_install.php but I got this error when trying to open it
Parse error: parse error, unexpected $ in /*************/phpBB2/coi_install.php on line 88

Can anyone HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!
User avatar
naderman
Consultant
Consultant
Posts: 3754
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann
Contact:

Post by naderman »

Hi,

I fixed the second bug (forgot a }), download from the first page. Run coi_install.php afterwards the first error should be fixed. If you have additional problems please download analyze.zip (see post before). Thanks.

naderman
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
Provokatiker
Registered User
Posts: 167
Joined: Mon Dec 22, 2003 2:13 pm
Contact:

Post by Provokatiker »

Hi, first: Great mod :)
But something doesnt work:

The entry in index_body.tpl looks like

Code: Select all

{TOTAL_USERS}<br />{NEWEST_USER}<br/><br/>
{TOTAL_POSTS} in {TOTAL_TOPICS}<br />
{L_RICHEST_USER}{richestrow.KOMMA}{richestrow.URL}{richestrow.USERNAME}</a>{richestrow.CASH}<br/>
{L_USERS_CASH}{USERS_CASH}
The Text of "richest user is..." and "your cash is 50 points" is displayed correctly, but the richest users and their cash are missed!

I think I did everything fine (SQL, File-changes). What else could be reason?

The code in index.php looks like

Code: Select all

$template->assign_vars(array(
		'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
		'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
		'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
		'L_RICHEST_USER' => $sornot,
        'USERS_CASH' => $users_cash,
        'L_USERS_CASH' => $l_users_cash,
		'TOTAL_TOPICS' => sprintf($l_total_topic_s, $total_topics),
All former entries have this "sprintf"-function around it, maybe the richest-stuff should have that, too?
User avatar
naderman
Consultant
Consultant
Posts: 3754
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann
Contact:

Post by naderman »

could you download the analyse.zip (a bit more to the top) it only contains one file upload it to your phpbb root and pm me its contents, or post in here. That would help me a lot to answer your problem thanks.
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
Provokatiker
Registered User
Posts: 167
Joined: Mon Dec 22, 2003 2:13 pm
Contact:

Post by Provokatiker »

Ok, here we go:
Analyse wrote: Checking Server Configuration

PHP Version: 4.3.1
Zend Version: 1.3.0
Interface Type: apache
DBMS: mysql
Register Globals: on

Checking phpBB Configuration

phpBB Version: 2.0.6
Easymod Version: Not installed
Cash Mod Version: 2.2.1
Points System Version: Not installed

Checking Cash on Index Mod Configuration

cash_richdis: 'komma'
cash_richnum: '1'
cash_userdis: 'yes'
cash_komma: 'komma'
cash_pointsorcash: 'cash'

Running the Script

$l_users_cash = $lang['users_cash'];
$lang["users_cash"]: Du hast momentan
$l_users_cash: Du hast momentan

$board_config['cash_richdis'] != 'no'

$display_limit = $board_config['cash_richnum'];
$display_limit: 1
$board_config['cash_richnum']: 1

$display_limit <= 1
$sornot = '<br />'.$lang['Richest_user'];
$sornot: <br />Die meisten Punkte hat:
$lang['Richest_users']: Die meisten Punkte hat:

$board_config['cash_pointsorcash'] == 'cash'

while : $c_cur = &$cash->currency_next($i,CURRENCY_ENABLED)
$i: 1

$cash_change = $c_cur->exchange();
$c_cur->exchange(): 1

$cash_change < $cash_overall_change)||($i==1)

$cash_id = $c_cur->id();
$c_cur->id(): 4

$cash_overall_change = $cash_change;$cash_field = $c_cur->db();
$c_cur->db(): user_points

$cash_sqls = ''.$cash_sqls.', '.$cash_field.'';
$cash_sqls: , user_points

$cash_order = ''.$cash_order.'('.$cash_field.' / '.$cash_change.') + ';
$cash_order: (user_points / 1) +

$c_cur = &$cash->currency_next($i,CURRENCY_ENABLED) : false
$i: 0

$board_config['cash_richdis'] != 'no'

$sql = "SELECT user_id, username $cash_sqls
FROM " . USERS_TABLE . "
WHERE (user_id <> " . ANONYMOUS . " )
ORDER BY ( $cash_order 0) DESC
LIMIT " . $display_limit;
$sql: SELECT user_id, username , user_points
FROM dbname_users
WHERE (user_id <> -1 )
ORDER BY ( (user_points / 1) + 0) DESC
LIMIT 1

$user_countusers = $db->sql_numrows($result);
$user_countusers: 1

$user_data = $db->sql_fetchrowset($result);
$user_data:
array(1) {
[0]=>
array(6) {
[0]=>
string(1) "11"
["user_id"]=>
string(1) "11"
[1]=>
string(12) "UserXY"
["username"]=>
string(12) "UserXY"
[2]=>
string(4) "67.5"
["user_points"]=>
string(4) "67.5"
}
}


for ($i = 0; $i < $user_countusers; $i++)
$i: 0

$richest_user = $user_data[0]['username'];
$richest_user: UserXY

$richest_uid = $user_data[0]['user_id'];
$richest_uid: 11

$board_config['cash_pointsorcash'] == 'cash'

while ( $c_cur = &$cash->currency_next($j,CURRENCY_ENABLED) )
$i: 0

$cash_field = $c_cur->db();
$cash_field: user_points

$cash_change = $c_cur->exchange();
$cash_change: 1

$richests_cash = $richests_cash + ($user_data[$i][$cash_field]/$cash_change);
$richests_cash: 67.5

$c_cur = &$cash->currency_next($j,CURRENCY_ENABLED) : false
$i: 0

$board_config['cash_pointsorcash'] == 'cash'

$c_cur = $cash->currency($cash_id);

$richests_cash = $c_cur->display(round($richests_cash,$c_cur->currency['cash_decimals']));
$richests_cash: 68 Punkte

$cashn = ' ('.$richests_cash.')';
$cashn: (68 Punkte)

$userdata['session_logged_in'] == true

$board_config['cash_userdis'] != 'no'

$board_config['cash_pointsorcash'] == 'cash'

while ( $c_cur = &$cash->currency_next($i,CURRENCY_ENABLED) )
$i: 1

$cash_change = $c_cur->exchange();
$c_cur->exchange(): 1

$users_money = $users_money + $userdata[$c_cur->db()] / $cash_change;
$users_money: 67.5

($cash_change < $cash_overall_change)||($i==1)

$cash_id = $c_cur->id();
$cash_id: 4

$cash_overall_change = $cash_change;
$cash_overall_change: 1

$c_cur = &$cash->currency_next($i,CURRENCY_ENABLED) : false
$i: 0

$c_cur = $cash->currency($cash_id);

$users_cash = ' '.$c_cur->display(round($users_money,$c_cur->currency['cash_decimals'])).'';
$users_cash: 68 Punkte

Checking Script Output

<br />Die meisten Punkte hat: <a href="profile.php?mode=viewprofile&u=11">UserXY</a>. (68 Punkte)
<br />Du hast momentan 44 Punkte

I noticed, that the values are right for the richest user (UserXY, 68 Punkte), and it is also showed correctly at the end of the analyse-result...But it wont show on my board...Also I realized the entry "komma" for the cash_richdis-value, I changed that to "1", but nothing happened...

Also strange: I have
$lang['Richest_user'] = 'Die meisten Punkte hat: ';
$lang['Richest_users'] = 'Die meisten Punkte haben: ';
in my lang_main.php, but above there is two times "Die meisten Punkte hat"...

(Ist es nicht irgendwie komisch, wenn zwei gleichsprachige Benutzer auf einem fremdsprachigen Board miteinander fremdsprachig schreiben *g*)
User avatar
naderman
Consultant
Consultant
Posts: 3754
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann
Contact:

Post by naderman »

I found some bugs in the admin page and released a new package with fixes, download the new files, you only need to replace the two files for the admin panel (php, tpl). The language thing was a typing mistake in analyse.php your lang vars are ok. Try to reconfigure your Cash on Index Mod in the Admin panel, if you still experience problems I would like you to run analyse.php once more. :)

(naja, komisch ist das schon, aber es hat den sinn, dass andere Benutzer des Forums auch verstehen um welche Probleme es hier geht, und da wir uns ja anscheinend auch auf Englisch verständigen können, finde ich das ok)
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
Provokatiker
Registered User
Posts: 167
Joined: Mon Dec 22, 2003 2:13 pm
Contact:

Post by Provokatiker »

Uploaded the two admin-files, reconfigured it but still same problem :-/
Redid analyse.php, result:

Code: Select all

Checking Server Configuration

PHP Version:           4.3.1
Zend Version:          1.3.0
Interface Type:        apache
DBMS:                  mysql
Register Globals:      on

Checking phpBB Configuration

phpBB Version:         2.0.6
Easymod Version:       Not installed
Cash Mod Version:      2.2.1
Points System Version: Not installed

Checking Cash on Index Mod Configuration

cash_richdis:          'yes'
cash_richnum:          '1'
cash_userdis:          'yes'
cash_komma:            'komma'
cash_pointsorcash:     'cash'

Running the Script

$l_users_cash = $lang['users_cash'];
$lang["users_cash"]:             Du hast momentan 
$l_users_cash:                   Du hast momentan 

$board_config['cash_richdis'] != 'no'

$display_limit = $board_config['cash_richnum'];
$display_limit:                  1
$board_config['cash_richnum']:   1

$display_limit <= 1
$sornot = '<br />'.$lang['Richest_user'];
$sornot:                         <br />Die meisten Punkte hat: 
$lang['Richest_user']:          Die meisten Punkte hat: 

$board_config['cash_pointsorcash'] == 'cash'

while : $c_cur = &$cash->currency_next($i,CURRENCY_ENABLED)
$i:                              1

$cash_change = $c_cur->exchange();
$c_cur->exchange():              1

$cash_change < $cash_overall_change)||($i==1)

$cash_id = $c_cur->id();
$c_cur->id():                    4

$cash_overall_change = $cash_change;$cash_field = $c_cur->db();
$c_cur->db():                    user_points

$cash_sqls = ''.$cash_sqls.', '.$cash_field.'';
$cash_sqls:                      , user_points

$cash_order = ''.$cash_order.'('.$cash_field.' / '.$cash_change.') + ';
$cash_order:                     (user_points / 1) + 

$c_cur = &$cash->currency_next($i,CURRENCY_ENABLED) : false
$i:                              0

$board_config['cash_richdis'] != 'no'

	$sql = "SELECT user_id, username $cash_sqls
	FROM " . USERS_TABLE . "
	WHERE (user_id <> " . ANONYMOUS . " )
	ORDER BY ( $cash_order 0) DESC
	LIMIT " . $display_limit;
$sql:   SELECT user_id, username , user_points
	FROM tj_users
	WHERE (user_id <> -1 )
	ORDER BY ( (user_points / 1) +  0) DESC
	LIMIT 1

$user_countusers = $db->sql_numrows($result);
$user_countusers:                1

$user_data = $db->sql_fetchrowset($result);
$user_data:
array(1) {
  [0]=>
  array(6) {
    [0]=>
    string(1) "11"
    ["user_id"]=>
    string(1) "11"
    [1]=>
    string(12) "UserXY"
    ["username"]=>
    string(12) "UserXY"
    [2]=>
    string(4) "67.5"
    ["user_points"]=>
    string(4) "67.5"
  }
}


for ($i = 0; $i < $user_countusers; $i++)
$i:                              0

$richest_user = $user_data[0]['username'];
$richest_user:                   UserXY

$richest_uid = $user_data[0]['user_id'];
$richest_uid:                    11

$board_config['cash_pointsorcash'] == 'cash'

while ( $c_cur = &$cash->currency_next($j,CURRENCY_ENABLED) )
$i:                              0

$cash_field = $c_cur->db();
$cash_field:                     user_points

$cash_change = $c_cur->exchange();
$cash_change:                    1

$richests_cash = $richests_cash + ($user_data[$i][$cash_field]/$cash_change);
$richests_cash:                  67.5

$c_cur = &$cash->currency_next($j,CURRENCY_ENABLED) : false
$i:                              0

$board_config['cash_pointsorcash'] == 'cash'

$c_cur = $cash->currency($cash_id);

$richests_cash = $c_cur->display(round($richests_cash,$c_cur->currency['cash_decimals']));
$richests_cash:                  68 Punkte

$cashn = ' ('.$richests_cash.')';
$cashn:                           (68 Punkte)

$userdata['session_logged_in'] == true

$board_config['cash_userdis'] != 'no'

$board_config['cash_pointsorcash'] == 'cash'

while ( $c_cur = &$cash->currency_next($i,CURRENCY_ENABLED) )
$i:                              1

$cash_change = $c_cur->exchange();
$c_cur->exchange():              1

$users_money = $users_money + $userdata[$c_cur->db()] / $cash_change;
$users_money:                    67.5

($cash_change < $cash_overall_change)||($i==1)

$cash_id = $c_cur->id();
$cash_id:                        4

$cash_overall_change = $cash_change;
$cash_overall_change:            1

$c_cur = &$cash->currency_next($i,CURRENCY_ENABLED) : false
$i:                              0

$c_cur = $cash->currency($cash_id);

$users_cash = ' '.$c_cur->display(round($users_money,$c_cur->currency['cash_decimals'])).'';
$users_cash:                      68 Punkte

Checking Script Output

<br />Die meisten Punkte hat: <a href="profile.php?mode=viewprofile&u=2">UserXY</a>. (68 Punkte) 
<br />Du hast momentan  68 Punkte
(jo, englisches Board = englisch schreiben, das is schon gut so ;) )
User avatar
naderman
Consultant
Consultant
Posts: 3754
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann
Contact:

Post by naderman »

Could you please post the part from index_body.tpl? Until now I don't really have an idea where the problem comes from, the analyse output seems ok so I think it's a template problem. Do you have an IM (Jabber, MSN, ICQ) ? If so I would be happy if you could pm me with the infos so we can work a little faster to solve this.
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
Provokatiker
Registered User
Posts: 167
Joined: Mon Dec 22, 2003 2:13 pm
Contact:

Post by Provokatiker »

Ok, the problem's fix was:
My code looked like:

Code: Select all

{richestrow.KOMMA}{richestrow.URL}{richestrow.USERNAME}</a>{richestrow.CASH}
But it should look like:

Code: Select all

<!-- BEGIN richestrow -->
{richestrow.KOMMA}{richestrow.URL}{richestrow.USERNAME}</a>{richestrow.CASH}
<!-- END richestrow -->
I didnt know, that the comments are crucial for the Mod! Now, it works fine
:D
Useful Mod, thanx a lot!
Shof515
Registered User
Posts: 1169
Joined: Wed Mar 19, 2003 4:36 am

Post by Shof515 »

I just installed this mod,and i will like to know how to do i make it read:
The richest users are(then the list of users)
This might be a litte helpful:
http://shof515.com/help.html
Whos missing up my sig?
User avatar
naderman
Consultant
Consultant
Posts: 3754
Joined: Fri Aug 01, 2003 10:06 pm
Location: Berlin, Germany
Name: Nils Adermann
Contact:

Post by naderman »

Well looking at that file showed me, that it should already look like that. What do you see?
I appreciate gifts from my Amazon wishlist.
naderman.de twitter: @naderman
Post Reply

Return to “[2.0.x] MODs in Development”