Not signed in (Sign In)

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

  1.  
    Hello,

    I just installed Plogger, and it works great!
    Only i'm customizing it to my needs, but I can't get something to work.

    What I want:
    - Display the filename below the thumbnails (instead of the caption)
    - Display the filename above the single picture (instead of the date & caption)

    I've tried to edit it in plog-functions.php and in the themefiles, but it doesn't work.

    Can someone help me please?
    • CommentAuthorkris6336
    • CommentTimeJul 11th 2007
     
    I had that same issue after upgrading, only I want the whole URL so that I can copy/paste for image linking in message boards. I am sure someone will figure it out as they play around, but that someone is not me, yet.
    •  
      CommentAuthormike
    • CommentTimeJul 11th 2007
     
    You should be able to just use the template function "plogger_get_picture_url()" in place of "plogger_get_picture_caption()". Take a look at the theme template files and you should be able to figure it out pretty easily.
    Thankful People: punkdisasters
    • CommentAuthorkris6336
    • CommentTimeJul 12th 2007
     
    thanks - it worked for me for the URLs!
    • CommentAuthorjeroenzelle
    • CommentTimeJul 12th 2007 edited
     
    Posted By: mikeYou should be able to just use the template function "plogger_get_picture_url()" in place of "plogger_get_picture_caption()". Take a look at the theme template files and you should be able to figure it out pretty easily.


    Yes, I tried that already, but that's not what I want :(
    •  
      CommentAuthormike
    • CommentTimeJul 12th 2007
     
    You just want the filename? Try replacing plogger_get_picture_caption() with

    basename($GLOBALS["current_picture"]["path"])

    If you want to be fancy, you could make your own template function... just add this to plog-functions.php

    function plogger_get_picture_filename() {
    return htmlspecialchars(SmartStripSlashes(basename($GLOBALS["current_picture"]["path"])));
    }


    And then in your template you would just need to use plogger_get_picture_filename()
  2.  
    Posted By: mikeYou just want the filename? Try replacing plogger_get_picture_caption() with

    basename($GLOBALS["current_picture"]["path"])

    If you want to be fancy, you could make your own template function... just add this to plog-functions.php

    function plogger_get_picture_filename() {
    return htmlspecialchars(SmartStripSlashes(basename($GLOBALS["current_picture"]["path"])));
    }


    And then in your template you would just need to use plogger_get_picture_filename()


    Thanks! Works great.
  3.  
    this is very nice, but now truncation doesn't work. How do I add it? Right now all my pics have filenames that are waaaaay too long, and I can't change it to something shorter without reuploading the pics with new filenames that aren't descriptive.

    I'm using the template function, not the other one.

    prime example: http://www.allhopeout.com/gallery/bands/the_used
    •  
      CommentAuthormike
    • CommentTimeJul 15th 2007
     
    Well... there are a few things you can do...

    1.) The easiest thing is to just make your thumbnails larger so the captions don't overflow into the adjacent thumbnails... but this isn't 100% reliable.

    2.) You can just hide the overflow using CSS

    Add "overflow: hidden" to the properties of the .tag CSS rule in gallery.css of your theme file (gallery.css (line 269)).

    .tag {
    height:125px;
    overflow:hidden; /* this will hide the overflowing captions */
    text-align:center;
    width:110px;
    }


    3.) You can add text truncation to the PHP template function. There is actually already a configuration variable on the options page called "truncate" that you could use, if the top two don't work let me know and I will write some PHP code you can use.
    Thankful People: punkdisasters
  4.  
    #1 isn't an option

    #2 works, but it just "cuts off" the letters as seen on the before mentioned page. while this works to the purpose, i'd prefer it to work like the truncation on beta 2.1 worked. that was sweet with the "..." added when the filename was too long. so what i'm saying is that it would be great if you could write that little bit of php that would make it awesome(r) than it is.

    thanks
    •  
      CommentAuthormike
    • CommentTimeJul 17th 2007
     
    I can't test this right now, but try something like...

    function truncate_str($str, $len, $dots = "...") {
    if (strlen($str) > $len) {
    $dotlen = strlen($dots);
    $str = substr_replace($str, $dots, $len - $dotlen);
    }
    return $str;
    }

    function plogger_get_picture_filename_truncated() {
    global $config;

    $fname = htmlspecialchars(SmartStripSlashes(basename($GLOBALS["current_picture"]["path"])));
    return truncate_str($fname, $config['truncate'], '...');
    }


    Then you can set your truncation amount in the options menu and it will change dynamically. Otherwise, just hard code a number in for $config['truncate'].
  5.  
    so i'm really sucky at coding, but now the pictures end up being placed randomly around in the plogger defined area, some lines include 1 thumb, while other include 4, some are aligned to the left, and some to the centre. that's not right?

    and truncation didn't work either :( it's supposed to be in the plog-functions.php file, right?