The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
I meant it should look like:
Code:
$count = $vbulletin->db->query_first("SELECT COUNT(*) AS count FROM ".TABLE_PREFIX."thread WHERE postuserid = ". $vbulletin->userinfo['userid']." AND forumid IN(164, 165, 166)"); global $template_hook; $template_hook[profile_stats_threadcount] = $count['count']; |
#12
|
|||
|
|||
unfortunately it doesn't work
ok, thank you for you time. i hope that somene else answer. |
#13
|
|||
|
|||
OK, I hate to give up, so I actually went to the test site and tried this (which I should have done from the start and saved us both time).
I made this plugin and used the hook member_profileblock_fetch_unwrapped Code:
if ($this->template_name == 'memberinfo_block_statistics') { global $vbulletin; $count = $vbulletin->db->query_first("SELECT COUNT(*) AS count FROM ".TABLE_PREFIX."thread WHERE postuserid = ". $vbulletin->userinfo['userid']." AND forumid IN(164, 165, 166)"); } Sorry I wasted your time before, this time I *really* quit |
#14
|
|||
|
|||
You are great man !
But i have still problem ... It works perfect when I set specific number of postuserid like: Code:
if ($this->template_name == 'memberinfo_block_statistics') { global $vbulletin; $count = $vbulletin->db->query_first("SELECT COUNT(*) AS count FROM thread WHERE postuserid = 1491 AND forumid IN(164, 165, 166)"); } Code:
if ($this->template_name == 'memberinfo_block_statistics') { global $vbulletin; $count = $vbulletin->db->query_first("SELECT COUNT(*) AS count FROM thread WHERE postuserid = ".$vbulletin->userinfo['userid']." AND forumid IN(164, 165, 166)"); } is there any another way to replace Quote:
|
#15
|
|||
|
|||
Oh, I wish it were true, but in fact that problem is probably why it didn't work before. I should have thought of making sure that it was right.
Anyway, here we go again : I found this in class_profileblock.php (the same file where the hook is called): Code:
$requirements = $this->registry->db->query_read_slave(" SELECT blockid, requirement FROM " . TABLE_PREFIX . "profileblockprivacy WHERE userid = " . intval($this->profile->userinfo['userid']) . " "); |
#16
|
|||
|
|||
YEAH ! it works !
Exactly what i want ! Thank you again mate without your help i cant solve the problem! Give via PM you paypal account. |
#17
|
||||
|
||||
I know this is an old thread Kevin but, I have edited this and edited this to get this to work on postbit_legacy with no luck.
I tried to get it to show (link) all threads by user in postbit_legacy but, only in select forum. Any chance you could have a look at your code again and help me out? I would really appreciate it. Though, I have done a great deal of research before posting this request, I was not able to locate anything like this, so, if you or anyone that reads this know of an edit or addon that does what I am seeking please let me know... Thank you for your time.... Tim |
#18
|
|||
|
|||
Wow, that's an old one. But I'm not sure what you're asking. The code above was only showing how many threads a user has in a certain set of forums. It sounds like you want links or something?
|
Благодарность от: | ||
blind-eddie |
#19
|
||||
|
||||
I am looking to edit this to show how many threads a user has in a certain set of forums, but not in a profile tab, I want it to show on the postbit_legacy, below total post.
I want to allow members to be able to click the link similar to what is show below, but in the postbit_legacy template, not in a profile tab. I am only going to show the link in the same forum that I want it to show all the threads a user made in those forums. I think I said that right.... |
#20
|
|||
|
|||
OK, I guess you could do something like this, at hook postbit_display_complete:
Code:
$forumids=array(1, 2, 3); $show['threadcount'] = in_array($post['forumid'], $forumids); if ($show['threadcount']) { $threadcount = $vbulletin->db->query_first("SELECT COUNT(*) AS count FROM ".TABLE_PREFIX."thread WHERE postuserid = ". $post['userid']." AND forumid IN (" . implode(',', $forumids) . "); if ($threadcount === FALSE) $show['threadcount'] = false; else $threadcount = $threadcount['count']; } Code:
<if condition="$show['threadcount']"> Threads: $threadcount<br /> </if> I should also point out that adds a query for each postbit displayed. If you're concerned about that, you could add a column to the user table and adjust the count whenever a thread is created or deleted, but of course that takes more work and probably a few more plugins. You could also keep and array for users that you've already done the query for, so if for instance the same user posts 5 times on a page, you'd only be doing it once. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|