No Support > Feature requests

Bugs in 1.1.1 and suggested fixes for 1.2.0

(1/2) > >>

EZ:
Many thanks to Morrey for salvaging this post from the old board!

(05-Oct-2003: Re-posted on new Coppermine board).
(07-Sep-2003: Added new bugs & solutions #8, #9).
(12-Sep-2003: Changed solution to #7 to be simpler and better.)
(12-Sep-2003: Added enhancement #10.)

Here are some problems that I've found with development version 1.1.1 and how I have solved them.

Summary:[*]Fix missing scrollbars in full-size image view on Mozilla browsers.
[*]Fix incorrect charset in full-size image view.
[*]Fix image file size so it works also with Right-To-Left language.
[*]Fix login redirect with phpBB.
[*]Fix logout redirect with phpBB.
[*]Cosmetic - in thumbnail view align thumbs in middle of table cells.
[*]Fix next/prev arrow images to work also with RTL languages.
[*]Fix e-cards for compatability with MS-Outlook.
[*]Fix probelm when buttons don't show in IE 5.X with RTL language.
[*]Enhancement - Allow admin to change category of user albums.[/list:u]
BACKUP ANY FILES YOU CHANGE AND DO IT BEFORE YOU CHANGE THEM

----------

1. When viewing big images in full size image with Mozilla, the size and position of the pop-up window isn't correct, and scrollbars are not displayed. The problem doesn't appear with IE.

Fix for scrollbars: In displayimage.php line#138, add "scrollbars=yes" to the javascript call:

--- Code: ---$pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','".uniqid(rand())."','scrollbars=yes,toolbar=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
--- End code ---

However I think that if the window size and positioning problem will be fixed, then Mozilla will also show the scroll bars, so the above fix will not be necessary.

----------

2. In full size view, the HTML is created with incorrect charset in the HTML header <META ...charset=...>. This sometimes causes some garbage to be displayed near the picture.

Fix in displayimage.php line #336, add global variable:

--- Code: ---global $lang_errors,$lang_charset;
--- End code ---

Fix in displayimage.php line #347, add expression that returns correct charset:

--- Code: ---<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $CONFIG['charset'&#93; == 'language file' ? $lang_charset &#58; $CONFIG['charset'&#93; ?>" />
--- End code ---

This fix is consistent with HTML generation throughout Coppermine, and has no side effect as far as I can see.

----------

3. Extra space between image size and size units causes inverted display in Right-to-Left languages (eg. Hebrew). For example, when a file size is displayed as "97 KB", in RTL it is inverted as "KB 97", because of the space between the number and the units.

Fix: In displayimage.php line #228, remove the space in the position marked by xxxx:

--- Code: ---$info[$lang_picinfo['File Size']] = ($CURRENT_PIC_DATA['filesize'] > 10240 ? ($CURRENT_PIC_DATA['filesize'] >> 10)[b]xxxx[/b].$lang_byte_units[1] : $CURRENT_PIC_DATA['filesize'].' '.$lang_byte_units[0]);
--- End code ---

Note that this will also affect the display of image file size for all languages, ie. it will always be displayed like "97KB".

----------

4. When integrated with phpBB, after logIN the user is not redirected back to Coppermine (and goes to phpBB).

Fix in bridge/phpbb.inc.php line #245 add redirect parameter (change to match the directory where your gallery is installed):

--- Code: ---$target = 'login.php'.'?redirect=/gallery/';
--- End code ---

Tested to work perfectly well with phpBB v2.0.4, when phpBB installed under /htmlroot/forum and Coppermine under /htmlroot/gallery.
A more elegant solution is to add a config/admin parameter with path to gallery, and use that value instead of hard-coded value.

----------

5. When integrated with phpBB, after logOUT the user is not redirected back to Coppermine (and goes to phpBB). I have 2 different fixes for this, which I will only describe, but not give all the exact code because it's too big.

First solution: In bridge/phpbb.inc.php line #254 add redirect as above, and change phpBB login.php as follows:
* Save a copy of the original file.
* Add the following code between line #43-#45:
--- Code: ---$redirect_var = isset($HTTP_POST_VARS['redirect']) ? $HTTP_POST_VARS['redirect'] : (isset($HTTP_GET_VARS['redirect']) ? $HTTP_GET_VARS['redirect'] : '');
--- End code ---
* Do a search&replace from $HTTP_POST_VARS['redirect'] to $redirect_var

The changes to phpBB login.php are required because phpBB does not check for a redirect GET parameter during logout (only during login). Tested ONLY with phpBB 2.0.4 - later versions will probably be different, but if you know PHP you can adapt the solution to other versions.

Second solution (just an idea, NOT tested) - doesn't require any change to phpBB, but requires more changes to Coppermine. Change the Logout link in Coppermine's main menu to call a new HTML file, for example bridge/phpbbold_logout.html that does contains the following:
* A form with a hidden field like:
--- Code: ---<input type="hidden" name="redirect" value="/gallery/" />
--- End code ---
* A submit button that calls phpBB login.php with logout parameter.
* An onLoad event (on <BODY>), that automatically submits the form.

This should work because phpBB login.php script checks for a redirect POST parameter during logout (and also during login, so such a solution can also work for login redirect back to Coppermine).

----------

6. A minor cosmetic issue: In thumbnail view, the thumbnails are displayed in table cells aligned to the top. I find it more pleasing to have the thumbnails vertically centered, especially when there are thumbnails with different dimentions on the same row.

Fix in themes/default/theme.php line #284 & #297, add valign:

--- Code: ---<td valign="center" class="thumbnails" width ="{CELL_WIDTH}" align="center">
<td valign="center" class="thumbnails" align="center">&</td>
--- End code ---


----------

7. For RTL languages, the next/previous arrows in the picture nav-bar should be reversed. For example, with "normal" LTR languages the arrows images show correctly as " < > ", however in RTL they become " > < ".

Fix in themes/default/theme.php lines:
* #373 - Replace prev.gif with {PREV_IMAGE}.gif
* #376 - Replace next.gif with {NEXT_IMAGE}.gif

Add in displayimage.php after line #99:

--- Code: ---'{PREV_IMAGE}' => ($lang_text_dir=='LTR') ? 'prev' : 'next',
'{NEXT_IMAGE}' => ($lang_text_dir=='LTR') ? 'next' : 'prev',
--- End code ---


----------

8. Problem with e-cards when received to Outlook - the HTML source of the e-card is displayed. This is really an Outlook problem not Coppermine, but there is a way to fix it. The fix was discussed on the forums but is not yet implemented in the development version.

Fix include/mailer.inc.php lines #32-#37 - just remove the \r from the end of each line.

The problem with Outlook is that it doesn't recognize mail headers that terminate with \r\n (CR+LF), although the mail RFC does specify \r\n as a legal terminator.

----------

9. Admin buttons and picture navbar buttons not shown on IE 5.X, when using a Right-to-Left language. This is due to the CSS2 "position" property that is used in the style sheet.

Fix theme/default/style.css: search for position: relative and comment out all occurences. CSS comments are /* ... */ like in C and PHP.

As far as I've tested removing this property doesn't introduce any problem, and only seems to fix the issue described.

----------

10. The albums displayed in the main page are those that have no category. The administrator can change categories for all albums that are NOT user albums, and so decide which albums display on the first page.
However, there is no way to put USER albums on the front page!

The solution is to allow the admin to change the the category of user albums, and also to change the category of an album back to the original user (or any other).

Fix in modifyalb.php::

* Change line #122 to:
--- Code: ---if (!GALLERY_ADMIN_MODE) {
--- End code ---
* Add after line #139 the follwoing section:
--- Code: ---$sql="SELECT DISTINCT(owner_id) FROM {$CONFIG['TABLE_PICTURES']}";
$result=db_query($sql);
if (mysql_num_rows($result) > 0) {
$rowset = db_fetch_rowset($result);
foreach ($rowset as $user)
$CAT_LIST[]=array($user['owner_id']+FIRST_USER_CAT, get_username($user['owner_id']));
}
--- End code ---


----------

That's all for now. I hope that the changes will be integrated into the next development release.

EZ.

Joachim Müller:
Thanks for your very well documented bug report and the suggested fixes. I committed 2 of the solutions immediately to the dev version and set up a bug tracker for the other 8 in the dev board. I'll keep you updated on the solution of those bugs.

GauGau

EZ:
GauGau,

You were too quick... I meant to enter the bugs into the racker myself - thanks for doing it.

Please let me know if you (or other developers) need help if my descriptions aren't clear enough. I'll be glad to help.

Eyal.

Joachim Müller:
we don't use the tracker of sf.net, we use our own "non-public" tracker, so it wouldn't have helped if you added it :wink:

GauGau

EZ:
Hi again GauGau,

Can you please tell me which of the fixes you'be applied, and for those that you haven't applied - why?

I'm not trying to pressure you to include all my fixes (well maybe just a little), but I want to know if my fixes do not seem appropriate then maybe I can come up with alternative solutions.

Also, is there any way to access the non-public tracker, and for that matter why not just use the SF tracker?

Thanks and kudos for the wonderful job you do in managing the project.

Eyal.

Navigation

[0] Message Index

[#] Next page

Go to full version