The Arcive of vBulletin Modifications Site. |
|
![]() |
|||||||||||||||||||||||||
ok, real quicky one: find all threads (note: threads, not posts!) started by X.
Open search.php and find: Code:
// ###################### Start posts by user x ####################### Code:
// ###################### Start threads by user x ####################### if ($action=="userthreads") { // get allowable forums: $forumsql=getallforumsql(); // get user: $usersql=" AND thread.postuserid='$userid'"; $wheresql="1=1".$forumsql.$usersql; if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE query='".addslashes($wheresql)."'")) { $searchid=$getsearch[searchid]; } else { // get last search for this user and check floodcheck if ($prevsearch=$DB_site->query_first("SELECT searchid,dateline FROM search WHERE ".iif($bbuserinfo[userid]==0,"ipaddress='$ipaddress'","userid=$bbuserinfo[userid]")." ORDER BY dateline DESC LIMIT 1")) { if (time()-$prevsearch[dateline]<$searchfloodcheck and $searchfloodcheck!=0) { // and !ismoderator()) { eval("standarderror(\"".gettemplate("error_searchfloodcheck")."\");"); exit; } } // insert query into db $DB_site->query("INSERT INTO search (searchid,query,dateline,querystring,showposts,userid,ipaddress) VALUES (NULL,'".addslashes($wheresql)."',".time().",'".addslashes($query)."',0,$bbuserinfo[userid],'".addslashes($ipaddress)."')"); $searchid=$DB_site->insert_id(); } eval("standardredirect(\"".gettemplate("redirect_search")."\",\"search.php?s=$session[sessionhash]&action=showresults&searchid=$searchid\");"); } For example, If you want it to appear in a user's profile, then place the following link in the getinfo template: Code:
<a href="search.php?s=$session[sessionhash]&action=userthreads&userid=$userinfo[userid]">Find threads started by $userinfo[username]</a> Show Your Support
|
Comments |
#2
|
||||
|
||||
![]()
it's great!!
![]() can show up in postbit template?? |
#3
|
||||
|
||||
![]()
the link for postbit template is
<a href="search.php?s=$session[sessionhash]&action=userthreads&userid=$post[userid]">View all threads started by $userinfo[username]</a> Cheers, Bira |
#4
|
||||
|
||||
![]()
Forgot to mention you can view this 'hack' on my bb, at http://www.atlasf1.com/bb (you don't need to be registered in order to view threads or profiles).
I have it added to the user's profile, but also in the first post of a thread (and only there), I have a link "view all threads started by X". |
#5
|
||||
|
||||
![]()
thankz bira!!
i really think this is a good hack for me~~ ![]() |
#6
|
||||
|
||||
![]()
Nice Hack, thanks Bira.
|
#7
|
||||
|
||||
![]()
late to the party but definitely installing this one
![]() |
#8
|
||||
|
||||
![]()
here's an add-on to this hack, which I have on my bulletin board:
On my BB (and you can see it at http://www.atlasf1.com/bb/index.php ) on the first post of a thread (and only on that post) there is a link "Find more threads started by this user". If you want to add that, do the following: This add-on uses the Post Counter hack, so you need to have that installed first (the $post[postcount] version) 1) Create a new template, called postbit_userthreads. This template should include: Code:
[high]<a href="search.php?s=$session[sessionhash]&action=userthreads&userid=$post[userid]">[/high]View all threads started by $post[username][high]</a>[/high] 2) Open showthread.php and find: Code:
$post[postcount] = ++$postcount; $postbits .= getpostbit($post); Code:
$post[postcount] = ++$postcount; [high] if ($post[postcount]=="1") { eval("\$post[userthreads] = \"".gettemplate("postbit_userthreads")."\";"); } else { $post[userthreads] = ""; }[/high] $postbits .= getpostbit($post); C'est tu ![]() |
#9
|
||||
|
||||
![]()
Thanks for the addon Bira, i gonna add it soon.
|
#10
|
|||
|
|||
![]()
Bira:
Great hack yet again. I know I will personally use this a lot. I would really like to see this added to the general search page too. How is the threadpreview hack working out on your board? I haven't noticed any slow downs at all since installing it. Parker |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|