Menu

#8 Allow diff images as folder logo

open
nobody
5
2005-01-01
2005-01-01
yorr
No

When gallery is organised into multiple sub-trees now
it takes 3 or more clicks to see the first image.
If I could select different image miniature for each
folder
instead of one folder picture for
all folders, main page would look much nicer.

Thanks to the author for nice job so far.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I think being able to specify a different image for each folder
    would be great.

    Perhaps by adding a _folder_image.png inside the folder would
    get loaded as that folder's image...

     
  • MrTorrance

    MrTorrance - 2005-05-12

    Logged In: YES
    user_id=1276995

    I added the below to WRAPPER.PHP
    //--------------------------------------------------------------------------------

    $current_dir_dirs = array();
    if (isset($current_dirs[0])) {
    $i = 0;
    foreach ($current_dirs as $dir) {
    $current_dir_dirs[$i]['href'] =
    utf8_encode($web_pAG_path_rel . $url_request_part .
    $dir['name']);
    $current_dir_dirs[$i]['name'] =
    utf8_encode(samba2workaround($dir['name']));
    // dif folder pics
    if
    (strstr($current_dir_dirs[$i]['name'],$cfg['template']['icon']['folder_audio']))
    {
    $dir_icon = $cfg['template']['icon']['folder_audio_pic'];
    $clean =
    "/(".$cfg['template']['icon']['folder_audio'].")/";
    $current_dir_dirs[$i]['clean_name'] =
    utf8_encode(samba2workaround(preg_replace($clean,"",$dir['name'])));
    }
    elseif
    (strstr($current_dir_dirs[$i]['name'],$cfg['template']['icon']['folder_video']))
    {
    $dir_icon = $cfg['template']['icon']['folder_video_pic'];
    $clean =
    "/(".$cfg['template']['icon']['folder_video'].")/";
    $current_dir_dirs[$i]['clean_name'] =
    utf8_encode(samba2workaround(preg_replace($clean,"",$dir['name'])));
    }
    elseif
    (strstr($current_dir_dirs[$i]['name'],$cfg['template']['icon']['folder_docs']))
    {
    $dir_icon = $cfg['template']['icon']['folder_docs_pic'];
    $clean =
    "/(".$cfg['template']['icon']['folder_docs'].")/";
    $current_dir_dirs[$i]['clean_name'] =
    utf8_encode(samba2workaround(preg_replace($clean,"",$dir['name'])));
    }
    else {
    $dir_icon = $cfg['template']['icon']['folder'];
    $current_dir_dirs[$i]['clean_name'] =
    utf8_encode(samba2workaround($dir['name']));
    }
    // end dif foler pics
    $current_dir_dirs[$i]['img'] =
    utf8_encode($web_pAG_path_rel .
    '__phpAutoGallery__picLoader/__phpAutoGallery/templates/' .
    $cfg['which_template'] . '/img/' . $dir_icon);
    //--------------------------------------------------------------------------------------

    Also need to add this to TEMPLATE_CONFIG.INC.PHP
    //--------------------------------------------------------------------------------------

    // custom folder pictures, images go in your template img folder
    $cfg['template']['icon']['folder_audio'] = '_audio_';
    $cfg['template']['icon']['folder_audio_pic'] =
    'folder_audio.png';
    $cfg['template']['icon']['folder_video'] = '_video_';
    $cfg['template']['icon']['folder_video_pic'] =
    'folder_video.png';
    $cfg['template']['icon']['folder_docs'] = '_docs_';
    $cfg['template']['icon']['folder_docs_pic'] = 'folder_docs.png';

    //------------------------------------------------------------------------------------------

    Now all I have to do is add "_video_" to my directory name...

    EXAMPLE: phpAutoGallery/Some_Videos_Of_Stuff_video_

    and yeah a different folder image. Now if you want to hide
    the folder extention name in the directory name... change
    this in the DIRLISTING.PHP:

    $arrCurrentDirDirs[i].name to $arrCurrentDirDirs[i].clean_name

    also to clean the navigation bar of your extention, I did this:

    {if $arrCurrentNav[i].href}
    <a
    href="{$arrCurrentNav[i].href}">{$arrCurrentNav[i].name|regex_replace:"/((^_[a-z]*_)|(_[a-z]*_$))/":""}</a>
    {else}

    <b>{$arrCurrentNav[i].name|regex_replace:"/((^_[a-z]*_)|(_[a-z]*_$))/":""}</b>
    {/if}
    {if !$smarty.section.i.last}
    &nbsp;/&nbsp;
    {/if}

    Maybe one of you folks would like to hard code the $clean
    into WRAPPER.PHP? Until then...Peace

    -MrTorrance

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.