Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[UBBT 6.0] Search Page Upgrade
#220375 07/02/2002 10:13 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
This will allow the user to specify searching the subject or body only or both. It also allows specifying the username in addition to the search criteria and not as an either/or option.

This also provides the fix so that showflat.php and showthreaded.php display your multiple word search results all words are highlighted.

There seemed to be an error for me in dosearch.php where the line

if ($Searchpage 0) {

is used.

I had to change this to

if ($Searchpage) {

to make it work for me.


Give me some feedback on how this goes. It may need some adjusting.

Attached Files
51739-searchupgrade.zip (0 Bytes, 14 downloads)
Sponsored Links
Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220376 07/02/2002 10:40 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
seems to be working well here.. let me know if it looks like I did something wrong

In dosearch, my file looks like this:

if ($Searchpage < 0) {
$html -> not_right($ubbt_lang['NO_MORE'],$Cat);
}


- Allen wavey
- What Drives You?
Re: [UBBT 6.0] Search Page Upgrade
SurfMinister #220377 07/02/2002 10:50 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
That's probably how it should look.

I just looked again at my last download from the members area of ubbthreads-6-0-2.tar.gz and it does look like what I showed. Is your file from an earlier version?

Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220378 07/02/2002 10:54 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I don't think so, tho I may have missed it in an earlier "upgrade"


- Allen wavey
- What Drives You?
Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220379 07/03/2002 11:28 AM
Joined: Jan 2000
Posts: 796
MTO Offline
Addict
Offline
Addict
Joined: Jan 2000
Posts: 796
My ubbthreads-6-0-2.tar.gz says the same as AllenAyres:
[:"#666666"]
if ($Searchpage < 0) {
$html -> not_right($ubbt_lang['NO_MORE'],$Cat);
} [/]

Sponsored Links
Re: [UBBT 6.0] Search Page Upgrade
D_Wolfwood #220380 07/03/2002 4:21 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
Now I'm going to have to go download it again. LoL I wonder how that can be? I looked at the file again and it does not have the < in it.

Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220381 07/03/2002 4:35 PM
Joined: Feb 2002
Posts: 1,759
Addict
Offline
Addict
Joined: Feb 2002
Posts: 1,759
That is odd. Thanks for the hack btw, works great

Re: [UBBT 6.0] Search Page Upgrade
D_Wolfwood #220382 07/03/2002 4:50 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
posted by MTO:
My ubbthreads-6-0-2.tar.gz says the same as AllenAyres:
[:"#666666"]
if ($Searchpage < 0) {
$html -> not_right($ubbt_lang['NO_MORE'],$Cat);
} [/]


I just downloaded it again and know what? Mine doesn't say that... LoL

Perhaps winzip is removing things? LoL I hope not.

Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220383 07/03/2002 5:00 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
do do do do ...

sounds like the twilight zone


- Allen wavey
- What Drives You?
Re: [UBBT 6.0] Search Page Upgrade
SurfMinister #220384 07/03/2002 5:09 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
LoL yes it is rather bewildering...

Sponsored Links
Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220385 07/04/2002 6:35 PM
Joined: Jun 2002
Posts: 375
Enthusiast
Offline
Enthusiast
Joined: Jun 2002
Posts: 375
Hmm, I'm getting some ugly SQL errors on 6.0.2 on win32...

Check them out if you dare! LOL

http://www.newoutriders.org/ubbtest/search.php

Re: [UBBT 6.0] Search Page Upgrade
neuron #220386 07/04/2002 11:50 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
There needs to be a space on each side of the OR

(B_Body LIKE '%dddd%')OR (B_Subject LIKE '%dddd%') )

should be looking like this (of course if there are no errors you wont see this)

(B_Body LIKE '%dddd%') OR (B_Subject LIKE '%dddd%') )


Hope that helps.

Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220387 07/05/2002 1:29 AM
Joined: Jun 2002
Posts: 375
Enthusiast
Offline
Enthusiast
Joined: Jun 2002
Posts: 375
OK, I think I got the spacing fixed but I still get the error. I have a space in front of each AND and OR now in the code added to the dosearch.php

Re: [UBBT 6.0] Search Page Upgrade
neuron #220388 07/05/2002 1:58 AM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
That is odd. Could you post your code and template changes? I'll see if I can spot what went wrong.

[UBBT 6.0] Search Page Upgrade (PATCH)
sjsaunders #220389 07/07/2002 6:12 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
This patch will make the "Show all user's posts" link in the profiles work correctly.

Above this line:

if (($Match == "Or") && ($Words)) {

add this:

if ($Match == "Username") {
$Match = "";
$ByUsername = $Words;
$Words = "";
}


I have attached the updated instructions.

Attached Files
52117-searchupgrade.2.0.zip (0 Bytes, 7 downloads)
Re: [UBBT 6.0] Search Page Upgrade (PATCH)
sjsaunders #220390 07/07/2002 6:41 PM
Joined: May 1999
Posts: 149
Enthusiast
Offline
Enthusiast
Joined: May 1999
Posts: 149
small error

Hi Dave,
Just installed this one, works great! Thanks.
A typo: you mention that in dosearch.php, you need to replace
if ($Searchpage 0) {
with
if ($Searchpage) {

But it looks like in the latest version, the problem was fixed in the base code... and it looks like it should really be

if ($Searchpage < 0) {

Regards,
Max



Re: [UBBT 6.0] Search Page Upgrade (PATCH)
Maze_Brendan #220391 07/07/2002 6:47 PM
Joined: Mar 2002
Posts: 305
Enthusiast
Offline
Enthusiast
Joined: Mar 2002
Posts: 305
posted by Max Fisch:
small error

and it looks like it should really be

if ($Searchpage < 0) {

Regards,
Max



Shhhhh-- Dave can't see the [:"red"] < [/] and swears it isn't there.


[:"red"]Lisa[/]
Re: [UBBT 6.0] Search Page Upgrade (PATCH)
Maze_Brendan #220392 07/07/2002 6:49 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
LoL this has been gone over in this thread. When I look at a fresh dosearch.php script right out of the .tar.gz file from the latest version release I have that error.

Oddly enough, someone sent me a dosearch.php script that they could not make work with the hack and I noticed they had the same error.

I have no idea why some have it (mostly me) and some dont.


So if your dosearch.php doesn't match the line that needs changing you probably shouldn't change it.

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
JacquiL #220393 07/07/2002 6:50 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
posted by Lisa_P:
posted by Max Fisch:
small error

and it looks like it should really be

if ($Searchpage < 0) {

Regards,
Max



Shhhhh-- Dave can't see the [:"red"] < [/] and swears it isn't there.




LoL @ Lisa


I swear!

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
sjsaunders #220394 07/07/2002 8:27 PM
Joined: May 1999
Posts: 149
Enthusiast
Offline
Enthusiast
Joined: May 1999
Posts: 149
Got it... but I was trying to say that if someone does need to change it, they should change it to " < 0 " as opposed to removing the 0 as your latest attached instructions state.

Cheers,
Max

Last edited by Max Fisch; 07/07/2002 8:28 PM.
Re: [UBBT 6.0] Search Page Upgrade (PATCH)
Maze_Brendan #220395 07/07/2002 8:32 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
Yeah I thought of that after I uploaded it. I forgot that Allen had showed me what it should look like. LoL wish there was a way to edit attachments.

Perhaps I'll fix that and then uploaded to the finished mods section.

Not much else to do with this one. Is anyone else besides Aglavalin having problems with this hack on a windows box?

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
sjsaunders #220396 07/07/2002 9:04 PM
Joined: Feb 2002
Posts: 1,759
Addict
Offline
Addict
Joined: Feb 2002
Posts: 1,759
posted by JustDave:
This patch will make the "Show all user's posts" link in the profiles work correctly.

Above this line:

if (($Match == "Or") && ($Words)) {

add this:

if ($Match == "Username") {
$Match = "";
$ByUsername = $Words;
$Words = "";
}


I have attached the updated instructions.


Hey Dave, saw a new attachment in this post. Can we just use the patch you mentioned or is there something else new in the new attachment?

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
palmen #220397 07/07/2002 9:26 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
If your search is working then all you probably need is the patch.

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
sjsaunders #220398 07/07/2002 9:30 PM
Joined: Feb 2002
Posts: 1,759
Addict
Offline
Addict
Joined: Feb 2002
Posts: 1,759
great, patched up and working fine. Thanks!

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
sjsaunders #220399 07/17/2002 11:36 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
posted by JustDave:
Yeah I thought of that after I uploaded it. I forgot that Allen had showed me what it should look like. LoL wish there was a way to edit attachments.



Check out scream's latest changes to 6.1, that's coming

I think I may have found a buglet with this or in the base code. I was looking for a php editor and typed that in the search box and got this:
click me

Seems it inserts a bold tag around every instance of php, even when it's a link to a smiley here, since /php/ is in the url Someway to fix this? I thought rick had fixed it in the base code.


- Allen wavey
- What Drives You?
Re: [UBBT 6.0] Search Page Upgrade (PATCH)
SurfMinister #220400 07/17/2002 11:46 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
hmmmm perhaps adding a space before and after the word that is to be highlighted?

In the showflat.php script try changing this:

$Body = @eregi_replace($searchwords[$x],"<b><i>".$searchwords[$x]."</i></b>",$Body);
$Body = preg_replace("|(<a\s*[^>]+)<b><i>(\Q$searchwords[$i]\E)</i></b>([^>]*>)|i","\\1\\2\\3",$Body);


to this:

$Body = @eregi_replace(" $searchwords[$x] ","<b><i>".$searchwords[$x]."</i></b>",$Body);
$Body = preg_replace("|(<a\s*[^>]+)<b><i>(\Q $searchwords[$i] \E)</i></b>([^>]*>)|i","\\1\\2\\3",$Body);


(I think that's how it would be... lol)

showthreaded.php may be the same as well...

Search PM:s
sjsaunders #220401 08/01/2002 11:44 PM
Joined: May 1999
Posts: 1,715
Addict
Offline
Addict
Joined: May 1999
Posts: 1,715
I've added the possibility for users to search through their sent and received PM:s to this hack. Instead of selecting a forum to search for, an PM-option can be selected instead. There is also a quick search box added to the PM box on My Home.

At the moment the code is a bit ugly, it works, but since the search is somewhat different for PM:s there is a lot of if statements. I don't really like that everything inside the loop that iterates through the search results is within an if statement and it does different things based on if the user searches the PM:s or the posts. I've also done an extra template for the PM:s search results. But I've used the normal search script because I didn't want to have two search pages and much of the code that builds the query is the same.

If anyone is interested in this hack I'll try to clean it up a bit and make instructions for it.

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
palmen #220402 08/07/2002 10:10 AM
Joined: Jan 2001
Posts: 374
Enthusiast
Offline
Enthusiast
Joined: Jan 2001
Posts: 374
There is still a bug.
I did Search for Username and typed my name.

I see more than one page. Good.
I click the forward button and I see not only my messages but tons of other messages too...

(You can try the search here at ubbdev.com and you see what I mean.)

Greetings

Last edited by caymuc; 08/07/2002 10:12 AM.
Re: [UBBT 6.0] Search Page Upgrade (PATCH)
rodrigo1 #220403 08/07/2002 9:04 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
After this part of the hack code:


if ($Match == "Username") {// profile "Show all user's posts" search link fix
$Match = "";
$ByUsername = $Words;
$Words = "";
}


add this:


$EByUsername = rawurlencode($ByUsername);



And add the variables to the navigation links in the dosearch.tmpl file:

<a href="{$config['phpurl']}/dosearch.php?Cat=$Cat&Forum=$URLForum&Words=$URLWords&Match=$URLMatch&Searchpage=$prevpage&Limit=$Limit&Old=$Old">

and

<a href="{$config['phpurl']}/dosearch.php?Cat=$Cat&Forum=$URLForum&Words=$URLWords&Match=$URLMatch&Searchpage=$nextpage&Limit=$Limit&Old=$Old">



would be:



<a href="{$config['phpurl']}/dosearch.php?Cat=$Cat&ByUsername=$EByUsername&Forum=$URLForum&Words=$URLWords&Match=$URLMatch&Searchpage=$prevpage&Limit=$Limit&Old=$Old">

and

<a href="{$config['phpurl']}/dosearch.php?Cat=$Cat&ByUsername=$EByUsername&Forum=$URLForum&Words=$URLWords&Match=$URLMatch&Searchpage=$nextpage&Limit=$Limit&Old=$Old">



Not sure if this will work. Just guessing.

Re: [UBBT 6.0] Search Page Upgrade (PATCH)
sjsaunders #220404 08/08/2002 3:08 AM
Joined: Jan 2001
Posts: 374
Enthusiast
Offline
Enthusiast
Joined: Jan 2001
Posts: 374
Hi Dave,
thank you very much for the fix!!!

I tested it:

*show all messages of other user (profile): ok
*show all messages of myself (profile): ok
*Seach for all posts of other username: ok
*Seach for all posts of myself: does not work
(That means if I click: show next page 3 times here: ERROR)

UPDATE: I was too quick, for some reason now ALL seems to work. No idea what I did wrong, when testing!!!!

Anyone else see this too?

Last edited by caymuc; 08/08/2002 3:13 AM.
Re: [UBBT 6.0] Search Page Upgrade (PATCH)
rodrigo1 #220405 08/08/2002 7:30 AM
Joined: May 1999
Posts: 1,715
Addict
Offline
Addict
Joined: May 1999
Posts: 1,715
Nope, all seems to work for me after adding the patch.

Re: Search PM:s
c0bra #220406 08/09/2002 12:33 PM
Joined: Mar 2002
Posts: 305
Enthusiast
Offline
Enthusiast
Joined: Mar 2002
Posts: 305
[]I've added the possibility for users to search through their sent and received PM:s


I'd LOVE to see this!


[:"red"]Lisa[/]
Re: Search PM:s
JacquiL #220407 08/10/2002 5:21 PM
Joined: May 1999
Posts: 1,715
Addict
Offline
Addict
Joined: May 1999
Posts: 1,715
It's coming, it is finished, I just need to write the install instructions. I got sidetracked on fixing some bugs in threads and writing the BypassModeration mod. It will probably take a couple of days until it's ready though.

Search Page Upgrade 3.0beta (Search PM)
sjsaunders #220408 08/18/2002 8:18 PM
Joined: May 1999
Posts: 1,715
Addict
Offline
Addict
Joined: May 1999
Posts: 1,715
New to this version
I've added the possibility to search the Private Messages. I hope I've got all the instructions correct, but I'm not sure. Please let me know if it works. =]

Mod Name / Version Searchpage Upgrade 3.0beta
Description This will add the option to search subject or body or both. Also, it allows for a seperate username field so searches can be done with specific criteria along with the username. It also allows for users to search through their sent and received Private Messages.
Working under UBB.threads 6.0.3
Any pre-requisites None
Author(s) Dave Lozier, Gardener
Credits Gardener for adding the PM-search.
Demo Not at the moment
Files Altered dosearch.tmpl, dosearch.php, myhome.tmpl, languages/dosearch.php
Database Altered No
New Files dosearch_PM.tmpl
Any other info This hack is heavily based on the Searchpage Upgrade 2.0 hack by Dave Lozier.

Attached Files
54327-Searchpage_Upgrade-3_0beta.zip (0 Bytes, 17 downloads)
Re: Search Page Upgrade 3.0beta (Search PM)
c0bra #220409 08/29/2002 6:50 PM
Joined: Aug 2002
Posts: 51
Power User
Offline
Power User
Joined: Aug 2002
Posts: 51
What are the chances this will work if I install on 6.1b1 ?

I just thought id ask before attempting it on a test board

Re: Search Page Upgrade 3.0beta (Search PM)
FlamingoWorld #220410 08/29/2002 7:13 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
I haven't seen the new code Gardener has added but from what I can remember there shouldn't be a problem with what I had added. Has anyone else got this running with 6.1 BR1 ?

Re: Search Page Upgrade 3.0beta (Search PM)
sjsaunders #220411 08/29/2002 7:48 PM
Joined: May 1999
Posts: 1,715
Addict
Offline
Addict
Joined: May 1999
Posts: 1,715
And I haven't seen 6.1b1 yet so I can't really tell either. But if the original code works, this version has a good chance of working as well.

Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220412 09/24/2002 7:30 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
Yes, once again I had problems with this:

code:

if ($Searchpage 0) {
$html -> not_right($ubbt_lang['NO_MORE'],$Cat);
}



I know it should be this:

code:

if ($Searchpage < 0) {
$html -> not_right($ubbt_lang['NO_MORE'],$Cat);
}




But while editing with Dreamweaver it kept removing the < for some strange reason.

I ended up changing the file to a "text" file and then edited it and uploaded it and then changed the name back to a php file and it worked!!!

Finally I know I'm not crazy. It was dreamweaver all the long... (I hope)

Re: [UBBT 6.0] Search Page Upgrade
sjsaunders #220413 11/12/2002 12:02 PM
Joined: Apr 2002
Posts: 102
Journeyman
Offline
Journeyman
Joined: Apr 2002
Posts: 102
Is it just me or in dosearch.php......

Shouldn't this:

$prevlinkstart = "<a href="{$config['phpurl']}/dosearch.php?Cat=$Cat&Forum=$URLForum&Words=$URLWords&Match=$URLMatch&Searchpage=$prevpage&Limit=$Limit&Old=$Old">";

Be this:

$prevlinkstart = "<a href="{$config['phpurl']}/dosearch.php?Cat=$Cat&Forum=$URLForum&Words=$URLWords&Match=$URLMatch&Searchpage=$prevpage&Limit=$Limit&Old=$Old&ByUsername=$ByUsername">";

... and you would need to do the same for the $nextlinkstart

Re: [UBBT 6.0] Search Page Upgrade
AleksejVL #220414 11/12/2002 12:03 PM
Joined: Jun 2001
Posts: 3,273
That 70's Guy
OP Offline
That 70's Guy
Joined: Jun 2001
Posts: 3,273
Yes you are correct. I believe I forgot to add that in here too. I had mentioned this change somewhere around here before but had forgotten about it. Thanks.

Page 1 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
jgeoff
jgeoff
NJ
Posts: 96
Joined: April 2001
Forum Statistics
Forums63
Topics37,543
Posts293,774
Members13,837
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 269
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 8
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,805
Greg Hard 4,625
Top Posters(30 Days)
isaac 1
Top Likes Received
isaac 39
Gizmo 10
Brett 7
Morgan 2
Top Likes Received (30 Days)
isaac 1
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Snapshot build 20200618.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.121s Queries: 99 (0.061s) Memory: 3.6552 MB (Peak: 4.1097 MB) Data Comp: Zlib Server Time: 2020-07-09 21:18:20 UTC
Valid HTML 5 and Valid CSS