XP Publish Wizard - Categories not output in album listing XP Publish Wizard - Categories not output in album listing
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

XP Publish Wizard - Categories not output in album listing

Started by pnear, January 10, 2005, 06:17:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pnear

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

Joachim Müller

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

pnear

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;

Joachim Müller

*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