PDA

View Full Version : a problem with the code related to "image_notes" ?


-okapi-
04-28-2005, 09:35 PM
there might be a problem with the code related to "image_notes"

when editing image description on the admin images page, i have to mask every dot "." with a backslash "\." to avoid layout and text display problems. it took me some time to find out that the dot caused the problem.

raminia
04-29-2005, 07:10 AM
dots? I don't think so. please describe it more.

-okapi-
04-29-2005, 08:52 AM
please take a look at these two entries:

in this one
http://www.a-visual-notebook.at/index.php?showimage=202
the image description (bottom of the image, left) is:
17. aplec internacional de la sardana, graz (austria), august 2004
(broken layout)

in this one
http://www.a-visual-notebook.at/index.php?showimage=203
the images description is:
17\. aplec internacional de la sardana, graz (austria), august 2004
(good layout)

besides, the webdevelopper extension of firefox shows me a block element for "IMAGE_NOTES" which is not shown for "IMAGE_TITEL".
in my layout both "IMAGE_NOTES" and "IMAGE_TITLE" are in table cells, equally css formated.

GeoS
04-29-2005, 12:51 PM
Do you use some WYSWIG editor for image_note??
In this broken somehow is incorrect code - there are tags for a list (<li>, <ol>) and I don't know why.
You had to put there some data with formating from MS WORD or other program, not clear text note!!!

-okapi-
04-29-2005, 01:33 PM
no i never use WYSWIG editors. i'm using htmlpad pro, exclusively.

the table for image, title and description in my template:
<table cellpadding="0" cellspacing="0" border="0" align="left">
<tr>
<td colspan="2"><a href="index.php?showimage=<IMAGE_PREVIOUS_ID>"><img id="image" src="images/<IMAGE_NAME>" alt="<IMAGE_TITLE>" title="" width="<IMAGE_WIDTH>" height="<IMAGE_HEIGHT>" border="0" /></a></td>
</tr>
<tr>
<td align="left" class="imagenotes"><IMAGE_NOTES></td>
<td align="right" class="imagetitle"><IMAGE_TITLE></td>
</tr>
</table>

there are no list tags in my layout code.

stylesheet:
.imagenotes {
font-family:verdana,arial,helvetica,sans-serif;
font-size:11px;
height:24px;
padding-left:11px;
}

.imagetitle {
font-family:verdana,arial,helvetica,sans-serif;
font-size:11px;
height:24px;
padding-right:11px;
}

but the output of the decription is:
<ol>
<li>aplec internacional de la sardana, graz (austria), august 2004 </li>
</ol>

i have no idea where the <ol> and <li> tags come from. maybe from the admin index.php?

GeoS
04-29-2005, 01:43 PM
I'm sure that not from PP :)

-okapi-
04-29-2005, 01:55 PM
i'm just typing plain text into the input form of the edit image page in the admin section. no copying, just typing.

and i have no <ol> and <li> tags in my templates.

so, where should it come from, if not from the php code? :?

GeoS
04-29-2005, 04:40 PM
There is no such possibility - PHP doesn't generate HTML code from nothing. It had to be somehow inputed by you.

Joe[y]
04-29-2005, 04:48 PM
if you want reassurance it isn't a PP problem i played about with a lot of dots in my editing in admin for posts in image_info and had no problem at all.


i see why you're so puzzled but you're going to have to look into some other possibilities - perhaps something dodgy is happening with your server.

raminia
05-01-2005, 08:48 AM
i see why you're so puzzled but you're going to have to look into some other possibilities - perhaps something dodgy is happening with your server.

why server?!

I was busy for few days:)... I didn't get into this problem then but I think it's not from PP. BTW, okapi, very interesting shots! great capture!

Joe[y]
05-01-2005, 12:17 PM
well, i agree it can't be PP.

i've no logical reason for saying the server is affecting it (or things installed on the server) other than it's highly unlikely it's PP.

blinking8s
05-02-2005, 02:55 AM
im so confused...what is going on?!?! lol

Joe[y]
05-02-2005, 08:01 AM
im so confused...what is going on?!?! lol


basically we are tearing our hair out over a solution to the original problem.

so far, we've got nowhere! :oops:

-okapi-
05-02-2005, 11:42 AM
to explain it more clearly:

take a look at this one:
http://www.a-visual-notebook.at/index.php?showimage=208

no problem with the description ot the image, but...

does anybody use the webdevelopper extension of firefox?

if so, click "display block level elements" (i hope this is the correct english translation).
then you will see the image description (bottom left of the picture) as a <p> element. on the bottom right of the picture you find the date, and this is no <p> element, though both are equally formatted. strange.

you can also see it in the source code, as firefox shows:

<table cellpadding="0" cellspacing="0" border="0" align="left">
<tr>
<td colspan="2"><a href="index.php?showimage=207"><img id="image" src="images/20050501233730_050430c.jpg" alt="april 30, 2005" title="" width="675" height="450" border="0" /></a></td>
</tr>
<tr>
<td algin="left" class="imagenotes"><p>"insect" - theater titanick, am hof, vienna, april 30, 2005</p>
</td>
<td align="right" class="imagetitle">april 30, 2005</td>
</tr>
</table>

where do the <p> tags come from??
they are not in my layout.


now take a look at this one:
http://www.a-visual-notebook.at/index.php?showimage=205

as description i wrote:

17. aplec internacional de la sardana, graz (austria), august 2004

the layout is broken.

the source code, as firefox shows, is:

<table cellpadding="0" cellspacing="0" border="0" align="left">
<tr>
<td colspan="2"><a href="index.php?showimage=103"><img id="image" src="images/20050501114558_040808a.jpg" alt="august 08, 2004" title="" width="675" height="450" border="0" /></a></td>

</tr>
<tr>
<td algin="left" class="imagenotes"><ol>
<li>aplec internacional de la sardana, graz (austria), august 2004</li>
</ol>
</td>
<td align="right" class="imagetitle">august 08, 2004</td>
</tr>
</table>
now we have a list element instead of the previous <p> element! strange again! where do the list tags come from?

again, there is no list element in my layout.
the "17." of the description text seems to be wrongly interpreted.

no problem anymore, as soon as i change the text, as can be seen here:
http://www.a-visual-notebook.at/index.php?showimage=202

but again, the <p> tags, to be seen in the source code.

additional note:
IE shows no broken layout, it just doesn't display the "17." at all.

this is why i think, the problem must be caused by php code...

Joe[y]
05-02-2005, 12:02 PM
<p> tags i can understand being inserted. as many text-input forms add this piece of html in automatically as it is part of standards compliance.

the list tags i can't explain, other than it may be somehow due to how the text was inserted into the form... but as you say you did exactly the same both times I can't explain this.

is that example of the list being populated the only one you have? or has it happened more than once?

EDIT - I put the same text into one of my photos in the same way you did but I had no problems. I really can't understand how this is a PP problem.

-okapi-
05-02-2005, 12:14 PM
is that example of the list being populated the only one you have? or has it happened more than once?

the <p> tags are with every post.
the layout is only broken with "17." in firefox.
IE doesn't show the "17." at all.

and please note that these tags are only shown with IMAGE_NOTES, not with IMAGE_TITLE!

a test:

i put in "17. test" both as image description and as image title, and here's the result:
http://www.a-visual-notebook.at/index.php?showimage=153

(i'll change this later again)

-okapi-
05-02-2005, 12:15 PM
I put the same text into one of my photos in the same way you did but I had no problems. I really can't understand how this is a PP problem.

oops...

and no <p> tags or <li> and <ol> tags in the source that the browser shows?

Joe[y]
05-02-2005, 12:27 PM
as i said, <p> tags were always present and for a good reason.

but no list tags at all!

-okapi-
05-02-2005, 12:27 PM
i tend to give up.
in the future, i just won't write titles beginning with "17." and everything will run smoothly.

sorry for the trouble. thanks for your help and your patience.

Joe[y]
05-02-2005, 12:29 PM
ahah! don't give up quite yet...


loookey -

<b>FinePix A205S
<br /> 1/100 sec | f 3 | 5.5 mm</b>
<ol>
<li>A photo of a melon in the style of Ed Weston for my study of shape, texture and form as a unit of my A-Level photography coursework. I took this photo just a few minutes ago and as I'm in a bit of a rush with work this was taken on my digital and processed in photoshop by simply changing mode to greyscale.</li>
</ol>

<p>Expect a few more mellons and other fruits to fill this page in the next few days. Sorry if that's a bit boring! </p>

there was one when i added the number in as well as the dot. the dot isn't the problem. it's the numbers!

Joe[y]
05-02-2005, 12:49 PM
ok. i would have expected the line $body = strip_tags( $body );

to take care of this. but as it's already present then i have to assume that pp is trying to be clever by making a list when a number and . are present at the beginning of a paragraph... such as 15.

so yeah. just avoid it if you can! or use 15•

-okapi-
05-02-2005, 01:11 PM
ahah! don't give up quite yet...


loookey -

<b>FinePix A205S
<br /> 1/100 sec | f 3 | 5.5 mm</b>
<ol>
<li>A photo of a melon in the style of Ed Weston for my study of shape, texture and form as a unit of my A-Level photography coursework. I took this photo just a few minutes ago and as I'm in a bit of a rush with work this was taken on my digital and processed in photoshop by simply changing mode to greyscale.</li>
</ol>

<p>Expect a few more mellons and other fruits to fill this page in the next few days. Sorry if that's a bit boring! </p>

there was one when i added the number in as well as the dot. the dot isn't the problem. it's the numbers!

i had the rope already in my hand...
on my gravestone one would have read: "he was too dump for pp"
but lately there's sunshine in my life again.
there's hope...

:lol:

so may i notice again...
the problem exists only with <IMAGE_NOTES>
and not with <IMAGE_TITLE>, so there must be a specific formatting related difference in the code between these two functions...

Joe[y]
05-02-2005, 01:22 PM
yes. somebody who has more experience with php... the term 'body' is basically used for image-notes in mySQL so perhaps something can be done with this in index.php.

raminia
05-02-2005, 07:02 PM
where is your server. maybe we have the UTF-8 issue here....

Anonymous
05-02-2005, 10:24 PM
where is your server. maybe we have the UTF-8 issue here....

what information do you need exactly?

-okapi-
05-02-2005, 10:25 PM
where is your server. maybe we have the UTF-8 issue here....

what information do you need exactly?

sorry, that was me, not logged in.

raminia
05-03-2005, 07:52 AM
I don't know exactly but I know that v1.4.1 has some bug with utf-8. I found this when I was wrting the addon for importing from wordpress to PP. In the installation and upgrade, pp does not specify the encoding of the tables and the encoding is inherited from the server defaults. Thus, it will be server dependent!! some servers has default encoding rather than UTF-8 and it may create problem. That's one of the issues we are working on in the dev team.

-okapi-
05-03-2005, 09:11 AM
ramin,
please note, that the problem exists only with <IMAGE_NOTES>
and NOT with <IMAGE_TITLE>, so there must be a specific formatting related difference in the code between these two functions...

when typing "17. aplec internacional..." as image title, everything is displayed correctly. when i do the same as image description, it comes to that strange behaviour.

if this were a general problem, it would presumably affect both functions, at least for my understanding.

raminia
05-03-2005, 11:32 AM
difference of these two

1-image note has markdown and tilte does not.

$image_notes = markdown(pullout($row['body']));


$image_title = pullout($row['headline']);


2- image title has some function to replace the special characters with html friendly ones

$image_title = htmlspecialchars($image_title,ENT_QUOTES);

now what's the difference came from?!