[ Video Sharing CMS v4 ] user rank

Started by wetvibes,

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

wetvibesTopic starter

Based on this query:

$users = $cachedb->get_results("SELECT  @rownum := @rownum + 1 AS rownum,id,name,avatar,views FROM ".DB_PREFIX."users , (SELECT @rownum := 0) AS dummy order by views DESC ".this_limit());

can anybody make it a global function so we can rank users?

We can use $user->rownum as a ranking number but i dont know how to make it a global function.
  •  

PHPVibe A.

What are you trying to rank it by? You've complicated the question with that query.
You could rank by : number of profile views, activities, likes on videos, views on videos, etc.

wetvibesTopic starter

i wanna rank by profile views. but i wanna be able to display the rank number on the profile page also.
  •  

PHPVibe A.

This should be very easy, you have the profile views fields, already existing and printed in the profile.
Not sure what else you look for?

Similar topics (7)