Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-22-2007, 03:48 PM
Casual Pligger
 
Join Date: Sep 2006
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
Question Total Number of Friends

I'm trying to display the total number of friends on a user page - if anyone has this working or has any idea how to implement a count function into Pligg 9, them please let me know!

Thanks,
bergs
Reply With Quote
  #2 (permalink)  
Old 01-24-2007, 12:41 AM
Casual Pligger
 
Join Date: Sep 2006
Posts: 37
Thanks: 1
Thanked 1 Time in 1 Post
Figured this out!

I just created a function that counts the number of friends a user has:

function count_friends(){
global $db, $user;
$friends = "SELECT count(*) FROM " . table_friends . " INNER JOIN " . table_users . " ON " . table_friends . ".friend_from = " . table_users . ".user_id WHERE (((" . table_friends . ".friend_to)= " . $user->id . ")) ;";
$count=$db->get_var($friends);
echo $count;
}
Reply With Quote
The Following User Says Thank You to bergs For This Useful Post:
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Sidebar Friends Module with messaging and activity AnAlienHolakres3 Modification Tutorials 31 02-09-2008 06:54 AM
total number for upcoming stories jacksdon2323 General Help 4 06-10-2007 01:22 AM
Suggestion for friends view dollars5 Suggestions 0 04-10-2007 12:52 PM
Total Number Of Stories smcgw General Help 0 04-08-2007 01:13 PM
Number of top stories allowed ngrad General Help 5 07-07-2006 10:52 PM


Search Engine Friendly URLs by vBSEO 3.2.0