PDA

View Full Version : how to stop search results being messed up all over page


supafunk
10-10-2005, 01:25 PM
Hey,

I just had a go a creating my first quick and basic template based on the simple.html template but with a little header. It looks nice, until you search and you see that the search results are muddled and confused all over the page and the header is repeated numerous times.

Any help is much appriciated, I'm thinking the fix must be reasonabley simple for one with an expirienced eye for this thing, the addy is: www.compulsivethinker.com/thinking/time/search.php

many thanks

Tom

Charter
10-14-2005, 08:58 AM
Hmm, that is strange. The cthinker.html template itself looks okay. How are you calling the template? In the config file, do you have the bold parts in the following code:

$templates_array = array('black.html','bluegrey.html','corporate.html','green.html','grey.html ','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.ht ml','terminal.html','yellow.html','gaagle.html');
if(isset($template_demo) && in_array($template_demo, $templates_array)) {
$template = "$relative_script_path/templates/cthinker.html";
} else {
$template = "$relative_script_path/templates/cthinker.html";
}

supafunk
10-15-2005, 11:05 AM
yep, the code I have there is:

$templates_array = array('black.html','bluegrey.html','corporate.html','green.html','grey.html ','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.ht ml','terminal.html','yellow.html','gaagle.html');
if(isset($template_demo) && in_array($template_demo, $templates_array)) {
$template = "$relative_script_path/templates/cthinker.html";
} else {
$template = "$relative_script_path/templates/cthinker.html";
}

the whole template code seems to be getting repeated over and over again for some reason....

any more help would be gratefully received.
cheers

Charter
10-15-2005, 04:38 PM
So I tested your template, and the PhpDig change I made was to set the cthinker.html template name like in my previous post. The results can be seen here (http://www.phpdig.net/demo/search.php?template_demo=cthinker.html&query_string=apache+server). I'd suggest FTPing the original PhpDig files back over to the server, as it seems a code change was made somewhere to make it repeat on your site.

supafunk
10-15-2005, 06:27 PM
that would seem to be the case...but i just uploaded a completely new download of phpDig, all i changed were the db connection details, the template appropriation code you mentioned above and the admin password and (as u can still see at www.compulsivethinker.com/thinking/time/search.php) i got the same result as i always get.

i'm tearing my hair out with this, you make it look so easy...

do you think the problem could lie with my host?

ta for all the help btw...

Charter
10-15-2005, 06:42 PM
What version of PhpDig are you using?

supafunk
10-15-2005, 07:45 PM
i have just now tried it with both the latest experimental and stable releases. the one currently running is the stable one. Both editions I downloaded fresh today...

supafunk
10-15-2005, 07:59 PM
I just set up a fresh database to work with the stable version and indexed three sites, but still the same messed up results...

Charter
10-15-2005, 08:30 PM
With PhpDig 1.8.7, you should not index multi-byte content or use UTF-8 in the following tag, as PhpDig 1.8.7 is not capable of properly understanding multi-byte content:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

The charset that you use with PhpDig 1.8.7 must match the charset of the pages that were indexed. PhpDig 1.8.7 is for one single-byte charset only. You could try using charset=ISO-8859-1 in the tag, but when you indexed sites, what PhpDig version did you use?

PhpDig 1.8.8 RC1 uses UTF-8, but if you are mixing and matching PhpDig versions, that might cause some weirdness in the templated page as encoding might be the issue, and though I'm not totally sure of the cause, I doubt it is your host.

First try using charset=ISO-8859-1 in the META tag, and if that doesn't work, try a fresh install, fresh tables, fresh index, and then see if the page looks okay. If you meet the PhpDig 1.8.8 RC1 requirements (http://www.phpdig.net/forum/showthread.php?t=1789), I would suggest using that version.

supafunk
10-15-2005, 08:53 PM
:) I can't thank you enough. changing the charset to ISO-8859-1 worked a treat on the install with both the new db I created and then again perfectly with the original database I was working with... I am now hoping it will work when i upgrade to 1.8.8 RC1.

now I can finally move on...

many, many, many thanks.

supafunk
10-15-2005, 09:03 PM
I just upgraded to 1.8.8 RC1 and it seems to be fine still. Although I havent indexed any new sites with this version and I'm pretty sure the sites currently in the db were indexed with 1.8.7...

I'll try the template you attached now...

supafunk
10-15-2005, 09:04 PM
oh it disappeared...

Charter
10-15-2005, 09:11 PM
Oops, here is the template again. It was taken away as it looked like charset was the issue. Note that the template has UTF-8 in the META tag, so if you use it with PhpDig 1.8.7 of course change the tag.

Charter
10-15-2005, 09:19 PM
PS: For PhpDig 1.8.8 RC1, the META tag should have UTF-8 instead of ISO-8859-1, because once you do the conversion on the files and tables, everything should be in UTF-8 encoding.

supafunk
10-15-2005, 09:33 PM
Yup cool. But the encoding on my original template was utf-8 and I'm sure I tried it with the updated tables after using the upgrade sql that comes with 1.8.8. Oh well, seems to be working okay now.

Charter
10-15-2005, 10:05 PM
Yeah, strange. Your template was copy-pasted straight to Notepad, and it worked fine. The only thing I can think of is that there was some text, either unseen or disguised, affected by the encoding that was removed when pasted into Notepad. Glad it's working now.