Log in | Register | Lost password

Bottom
HACK: Relating a Mediashare Album with a Pagesetter publication
  • Posted: 16.01.2009, 23:35
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Topics are needed to install Pagesetter but i never really got to use them in any publication type i made... I found easier to edit and define a category field.

    In any case, what, then can we do about the now unused Topic field when creating a new publication? Well why not repurpose it to create a link between your publications (any publication) and your Mediashare albums?

    Yeah!, like this you would create an album, then write about those images and link them...

    Pros
    -----

    You'll use the $core.topic.name to get the name from that album.
    It should make easier to embed the contents of an album into a publication.
    It means also that you can also add to your album and it will dynamically expand on your publication.

    Cons
    ----

    You'll be losing your topics (if you needed them... well... then don't do this).
    Implementation needs to be 'unhacked', maybe someone more intelligent can catch the drift and code up a solution that's less dirty.
    Filtering by topic would be pointless (using topicid=x)

    -----------------------------------

    Why?
    ----

    Not only because it can be done, but because it's more convenient: you can use the XML output to display your album images using several flash scripts, or create your own templates to show the album embedded on the publication.

    -----------------------------------

    How?
    ----
    BACKUP YOUR INSTALLATION AND DATABASE!
    TEST FIRST IN LOCALHOST!
    If this breaks up your site I'm not responsible.

    Go to line 280 of common.php in modules/pagesetter/
    Change the word Topics for mediashare (lowcaps!!!)

    Lines 287 to 290 or 288 to 291 has the $sql variable (the sql query), change it so it now reads like this:

    Code

    $sql = "SELECT ms_id, ms_title FROM zk_mediashare_albums ORDER BY ms_title";


    Of course, if you chose a different prefix for your tables (pn if you use postnuke for example) change it accordingly.

    ------------------------------------

    THAT'S IT!

    Don't touch anything more and go to any publication type... See the wonderful Album selector where the publication topic selector was !!!

    ------------------------------------

    Usage
    -----

    Unfortunately i have not yet discovered how to extract the main image from an album to use as an album cover so... We'll do with what we have at hand

    On your templates:

    $core.topic.name
    Displays the associated Album name.

    $core.topic.id
    Displays the associated Album Id number.

    ------------------------------------

    So... we finish an article and we could use the xml mediashare template to create a nice list that works with ... say ... JW Image Rotator.

    This way also let's us use any mediashare output that is headerless and footerless (lightbox!!!).

    If somebody says "Hey, that image is mine and i would like you to remove" (you know, your typical Cease and Desist), you can easily remove the offending image from your Mediashare Album instead of editing your Pagesetter publication.

    -------------------------------------

    TODO
    ----

    Here's where we need people far more clever!
    The $sql query is not parametrized, and hence, not truly up to the quality of what Jorn has done with his beautiful modules (and that's why this is a HACK and not a MOD :D )...

    There should be a way to do this (IMHO) without needing to cripple Topics.

    I propose somebody fixes this and let's us know where to make the changes and what files to add so this is more compliant.

    There should be a way to "read" what the Album main image is, to display it if needed.

    There should be a way to say something like $core.mediashare_album.id, $core.mediashare_album.name and $core.mediashare_album.mainimage and a proper function to embed the associated Album info and/or contents using any mediashare template we would like.

    What happens to a publication when it points to an album that no longer exists? If this happens, there should be a "set to none" function working there too (on Mediashare).

    What happens if the album has subalbums or if it doesn't have any pictures?

    Can somebody code or hack an FLV connector for Mediashare?

    -------------------------------------
    I'm going to test it just now, i'll let you know how it went!





Template courtesy of Designs By Darren.