Not signed in (Sign In)

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

    • CommentAuthorchewbears
    • CommentTimeJul 7th 2008 edited
     
    I am having trouble making a button appear ONLY on selected albums. Meaning I would like a button that will behave differently depending on which album you are in.

    Currently when I navigate to Album 1 I would like to have a button that searchs for the term CPP1. When this button is clicked it shows all the photos in that particular album that have that key word. (CPP1 WOULD be a unqiue keyword that would only apply to pictures in that particular album).

    Now the tricky part.

    However when I navigate to Album 2 I would no like that same button (same in terms of place name) to search for the term CPP2. When clicked it does the same as the above and remains unique.

    And if you go to Album 3 I would like the button to either not be there or not function

    Is this possible? Or on the Album level can you only really do a generic function for all albums?

    Thanks
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 8th 2008
     
    chewbears,

    Where would you like this button to appear? In the header, footer, or the "album part" in album.php? I can help you with any of them, but the logic will be different depending on which location you would like the header to be located. If you could create a screenshot of where you would like the button (or better yet, do a dummy button on an install that I can see the source of), I can provide you with the necessary code.
    • CommentAuthorchewbears
    • CommentTimeJul 8th 2008
     
    Sid,

    Thanks for the reply, first off what part is the easier, or are they all the same.

    In my vision I woul dhave it in the middle of View as Slideshow and Sort by:
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 8th 2008
     
    Posted By: chewbearsIn my vision I woul dhave it in the middle of View as Slideshow and Sort by:

    Footer it is then! :D

    One more question, when searching for CPP1, did you only want CPP1 to be searched for in that album only, or would you only be adding CPP1 to those album images from the admin section? If you are trying to search only within that album (i.e. if CPP1 is listed in the description of album 1 AND album 2, but you only want to search within album 1), that means we have to edit the search function as well. If CPP1 is ONLY listed in the searchable areas of album 1, then we can easily add the searchterms to the URL.
    • CommentAuthorchewbears
    • CommentTimeJul 9th 2008
     
    SId,

    THanks again for the fast reply. CPP1 would only be in that particular album. Its for flight photos and every say 5th minute we tag on with a tag like CPP1. So when this button works it shows you the picture for every 5th minute and at the distance we are it it almost makes like a panaramic.
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 9th 2008
     
    chewbears,

    One final question, did you want the search to be dynamically linked to the album id (i.e. the search will always be for CPPx where x is the same number as the album viewed), or would you like to manually code the search for each album?
    • CommentAuthorchewbears
    • CommentTimeJul 10th 2008
     
    CPP1 is only in the Exif information and not related. I do believe the template you create will have to be manually edited for every album I create.
    • CommentAuthorchewbears
    • CommentTimeJul 11th 2008 edited
     
    100% manually edit the code for each album. Sorry for the delay.
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 11th 2008 edited
     
    So basically you would do something like this in your 'footer.php' for the theme you are using:
    <?php
    if ($GLOBALS['plogger_level'] == "album") {
    switch ($GLOBALS['plogger_id']) {
    case '1': // This is the album id #
    $button = "<a href=\"".$_SERVER['PHP_SELF']."?level=search&searchterms=CSS1\">CSS1</a>"; // this searches for 'CSS1' if the album id is '1'
    break;
    case '4': // This is the album id #
    $button = "<a href=\"".$_SERVER['PHP_SELF']."?level=search&searchterms=CSS2\">CSS2</a>"; // this searches for 'CSS2' if the album id is '4'
    break;
    default: //defaults to nothing
    $button = '';
    break;
    }
    }
    ?>

    Then wherever you would like to have the button show up, you place the following code:
    <?php print $button; ?>
    Like if you were using the default theme, your footer.php code could be:
    print ' <div id="pagination">
    <table style="width: 100%;">
    <tr>
    <td>'.plogger_slideshow_link().'</td>
    <td>'.plogger_pagination_control().'</td>
    <td>'.$button.'</td>
    <td id="sortby-container">'.plogger_sort_control().'</td>
    <td id="rss-tag-container">'.plogger_rss_feed_button().'</td>
    </tr>
    </table>
    </div>'."\n";
    • CommentAuthorchewbears
    • CommentTimeJul 11th 2008
     
    So basically the first album I make is 1, second = 2 etc etc?

    Thanks again!
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 11th 2008
     
    Posted By: chewbearsSo basically the first album I make is 1, second = 2 etc etc?

    Thanks again!
    Yep, but you can also check this in the Admin -> Manage section. When you are at the album you want, the URL should read http://yourploggerinstall.com/plog-manage.php?level=pictures&id=4 (where '4' is the ID number for that album).
    • CommentAuthorchewbears
    • CommentTimeJul 13th 2008 edited
     
    Sid,

    I am having a little problem implementing the above code. Could you paste a working default footer.php? Also should I create my own image called button (the name of the picture?) , but what folder do I put it in? Bascially pasting your code as you have instructed above does not add any button.
    • CommentAuthorchewbears
    • CommentTimeJul 15th 2008
     
    Alright I spent most of yesterday trying to trouble shoot this and "think" that everything works when pasted but I can not get the button to appear. My button is called button.gif. I think the $button is referencing this, but I am unsure where I was suppose to put the button (folder wise). Testing I am using the default theme so I think as soon as I understand where and how button.gif works or how your code is using the button as an image I will be all set. Still seeing your default footer would be great. You can e-mail too if need be to attach files.

    Thanks sid!
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 15th 2008 edited
     
    Hi chewbears,

    My code above doesn't have a button at all, it should just have a link (i.e. CSS1). If you want a button named button.gif, you should use some code like this:<?php
    if ($GLOBALS['plogger_level'] == "album") {
    switch ($GLOBALS['plogger_id']) {
    case '1': // This is the album id #
    $button = "<a href=\"".$_SERVER['PHP_SELF']."?level=search&searchterms=CSS1\"><img src=\"button.gif\" title=\"button\" alt=\"CSS1\" /></a>"; // this searches for 'CSS1' if the album id is '1'
    break;
    case '4': // This is the album id #
    $button = "<a href=\"".$_SERVER['PHP_SELF']."?level=search&searchterms=CSS2\"><img src=\"button.gif\" title=\"button\" alt=\"CSS2\" /></a>"; // this searches for 'CSS2' if the album id is '4'
    break;
    default: //defaults to nothing
    $button = '';
    break;
    }
    }
    ?>
    Thankful People: chewbears
    • CommentAuthorchewbears
    • CommentTimeJul 15th 2008 edited
     
    Well Sid, I just figured it out, I am embaressed to say, but... I was refreshing in album ID '2' not 1 or 4 : ( It works great !!!

    One thing I am noticing though is that if the collection ID matches the Album ID I get the text on the collection and the album that matches the number. So Collection 1 has CSS1 and Album 1 does as well.

    Also as I am developing my ideas I just ran into the problem which I thought was impossible. What if 1 album has CCS1 and CSS2? Could there be a drop down mnu like the one next to sort by: That would allow the user to choose which string (css1 or css2)? Thanks so much
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 15th 2008 edited
     
    Posted By: chewbearsOne thing I am noticing though is that if the collection ID matches the Album ID I get the text on the collection and the album that matches the number. So Collection 1 has CSS1 and Album 1 does as well.
    heh, my bad. I fixed my post above. The first line should have "==" like:if ($GLOBALS['plogger_level'] == "album") {not:if ($GLOBALS['plogger_level'] = "album") {

    Posted By: chewbearsAlso as I am developing my ideas I just ran into the problem which I thought was impossible. What if 1 album has CCS1 and CSS2? Could there be a drop down mnu like the one next to sort by: That would allow the user to choose which string (css1 or css2)?
    This could be done, but not as easily as the above code. I can look into it for you. You'll have to submit a form (either via a form button or a javascript submit link) instead of just a normal link. Let me know if you want this looked into. Also, would you only want the pulldown if there were more than one search term that you manually code in?
    • CommentAuthorchewbears
    • CommentTimeJul 15th 2008
     
    Sid you can look into it but I would like to research what exactly I would want out of this feature, so I would rather you not spend time looking into it too much until I have an idea of what exactly I would want out of a feature like this. I am just thinking of how to populate multiple CSS1 links but not having it look sloppy, so drop down boxes where my next best idea. If you have any ideas of how to make it look more professional let me know. I just didn't want it to say CSS1, CSS2, right there in the footer.