vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Release: Toggle Search Results between Posts + Threads (https://vborg.vbsupport.ru/showthread.php?t=88363)

Dockaych 10-11-2003 08:01 PM

Release: Toggle Search Results between Posts + Threads
 
1 Attachment(s)
Author: Dock

Description:This is a really, really, simple template modification. It basically adds the ability to choose whether to see the search results as posts or threads. I wanted to add this because I found it annoying using the 'simple search', but then realising I wanted to see posts instead of threads.

I realise that it's possible to click on the 'Searched for' text to go back to the search page, but this is nicer IMO :) I don't know whether this is useful for anyone.

EDIT: 1.1 - I changed the code so that it recognises whether it is on threads or posts, and offers to toggle to the other view.
EDIT: 1.2 - I fixed the code so that it doesn't show on the getnew page.

In the 'SEARCH-FORUMS' template, search for:
Code:

Search took <b>$searchtime</b> seconds.
and replace with:
Code:

Search took <b>$searchtime</b> seconds. 

<if condition="$action == 'getnew'">
<else />
    <if condition="$search[showposts]">
    <b><a href="search.php?$session[sessionurl]$searchquery&showposts=0&do=process">See results as 
threads</a></b>
    <else />
    <b><a href="search.php?$session[sessionurl]$searchquery&showposts=1&do=process">See results as posts</a></b>
    </if>
</if>

Example: See attached image

Dockaych 10-11-2003 11:28 PM

Notes:

This hack will also show up on the "search within this thread" results, but clicking either of the links will make no change to the current page. I should probably try to find a conditional to make it disappear for that page too.

Dockaych 10-19-2003 07:27 AM

I was wondering if anyone could help me to finish this hack. I still have problems with this code appearing within the 'search this thread' results. I've tried <if condition="$search[searchthread]"><else /> and <if condition="$search[searchthreadid]"><else /> and a wealth of others, but I can't see to find any way to turn off this hack on the 'search this thread' page. :( Can anyone help?


All times are GMT. The time now is 12:35 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.00895 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete