vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Add Search/Sort/Order in thread view (https://vborg.vbsupport.ru/showthread.php?t=39947)

bad_madman 06-16-2002 10:00 PM

Add Search/Sort/Order in thread view
 
Add sort, order, search, posts from user options at the end of the thread.

Latest version: 1.20 (6-27-2002)
- Bug fixed: at every search views counter is increased (link)

Features:
  • The following options are available:
    - Display posts from previous xx days
    - Sorted by Post date, User name, Subject, Attachement, Post length
    - Show the post of all/definite users (with number posts)
    - ascending/descending
    - Search in Thread
      » Show only posts in which the search string was found (v1.20)
      » Own replacement for highlighted words possible (v1.20)
      » String search in words
      » Also mark parts of words
  • Decide which options shall be shown (simple template change)!
  • Show message instead of a empty thread, if the sort result = 0 posts (v1.10)
  • This hack is compatible with:
    - TWTCommish's hack 'View All Attachments in Thread'
    - FireFly's beta hack 'Multiple Quotes'
  • Tested with vBulletin 2.0.3, 2.2.5, 2.2.6
  • It works with vBulletin 2.0.3 to 2.2.6 now.
  • Very simple installation:
    - 2 Templates must be made
    - 1 Template must be changed
    - 2 Files (showthread.php, admin/functions.php) must be changed
  • Look at the screenshot for more informations...
Updates 1.20 (6-24-2002):
- Show only posts in which the search string was found
- Own replacement for highlighted words possible
- String search in words
- Also mark parts of words
- Update instructions in download archive

Updates 1.10 (6-19-2002):
- Show message instead of a empty thread, if the sort result = 0 posts
- Now compatible with: FireFly's beta hack 'Multiple Quotes'
- Bug fixed: if you use the links 'Previous Thread' ... 'Next Thread' in thread...

Screenshots:
- Thread view

Installation:
- Read !readme.txt in ZIP-ARCHIV!

Download:

Broekie 06-17-2002 06:08 AM

kewl :)

putting it on the "To Install" list :)

X-Fan 06-17-2002 07:09 AM

Very, very cool hack, bad_madman!

This will make it heaps easier to moderate long threads! Thanks!

Floris 06-17-2002 07:15 AM

Hey this looks like fun, downloaded the file and I will look at it later :) Maybe even install it. Gonna discuss how needed this is for our forum. By the way, can this be made for only certain usergroups? So only registered members can use it, or only admins.

bad_madman 06-17-2002 09:30 AM

Quote:

Originally posted by xiphoid
...By the way, can this be made for only certain usergroups? So only registered members can use it, or only admins.
No problem. Only ONE line must be changed for this in the file showthread.php

Search after hack installation in showthread.php for:
Code:

eval("\$threadview_adds=\"".gettemplate("showthread_adds")."\";");
and replace with
Code:

if ($bbuserinfo[usergroupid]==x) eval("\$threadview_adds=\"".gettemplate("showthread_adds")."\";");
x = Usergroup. For example '...$bbuserinfo[usergroupid]==6...'

Xenon 06-17-2002 11:51 AM

hey, looks very good

good work

bad_madman 06-17-2002 12:02 PM

@xiphoid

In addition, you can remove options.
Open the template 'showthread_adds' and remove the options which you don't need.
For example:
Code:

<option value="attach" $ososel[attach]>Attachement</option>
<option value="length" $ososel[length]>Post Length</option>

Or remove a complete block. For example:
Code:

<b>in</b>
<select name="sor"><option value="asc" $sorsel[asc]>ascending</option>
<option value="desc" $sorsel[desc]>descending</option></select>


bluecat 06-17-2002 12:58 PM

Hi. Great hack. How can I change the color of the background to match my forum? Also, is there a way this can be added to all the pages? Right now it only shows up on individual threads. Thanks again. :)

bad_madman 06-17-2002 02:19 PM

I have changed the templates.
Reinstall the hack (only templates) or change the templates:
Search in template showthread_adds:
PHP Code:

<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextrawidth="100%"

and
Code:

</table>
and delete both lines...

Search in the template showthread for:
Code:

        </table>
        $threadview_adds

and replace with:
Code:

        $threadview_adds
        </table>


bluecat 06-17-2002 02:27 PM

Thank you very much. :)

The Piper 06-17-2002 02:40 PM

This hack is wonderful, this should definately be in vB 3. I specially like the possibility of searching in a thread only, since I always get lost when I get 80 threads as a result, each one of them with 50 pages! :)

Congrats and thanks for a great hack!

bluecat 06-17-2002 02:53 PM

Hmmm, still can't get the background color to change to my forum's colors...it's purple. Am I missing something or is there another way to do it? I tried both way (reinstalling and manually). Thanks again.

bluecat 06-17-2002 03:00 PM

Opp, my bad. I got it through my main colors page. :confused:

bad_madman 06-17-2002 03:29 PM

Search in template showthread_adds for:
Code:

<td colspan=4 align=center>
replace with:
Code:

<td colspan=4 bgcolor="{ tableheadbgcolor }" align=center>
Set for "tableheadbgcolor" your 'replacement'...

sorry :nervous:
Please, test it. I then change the Download. Thx.

edit:
1. not template "showthread" but template "showthread_adds"
2. { tableheadbgcolor } -> without blanks !

Recluse 06-17-2002 04:00 PM

ok installed, got a small problem tho, every search takes me the the new reply of the thread im currently looking at

bad_madman 06-17-2002 04:29 PM

@Recluse: After the search the complete thread is always shown. Become the search result (the words) highlightedly (highlight function). Do you mean this?

bluecat 06-17-2002 04:30 PM

Quote:

Originally posted by bad_madman
Search in template showthread_adds for:
Code:

<td colspan=4 align=center>
replace with:
Code:

<td colspan=4 bgcolor="{ tableheadbgcolor }" align=center>
Set for "tableheadbgcolor" your 'replacement'...

sorry :nervous:
Please, test it. I then change the Download. Thx.

edit:
not template "showthread" but template "showthread_adds"


Cool, yep, it works. Thanks. :)

bad_madman 06-17-2002 04:35 PM

@bluecat: Good. Very good. :classic:
Thx for your report. The Download was actualized.

bluecat 06-17-2002 05:06 PM

For what it's worth, I added a new replacement variable (Replacement > Add) and created {tableheadbgcolor2}, made this color it's own and edited it in the showthread_add to the new variable, giving me the option to change just this table's colors. :) Thanks again for the great hack.

Smoothie 06-17-2002 05:38 PM

will this work on older versions of vb

bad_madman 06-17-2002 07:58 PM

Quote:

Originally posted by Smoothie
will this work on older versions of vb
I am not sure. However, I think. I will test it. With which vB version do you work?

bad_madman 06-17-2002 09:38 PM

Quote:

Originally posted by bad_madman
I am not sure. However, I think. I will test it. With which vB version do you work?
I have small things at this hack changed (replaced the 'gobutton' by the image tag in template showthread_adds etc.). This hack should now work with older vBulletin versions :classic:

Smoothie 06-17-2002 10:21 PM

The latest version is now good to go with vb 2.2.2?

bad_madman 06-17-2002 11:09 PM

Quote:

Originally posted by Smoothie
The latest version is now good to go with vb 2.2.2?
Yes... works with 2.0.3 - 2.2.6

Smoothie 06-17-2002 11:51 PM

bad_madman,

That's probably the best set of install instructions I've ever seen. Absolutely perfect! Installed and works great. Thank you for this great hack.

Recluse 06-18-2002 04:08 AM

Quote:

Originally posted by bad_madman
@Recluse: After the search the complete thread is always shown. Become the search result (the words) highlightedly (highlight function). Do you mean this?

ok 2 part post :) when i go here to search

Recluse 06-18-2002 04:09 AM

it takes me here

bad_madman 06-18-2002 08:23 AM

Quote:

Originally posted by Recluse
it takes me here
Ahhh - I understand. Many thanks for Screenshots.
I believe the reason for the problem is the form tag (<form>...).
You probably use a form-tag in a form-tag (<form>.... <form>.....</form>....</form>).
The html source code or your URL would be helpfully.
You look the html source code on, whether it is so.
This probably sounds very complicated ?! :surprised:

You have already changed the Template before? Or is it still original? If it is still the original, then repeat the changes in the template "showthread" once again. You probably have inserted the line "$ threadview_adds" to a wrong place...

edit:
Hm. You have installed FireFly's beta hack 'Multiple Quotes...'? This is the reason.... I try to adapt my hack to the beta hack 'Multiple Quotes'.

Recluse 06-18-2002 01:59 PM

Quote:

Originally posted by bad_madman

Hm. You have installed FireFly's beta hack 'Multiple Quotes...'? This is the reason.... I try to adapt my hack to the beta hack 'Multiple Quotes'.


yep , now what :)

bad_madman 06-18-2002 03:08 PM

Quote:

Originally posted by Recluse
yep , now what :)
It would work, if you install the 'Multiple Quotes' update from B-b00gie -> Link or
you must put the button "Quote Selected" into the same line as "new thread" and "post reply".

In addition, you should change the template 'showthread' easily again. However, this is insignificant.
The form (<form> ... </form>) would stand within a table (<table> .... </table>) in front of <tr> (for example: <table><form><tr> ... </tr></form></table>), though.
It is usual to surround the complete table by the form (<form><table> ... </table></form>). However, this is unproblematic.

I change my hack for FireFly's hack 'Multiple Quotes', if there is still interest.

Recluse 06-18-2002 04:47 PM

ill give your suggestion a try after work tonight, let you know the outcome in about 12 hours

bad_madman 06-18-2002 11:53 PM

Quote:

Originally posted by Recluse
ill give your suggestion a try after work tonight, let you know the outcome in about 12 hours
https://vborg.vbsupport.ru/external/2002/06/2.gif thx !

However, take the new version 1.10 of the hack for this.

bad_madman 06-18-2002 11:58 PM

New version out: 1.10

Features/Updates
- Show message instead of a empty thread, if the sort result = 0 posts
- Now compatible with: FireFly's beta hack 'Multiple Quotes'
- Bug fixed: if you use the links 'Previous Thread' ... 'Next Thread' in thread...

Screenshots:
Screenshots in the first post.

Download:
The latest version is in the first post of this thread.

Recluse 06-19-2002 07:35 AM

ok reinstalled to the new version for the multi quote hack, this is what i get when searching

Warning: Variable passed to reset() is not an array or object in /home/cra++++/public_html/forums/showthread.php on line 749

Warning: Variable passed to each() is not an array or object in /home/cra++++/public_html/forums/showthread.php on line 750


Code:

        //highlight words for search engine
        if (isset($highlight)) {
                if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
749         reset($replacewords);
750         while (list($key,$val)=each($replacewords)){
                        $post['message']=preg_replace("/(^| |\n|\r|\t|\]|>|\")(".$val.")(([\.,]+[ $\n\r\t])|$|\"|<|\[| |\n|\r|\t)/si", "\\1<highlight>\\2</highlight>\\3", $post['message']);
                        }
                }
        }


bad_madman 06-19-2002 10:06 AM

Strange. Which version of vB do you use? It seems to be an old version.
Replace the complete highlight-part by this code.
PHP Code:

// words to highlight from the search engine
$replacewords = array();
if (isset(
$highlight) && $highlight != '') {
  
$highlight urldecode($highlight);
  
$highlightwords=explode(" ",str_replace("/","\/",quotemeta($highlight)));
  while (list(
$key,$val)=each($highlightwords)) {
    
$val strtolower($val);
    if (
$val=='or' OR $val=='and' OR $val=='not') {
      continue;
    }
    if (
$allowwildcards) {
      
$val str_replace("\*""[a-zA-z]+"$val);
    }
    
$replacewords[$key]="$val";
  }


edit:
code changed

BigJohnson 06-19-2002 10:13 AM

I already installed the old hack can some just post what i have to change in order to have it updated? That would help alot more thanks.

bad_madman 06-19-2002 10:41 AM

Quote:

Originally posted by BigJohnson
I already installed the old hack can some just post what i have to change in order to have it updated? That would help alot more thanks.
Update from v1.00 to 1.10:
Note: Remove all blanks between { and }
for example: ="{ secondaltcolor}
-------------- ^

search in template 'showthread_adds' for:
Code:

<input type="hidden" name="threadid" value="$threadid">
and replace with:
Code:

<input type="hidden" name="threadid" value="$threadid"><input type="hidden" name="goto" value="$goto">
Add new template "showthread_adds_notfound" and copy & paste this in:
Code:

<table bgcolor="{ pagebgcolor}" width="{ tablewidth}" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="{ imagesfolder}/space.gif" alt=""></td><td width="100%"><!-- spacer -->
<table cellpadding="{ tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{ tablebordercolor}" { tableouterextra} width="{ contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{ tableinnerborderwidth}" border="0" { tableinnerextra} width="100%">
<tr>
        <td bgcolor="{ secondaltcolor}" width="100%" nowrap><br><br><p align="center"><normalfont>No posts found</b><br>Please <a href="javascript:history.back()"><b>go back</b></a></normalfont></p><br></td>
</tr>
</table>
</td></tr></table>
<!-- spacer --></td><td width="10"><img width="10" height="1" src="{ imagesfolder}/space.gif" alt=""></td></tr></table>

Search in file "showthread.php" for:
Code:

$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage$threadnavi".iif(isset($highlight), "&highlight=$highlight", ""));
and replace with:
Code:

if ($totalposts<1) eval("\$postbits=\"".gettemplate("showthread_adds_notfound")."\";");
$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage$threadnavi".iif(isset($highlight), "&highlight=$highlight", ""));

That's all!

Recluse 06-19-2002 04:20 PM

using 2.2.2 with a few updates for securty, ill give your codea go when i return from work

Smoothie 06-19-2002 05:38 PM

bad_madman,

Maybe its me, but I had to remove this hack. It caused my showthread page queries to go from 23 to anywhere from 50-89 queries. Anyone else see this?

bad_madman 06-19-2002 08:13 PM

This is interesting. :surprised: I will have a look at this more exactly in my forum...


All times are GMT. The time now is 06:47 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.04428 seconds
  • Memory Usage 1,851KB
  • 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
  • (17)bbcode_code_printable
  • (2)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete