Version: , by bira
Developer Last Online: Jun 2013
Version: 2.2.x
Rating:
Released: 11-25-2001
Last Update: Never
Installs: 18
No support by the author.
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 #######################
Above it insert:
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\");");
}
That's it, essentially. Now you just need to decide where you want to place the link to this.
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
This modification may not be copied, reproduced or published elsewhere without author's permission.
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".
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]
** Note that the text between the highlighted code above can be whatever you want - text, image/button, whatnot.