Not signed in (Sign In)

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

    • CommentAuthorPieperLy
    • CommentTimeAug 17th 2008 edited
     
    the truncate option don't work, filenames are longer then thumbs width. what can i do to truncate ...
    on beta2 it wirks fine, beta3 don't work on album.php

    thanks for your help
    uwe
    •  
      CommentAuthorsidtheduck
    • CommentTimeAug 19th 2008 edited
     
    PieperLy,

    Did you want Plogger to truncate the actual filename as stored on the server or just truncate the output to make sure your layout stays clean?

    If the second option, you can edit your new function like so:
    function plogger_get_picture_filename() {
    global $config;
    $filename = SmartStripSlashes(basename($GLOBALS["current_picture"]["path"]));
    if (intval($config['truncate']) > 0) {
    $filename = substr($filename, 0, intval($config['truncate']));
    }
    return htmlspecialchars($filename);
    }


    That should work for you
    • CommentAuthorPieperLy
    • CommentTimeAug 19th 2008
     
    for the first: thanks for your time!

    with this code, truncate don't work. the code shows also filenames, but without truncate. i have many probally, but i'am to stupid for solution.
    my feeling is, that the code not with truncate-assignment on adminpaneel communicate.

    as workaround, i set font-size: 7pt, but there isn't a solution.
    another idea?

    reagards from germany
    uwe
    •  
      CommentAuthorsidtheduck
    • CommentTimeAug 19th 2008
     
    What number do you have set for your truncate option in the Admin -> Option tab? Do you have a link to your gallery?
    • CommentAuthorPieperLy
    • CommentTimeAug 19th 2008 edited
     
    i've set number 20 (also probally 10 and 30)
    my gallery

    regards from germany
    uwe
    ps: i have many edit the plogger-code, possible i've be broken the code, and lost connection to admins options.
    the most important changes that i makes:

    change startsite from / to old format /index.php
    ("/" overwrite my startsite /index.htm, /index.php is the gallerysite)

    change /?plog_page to old format /?page
    (rename plogger-variable $page to $pages and $plog_page to $page)

    replace plogger searchfield with google-searchfield
    remove sort-form (google says double content with different sorts)
    use old gallery.css from beta2
    translate any words to german language
    • CommentAuthorPieperLy
    • CommentTimeAug 21st 2008
     
    okay, i have no solution, but a workaround:

    change the new function in plog-functions.php to:
    function plogger_get_picture_filename() {
    $filename = SmartStripSlashes(basename($GLOBALS["current_picture"]["path"]));
    $filename = substr("$filename", 0, 28);

    return htmlspecialchars($filename);
    }

    28: this is number of chars there shows under thumbs. change it for your right thumb-width.

    disadvantage of this workaround is, that no show "..." filenams under thumbs. end of filnenames are cut off.

    hope, that help you.
    reagards from germany
    •  
      CommentAuthorsidtheduck
    • CommentTimeAug 22nd 2008 edited
     
    Here PieperLy,

    Try this (I edited my code above that it should work now too . . . I forgot to call "global $config;" for the function). Hopefully this will work for you (although I haven't tested it completely yet, so let me know).
    function plogger_get_picture_filename() {
    global $config;
    $filename = SmartStripSlashes(basename($GLOBALS['current_picture']['path'])); //get the basename and clean up the text a little
    $filename = substr($filename, 0, strrpos($filename, '.')); //remove the file extension
    //if the truncate value is set and the filename is longer than the truncate value
    //chop it off and add the trailing ellipses
    if (intval($config['truncate']) > 0 && isset($filename{ intval($config['truncate'])})) {
    $filename = substr($filename, 0, intval($config['truncate'])).'...';
    }
    return htmlspecialchars($filename);
    }
    • CommentAuthorPieperLy
    • CommentTimeAug 22nd 2008 edited
     
    hehe, thats it!!! it works great! i'am very, very happy :-)))

    very, very thanks to you, now can i smoke a cigarette :-)

    reagards from germany
    uwe
    ps: you are a good man.