Not signed in (Sign In)

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

    • CommentAuthorpandianbe
    • CommentTimeJun 20th 2008
     
    Hi,

    Please let me know...

    How to disable the collection concept? i need only albums and Pictures? is it Possible...

    Thanks in advance :-0
    • CommentAuthoropec
    • CommentTimeJun 25th 2008
     
    Could you explain what you modified in order to start directly with the album view? I already looked at the php file but i couldnīt find a poitn to start editign because iīm not a expert in php.

    greetz

    opec
    • CommentAuthorspeedygot7
    • CommentTimeJun 28th 2008
     
    the way i did it was to go to gallery.php and in the_gallery change the $use_file=collections.php to collection.php then in plog-functions.php in plogger_init change the else condition from

    else {
    plogger_init_collections(array(
    'from' => $from,
    'limit' => $lim,
    'sortby' => !empty($config['collection_sortby']) ? $config['collection_sortby'] : 'id',
    'sortdir' => !empty($config['collection_sortdir']) ? $config['collection_sortdir'] : 'DESC'));*/


    ======
    to

    plogger_init_albums(array(
    'from' => $from,
    'limit' => $lim,
    'collection_id' => DEFAULT_COLLECTION,
    'sortby' => !empty($config['album_sortby']) ? $config['album_sortby'] : 'id',
    'sortdir' => !empty($config['album_sortdir']) ? $config['album_sortdir'] : 'DESC'));
    }

    where DEFAULT_COLLECTION is the collection_id of the base collection. If you want to use the default collection that comes with plogger then you can use collection id = 1;

    that is all.

    this seems to work. However, I am not sure if this breaks anything else so use this at your own risk.

    hope this helps
    Thankful People: manavtech, _Eric_
    •  
      CommentAuthor_Eric_
    • CommentTimeJul 1st 2008 edited
     
    Speedygot7's code seems to work well. As a final step, you can get rid of the collections link in the breadcrumbs by changing the last line of the generate_breadcrumb function in plog-functions.php:

    return '<div id="breadcrumb_links">'.$breadcrumbs.'</div>';

    into

    return '<div id="breadcrumb_links">' . str_replace($collections_link . $sep, '', $breadcrumbs) . '</div>';

    This gets rid of the collections link plus the following separator when the breadcrumbs are returned. You could also prevent the collections link and separator from being added to the breadcrumbs in the first place, but this happens in a number of different places, so the method above leaves less room for mistakes and is easier to change back later if needed.
    Thankful People: manavtech
    • CommentAuthormadalyn
    • CommentTimeJul 8th 2008
     
    Please help:
    I've been trying to jump-to either collection (name of collection) or slite-show view. I've been tracking those who enter the site and most don't seem to have the where-with-all to figure out they need to click through to collection and then the one collection I have to get to my photo's .


    With help from Plogger, I've embedded <?php the_gallery(); ?> within my gallery page. I tried your solution and it didn't work (I'm guessing either because I've done something wrong and/or the modifications done mean a different solution.

    the first line on my gallery page named: http://mysite.com/gallery/index.php is this line: <?php include("gallery.php"); ?>

    here's the html from "gallery.php"
    <?php
    #error_reporting(E_ALL);
    include("plog-globals.php");
    include_once("plog-load_config.php");
    include_once("plog-functions.php");

    global $config;

    // process path here - is set if mod_rewrite is in use
    if (!empty($_REQUEST["path"])) {
    // the followling line calculates the path in the album and excludes any subdirectories if
    // Plogger is installed in one
    $path = join("/",array_diff(explode("/",$_SERVER["REQUEST_URI"]),explode("/",$_SERVER["PHP_SELF"])));
    $resolved_path = resolve_path($path);
    if (is_array($resolved_path)) {
    $_GET["level"] = $resolved_path["level"];
    $_GET["id"] = $resolved_path["id"];
    if (isset($resolved_path['mode'])) {
    $_GET['mode'] = $resolved_path['mode'];
    };

    // get page number from url, if present
    $parts = parse_url($_SERVER["REQUEST_URI"]);
    if (isset($parts["query"])) {
    parse_str($parts["query"],$query_parts);
    if (!empty($query_parts["plog_page"])) $_GET["plog_page"] = $query_parts["plog_page"];
    };
    $path = $parts["path"];
    };
    };

    // Set sorting session variables if they are passed
    if (isset($_GET['sortby'])) {
    $_SESSION['plogger_sortby'] = $_GET['sortby'];
    };

    if (isset($_GET['sortdir'])) {
    $_SESSION['plogger_sortdir'] = $_GET['sortdir'];
    };

    // The three GET parameters that it accepts are
    // $level = "collection", "album", or "picture"
    // $id = id number of collection, album, or picture
    // $n = starting element (for pagination) go from n to n + max_thumbs (in global config)

    // use plogger specific variables to avoid name clashes if Plogger is embedded



    $GLOBALS['plogger_level'] = isset($_GET["level"]) ? $_GET["level"] : '';
    $GLOBALS['plogger_id'] = isset($_GET["id"]) ? intval($_GET["id"]) : 0;
    $GLOBALS['plogger_mode'] = isset($_GET["mode"]) ? $_GET["mode"] : '';

    $allowed_levels = array('collections','collection','album','picture','search');
    if (!in_array($GLOBALS['plogger_level'],$allowed_levels)) {
    $GLOBALS['plogger_level'] = 'collections';
    };

    // niisiis, mul on need 2 funktsiooni ja ma pean need mergema
    // vana mingi teise failiga, et ma saaks plogger korrektselt integreerida
    // noh, proovime siis.

    define('THEME_DIR', dirname(__FILE__) . '/themes/' . $config['theme_dir']);
    define('THEME_URL', $config['theme_url']);

    function the_gallery_head() {
    plogger_head();

    $use_file = 'head.php';
    if (file_exists(THEME_DIR . "/" . $use_file)) {
    include(THEME_DIR . "/" . $use_file);
    } else {
    include(dirname(__FILE__).'/themes/default/'.$use_file);
    }
    }

    function the_gallery(){
    // collections mode (show all albums within a collection)
    // it's the default
    $use_file = "collections.php";
    if ($GLOBALS['plogger_level'] == "picture"){
    $use_file = 'picture.php';
    }
    elseif ($GLOBALS['plogger_level'] == "search"){
    if ($GLOBALS['plogger_mode'] == "slideshow") {
    $use_file = 'slideshow.php';
    } else {
    $use_file = 'search.php';
    };
    }
    elseif ($GLOBALS['plogger_level'] == "album") {
    // Album level display mode (display all pictures within album)
    if ($GLOBALS['plogger_mode'] == "slideshow") {
    $use_file = 'slideshow.php';
    } else {
    $use_file = 'album.php';
    };
    }
    else if ($GLOBALS['plogger_level'] == "collection") {
    $use_file = 'collection.php';
    };

    // if the theme does not have the requested file, then use the one from the default template
    if (file_exists(THEME_DIR . "/" . $use_file)) {
    include(THEME_DIR . "/" . $use_file);
    } else {
    include(dirname(__FILE__).'/themes/default/'.$use_file);
    }
    }
    ?>
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 8th 2008 edited
     
    So basically, it's a 3 part process (combining the intent of both speedygot7's and _Eric_'s posts above) using the Beta 3.0 code.

    1. open 'gallery.php'.
    Find:function the_gallery(){
    // collections mode (show all albums within a collection)
    // it's the default
    $use_file = "collections.php";

    Change To:function the_gallery(){
    // collections mode (show all albums within a collection)
    // it's the default
    $use_file = "collection.php";


    2. open 'plog-functions.php'.
    Find:function plogger_init() {
    [...more code here...]
    } else {
    // Show all of the collections
    plogger_init_collections(array(
    'from' => $from,
    'limit' => $lim,
    'sortby' => !empty($config['collection_sortby']) ? $config['collection_sortby'] : 'id',
    'sortdir' => !empty($config['collection_sortdir']) ? $config['collection_sortdir'] : 'DESC'));
    }

    Change To:function plogger_init() {
    [...more code here...]
    } else {
    // Show all of the collections
    plogger_init_albums(array(
    'from' => $from,
    'limit' => $lim,
    'collection_id' => 1, //where 1 equals the id of the collection you want to display
    'sortby' => !empty($config['collection_sortby']) ? $config['collection_sortby'] : 'id',
    'sortdir' => !empty($config['collection_sortdir']) ? $config['collection_sortdir'] : 'DESC'));
    }


    3. open 'plog-functions.php'.
    Find:function generate_breadcrumb(){
    [...more code here...]
    return '<div id="breadcrumb_links">'.$breadcrumbs.'</div>';

    Change To:function generate_breadcrumb(){
    [...more code here...]
    return '<div id="breadcrumb_links">' . substr($breadcrumbs, strpos($breadcrumbs, "&raquo;")+8) . '</div>';


    I think that should work for you. _Eric_'s post is using post-Beta3.0 release code (the breadcrumbs function has since been simplified with extended functionality).
    Thankful People: manavtech, douglas, Drakkim
    •  
      CommentAuthordouglas
    • CommentTimeJul 9th 2008 edited
     
    sidtheduck's post is good but needs two corrections in step three.
    1. strpos(haystack, needle)
    2. When you first visit the page, it reads "ections"

    Step three, open 'plog-functions.php'.
    Find:

    default:
    $breadcrumbs = ' <b>Collections</b>';
    break;
    }

    return '<div id="breadcrumb_links">'.$breadcrumbs.'</div>';


    Change to:

    default:
    //code from case 'collection' and changing $id
    $row = get_collection_by_id(1); //where 1 equals the id of the collection you want to display
    $breadcrumbs = ' <a accesskey="/" href="'.$config["baseurl"].'">Collections</a> &raquo; <b>' . SmartStripSlashes($row["name"]) . '</b>';
    if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= ' &raquo; Slideshow';
    break;
    }

    return '<div id="breadcrumb_links">' . substr($breadcrumbs, strpos($breadcrumbs, "&raquo;")+8) . '</div>';


    If you don't want there to be duplicate code, I believe you can actually delete the 'collection' case after this change.
    Thankful People: sidtheduck, manavtech, Drakkim
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 9th 2008
     
    Thanks for catching my misuse of strpos, douglas! I'll edit my post above so people can just copy/paste that if they would like.
    Thankful People: sergeglass
    • CommentAuthormanavtech
    • CommentTimeAug 12th 2008 edited
     
    Hi,

    I tried your steps and unfortunately they didn't work for me. On the gallery page it says "No pictures in this collection!" and in the backend it throws warning

    "Warning: Cannot modify header information - headers already sent by (output started at /home/sarahand/public_html/gallery/plog-functions.php:4482) in /home/sarahand/public_html/gallery/admin/plog-admin.php on line 29"

    and refuses to show up anything! :(

    I don't know whats going wrong! Please check the url http://www.sarahandmenachem.com/album.php

    Please help!
    • CommentAuthormanavtech
    • CommentTimeAug 12th 2008 edited
     
    I installed Plogger again and it seems to work fine now. Strange, why it was not working with the previous install. Anyways, thanks a lot :)

    But I would still like to know what that header problem is? Why header information can't be modified? Isn't there any way to modify/update the header information later?

    Best Regards
    • CommentAuthorKatoJune
    • CommentTimeAug 21st 2008
     
    Hello,

    I have tried the above steps but I am now having a problem. It just says no pictures in this collection. At first I thought it was just I didn't have the right collection id but I have checked it an made sure I did any other suggestions?

    Thanks
    • CommentAuthorDrakkim
    • CommentTimeSep 29th 2008
     
    @KatoJune

    In steps 2 & 3, make sure you change the id to the one you're using...

    To find it, go to the collection (in an unmodified version) and look at the address bar for something like "&id=" the number after that is your collection ID

    If you took a nice fresh install and didn't delete the default collection until after creating a new one (like I did), your ID is probably 2
    • CommentAuthorfjordside
    • CommentTimeOct 23rd 2008
     
    Hi All,

    This is allmost exactly what i was looking for, only i need the disabling-hack to go one level further - to also disable albums (so that the user only sees the content of the default album).

    Is there any way to make this possible?


    Thanks
    • CommentAuthormashupmo
    • CommentTimeNov 9th 2008
     
    I share in the original topic of this string. I just want the albums to show up and not the collections. I did all of the above steps and it worked with one exception.

    The word "ections" appears at the top of the albums

    Here is the page I'm working on: http://www.mashupmobile.com/altogetherimprovements/ploggerb3/index.php

    How can I get that to disappear?.......
    • CommentAuthormashupmo
    • CommentTimeNov 9th 2008
     
    Nevermind - I didn't copy the close for the "break" at the end of the code that Douglas posted earlier.

    default:
    $row = get_collection_by_id(1);
    $breadcrumbs = ' <a accesskey="/" href="'.$config["baseurl"].'">Collections</a> &raquo; <b>' . SmartStripSlashes($row["name"]) . '</b>';
    if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= ' &raquo; Slideshow'; break;
  1.  
    BRILLIANT! thank you all so much!
    • CommentAuthormikez
    • CommentTimeJan 12th 2009
     
    Because I try to avoid mixing data with structure, here's my contribution to dynamically fetch the category ID rather than have to hardcode it (because the category ID will change if you ever delete it and add a new one):

    // dynamically fetch the default category id
    $result=run_query("SELECT id FROM ".TABLE_PREFIX."collections LIMIT 1");
    $rowx=mysql_fetch_assoc($result);
    $catid=$rowx['id'];
    • CommentAuthorsergeglass
    • CommentTimeJan 19th 2009
     
    Thanks for the dynamic fetch of the ID. But in which file and where is this placed? Is it added to or replaces step 3 above in the plog-functions.php? Thanks!