How to search on static pages?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

In another thread we realized that someone was using the "utf8-binary" collation for the mysql connection. Using binary collations always leads to case sensitive search, thus you need to switch your connection to just "utf8" for mysql. Your server admin should be able to do that.
Where is the file located at? I'am right, that i need to have ftp-access to the server, to modify this file?
Yes, you need FTP access for that. The .tpl file should be in the serendipity_event_staticpage plugin directory.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
urmelchen
Regular
Posts: 27
Joined: Thu Jul 27, 2006 9:15 pm
Contact:

Post by urmelchen »

garvinhicking wrote: In another thread we realized that someone was using the "utf8-binary" collation for the mysql connection. Using binary collations always leads to case sensitive search, thus you need to switch your connection to just "utf8" for mysql. Your server admin should be able to do that.
Okay, i will submit this information to the admin. You was asking for the mysql version: mysql Ver 14.7 Distrib 4.1.10a, for pc-linux-gnu (i386) (on Ubuntu Hoary).
Where is the file located at? I'am right, that i need to have ftp-access to the server, to modify this file?
Yes, you need FTP access for that. The .tpl file should be in the serendipity_event_staticpage plugin directory.[/quote]

There is no way at the moment to get access to the file. I suggest the result page should not display images by default, because of possible layout crap. Maybe you can change the default setting to someting like this (like search in articles work)?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, we can't really strip that option easily. Many people want their complete entry texts to show up there...I think the default situation should be to display the entry as is.

Sadly s9y relies on template files for customization purposes, and introducing web-based editing of .tpl files might create security concerns...so I actually don't really know what to do :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
urmelchen
Regular
Posts: 27
Joined: Thu Jul 27, 2006 9:15 pm
Contact:

Post by urmelchen »

I easily can live with the default, if the template works correctly ;-) Why my layout is getting so destroyed? I'am using standard s9y functions to implement pictures.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi urmelchen!

Could you show us a screenshot and give the URL plus what to search for to see what you mean? Maybe I didn'T get the problem properly.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
urmelchen
Regular
Posts: 27
Joined: Thu Jul 27, 2006 9:15 pm
Contact:

Post by urmelchen »

Hi Garvin,
for sure. Try this search (search gaehn.org for "Gotha") and you will see this result page:

Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Ah!

Now I See!

Well, the problem is this: The staticpage search uses the smarty "truncate" function to limit the output of the text to X characters.

Now in your case, the HTML is broken in the middle, because it is truncated. This leads to invalid formatting.

So the solution would be to either NOT truncate the staticpage search (but that would result in HUGE pages) or to create a truncate function that first strips HTML. I think the latter is better, but it would remove all HTML formatting in the result page of course...what do you tihnk?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

If you're up to a little template editing, you might be able to get a better solution.

First edit or create the config.inc.php in your template directory. Add the Smarty HTML truncating code found here. Then find the {$<whatever>|truncate} call and change it to {$<whatever>|html_substr} instead.
Judebert
---
Website | Wishlist | PayPal
urmelchen
Regular
Posts: 27
Joined: Thu Jul 27, 2006 9:15 pm
Contact:

Post by urmelchen »

garvinhicking wrote:Ah!
Now I See!
Fine :-)
So the solution would be to either NOT truncate the staticpage search (but that would result in HUGE pages) or to create a truncate function that first strips HTML. I think the latter is better, but it would remove all HTML formatting in the result page of course...what do you tihnk?
IMHO it would be the best to remove html formattings from the result page (imho they are not needed there). I'm sure that there are more users out there, they actualy did have this problem.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

To remove the tags, you could edit your template, too. Just find the ${<whatever>|truncate...} call and change it to {$<whatever>|strip_tags|truncate...}.
Judebert
---
Website | Wishlist | PayPal
urmelchen
Regular
Posts: 27
Joined: Thu Jul 27, 2006 9:15 pm
Contact:

Post by urmelchen »

judebert wrote:To remove the tags, you could edit your template, too. Just find the ${<whatever>|truncate...} call and change it to {$<whatever>|strip_tags|truncate...}.
judebert, you are right. But i don't have access to the server. s9y is hosted by another team member of the kubuntu.de community.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I added a |@escape modifier to the default staticpage tpl file. I'm afraid "strip_tags" would trigger the Smarty Security alarm, because strip_tags is a native PHP function?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply