xp_upload improvments xp_upload improvments
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

xp_upload improvments

Started by imrich, December 11, 2005, 03:13:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

imrich

I've been trying to work on some issues and clean up xp_upload.php a bit.

1) I can't get the login function to work if I'm not already logged into coppermine

I haven't made any progress with this. I still can't get xp_publish to log in to my coppermine. :( Unfortunately, the logging functions do not seem to have any entries in it for login failures with xp_publish login attempts. So I'm still working on this one, but I'm not making any progress.

2) It won't input single and double quotes properly into the "upload wizzard", they get shown as their HTML Entity's instead

To fix this, find these lines:

    $lines[] = '"displayname"="' . $CONFIG['gallery_name'] . '"';
    $lines[] = '"description"="' . $CONFIG['gallery_description'] . '"';


and change them to this:

    $lines[] = '"displayname"="' . ereg_replace('"', '\\"', html_entity_decode($CONFIG['gallery_name'], ENT_QUOTES, UTF-8)) . '"';
    $lines[] = '"description"="' . ereg_replace('"', '\\"', html_entity_decode($CONFIG['gallery_description'], ENT_QUOTES, UTF-8)) . '"';



3) The registry file name is a seemingly meaningless string of numbers (it's a time stamp, but this is meaningless to the average end user).

To fix this, find this line

        header("Content-Disposition: attachment; filename=cpg_".$time_stamp.".reg");


and change it to this:

        header("Content-Disposition: attachment; filename=cpg_".$_SERVER["HTTP_HOST"].".reg");


This will change the name of the file from something like cpg_123456789.reg to cpg_www.yourdomain.tld.reg which is easier to find and understand to the end user.  It also looks less intimidating! For some reason, on my system the actual file name is cpg_www[1].domain.tld.reg. I don't know where the [1] comes from, perhaps it's an XP function? But I feel this is still less intimidating to end users.

I didn't change the language file to change the descriptive text yet to show that the #### will be the site name such as "www.domain.tld". That would be a complete fix which I may do later.

#4, there is credit given for some original work. I always believe that credit should always go to the original author, but the link provided to the original work has long since been invalid.  The source code already gives credit to the original work, so why display an invalid link? To clean this up, I changed the following line:

from

<?php echo $lang_xp_publish_client ?> Sebastian Delmont <a href="http://www.zonageek.com/code/misc/wizards/">Creating your own XP Publishing Wizard</a>.</p>


to

<?php echo $lang_xp_publish_client ?> Sebastian Delmont.</p>


I think it would be better to completely delete this reference to the original code and just leave it in the source code.

4) Minor 'customization', place the name of your site in the title

change this line:

<title>Coppermine Photo Gallery - XP Publish README</title>


to this

<title><?= $_SERVER["HTTP_HOST"] ?> Photo gallery - XP Publish README</title>

imrich

#1
Quote from: imrich on December 11, 2005, 03:13:41 PM
I've been trying to work on some issues and clean up xp_upload.php a bit.

1) I can't get the login function to work if I'm not already logged into coppermine

I haven't made any progress with this. I still can't get xp_publish to log in to my coppermine. :( Unfortunately, the logging functions do not seem to have any entries in it for login failures with xp_publish login attempts. So I'm still working on this one, but I'm not making any progress.


Ok, here's my progress on this. I actually have the login function working with my coppermine now.  ;D

in 'xp_publish.php' find these lines:


// Display the login page
function form_login()
{


After ADD this line:


    global $CONFIG;


It looks like someone missed a global declaration!  Without the global this would work if coppermine was installed in your web server's root (i.e.: www.domain.tld would work ok. But www.domain.tld/coppermine would not).  So perhaps this is why some of the developers could't duplicate this problem.

Thanks to the developers for creating the login function to xp_publish, this makes it work much better than it ever did in past versions!

GuidoR13

My Gallery has an German umlaut in it's name, unfortuntely it's not correct in the regfile, the "Ä" is displayed as "ä", can you give me a hint where to change xp_publish.php - THANK YOU.

Guido