• I know this has been asked before so I thought I would share how I do it.

    I added a tag cloud to my side bar and added a POST called ‘Custom Gallery’. Each time I add a new gallery and tag the pictures, I go to my ‘Custom Gallery’ post and add new tags there. Most the time the tag’s are already there anyhow, but I check. This way, my Tag Cloud will pick up my new tags.

    Then for the body of the post (I am using the exec-php plug-in) I put in:

    <?php
    if ($_REQUEST[“tag”] <> “”) echo “[tags=”.$_REQUEST[“tag”].”]”;
    ?>

    Works great. I am probably going to use the album tag if multiple tags are being searched. Makes more sense. I’ll have to replace the ‘+”s with ‘,”s when I do this in php.

    I would also like to figure out how to search tags like tag1+tag2 so the return is only the pictures that include both tags. Does anyone no how to do this?

    Thanks. Hopefully someone has the answer to multi taged custom galleries. Hope my code helps someone out there.

Viewing 15 replies - 16 through 30 (of 35 total)
  • Hi Guys,

    image library

    I have just worked out a simple way to search tags, via the SQL-generated tag cloud. It’s just a couple of SQL queries.

    I will work out now to do multiple tag selection via tickboxes. Something like generating [tags=MBL, Boston, 2008, WSC] via multiple-tickboxes selection.

    But, ya, it would be great if Alex would be able to implement a tag cloud which works with the WP tag system.

    Cheers,

    Eric

    Thread Starter realsol

    (@realsol)

    I’ll tell ya, just looked at your image library it the tag’s look great. Great pic’s by the way.

    For myself, as my blog page isn’t quite as large, would lower the font size and put the code into a text widget to display on the sidebar.

    I am starting to like the idea keeping the photo tags separate from the blog tags though. Thought I wouldn’t say that. I might tag the page itself with my top level tags, like 2008, 2007, 2006… so a user could jump to the photo tag page from within my standard wordpress blog tags, but then display a separate tag cloud once on the page showing only my photo tags, since there will probably be a lot once I get all my pic’s online.

    This way also a user could click on another tag 3 drill down, once you figure the SQL stuff. I wish I had more time to spend on it than I do. Looks like fun. I would have to brush up on my SQL a bit I’m afraid. Seems like I get deep into something when I need it, then move on to another language (Delphi is my money maker) and then forget everything I learned. It’s been 7 years since I really did anything in PHP. But I am having a blast.

    Let me know how the progress is going.

    And Alex, keep up the work!!

    Thanks yyeric.

    Thread Starter realsol

    (@realsol)

    Oh, when I say drill down, I mean:

    • Show ALL tag cloud
    • When a user clicks on a tag, then show a tag cloud showing only the tags that include the tag chosen.
    • When a user clicks on another tag, show only a tag cloud that included the 2 tags already chosen, and so on.

    This way, a user can drill down to what the want. I would also include within the tag a ‘All Images’ tag, big, so a user could go back to the beginning easily.

    I hope you know what I mean…

    Thanks Eric & Realsol for your ideas, very helpful for the further dev.

    If you are interested (and have time) check out the current trunk of Version 1.00, during the upgrade routine I added all image tags to the WordPress tag tables and from this point I would later go on to build a Tag cloud or what ever is usefull. The tables wp_ngg_pic2tags & wp_ngg_tags will be then dropped…

    Please use the trunk only on a test system, it could break your live blog.

    Thread Starter realsol

    (@realsol)

    I thought I would share this bit of code I use to browser my albums and search my tags all within the same page or post. You have to be able to execute php on a page or post in order to run this, but I works pretty well, I use this in combination with the tag cloud mentioned above. And I hide the post from casual visitors useing the hidepost plugin.

    yyeric, you might like this along with your tag cloud. Great way to integrate a tag based gallery, with and albumtag and gallery tag.

    Basically, you either select the album, or you do a search. It also is a great management tool. If I new javascript better (just learning) I probably could have fun with this…


    [hidepost]
    Select an Album or search for what (or who) you are looking for.
    <script type="text/javascript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }
    //-->
    </script>

    <table width="100%" border="0">
    <tr>
    <th valign="top" scope="row"><?php
    global $wpdb;
    $albumlist = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY id ASC");
    ?>
    <select name="jumpMenu" id="jumpMenu" onChange="MM_jumpMenu('parent',this,0)">
    <option value="">Select Album</option>

    ';

    <?php
    if(is_array($albumlist))
    {
    foreach($albumlist as $album)
    {
    if ($_POST['myalbum'] == $album->id) $selected = 'selected="selected" ';else $selected = '';
    echo '<option value="https://yoururl.com/?page_id=YourID&myalbum='.$album->id.'">'.$album->name.'</option>';
    }
    }
    ?>
    </select></th>
    <td><form name="form1" method="get" action="https://yoururl.com" >
    <p>
    <input name="page_id" type="hidden" value="54">
    <input name="tag1" type="text">
    <input type="submit" name="submit" id="submit" value="Search">

    </p>
    </form></td>
    </tr>
    </table>

    <?php
    if ($_REQUEST["tag1"] <> "")
    {
    echo "[tags=".$_REQUEST["tag1"]."]";
    } elseif ($_REQUEST["myalbum"] <> "")
    {
    echo "[album=".$_REQUEST["myalbum"].",extend]";
    }
    ?>
    [/hidepost]
    Currently there are no public Pictures online. You will need to log-in to see any of my albums.

    Anyhow, just thought I would share it.

    Thread Starter realsol

    (@realsol)

    Woops. hit submit twice.

    G’Day, Is there a demo on your site that we can have a look?

    Eric

    Thread Starter realsol

    (@realsol)

    Yeah, I will have to get it back up. Been moving things around and am having a hard time getting the time to upload again since the flash upload doesn’t work for me and I am running WordPress MU and that just adds another layer of heartache.

    I’ll let you know.

    Thread Starter realsol

    (@realsol)

    Until the flash upload is fixed or nextGEN can create galleries for uploaded files, I am going to be using a different plug-in. Been fun while it lasted, but I don’t feel like going through everything over again.

    Hi,

    Thank you so much for posting this php code to allow tags for nextGen, I have followed the tutorial kindly posted by yyeric, and all is working apart from when i click a tag in the cloud, I am not getting the resulting pics to show.

    Anyone know what i’m doing wrong ?

    here is a link https://tommills.co.uk/latestnews/image-library/

    Really grateful for any advice ??

    best wishes,

    tom

    I used part of yyeric’s code to output the tag list in the sidebar of my page. I’m not really a programmer, so I have no idea if this is the best way to do it, but it’s working for what I need it for.

    I created a new page called “tags” (id=46) with the content:
    [albumtags=]

    Then put this code in my gallery page sidebar to output the tags as links:

    Show photos of:<br /><ul class="galtags">
    <?
    global $wpdb;
    $results = $wpdb->get_results('SELECT name, slug FROM wp_ngg_tags');
    foreach ($results as $row) {
    
    echo "<li><a href=https://www.fathernaturelandscapes.com/nggallery/page-46/tags/";
    echo $row->slug;
    echo ">";
    echo $row->name;
    echo "</a> </li> ";
    }
    ?>
    </ul>

    The link in the sidebar code uses the tags page id and slug to make it work. Don’t really understand why, but there you have it.

    Here’s the gallery page in action.
    Here’s a more indepth explanation of what I did.

    Hi,

    Thanks for reply shopefowler. After quite a few hours I managed to get yyeric’s code to work. The trouble was creating the url to display the images ??

    Yyeric if you are reading this, a thousand thank you’s ! and also to realsol !

    I am a very happy man ??

    best wishes,

    tom

    p.s. I will post link to library when finished, right now I have an awful lot of tagging to do ??

    G’Day guys,

    It’s all for a better NextGen Gallery to come! Thanks Alex for all the development work.

    By the way, if you want tag cloud to be listed in alphabetical order

    $results = $wpdb->get_results('SELECT name, slug FROM wp_ngg_tags ORDER by name');

    tommo77funk you have got some great photography works out there!
    will do.

    For those who might be interested. I wrote up a little SQL to bring back “Related Tags” after you are viewing [tags=Whatever] via $_REQUEST[“tags”]

    To get a feel of what it is like. Please click through to Canberra Pictorial Image Library. Select on any of the tags listed in the page. Or click directly here on one of the tags: AIS Basketball.

    It brings back all the “other” tags which were embedded with “all” images listed in the page.

    I will write up a quick tutorial very soon.

    Cheers,

    Eric

    If you are a heavy NextGen Gallery user, you probably will sooner or later realise that there are too many tags in tag cloud. Of course, you may limit the number of tags showing, but I don’t want to eliminate any.

    I will write something up which simulates 2 level of tags when displaying the tag clouds.

    Example.

    MLB
    MLB-Boston
    MLB-Seattle
    MLB-Chihcago

    the 3 teams will show under MLB as a parent tag.

    Don’t know how it will go, but this is something I need and will do my best to try to get it up and running.

    Cheers, just some thoughts.

    Eric

Viewing 15 replies - 16 through 30 (of 35 total)
  • The topic ‘[Plugin: NextGEN Gallery] I now am displaying pic’s from a tag cloud!’ is closed to new replies.