Viewing 4 replies - 1 through 4 (of 4 total)
  • First, I would recommend you to wait some days, as this weekend I will release the 0.8 version and how to do it will change on that.

    Instructions are for the coming 0.8 version, you can get the development version at http://wordpress.org/extend/plugins/alkivia/download/

    You need two things:

    1) The user ID you want the gallery of.
    2) Call the function aoc_get_user_gallery() passing as the first parameter the user ID.

    The function will return an array with all needed data for user gallery. Each array element is a gallery item. In this item, you need the IMG key which is the HTML source to the image thumbnail.

    I’m replacing just now the system that outputs the user gallery and will be done this weekend. When finished, all will be easiest, as will exists a function like: aoc_get_gallery_output($user_id); With this function, you only will need to call it with the user ID and you will get the formated gallery content to output it anywhere you want. Also, this will allow to code new gallery templates.

    Stay connected as I will post here as soon as this is done and available.

    Just released 0.8 this includes a function: aoc_gallery_content() that can be used for what you want.

    Call this function this way:

    <?php
    if ( aoc_is_component('gallery') {
        echo aoc_gallery_content($user_login_or_id);
    }

    Look I’m checking first that the gallery component is active to not broke anything if the component is disabled. If you will use outside the plugin, check that function exists:

    <?php
    if ( function_exists('aoc_gallery_content') {
        echo aoc_gallery_content($user_login_or_id);
    }

    The only parameter the function needs is self-explanatory. Pass the user ID or the user login. You will get the HTML gallery code if the user has images, if not, the function returns false.

    The gallery output comes from the selected gallery template (on the settings page). Templates are located in the ‘templates’ directory, and those for gallery are prefixed ‘gallery-‘. If you create your own template, upload it to this folder and select it on the settings page, you template output will be returned.

    Thread Starter acub

    (@acub)

    i’m back.
    just upgraded the plugin to 0.8 and I think it’s great.
    i specifically like that you’ve made styling the list very easy.
    I’ll try what you recommended tomorrow and will post again.

    thank your for the quick response and support.

    hi, I figured it would be best to move the discussion here. Still having a minor problem with implementing the code. I looked through the files that make up the Alkivia plugin; also through forum posts to see if I could find the information I need. Sorry if I’m asking a question you’ve already answered.

    Here’s the problem:

    I’m attempting to use your 2nd code example, to call up the image gallery from another page outside of the plugin. How can I access the user metadata outside the plugin? I think the necessary variables are not in the proper scope and I would need to require a library file from the Alkivia plugin. Is that right? Thanks for your time!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: User Community] Gallery outside dashboard?’ is closed to new replies.