Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 01-06-2005, 05:36 PM
bamaster bamaster is offline
 
Join Date: Dec 2004
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help with a Query - "View My Classifieds"

Hello,

I run a bowling forum, allBowling.com, with a forum for selling used bowling equipment:
http://www.allbowling.com/forum/forumdisplay.php?f=9

I'd like to offer my users the ability to place in their sig something like "Click Here to View All My Classifieds". I'm thinking it would be a search string.

Example: Seach all New Threads created by User within this Forum

Is this possible?

Thanks in advance!
Reply With Quote
  #2  
Old 01-06-2005, 09:35 PM
memobug memobug is offline
 
Join Date: Jun 2002
Posts: 418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can pass requests directly to search.php

Imagine that this very forum we are in at vbulletin.org (#97) as your hypothetical classifieds area and the post above is an ad. This link will return all threads started by you, bamaster in the last year in just this forum, showing the results in reverse order as posts.

You can try it by clicking on this:
Find bamaster's Classified ads

Here is the code for that link:
Code:
https://vborg.vbsupport.ru/search.php?do=process&searchuser=bamaster&starteronly=1&exactname=1&searchdate=365&showposts=0&forumchoice[]=97

2. You can do whatever you want with this. Now, here, for example are all the threads I, memobug, started anywhere at vbulletin.org in the past month. This is something I might be able to use to catch up on stuff!
Find memobug's threads started this month

Code for that is here:
Code:
https://vborg.vbsupport.ru/search.php?do=process&searchuser=memobug&starteronly=1&exactname=1&searchdate=30&showposts=0&forumchoice[]=0
That's the good news. Here is the bad news.
There may be a problem that may or may not affect you. and this has always been a difficulty in using usernames in links, they can contain characters that can't be passed in URL. Stuff like the ampersand character or maybe spaces and semicolons and slashes that might prevent the posted form from getting all the data.

Nevertheless, it will work for most usernames without changes. If you want it 100% right, there are some things you can do:

Some workarounds:
1) If you wanted you could install a hack by a guy named Reynoldovb that keeps users from including illegal characters in their username.
https://vborg.vbsupport.ru/showthread.php?t=73559&goto=newpost

2) Or you could simply (right, if you know html!) make your classifieds link into a simple form with a bunch of hidden fields that will pass the username using the POST method, without issue. You can just look at the html output of the search.php to find the right syntax and delete all the hidden fields you aren't going to use. That's pretty much what I did to get the link I used above.
I can pretty much guarantee you that you can get this to work using that method.
The search.php search form (be sure you look at what the html output that browser sees, not the raw code) starts with the line
Code:
<form action="search.php" method="post" name="vbform">
so start with that and end with </form> beneath it. Then start clipping. You only need the terms I listed in the search line above. and possibly the session id if you even care to support that. The only tricky part, and that is not really that difficult: you will need to pass the user's username also. That should not be a big deal in any template. Let me know if you need help with that part.

Regards,
Matt

P.S. Due to a problem with the way the board parses BBCODE, I had to modify the search link to make it work in the forum. The CODE bit has it correct. Basically I just dropped the brackets [] in the first link, because they were getting clipped off by vbulletin's bbcode parser.
Reply With Quote
Reply

Thread Tools
Display Modes

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 04:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05908 seconds
  • Memory Usage 2,163KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete