PDA

View Full Version : Avatar Usage Statistics in AdminCP 1.0


N9ne
04-10-2003, 10:00 PM
// Avatar Usage Statistics In AdminCP
-- // A hack by N9ne
-- // Creation Date: 11th April 2003
-- // Copyright N9ne 2003+

// Description
-- // This hack will add an option in the 'Avatar' options, in your AdminCP.
The option will read 'Usage Statistics' and upon clicking on it, a page
will be brought up listing, ordered by # of users descending, avatar IDs
with the number of users using each avatar next to it. Avatars are not
displayed on the page as for some forums, this could be quite intensive!
Avatars which have no one using them will not be listed.

// What needs to be done to install this hack
-- // Modification of: admin/(index.php, avatar.php)

// Hack Requested by B Freeze

// Addons
-- // Search for avatars by avatar ID in adminCP. (https://vborg.vbsupport.ru/showthread.php?postid=380588#post380588)
-- // Show Avatar Image In Listing Too (https://vborg.vbsupport.ru/showthread.php?postid=381177#post381177)

B Freeze
04-11-2003, 12:56 PM
Awesome job man! You rule! I thought of this hack a week ago and it sounded simple enough, but I didn't see it around anywhere suprising enough. Glad I caught you online. This is going to be a great feature, especially to those who decide to take down avatars but can't decide which ones to remove. Thanks for everything! :)

Dean C
04-11-2003, 01:08 PM
What about if you have a million odd avatars, that will like kill the database when you check the page - you should try and add pagination so i can steal your code and learn from it ;)

- miSt

N9ne
04-11-2003, 01:16 PM
Today at 03:02 PM Mist said this in Post #3 (https://vborg.vbsupport.ru/showthread.php?postid=380583#post380583)
What about if you have a million odd avatars, that will like kill the database when you check the page - you should try and add pagination so i can steal your code and learn from it ;)

- miSt


You'll have to do it first, so I can steal your code and learn from it :p :p

I thought about pagination, obviously, in fact I always do, and I could add a lot more to it, ie a picture of the avatar, but I don't know how to...don't have the time to learn how to either...

So this would have to do for now :p It won't kill the server too much :p

I changed it from what I originally made it which displayed the actual avatar too, I had 300 to display and got bored, so I removed that as most will have the same problem :p

colicab-d
04-11-2003, 01:21 PM
in pagination not offset something? /me cant rememeber

N9ne
04-11-2003, 01:22 PM
Ok, a little addon, to make life easier for people:

This addon will allow you to search for an avatar from your adminCP by avatar ID.

It's attached :p

N9ne
04-11-2003, 01:24 PM
Today at 03:15 PM colicab-d said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=380586#post380586)
in pagination not offset something? /me cant rememeber


I don't understand your post? :ermm:

Areku
04-11-2003, 06:52 PM
ANy screenies?

N9ne
04-11-2003, 08:05 PM
Here's one.

Sebastian
04-11-2003, 09:03 PM
Today at 10:15 AM colicab-d said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=380586#post380586)
in pagination not offset something? /me cant rememeber


pagination makes pages, 1,2,3,etc... if that is your question ;)

sabret00the
04-12-2003, 08:09 PM
pretty cool, could you get it to display the avatar next to the picture?

N9ne
04-12-2003, 08:13 PM
sabret00the, you probably mean display the avatar next to the ID, and yes, it's possible but you must know it will be quite intensive to load up the page, but I'll post up instructions for you to do so if you wish..

N9ne
04-12-2003, 08:20 PM
Addon: Display Actual Avatar too
- Firstly install the actual hack, and then do these steps.

In admin/avatar.php, find:


$get_the_info=$DB_site->query("SELECT COUNT( username ) AS users, avatar.avatarid, user.avatarid


Replace that with:


$get_the_info=$DB_site->query("SELECT COUNT( username ) AS users, avatar.avatarid, avatar.avatarpath, user.avatarid




Find:


<tr class='tblhead'><td align=\"center\" colspan=2><b>


Replace that with:


<tr class='tblhead'><td align=\"center\" colspan=3><b>




Find:


<tr class='".getrowbg()."'><td align=\"center\" nowrap><font size='1'>


Replace that with:


<tr class='".getrowbg()."'><td align=\"center\" nowrap><font size='1'><b>Avatar</b></font></td><td align=\"center\" nowrap><font size='1'>




Find:


$numberusers=$the_info['users'];
$avatarid=$the_info['avatarid'];


Replace that with:


$numberusers=$the_info['users'];
$avatarid=$the_info['avatarid'];
$avatar=$the_info['avatarpath'];





Find:


<tr class='".getrowbg()."'>


Replace that with:


<tr class='".getrowbg()."'><td align=\"center\" nowrap><img src=\"$bburl/$avatar\" border=\"0\"></td>




Done!

Mathiau
04-15-2003, 03:44 AM
how can one make this page availible to anyone when they edit their avatar - perhaps in the avatar page where you choose your avatar - place a number beside / under it saying how many people are currently using that avatar? Or is this another hack already released?

MarkL
04-25-2003, 01:00 AM
After doing the add-ons, I recieved this error when trying to do anything with Avatars in the Admin CP....

"Parse error: parse error, expecting `','' or `';'' in /admin/avatar.php on line 57"

What does that mean?