Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormobby
    • CommentTimeJun 3rd 2008
     
    Would like to find out if it is possible to put HTML tags inside album discription? When i enter, it shoulds HTML instead of a link which i am trying to place..

    Thanks in advance
    •  
      CommentAuthorsidtheduck
    • CommentTimeJun 3rd 2008
     
    • CommentAuthormobby
    • CommentTimeJun 3rd 2008
     
    Thanks again... guess i used the wrong keyword to search. hehe
    • CommentAuthormobby
    • CommentTimeJun 3rd 2008
     
    Hi sidtheduck,

    Just tried it, but it does not fully work for my case.

    While in the admin area, after i change i enter HTML into description, it will work, but after refresh or come back from another page, it goes back to <BR> or <A HREF=XXXXX> again instead of normal line break or a link.

    http://jim.kazomi.us/asia_travels
    •  
      CommentAuthorsidtheduck
    • CommentTimeJun 4th 2008
     
    Hi mobby,

    Can you add another example to your page? It looks like you erased everything before I had a chance to look at it fully.
    Thanks.
    • CommentAuthormobby
    • CommentTimeJun 4th 2008
     
    sorry, was trying to reinstall to check...

    http://jim.kazomi.us/

    the Test album is created refresh after modifying to your code.
    thanks
    • CommentAuthormobby
    • CommentTimeJun 4th 2008
     
    found out why already...
    for albums and gallery to have HTML also, need to modify the other similar codes

    plogger_get_picture_description()
    plogger_get_collection_description()
    plogger_get_album_description()

    Thanks!
    :-)
    • CommentAuthoramihere
    • CommentTimeSep 6th 2008
     
    Hello,

    I made changes to get html tags in descriptions as descripted above. Everything worked fine untill I added tag <a href="">text</a> I don't know how to describe the problem, you can see it here in my testing collection (the first album named "pokus"). A whole html code inserted into the album description is <b>111</b><br><i>222</i><br><a href="">link</a>One thing is strange. In administration mode the description of the album is correct (this picture), but in the album options there is some another error (this picture). It seems like the link tag splits and some part is written over the row.

    Any idea how to fix it (except "don't write links into descriptions" :-) )?
    • CommentAuthoramihere
    • CommentTimeSep 9th 2008
     
    Nobody has any idea or solution?
    •  
      CommentAuthorsidtheduck
    • CommentTimeSep 9th 2008
     
    amihere,

    The issue seems to happen with your double quotes (") when they are stored in the title and alt tags of the image.

    For example, in 'collection.php' (in the Lucid theme I believe you are using), find the following code:
    print '<img class="photos" src="'.plogger_get_album_thumb().'" title="'.$desc.'" alt="'.$desc.'" /></a>';
    and change it to:
    print '<img class="photos" src="'.plogger_get_album_thumb().'" title="'.htmlentities($desc).'" alt="'.htmlentities($desc)c.'" /></a>';

    Same thing for 'album.php':
    title="'.$capt.'" alt="'.$capt.'" />';
    to:
    title="'.htmlentities($capt).'" alt="'.htmlentities($capt).'" />';

    'collections.php':
    print '<img class="photos" src="'.plogger_get_collection_thumb().'" title="'.$desc.'" alt="'.$desc.'" /></a>';
    to:
    print '<img class="photos" src="'.plogger_get_collection_thumb().'" title="'.htmlentities($desc).'" alt="'.htmlentities($desc).'" /></a>';

    and finally, 'picture.php':
    $imgtag = '<img class="photos-large" src="'.plogger_get_picture_thumb(THUMB_LARGE).'" title="'.$capt.'" alt="'.$capt.'" />';
    to:
    $imgtag = '<img class="photos-large" src="'.plogger_get_picture_thumb(THUMB_LARGE).'" title="'.htmlentities($capt).'" alt="'.htmlentities($capt).'" />';
    Thankful People: amihere
    • CommentAuthoramihere
    • CommentTimeSep 9th 2008
     
    woohoo, it works! Sidtheduck, you are as helpful as every time :-) Thank you!

    Unfortunatelly the mistake from the second picture is still there. But I think, it's such a cosmetic defect. I think it's the same sort of mistake as above.
    •  
      CommentAuthorsidtheduck
    • CommentTimeSep 9th 2008
     
    and actually, amihere, you should use htmlspecialchars() instead of htmlentities() in my code above (better for foreign language support). And also, it may be good to escape single quotes as well, so use htmlspecialchars($desc, ENT_QUOTES)

    To fix the second picture issue, this is located in 2 files (but rest assured that both the 1st and second pictures have been fixed in the current SVN code so you won't have to do this for the next release).

    First, open 'plog-manage.php' and find the following code:
    $output .= '<label accesskey="c" for="caption"><em>C</em>aption:</label><input size="80" name="caption" id="caption" value="'.SmartStripSlashes($photo['caption']).'"><br />
    <label>Description:</label><br />
    <textarea name="description" id="description" cols="60" rows="5">'.SmartStripSlashes($photo['description']).'</textarea><br />

    <label for="allow_comments" accesskey="w">Allo<em>w</em> Comments?<label><br /><input type="checkbox" id="allow_comments" name="allow_comments" value="1"'." $state>";

    and change it to:
    $output .= '<label accesskey="c" for="caption"><em>C</em>aption:</label><input size="80" name="caption" id="caption" value="'.htmlspecialchars(SmartStripSlashes($photo['caption']), ENT_QUOTES).'"><br />
    <label>Description:</label><br />
    <textarea name="description" id="description" cols="60" rows="5">'.htmlspecialchars(SmartStripSlashes($photo['description']), ENT_QUOTES).'</textarea><br />

    <label for="allow_comments" accesskey="w">Allo<em>w</em> Comments?<label><br /><input type="checkbox" id="allow_comments" name="allow_comments" value="1"'." $state>";


    Then, open 'plog-admin-functions.php' and find the following code under:
    function plog_edit_album_form():
    $output .= '<label for="name" accesskey="n"><em>N</em>ame:</label><br/><input size="30" name="name" id="name" value="'.SmartStripSlashes($album['name']).'"><br/>
    <label for="description" accesskey="d"><em>D</em>escription:</label><br/><input size="80" name="description" id="description" value="'.SmartStripSlashes($album['description']).'"><br/>
    Thumbnail:<br/><select name="thumbnail_id" class="thumbselect" id="thumbselect"
    onchange="updateThumbPreview(this)">' . $images . '</select>
    <script type="text/javascript">updateThumbPreview(document.getElementById(\'thumbselect\'));</script>';

    change to:
    $output .= '<label for="name" accesskey="n"><em>N</em>ame:</label><br/><input size="30" name="name" id="name" value="'.htmlspecialchars(SmartStripSlashes($album['name']), ENT_QUOTES).'"><br/>
    <label for="description" accesskey="d"><em>D</em>escription:</label><br/><input size="80" name="description" id="description" value="'.htmlspecialchars(SmartStripSlashes($album['description']), ENT_QUOTES).'"><br/>
    Thumbnail:<br/><select name="thumbnail_id" class="thumbselect" id="thumbselect"
    onchange="updateThumbPreview(this)">' . $images . '</select>
    <script type="text/javascript">updateThumbPreview(document.getElementById(\'thumbselect\'));</script>';


    and finally function plog_edit_collection_form():
    $output .= '<label accesskey="n" for="name"><em>N</em>ame:</label><br/><input size="30" name="name" id="name" value="'.SmartStripSlashes($collection['name']).'"><br/>
    <label accesskey="d" for="description"><em>D</em>escription:</label><br/><input size="80" name="description" id="description" value="'.SmartStripSlashes($collection['description']).'"><br/>
    Thumbnail:<br/><select name="thumbnail_id" onchange="updateThumbPreview(this)"
    class="thumbselect" id="thumbselect">' . $images . '</select>
    <script type="text/javascript">updateThumbPreview(document.getElementById(\'thumbselect\'));</script>';

    to:
    $output .= '<label accesskey="n" for="name"><em>N</em>ame:</label><br/><input size="30" name="name" id="name" value="'.htmlspecialchars(SmartStripSlashes($collection['name']), ENT_QUOTES).'"><br/>
    <label accesskey="d" for="description"><em>D</em>escription:</label><br/><input size="80" name="description" id="description" value="'.htmlspecialchars(SmartStripSlashes($collection['description']), ENT_QUOTES).'"><br/>
    Thumbnail:<br/><select name="thumbnail_id" onchange="updateThumbPreview(this)"
    class="thumbselect" id="thumbselect">' . $images . '</select>
    <script type="text/javascript">updateThumbPreview(document.getElementById(\'thumbselect\'));</script>';


    That should do it for you!
    Thankful People: amihere