Log in

View Full Version : What about Number of Friends in postbit ??


mostafa megahed
12-26-2008, 11:30 AM
Hello,

In this topic :

https://vborg.vbsupport.ru/showthread.php?t=189788

i like this part :

#################### GIFT COUNT ON POSTBIT ####################

To display gifts count on postbit's:

Add new plugin

Hook Location: showthread_postbit_create
Title: Gifts in Postbit Legacy
Execution Order: 5
Plugin PHP Code:
$num_gifts = $db->query_first("
SELECT COUNT(*)
FROM " . TABLE_PREFIX . "gifts AS gifts
WHERE recipientid = " . $post['userid']
,DBARRAY_NUM);
$post['gifts'] = $num_gifts[0];
Plugin is active: yes

Then on the postbit where you want to display it just put

(<a href="member.php?$session[sessionurl]u=$post[userid]">$post[gifts]</a>) gifts

#################### /GIFT COUNT ON POSTBIT ####################

This is For Numbers of the Gifts in postbit !!!

What about Number of Friends ??

can any one help me in this ??

thxxxx..

Lynne
12-26-2008, 03:05 PM
Have you tried the variable $post['friendcount'] in the postbit?

mostafa megahed
12-26-2008, 08:52 PM
yes and it worked, but with this $post[friendcount] Not $post['friendcount'],

what about Number of Topics ????

--------------- Added 1230332057 at 1230332057 ---------------

and Number of Albums plz ???

Lynne
12-26-2008, 09:07 PM
I don't know what you mean by Number of Topics. If you mean number of threads, I think there is a modification to do that.

As for number of albums, you will probably have to add a plugin to join in the query and do a count(album.albumid) of the albums for the user joining on album.userid. The above way of doing it for the gifts adds one query per postbit which is not the best way to go. It's probably better to join in the query when the post information for the user is obtained (but don't ask me if it's a left join or right join or any of that cuz I don't know).

mostafa megahed
12-26-2008, 10:58 PM
I don't know what you mean by Number of Topics. If you mean number of threads, I think there is a modification to do that.

As for number of albums, you will probably have to add a plugin to join in the query and do a count(album.albumid) of the albums for the user joining on album.userid. The above way of doing it for the gifts adds one query per postbit which is not the best way to go. It's probably better to join in the query when the post information for the user is obtained (but don't ask me if it's a left join or right join or any of that cuz I don't know).

Thank U ...

yes i mean number of threads !! but i didn't found this modification ...

and i can't do what you say about the albums count ... so my request is for this :

1- count of user's albums .
2- count of user's friends . [Done]
3- count of user's threads .
4- count of user's referrals .

Any Help ... :)

Lynne
12-26-2008, 11:18 PM
Do a search on "postbit*" in "all mods" "titles only" . I saw mods regarding referrals, albums, and threads in there (you will have to look through a few pages of the results).

mostafa megahed
12-26-2008, 11:44 PM
thank u, i will :D