Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by bira bira is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

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.

Comments
  #2  
Old 11-26-2001, 05:06 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's great!!

can show up in postbit template??
Reply With Quote
  #3  
Old 11-26-2001, 05:13 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 11-26-2001, 05:22 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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".
Reply With Quote
  #5  
Old 11-26-2001, 05:34 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thankz bira!!

i really think this is a good hack for me~~
Reply With Quote
  #6  
Old 11-26-2001, 06:53 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice Hack, thanks Bira.
Reply With Quote
  #7  
Old 12-17-2001, 04:09 PM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

late to the party but definitely installing this one
Reply With Quote
  #8  
Old 12-17-2001, 04:38 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

2) Open showthread.php and find:

Code:
  $post[postcount] = ++$postcount;
  $postbits .= getpostbit($post);
Change it to (addition marked in high):

Code:
  $post[postcount] = ++$postcount;
[high]  if ($post[postcount]=="1") {
	eval("\$post[userthreads] = \"".gettemplate("postbit_userthreads")."\";");
  } else {
	$post[userthreads] = "";
  }[/high]
  $postbits .= getpostbit($post);
3) edit the template postbit, and place $post[userthreads] at the point where you want this link to show.

C'est tu
Reply With Quote
  #9  
Old 12-17-2001, 04:58 PM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the addon Bira, i gonna add it soon.
Reply With Quote
  #10  
Old 12-18-2001, 06:47 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 11:30 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04584 seconds
  • Memory Usage 2,296KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete