https://www.icyphoenix.com/viewtopic.php?f=26&t=1624
-----------------------------------
symphosius
Fri 13 Apr, 2007 00:24

Multiple Ranks Mod 2.0.3 - User_totalpages
-----------------------------------
Hi Folks,
it should be possible to assign a rank to the number of pages a member has visited (user_totalpages) insted of the number of postings or days of membership (regarding user_regdate). 
Could you please give me a hint, where to screw? Changing  user_regdate to user_totalpages in funktions_mg_ranks.php 

[code linenumbers=false]$day_diff = intval( (time() - $user_row['user_regdate']) / 86400 );
	to		$totalpages = intval($user_row['user_totalpages']);

and 

case '-1':
	if (($user_row[$user_fields_array[$k]] == '-1') && ($totalpages >= $ranks_sql['ranksrow'][$j]['rank_min']))
	{
		$rank_sw = true;
	}
	break;
[/code]

does not work, 'user_totalpages' seems not to be read from the database.

Thank you,
symphosius


-----------------------------------
Mighty Gorgon
Sun 15 Apr, 2007 20:25

Re: Multiple Ranks Mod 2.0.3 - User_totalpages
-----------------------------------
Maybe [b]user_totalpages[/b] isn't queried... that's why.

Try to check the original SQL in viewtopic.

[codeblock]		// Go ahead and pull all data for this topic
		$sql = "SELECT u.username, u.user_id, u.user_posts, ...[/codeblock]

Add that field and try again.

Let me know.


P.S.: I would like just to specify for normal phpBB users that for this to work you should have an old Niels Mod installed (user_totalpages isn't part of standard phpBB).


-----------------------------------
symphosius
Mon 16 Apr, 2007 23:24

Re: Multiple Ranks Mod 2.0.3 - User_totalpages
-----------------------------------
[quote user="Mighty Gorgon" post="12215"]Maybe [b]user_totalpages[/b] isn't queried... that's why.
Try to check the original SQL in viewtopic.
Add that field and try again.[/quote]

Right, that was the missing piece as I found out yesterday. I changed  case '0' from 'user_posts' to 'user_totalpages' as I did'nt arrive to get it to work as an additional option (case '-3'). The case-variable -3 is written to the database, but the rank isn't shown up this way.  :? 


[quote user="Mighty Gorgon" post="12215"]Let me know.
P.S.: I would like just to specify for normal phpBB users that for this to work you should have an old Niels Mod installed (user_totalpages isn't part of standard phpBB).[/quote]
Yes, It comes with Niels Last Visit Mod. If the rank should be avaliable in the memberlist too, the same field must be added to the query in memberlist.php as in viewtopic.php.

Thank's a lot!


