Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 12-23-2005, 05:48 AM
kitkit201 Offline
forum loafer
 
Join Date: Dec 2005
Location: Bay Area, CA
Posts: 15
Send a message via AIM to kitkit201 Send a message via MSN to kitkit201
Using <IMAGE_NOTES> with overlib

Hi folks

My problem is that I am trying to implement <IMAGE_NOTES> using the overlib javascript. It seems to only work when <IMAGE_NOTES> does not have ANY HTML tags on it.

Right now, this picture's <IMAGE_NOTES> has been stripped of ALL HTML tags and new line characters. http://www.photokit.net/index.php?showimage=296 . It works fine and the overlib float-over is fine.
<IMAGE_NOTES> output: <p><i>Spotted something back in October while looking for something new to publish. I am currently under the weather, so going outside may make me more ill. <p>Taken with Nikon D70 + Nikkor 18-70mm


However, the preceeding picture's <IMAGE_NOTES> still has all of it's HTML tags in it, but does not show up in mouseover of the picture. http://www.photokit.net/index.php?showimage=295
<IMAGE_NOTES> output: <p><i>SF's own DPT (Department of Parking and Traffic) directing holiday traffic a couple of days ago. Keep in mind that this exit is about 10 blocks away from Union Square (considered the main shopping area of SF). <p>Taken with Nikon D70 + Nikkor 18-70mm

Is this a problem with overlib or is there some kind of hack in pixelpost that I can use to overcome this dilemma?

I am using <IMAGE_NOTES_CLEAN> but it doesn't seem to work...
Thanks
Reply With Quote
  #2  
Old 12-23-2005, 12:10 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
i wouldn't say it's a problem with pp if the imagenotes can be displayed normally on a noraml html template - so overlib may not accept html - i hven't had much experience with overlib to be honest.. i don't really like it.

perhaps it's to do with not closing your <i>
Reply With Quote
  #3  
Old 03-10-2006, 11:41 AM
TheRedRose Offline
forum loafer
 
Join Date: Mar 2006
Location: Germany
Posts: 19
Okay, I tried to implement this feature as well and I found the problem (I think)...
PP adds a linefeed to <IMAGE_NOTES(_CLEAN)>, regardless of the content. Overlib can handle HTML, the linefeed simply screws up the HTML-Code.

Template:
onmouseover="return overlib('<IMAGE_NOTES>', CAPTION, '<IMAGE_TITLE>')"
This is the code generated by PP:
onmouseover="return overlib('<p>..the sunset</p>
', CAPTION, 'driving by..')"

As you can see, there is a linefeed right after the image notes, if you enter any (html)text yourself it works well.

Now for the question: ;-)
How to get rid of the linefeed at the end of <IMAGE_NOTES>??

Thx for your help in advance.
Reply With Quote
  #4  
Old 03-10-2006, 12:27 PM
TheRedRose Offline
forum loafer
 
Join Date: Mar 2006
Location: Germany
Posts: 19
I solved the problem right now with a quickŽnŽdirty hack.

In index.php after this line
$image_notes = markdown(pullout($row['body']));

insert:
$image_notes = substr($image_notes,0,strlen($image_notes)-1);

This removes the linefeed (? still not sure what I remove here ) and the overlib library can display the image notes, including html.
Remember not to use characters like ' and " in your image notes.
To implement links etc. you have to use &quot and so on...
Reply With Quote
  #5  
Old 03-10-2006, 09:06 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
IMHO you should use this:

PHP Code:
    $image_notes_clean strip_tags($image_notes);
        
$image_notes_clean htmlspecialchars($image_notes_clean,ENT_QUOTES); 
and after that use tag <IMAGE_NOTES_CLEAN>.
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #6  
Old 03-12-2006, 01:23 PM
TheRedRose Offline
forum loafer
 
Join Date: Mar 2006
Location: Germany
Posts: 19
Okay, I searched google for the use of this (I'm no web programmer, so php looks like java to me) and I like it. Will be using this for all the notes (not only image_clean) because overlib can display links, images and line feed.

thx
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 06:51 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs