Is this generic? - Usergalleries not paging Is this generic? - Usergalleries not paging
 

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

Is this generic? - Usergalleries not paging

Started by Wroenco, July 20, 2004, 06:09:09 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Wroenco

In 1.2:

Have set the number of albums to display to 12, so that the iframe fills nicely with no scrolling required. But now that I have 13 albums, ALL 13 are listed (with album thumbnail), as "13 users on 1 page(s)" when logic dictates that it should now read "13 users on 2 page(s)" with a link to page to the second page.

Paging works in individual albums however!

Is there a fix for this as I have users in excess of 150 and when they all get albums the lack of paging will be ridiculous.

Posted Here in case this is a generic problem.

Joachim Müller


Wroenco

#2
Well, I thought my explanation was pretty comprehensive, but here goes:

Here

u/n Guest
p/w Guest

Config: here

Joachim Müller

OK, ic. Please try upgrading to cpg1.3.1 and see if this fixes your issue.

GauGau

Wroenco

Like many others have commented, I find the various instances of CPG totally bewildering. I am using postnuke but don't think that should preclude from posting a "bug" here if it is thought to be generic. Plus a solution to one problem could be hacked to produce a solution to many. And this board is where the vast expertise resides.

Afterall, the core functionality is broadly the same.

1.31 is now recommended to test whether the "bug" persists. Now I have to try many downloads to see if that is the 1.31 which is the patch/upgrade to the 1.2 that I am using. That is, for a newbie to PHP and to CPG is a pretty daunting prospect.

I will give it a go and report back.

Afterall, the product is what it is today by virtue of the great unwashed and uninitiated who have trialled and tribulated this rocky course to what seems like one of the best gallery programs around. Many have floundered so that the few can have a smooth and slick implementation.

Woe is me...  ;D ;D ;D

Wroenco

Ugh! Have you seen the new problems I would be faced with! Yikes!!!  :\'(

Joachim Müller

are you using cpg standalone plus the pnCPGH hack from CasNuy, or are you using "Coppermine for CMS" (aka cpgNuke)?

GauGau

Wroenco

Hi GauGau,

I am at work at the mo'. I tried two or three downloads to get to the fairly starightforward 1.2 version. ot sure wherefrom but will look tonight (it's 16:35 in the UK here). Many thanks for maintaining an interest. I haven't seem any sites with this problem.

Anon...  :-[ :\'(

Casper

I think you were advised before, on this thread, that you are not using the latest versions of either coppermine, or pn, http://forum.coppermine-gallery.net/index.php?topic=7872.msg34649#msg34649.

It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Wroenco

Thanks for the reminder. If I am using pnCPG 1.5 and you say there is a production 2.0 and a beta 2.1 where on this site can it be download, because there is not a 2.anything on the download pages? I posd my question to ascertain if it was a generic problem, (which has not been dismissed), in which case there could be a generic solution. No other visitor has so far expressed familiarity with it.

Maybe if I could find version 2 then I could test for recurrence??

TIA


Joachim Müller

I moved this thread to the pnCPG board, lets's see if Cas has got an idea...

GauGau

Wroenco

Quote from: GauGau on July 21, 2004, 08:38:49 AM
I moved this thread to the pnCPG board, lets's see if Cas has got an idea...

GauGau

Hi,

Until it is determined whether or not this failure to display usergalleries over several, tabbed, pages is generic, maybe this topic should be ghosted in the 1.2 Forum as well. CasNuy is not supporting pnCPG I gather and is unlikely to drop by here in this basement!!!

No-one seems to want to offer a place to get pnCPG2.0 to see if the problem persists. 1.3 is too buggy on the install and causes more problems and I want only to establish whether the problem is generic.

I am porting over 100 albums over from a WebApp site, totalling 700 pics, with captions. My users are getting impatient for their albums, I have done 14 so far, but without paging of usergalleries, I can't see coppermine being of great value as the album list in usergalleries would have to scroll quite a ways.

Does anyone have a version of coppermine which DOES page usergalleries? Really?

I have lost almost a week with this install and getting nowhere. But then, in this basement forum my query is NOWHERE!

Where do coppermine experts really hang out? Where is pnCPG2.0? Why do I not get a mail notifying me of further replies to my posts?

I really woud be very grateful for a solution to this problem.

Joachim Müller

please allow some time for Cas to react. Use the notification button to obtain updates on the threads you posted in by email, or modfiy your message and check "additional options".

I wouldn't consider cpg1.3.x as being buggy, imo it's the best version ever. I you have complaints about the install routine, why don't you post them separately?

GauGau

Wroenco

Hi,

I have tried the 1.3 install. There is the lang-eng problem to deal with, which is well documented. Then I came across a $sel-theme (spelling from memory) issue, then there were problems in the nbb file. (again from memory), so as I see it I have 1.2 with one bug that impacts me, and at least three bugs with 1.3, and I still do not know whether the usergalleries issue is generic, so if I can get round the 1.3 install issue I could still be left with a "generic" pages issue.

I have trawled the web seeking out users with a large number of albums/galleries to see if they page correctly, none I came accross saw paging of usergalleries.

I am no coder but I tried looking in the index.php within the coppermine folder and in 1.2 there are two instances where the code attempts to page galleries.

// List all albums
function list_albums()
{
    global $CONFIG, $USER, $USER_DATA, $PAGE, $lastup_date_fmt;
    global $cat;
    global $lang_list_albums, $lang_errors;

    $alb_per_page = $CONFIG['albums_per_page'];
    $maxTab = $CONFIG['max_tabs'];

    $result = db_query("SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = '$cat'");
    $nbEnr = mysql_fetch_array($result);
    $nbAlb = $nbEnr[0];
    mysql_free_result($result);

    if (!$nbAlb) return;

    $totalPages = ceil($nbAlb / $alb_per_page);

    if ($PAGE > $totalPages) $PAGE = 1;
    $lower_limit = ($PAGE-1) * $alb_per_page;
    $upper_limit = min($nbAlb, $PAGE * $alb_per_page);
    $limit = "LIMIT " . $lower_limit . "," . ($upper_limit - $lower_limit);

    $sql = "SELECT a.aid, a.title, a.description, visibility, filepath, " . " filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_ALBUMS']} as a " . "LEFT JOIN {$CONFIG['TABLE_PICTURES']} as p ON thumb=pid " . "WHERE category = '$cat' ORDER BY pos " . "$limit";
    $alb_thumbs_q = db_query($sql);
    $alb_thumbs = db_fetch_rowset($alb_thumbs_q);
    mysql_free_result($alb_thumbs_q);

    $disp_album_count = count($alb_thumbs);
    $album_set = '';
    foreach($alb_thumbs as $value) {
        $album_set .= $value['aid'] . ', ';
    }
    $album_set = '(' . substr($album_set, 0, -2) . ')';

    $sql = "SELECT aid, count(pid) as pic_count, max(pid) as last_pid, max(ctime) as last_upload " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE aid IN $album_set AND approved = 'YES' " . "GROUP BY aid";
    $alb_stats_q = db_query($sql);
    $alb_stats = db_fetch_rowset($alb_stats_q);
    mysql_free_result($alb_stats_q);

    foreach($alb_stats as $key => $value) {
        $cross_ref[$value['aid']] = &$alb_stats[$key];
    }

    for ($alb_idx = 0; $alb_idx < $disp_album_count; $alb_idx++) {
        $alb_thumb = &$alb_thumbs[$alb_idx];
        $aid = $alb_thumb['aid'];

        if (isset($cross_ref[$aid])) {
            $alb_stat = $cross_ref[$aid];
            $count = $alb_stat['pic_count'];
        } else {
            $alb_stat = array();
            $count = 0;
        }
        // Inserts a thumbnail if the album contains 1 or more images
        if ($count > 0) {
            $visibility = $alb_thumb['visibility'];
            if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || strstr(USER_GROUP_SET, $visibility)) {
                if ($alb_thumb['filename']) {
                    $picture = &$alb_thumb;
                } else {
                    $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$alb_stat['last_pid']}'";
                    $result = db_query($sql);
                    $picture = mysql_fetch_array($result);
                    mysql_free_result($result);
                }
                $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['alb_list_thumb_size']);
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"" . get_pic_url($picture, 'thumb') . "\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
            } elseif ($CONFIG['show_private']) {
                $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
                $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/private.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
            }
        } else {
            $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
            $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/nopic.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
        }
        // Prepare everything
        if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || $visibility == $USER_DATA['group_id']) {
            $last_upload_date = $count ? localised_date($alb_stat['last_upload'], $lastup_date_fmt) : '';
            $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
            $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
            $alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
            $alb_list[$alb_idx]['pic_count'] = $count;
            $alb_list[$alb_idx]['last_upl'] = $last_upload_date;
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "");
            $alb_list[$alb_idx]['album_adm_menu'] = (GALLERY_ADMIN_MODE || (USER_ADMIN_MODE && $cat == USER_ID + FIRST_USER_CAT)) ? html_albummenu($alb_thumb['aid']) : ' ';
        } elseif ($CONFIG['show_private']) { // uncomment this else block to show private album description
            $last_upload_date = $count ? localised_date($alb_stat['last_upload'], $lastup_date_fmt) : '';
            $alb_list[$alb_idx]['aid'] = $alb_thumb['aid'];
            $alb_list[$alb_idx]['album_title'] = $alb_thumb['title'];
            $alb_list[$alb_idx]['album_desc'] = bb_decode($alb_thumb['description']);
            $alb_list[$alb_idx]['pic_count'] = $count;
            $alb_list[$alb_idx]['last_upl'] = $last_upload_date;
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "");
            $alb_list[$alb_idx]['album_adm_menu'] = (GALLERY_ADMIN_MODE || (USER_ADMIN_MODE && $cat == USER_ID + FIRST_USER_CAT)) ? html_albummenu($alb_thumb['aid']) : ' ';
        }
    }

    theme_display_album_list($alb_list, $nbAlb, $cat, $PAGE, $totalPages);
}


and a similar function below this starting as follows:

// List category albums
// This has been added to list the category albums largely a repetition of code elsewhere
// Redone for a cleaner approach
function list_cat_albums($cat = 0)
{
    global $CONFIG, $USER, $PAGE, $lastup_date_fmt, $HTTP_GET_VARS, $USER_DATA;
    global $lang_list_albums, $lang_errors;

    if ($cat == 0) {
        return '';
    }


This code runs on of course but there is no merit in posting it.

One of this functions is trying to page the usergalleries. This snippet is trying to caclulat ethe number of pages it will need to tab.

   $totalPages = ceil($nbAlb / $alb_per_page);

so I am in the right area.

Curiously the same file in 1.3. only has one instance of trying to page galleries. I pasted that code into my 1.2 index file and the site did not crash, but guess what ? It did not page galleries either. I don't know if it is a field name issue, a defect in the code but it looks GENERIC to me.

Any clues?

PS: I have rechecked my profile, the email address is sound. I have been exanding for more options at the end of each post and asking for notification of posting, as I will do again. But I have not ever received a notification of a further comment.

I am trying my damndest to self-help but I am stuck.

Any clues?


TIA

Joachim Müller

Quote from: Wroenco on July 22, 2004, 11:35:09 AM
There is the lang-eng problem to deal with, which is well documented. Then I came across a $sel-theme (spelling from memory) issue, then there were problems in the nbb file. (again from memory), so as I see it I have 1.2 with one bug that impacts me, and at least three bugs with 1.3, and I still do not know whether the usergalleries issue is generic, so if I can get round the 1.3 install issue I could still be left with a "generic" pages issue.
I don't have the slightest idea what well-documented issues you're refering to.
Let's get this straight: we (the dev team) code new versions of coppermine and test it as standalone and bridged with bbs apps. We never check if it works with postnuke. It's not our intention that it works with postnuke. We even recommend postnuke-users to run "Coppermine for CMS". But then there is a hack (a user contribution from Cas, who generously provides his hack to the public) that is designed to make coppermine standalone work within a postnuke install. Although I highly appreciate Cas' efforts you have to understand that Cas' hack is not something that is "officially supported". Cas asked us to create this sub-board, where users of his hack could post questions related to his hack, but he's the only one who actually does support work on this sub-board, and you simply can't blame him if he doesn't have an answer to everything.

So, if you're refering to "known issues", please don't assume everybody actually "knows" them - post a link to the page or quote the issue in question.

GauGau

Wroenco

I have a specific problem with an implementation of Coppermine. My first approach was to advertise the fact with a question. Is it generic? That is: Does it appear with EVERY implementation of Coppermine?

No-one has been able to answer that question. No-one has been able to confirm that the problem DOES NOT exist in any other implementation. The query has been relegated to an unsupported area (pnCPG) waiting for casNuy to happen by. And yet we do not know for sure that it is specific to pnCPG1.2. If it is specific then the query has been moved to the correct forum, fair enough.

However, until this has been established by the user community or the developers, it deserves a higher profile, surely? Every other feature of pnCPG1.2 is working fine. It is just a bit suspect that there is this one problem I am experiencing and the decision has been "not our problem". It is based on an assumption that it is specific to pnCPG1.2.

I am told to try pnCPG2.0 but there is no such thing. So I cannot delve further myself to test this, (for me and for the Coppermine community).

The point of this forum is to pool knowledge and experience, to continually improve the product. My question aims to establish a fact. It is a straightforward question. IS IT GENERIC?

Apparently this is not known because no-one who visits here has tried paging of user galleries. They work with one user gallery and it APPEARS to work fine. When you are working in an IFRAME paging becomes vital.

Can this paging issue REALLY be confined to pnCPG, when identical code for paging of usergalleries in in the 1.3 version

I am not being unappreciative of the help and assistance that the developers and other contributors offer. I just want to know:

1. IS THIS A GENERIC PROBLEM?

if not, and paging of usergalleries works in other implementations with certainty.

2. CAN SOMEONE offer advice on a fix.? Please.

Thanks.

Tarique Sani

OK! I did some testing - IT IS NOT GENERIC
SANIsoft PHP applications for E Biz

Wroenco

Quote from: Tarique Sani on July 22, 2004, 04:35:03 PM
OK! I did some testing - IT IS NOT GENERIC

That's where you are wrong Tarique. The problem can be replicated in ANY instance of Coppermine. And the reason I know? Because I have solved the problem.

Now you would have expected that the vastly more knowledgable long term users, who have transitionied up the versions would have realised something that I discovered by chance, but should have been obvious to all but a newbie, which I freely confessed that I was!

Original Problem described so:

"Have set the number of albums to display to 12, so that the iframe fills nicely with no scrolling required. But now that I have 13 albums, ALL 13 are listed (with album thumbnail), as "13 users on 1 page(s)" when logic dictates that it should now read "13 users on 2 page(s)" with a link to page to the second page.

Paging works in individual albums however!"

It would seem that setting the number of albums to 12, (in the albums list view)  has no bearing on the paging of the usergalleries thumbnail listing. Don't you know! [I had now14 albums and expected them to page in 1 page with 12, and 2nd page with 2]

ACTUALLY: The paging is simply a function of the thumbnail settings, i.e. the number of rows and the number of columns, so setting to 3 rows and 4 columns giving 12 albums per page, results in tabbed paging for the excess over 12).

BURYING the problem as a result of assuming that use of pnCPG implies a pnCPG ONLY problem was shortsighted. It was a basic error of understanding born out of my lack of familiarity with the product. That's my excuse!

ADMITTEDLY the fact that a CMS style user would be very concerned with iframe implications means that he would perceive a problem which others in the standalone community would not appreciate (and didn't!).


Anyways, I am happy with my pnCPG1.2 implementation, and I can and will heartliy recommend the product, what ever the version.

Thanks for all for keeping the dialogue going, that at least held out the hope of a solution. And one came, praise be!

No hard feelings guys!!

Cheers!


Casper

#18
Well, right from the start of this thread, you have come across as someone who thinks they know better, and will not listen.

Well I also tested, and it is not generic.  As you can see from the pics attached, which are from 2 different standard installs, without your 'fix', the pagination works just fine, on a standalone install.

So I think you are not actually looking for support, but just trying to find problems to flame the board.  
You have just shown on this thread, that the problem lies between your keyboard and your chair.

I suspect this thread will turn up on another applications board as proof of how they do things better than us.

It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Tarique Sani

#19
I consider this problem as an invalid bug for Coppermine stand-alone as

1) It has not been replicated by anyone other than the reporter
2) It has not been demonstrated on the latest standalone version
SANIsoft PHP applications for E Biz