View Full Version : Add Search/Sort/Order in thread view
bad_madman
06-16-2002, 10:00 PM
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 (https://vborg.vbsupport.ru/showthread.php?postid=266478#post266478))
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 (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36416)'
- FireFly's beta hack 'Multiple Quotes (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36896)'
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 (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36896)'
- Bug fixed: if you use the links 'Previous Thread' ... 'Next Thread' in thread...
Screenshots:
- Thread view (http://www.securityzone.de/_badmadman/threadview.gif)
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
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:eval("\$threadview_adds=\"".gettemplate("showthread_adds")."\";");and replace withif ($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:<option value="attach" $ososel[attach]>Attachement</option>
<option value="length" $ososel[length]>Post Length</option>Or remove a complete block. For example:<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:<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">and</table>
and delete both lines...
Search in the template showthread for:
</table>
$threadview_addsand replace with: $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:<td colspan=4 align=center>replace with:<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
Originally posted by bad_madman
Search in template showthread_adds for:<td colspan=4 align=center>replace with:<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
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
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
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
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
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
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
Originally posted by Recluse
yep , now what :)
It would work, if you install the 'Multiple Quotes' update from B-b00gie -> Link (https://vborg.vbsupport.ru/showthread.php?postid=246109#post246109) 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
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 (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36896)'
- Bug fixed: if you use the links 'Previous Thread' ... 'Next Thread' in thread...
Screenshots:
Screenshots in the first post (https://vborg.vbsupport.ru/showthread.php?postid=262372#post262372).
Download:
The latest version is in the first post (https://vborg.vbsupport.ru/showthread.php?postid=262372#post262372) 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
//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.
// 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
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:
<input type="hidden" name="threadid" value="$threadid">and replace with:<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:
<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:
$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage$threadnavi".iif(isset($highlight), "&highlight=$highlight", ""));and replace with:
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...
Smoothie
06-19-2002, 08:30 PM
Depending on the number of posts in each thread, I saw queries as hig as 89, but just on the showthreads. On every other page it was normal. My normal amount of queries on showthreads is about 26-28. After I took the hack out, showthreads page went back to normal.
bad_madman
06-19-2002, 10:06 PM
The problem is found and cleared.
Update follows...
@Smoothie:
Many many thanks for your note :classic: :cool:
edit:
Download was actualized.
Smoothie
06-20-2002, 12:30 AM
The new version is in the first post?
bad_madman
06-20-2002, 12:46 AM
yep
Smoothie
06-20-2002, 01:15 AM
how many queries are you seeing with the new version?
bad_madman
06-20-2002, 01:21 AM
With installed new version of the hack it is only still 2 queries more now... :classic:
But this isn't avoidable. If you still liked to have a query less, then copy the contents of template "showthread_adds" into the template "showthread" (replace $threadview_adds with that) and remove the template "showthread_adds". You still then remove the line
eval("\$threadview_adds=\"".gettemplate("showthread_adds")."\";"); in file showthread.php.
That's all. It is then only ONE query. But this everything for a query less ? ;) ;)
Smoothie
06-20-2002, 05:17 AM
bad_madman,
thanks for the update. I'll install and let ya know how it goes.
Smoothie
06-20-2002, 06:05 AM
Nice! Works great! Thanks. :)
Velocd
06-21-2002, 02:17 AM
Great hack, but the only problem I have found is that the string-search option doesn't work at all! I can type a specific word in somebody's post and hit the submit button, but all it does is refresh the page. Anybody else getting the search option to work? Which is basically the reason I need this hack ;)
Smoothie
06-21-2002, 02:21 AM
It does however highlight the word in red.
Velocd
06-21-2002, 03:26 AM
My search is bugged then, it doesn't highlight nor find :(
Attached is a picture, incase anybody is wondering, of what this hack looks like (except it doesn't come with my template modifications ;))
Velocd
06-21-2002, 03:40 AM
Sorry for the double post, though it does work! I just rechecked it and the search words are in red. This hack is totally awesome bad_badman, and should be a definate nomination for hack of the month. If it were implemented on these forums it would make searching within huge threads so much easier! We just need FireFly to look at this...
BigJohnson
06-21-2002, 09:14 AM
Well i am getting a problem. I upgraded not doing the first post ove rbut just adding and editing the post that i asked for. Just to add what i need to update. i don't no if you told me the wrong thing to update but i did a test on my forums. In one post i have several posts with the word STUFF in it and i searched that word and then i get only one highlighted word stuff. Thats it. All the other words are not highlighted at all. Plus if i search for a word not in the post it wont give me that error message that the update is all about.
BigJohnson
06-21-2002, 09:17 AM
ok never mind it works. But it is wierd. It doesnt show the word stuff in the last post. i dont no why it is doing that but that is the only word it does it for. Wierd. Also i am still not getting any error screen. What is wrong witht that?
And also one of my templates is red so that is a problem. Is there any way we can use a replacement variable for this hack? So i can then change the replace ment variable for the HIGHLIGHTED word colors? That owuld be great because every style on my boar dhas its on replacement variable.
Boofo
06-21-2002, 09:22 AM
I am getting 2 black boxes (1 on either side of the not found window when it displays). Has anyone else run into this problem?
BigJohnson
06-21-2002, 09:24 AM
I dont get the error screen at all. It is wierd. i just geta refreshed page.
Boofo
06-21-2002, 09:24 AM
It also will only refesh the page if it doesn't find the word it is looking for. Is there a way to have it tell you that it can't find the word you are looking for?
Originally posted by Smoothie
It does however highlight the word in red.
BigJohnson
06-21-2002, 09:29 AM
Well that was the whole point of the new updated version in. read throught the thread it is on page 3. There is no error screen and there is suppose to be one.
bad_madman
06-21-2002, 12:14 PM
Originally posted by Boofo
I am getting 2 black boxes (1 on either side of the not found window when it displays). Has anyone else run into this problem? Your original postbit template is very changed. You also have an unusual but nice design :) You must adapt the template showthread_adds_notfound to your postbit template. You then don't get the black boxes any more.
bad_madman
06-21-2002, 04:55 PM
Originally posted by BigJohnson
...Also i am still not getting any error screen. What is wrong witht that?... The error screen only comes, if this sort result (not the search result!!) doesn't give any posts back.Originally posted by BigJohnson
...And also one of my templates is red so that is a problem. Is there any way we can use a replacement variable for this hack? So i can then change the replace ment variable for the HIGHLIGHTED word colors? That owuld be great because every style on my boar dhas its on replacement variable.... This is a little more complicated. I have a fast solution here. This also more simply works certainly... :rolleyes:
- Make your replacements:
</myhighlight> is replaced by </font></i></b>
<myhighlight is replaced by <b><i><font color="red"
- Search in showthread.php for:
if (isset($highlight) and $highlight!="search") {$src[string]="$highlight";}
- and replace with:
if (isset($highlight)) {$src[string]="$highlight"; $myhighlight=1;}
- Search in admin/functions.php for:
//highlight words for search engine
if (isset($highlight) && $highlight != '') {
if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
reset($replacewords);
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']);
}
}
}and replace with:
global $myhighlight;
//highlight words for search engine
if (isset($highlight) && $highlight != '') {
if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
reset($replacewords);
while (list($key,$val)=each($replacewords)) {
if ($myhighlight) {$highl1="<myhighlight>";$highl2="</myhighlight>";} else {$highl1="<highlight>";$highl2="</highlight>";}
$post['message']=preg_replace("/(^| |\n|\r|\t|\]|>|\")(".$val.")(([\.,]+[ $\n\r\t])|$|\"|<|\[| |\n|\r|\t)/si", "\\1$highl1\\2$highl2\\3", $post['message']);
}
}
}
That's all ??!
Boofo
06-21-2002, 05:42 PM
I just added the above code to my board and I get an error on this line every time I do a search for a specific word now.
$post['message']=preg_replace("/(^| |\n|\r|\t|]|>|\")(".$val.")(([.,]+[ $\n\r\t])|$|\"|<|[| |\n|\r|\t)/si", "\1$highl1\2$highl2\3", $post['message']);
The error I get is:
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Warning: Compilation failed: missing terminating ] for character class at offset 57 in /home/virtual/site3/fst/var/www/html/forum/admin/functions.php on line 358
Any ideas how I can fix this, please? :)
BigJohnson
06-21-2002, 06:58 PM
Well i am sorry but i am sorta lost at the replacements part. What do i exactly do. I have a code to find insert. Lol. I am new with replacements because i havent used them that much. Thanks for the quick reply though.
Boofo
06-22-2002, 12:53 AM
bad_madman,
Any ideas yet why I am getting the error I wrote about a couple of posts back?
bad_madman
06-22-2002, 01:07 AM
Originally posted by Boofo
bad_madman,
Any ideas yet why I am getting the error I wrote about a couple of posts back? Ouh sorry.
The code from my post (https://vborg.vbsupport.ru/showthread.php?action=showpost&postid=264044) was wrong.
Having been missing a couple of things there.
Replace the code in the file admin/functions.php with the new code in this post (https://vborg.vbsupport.ru/showthread.php?action=showpost&postid=264044).
Boofo
06-22-2002, 01:23 AM
Ok, that fixed the error I was getting, but now if I search for a word that is not in any messages, it just redraws the screen instead of giving me the GO BACK box. And the highlighted word is in italics too. I like it like that but it might be a good idea to make that an option. :)
Originally posted by bad_madman
Ouh sorry.
The code from my post (https://vborg.vbsupport.ru/showthread.php?action=showpost&postid=264044) was wrong.
Having been missing a couple of things there.
Replace the code in the file admin/functions.php with the new code in this post (https://vborg.vbsupport.ru/showthread.php?action=showpost&postid=264044).
bad_madman
06-22-2002, 02:35 AM
Originally posted by Boofo
Ok, that fixed the error I was getting, but now if I search for a word that is not in any messages, it just redraws the screen instead of giving me the GO BACK box. And the highlighted word is in italics too. I like it like that but it might be a good idea to make that an option. :)
Ok. You have persuaded me... *fgg
I plan another one couple of additional search options.
- Show only posts in which the search string was found.
- Show a message (with go back ;)), if the search string wasn't found.
Boofo
06-22-2002, 02:39 AM
You are the man! I will be anxiously waiting and wanting this one! :):):)
Originally posted by bad_madman
Ok. You have persuaded me... *fgg
I plan another one couple of additional search options.
- Show only posts in which the search string was found.
- Show a message (with go back ;)), if the search string wasn't found.
Velocd
06-22-2002, 02:59 AM
Same here ;)
Smoothie
06-22-2002, 04:26 AM
me too
BigJohnson
06-22-2002, 08:01 AM
Originally posted by BigJohnson
Well i am sorry but i am sorta lost at the replacements part. What do i exactly do. I have a code to find insert. Lol. I am new with replacements because i havent used them that much. Thanks for the quick reply though.
Can you please help me with this.
Edgar
06-22-2002, 09:20 AM
I get a few erros as soon I uploaded my modified showthread.php file, can anybody help me?
Database error in vBulletin 2.2.6:
Invalid SQL:
SELECT post.postid FROM post
WHERE post.threadid='3351' AND post.visible=1 ORDER BY LIMIT 0,15
mysql error: You have an error in your SQL syntax near 'LIMIT 0,15
' at line 3
mysql error number: 1064
Date: Saturday 22nd of June 2002 06:11:46 AM
Script: http://www.avalancheonline.net/forums/forums/showthread.php?s=&threadid=3351
Referer: http://www.avalancheonline.org/forums/forumdisplay.php?s=&forumid=3
bad_madman
06-22-2002, 11:29 AM
Originally posted by Edgar
...I get a few erros as soon I uploaded my modified showthread.php file, can anybody help me?...
Something seems to be missing there. Check the place still time. In the file showthread.php must be at this place:$getpostids=$DB_site->query("
SELECT post.postid FROM post
WHERE post.threadid='$threadid' AND post.visible=1$threadadds
ORDER BY $osofin $postorder LIMIT ".($limitlower-1).",$perpage
");
bad_madman
06-22-2002, 11:35 AM
Originally posted by BigJohnson
Can you please help me with this. Go to the vB admin CP area.
1st replacement:
- Click there on Replacements -> Add.
- Code to find: <myhighlight
- Code to insert: <b><i><font color="red"
2nd replacement:
- Click there on Replacements -> Add.
- Code to find: </myhighlight>
- Code to insert: </font></i></b>
Edgar
06-22-2002, 01:05 PM
Ok, I found it, my showthread file was a little messed up and the quick reply box interfered somehow, I readded all the hacks in it and it seems to be working fine now.
Great hack madman and thanks!
Cheers.
BigJohnson
06-22-2002, 07:58 PM
OK your thing worked great for the different templates. Thank you so much. You are the best.
bad_madman
06-24-2002, 09:16 PM
New version out: 1.20
Updates
- 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
Screenshots:
Screenshots in the first post (https://vborg.vbsupport.ru/showthread.php?postid=262372#post262372).
Download:
The latest version is in the first post (https://vborg.vbsupport.ru/showthread.php?postid=262372#post262372) of this thread.
Boofo
06-24-2002, 10:00 PM
Is there any update instruction if we have it installed already? :) You know how bad my template had to be redone. :)
Originally posted by bad_madman
[B]New version out: 1.20
bad_madman
06-24-2002, 11:20 PM
Ok, I changed the download file again. The update instruction are contained in the download archive now :) ... run sqltodos.php and then select "Click here for an update installation from v1.10"...
Originally posted by Boofo
Is there any update instruction if we have it installed already? :) You know how bad my template had to be redone. :)
bad_madman
06-27-2002, 01:29 PM
Somebody had complained that at every search the views counter one is increased :surprised: :nervous: This can be changed (is recommendable) :classic:
Search in showthread.php for:
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
}
and replace with:
if ($ownsearch!=1) {
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
}
}
that's all
edit:
wrong code
Birdie501
07-11-2002, 04:42 PM
Hi, nice hack!!
i installed the hack that shows the number of posts and direct link in that thread! If you search the thread and the result is shown the numbers change and start again with 1.
Is it possible to keep the original numbers?
So if a post is the third post in this thread (post #3), this number will also be shown in the search result?
Otherwise it is a little bit confusing.
Also how can i get back to the thread after searching? Because after the search there is no button where i can reset the search?
Hope you understand what i mean, is a little bit difficult for me to explain in english :)
Thanks
Birdie501
07-11-2002, 05:08 PM
another thing: I have the contract/expand post hack installed, but after installation of this hack the images for contracting/expanding are not shown??????
BigJohnson
07-11-2002, 08:09 PM
That addon for the VIEWS thing that is up a couple of posts. You said to replace the code with that code. Well I have the STORE hack installed so it looks a little different can you help me please. What do i do about it. This is what my code looks like thanks.
if ($noshutdownfunc) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
// Store hack by Lesane
$storeview=$DB_site->query_first("select views, postuserid from thread WHERE threadid='$threadid'");
$views=$storeview[views];
$postuserid=$storeview[postuserid];
$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$view1=$storeadmin[view1];
$view2=$storeadmin[view2];
$view3=$storeadmin[view3];
$view4=$storeadmin[view4];
$view5=$storeadmin[view5];
$viewpoint1=$storeadmin[vpoint1];
$viewpoint2=$storeadmin[vpoint2];
$viewpoint3=$storeadmin[vpoint3];
$viewpoint4=$storeadmin[vpoint4];
$viewpoint5=$storeadmin[vpoint5];
if ($views == $view1)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint1 where userid='$postuserid'");
}
elseif ($views == $view2)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint2 where userid='$postuserid'");
}
elseif ($views == $view3)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint3 where userid='$postuserid'");
}
elseif ($views == $view4)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint4 where userid='$postuserid'");
}
elseif ($views == $view5)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint5 where userid='$postuserid'");
}
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
// Store hack by Lesane
$storeview=$DB_site->query_first("select views, postuserid from thread WHERE threadid='$threadid'");
$views=$storeview[views];
$postuserid=$storeview[postuserid];
$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$view1=$storeadmin[view1];
$view2=$storeadmin[view2];
$view3=$storeadmin[view3];
$view4=$storeadmin[view4];
$view5=$storeadmin[view5];
$viewpoint1=$storeadmin[vpoint1];
$viewpoint2=$storeadmin[vpoint2];
$viewpoint3=$storeadmin[vpoint3];
$viewpoint4=$storeadmin[vpoint4];
$viewpoint5=$storeadmin[vpoint5];
if ($views == $view1)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint1 where userid='$postuserid'");
}
elseif ($views == $view2)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint2 where userid='$postuserid'");
}
elseif ($views == $view3)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint3 where userid='$postuserid'");
}
elseif ($views == $view4)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint4 where userid='$postuserid'");
}
elseif ($views == $view5)
{
$DB_site->query("UPDATE user SET storep=storep+$viewpoint5 where userid='$postuserid'");
}
}
if ($bbuserinfo[cookieuser]) {
vbsetcookie("bbthreadview[$threadid]",time(),0);
bad_madman
07-13-2002, 12:04 AM
Originally posted by Birdie501
Hi, nice hack!!
i installed the hack that shows the number of posts and direct link in that thread! If you search the thread and the result is shown the numbers change and start again with 1.
Is it possible to keep the original numbers...
...Also how can i get back to the thread after searching? Because after the search there is no button where i can reset the search?...
Thanks A couple of good suggestions :classic: I will write an update. I have little time at the moment. :surprised: But the update comes... ! ;)
Originally posted by Birdie501
Hope you understand what i mean, is a little bit difficult for me to explain in english :)Hehe, h?ttest es auch in deutsch versuchen k?nnen *fgggOriginally posted by Birdie501
another thing: I have the contract/expand post hack installed, but after installation of this hack the images for contracting/expanding are not shown?????? I will install the hack and let you know...
bad_madman
07-13-2002, 12:17 AM
Originally posted by BigJohnson
That addon for the VIEWS thing that is up a couple of posts. You said to replace the code with that code. Well I have the STORE hack installed so it looks a little different can you help me please. What do i do about it. This is what my code looks like thanks....
Search for:
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
and replace with:if ($ownsearch!=1) {
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
}
and search for:
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
and replace with:if ($ownsearch!=1) {
$shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
}
That's all...
Birdie501
07-16-2002, 06:09 AM
Hi,
i made an addon for this great hack. The user can choose if he wants to see the search form or not! He can enable/disable it in his options!
Details in zip file.
Have fun.
:cool:
Larry@IOG
08-25-2002, 04:29 PM
Wheres the detailed insructions on how to install this hack? I downloaded the zip file but it looks very confusing to me
Thanks
Larry Jude
groovesalad
10-15-2002, 11:59 PM
I get this error:
Parse error: parse error in /www/g/groove_salad/htdocs/forum/showthread.php on line 200
Bison
10-16-2002, 01:31 AM
Excellent work! My team members love this one!
X-Fan
11-10-2002, 11:01 PM
Quick question about this hack - it seems to be adding a *LOT* of queries on the showthread page. Is there any way to reduce this?
X-Fan
11-11-2002, 09:56 PM
Okay, I installed the fix and the upgraded version, and now this hack isn't showing up at all on any threads!
Can someone help with this, please?
Gutspiller
04-13-2003, 08:55 PM
demo?
tiedyetoga
02-06-2004, 05:36 PM
Thanks.
r0bitnet
02-11-2004, 12:40 PM
I've skimmed through the posts and didn't notice an answer for this question... will this hack work with vb 2.3.4? I assume it will but I didn't see anything in the doc that specificly says it does. I backed up functions.php and showthread.php. is that the only 2 files that need to be backed up incase this hack isn't compatable? thanks
tiedyetoga
02-16-2004, 02:26 PM
Anyone have an answer to r0b's post?
tiedyetoga
03-02-2004, 12:51 PM
Anyone get this to work on 2.3.4?
noonespecial
04-06-2004, 01:41 AM
Anyone get this to work on 2.3.4?
this is needed for 3.0 anyone?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.