coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Upload => Topic started by: pnear on January 10, 2005, 06:17:18 AM

Title: XP Publish Wizard - Categories not output in album listing
Post by: pnear on January 10, 2005, 06:17:18 AM
I recently upgraded to the latest released version and noticed a very welcome upgrade - albums are now listed in dropdowns with their category preceding the album names.

However, this isn't the case in the XP Publishing Wizard interface, which I use extensively.  Would be very helpful for me to have this listing in the XP_Publish interface, to help sort through, for example "2004 > Christmas" and "2003 > Christmas".

A quick search didn't turn up much, but I'm wondering two things:
1. Anybody already done this, or is it scheduled for the next release?
2. If I write a quick change, can it be considered for inclusion in the next release? 

Not a fan of running forked code, that's what kept me from upgrading for so long to 1.3.

Thanks,
Pete
Title: Re: XP Publish Wizard - Categories not output in album listing
Post by: Joachim Müller on January 10, 2005, 09:26:25 AM
XP Publisher is part of the operating system "Windows XP" - you'll have to post this request over at the site from Redmond afaik. Nothing we can do about this... ;)

Joachim
Title: Re: XP Publish Wizard - Categories not output in album listing
Post by: pnear on January 10, 2005, 03:50:16 PM
There is a file xp_publish.php that provides the HTML which is rendered in the publishing wizard dialog box.  The HTML in there is very much driven by coppermine.

I'd be happy to update it myself if it hasn't been done already, the snippet below is what will require modification to match the new album return code from the coppermine core.

// Return the HTML code for the album list select box
function html_album_list(&$alb_count)
{
    global $CONFIG;

    if (USER_IS_ADMIN) {
        $public_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
        if (mysql_num_rows($public_albums)) {
            $public_albums_list = db_fetch_rowset($public_albums);
        } else {
            $public_albums_list = array();
        }
    } else {
        $public_albums_list = array();
    }

    if (USER_ID) {
        $user_albums = mysql_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category='" . (FIRST_USER_CAT + USER_ID) . "' ORDER BY title");
        if (mysql_num_rows($user_albums)) {
            $user_albums_list = db_fetch_rowset($user_albums);
        } else {
            $user_albums_list = array();
        }
    } else {
        $user_albums_list = array();
    }

    $alb_count = count($public_albums_list) + count($user_albums_list);

    $html = "\n";
    foreach($user_albums_list as $album) {
        $html .= '                        <option value="' . $album['aid'] . '">* ' . $album['title'] . "</option>\n";
    }
    foreach($public_albums_list as $album) {
        $html .= '                        <option value="' . $album['aid'] . '">' . $album['title'] . "</option>\n";
    }

    return $html;
Title: Re: XP Publish Wizard - Categories not output in album listing
Post by: Joachim Müller on January 12, 2005, 02:08:11 AM
*blush* - I'm sorry, I don't have Windows XP, maybe I should have shut up instead of posting things I'm not fully sure of. You are right, it'd be great if you modified this - thanks in advance.

Joachim