Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2009, 05:32 PM
H3C x Nevz H3C x Nevz is offline
 
Join Date: Mar 2009
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help - Linking to Search in Only SOME Boards

I've edited a template and included this search to find all threads started by a user.
PHP Code:
<a href="search.php?$session[sessionurl]do=finduser&u=$post[userid]&starteronly=1">Threads Started</a
How would I make it search in only specified boards? For instance, forumIDs 26 and 28.
Reply With Quote
  #2  
Old 04-25-2009, 06:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look on the Forums page and see the links that say "Click here to view the latest topics" and you should get a good idea of how to do that. Or, look at the search.php code and you'll see the variables allowed also.

If you still need help, post back here with the different code you have tried and we'll see if we can help figure out what is wrong.
Reply With Quote
  #3  
Old 04-25-2009, 10:21 PM
H3C x Nevz H3C x Nevz is offline
 
Join Date: Mar 2009
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not extremely experienced in PHP, and I really can't seem to find the correct variable or how to format it correctly... sorry...
Reply With Quote
  #4  
Old 04-25-2009, 10:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by H3C x Nevz View Post
I am not extremely experienced in PHP, and I really can't seem to find the correct variable or how to format it correctly... sorry...
You are interested in do=finduser, so open search.php and you'll find this line about that:
PHP Code:
if ($_REQUEST['do'] == 'finduser'
Under that is the section that deals with that do variable. Right under there is this:
PHP Code:
    $vbulletin->input->clean_array_gpc('r', array(
        
'userid'         => TYPE_UINT,
        
'starteronly'    => TYPE_BOOL,
        
'forumchoice'    => TYPE_ARRAY,
        
'childforums'    => TYPE_BOOL,
        
'searchthreadid' => TYPE_UINT,
    )); 
That defines the variables it will be looking for. Of that list, I'd say forumchoice would be the one you are looking for. So, try that and see if it works.
Reply With Quote
  #5  
Old 04-26-2009, 03:44 PM
H3C x Nevz H3C x Nevz is offline
 
Join Date: Mar 2009
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I appreciate your help, but I have no idea how to take that and make a properly formatted link out of that.
Reply With Quote
  #6  
Old 04-27-2009, 02:42 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to add the variable to the end of your link.

You wrote this:
HTML Code:
<a href="search.php?$session[sessionurl]do=finduser&u=$post[userid]&starteronly=1">Threads Started</a>
Add it at the end like this:
HTML Code:
<a href="search.php?$session[sessionurl]do=finduser&amp;u=$post[userid]&amp;starteronly=1&amp;forumchoice[]=xxx,yyy">Threads Started</a>
(Not tested - you may have to play with it.)
Reply With Quote
  #7  
Old 04-27-2009, 11:42 PM
H3C x Nevz H3C x Nevz is offline
 
Join Date: Mar 2009
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks so much for your help - you have been a lifesaver, Lynne. I just have one more question: I currently have this link (Which works perfectly) and the text currently displays "Posted Content." How could I make it "[USERNAME OF USER]'s Posted Content"?
Reply With Quote
  #8  
Old 04-28-2009, 01:51 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Um, I'm not sure where on your site it says that, but you are talking about the actual viewer of the page, right? Doesn't it usually say the name in the search field? You can try using either $user[username] or $searchuser[username] and see if that works.
Reply With Quote
  #9  
Old 04-28-2009, 08:16 PM
H3C x Nevz H3C x Nevz is offline
 
Join Date: Mar 2009
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm displaying this below someone's signature with the aid of a mod. I'd like it to display that user's name below their sig.
Reply With Quote
  #10  
Old 04-28-2009, 08:26 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You want to display the name of the poster in the same poster's signature? I think $post[username] is the username of the poster.
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:21 PM.


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.04003 seconds
  • Memory Usage 2,258KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)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