Advanced search  

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

Pages: [1]   Go Down

Author Topic: xp_upload improvments  (Read 3928 times)

0 Members and 1 Guest are viewing this topic.

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
xp_upload improvments
« 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.

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:
Code: [Select]
    $lines[] = '"displayname"="' . $CONFIG['gallery_name'] . '"';
    $lines[] = '"description"="' . $CONFIG['gallery_description'] . '"';

and change them to this:
Code: [Select]
    $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
Code: [Select]
        header("Content-Disposition: attachment; filename=cpg_".$time_stamp.".reg");

and change it to this:
Code: [Select]
        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
Code: [Select]
<?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
Code: [Select]
<?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:
Code: [Select]
<title>Coppermine Photo Gallery - XP Publish README</title>

to this
Code: [Select]
<title><?= $_SERVER["HTTP_HOST"] ?> Photo gallery - XP Publish README</title>
« Last Edit: December 11, 2005, 03:32:08 pm by imrich »
Logged

imrich

  • Tester
  • Coppermine regular visitor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 70
Re: xp_upload improvments
« Reply #1 on: December 13, 2005, 01:12:47 am »

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:

Code: [Select]
// Display the login page
function form_login()
{

After ADD this line:

Code: [Select]
    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!
« Last Edit: December 13, 2005, 01:59:01 am by imrich »
Logged

GuidoR13

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 22
Re: xp_upload improvments
« Reply #2 on: December 23, 2005, 11:36:53 am »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.