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: How Do I Change File Descriptions in MASS ?  (Read 3762 times)

0 Members and 1 Guest are viewing this topic.

geffroman

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
How Do I Change File Descriptions in MASS ?
« on: April 04, 2009, 03:42:12 am »

I need to change a redundant BB Link in my file descriptions.  I have hundreds to do and may need to do this again in the future.  If doing simple HTML I would simply FIND/REPLACE code on all pages on my site.  I need to do the same thing within the File Descriptions on my Coppermine Gallery.

Example:

Current text  "[url=file:///M:/A"

Change to  "[url=file:///L:/A"

It looks like a small thing but 100s of manual entries makes it important to find a FIND/REPLACE procedure.

Thank you for any advise.  Jeff
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How Do I Change File Descriptions in MASS ?
« Reply #1 on: April 04, 2009, 12:24:37 pm »

That information is not being stored in a file, but in the database. Therefor, you'll need a tool like phpMyAdmin that allows you to perform edits directly on the database. You will then have to run queries against the database that perform such find/replace operations. But you need to understand that this is not trivial: if you make a mistake, you will lose data. It's mandatory to perform a backup (database dump) before "playing" with the database.

However: in the most recent security release, bbcode linking has been disabled for security reasons. If you still have bbcode links, you probably are running an outdated version that subsequently is vulnerable in terms of security. It's mandatory to upgrade to cpg1.4.21. Please read up the corresponding announcement thread.
Logged

geffroman

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How Do I Change File Descriptions in MASS ?
« Reply #2 on: April 04, 2009, 09:24:38 pm »

I understand that this is a data base issue rather than a simple file edit.  That's why I need help from you guys.

I appreciate the security issue.  However it does not affect me.  My gallery is not public.  It is a private system only used by my family.  In short, it is locked down and not available to anyone outside my home.  Secondly, I use Coppermine as a search-able, sortable front end to find files on local computers in my home via these links in the file descriptions.   So for me, updating Coppermine would render the program completely unusable for the purpose I use it.  I have months invested in the system.  We love it as it is.

So can you help me understand what it will take to make these File Description text adjustments in bulk/mass ?

Thank you...  Jeff
Logged

Nibbler

  • Guest
Re: How Do I Change File Descriptions in MASS ?
« Reply #3 on: April 04, 2009, 09:39:56 pm »

The query would something like

Code: [Select]
UPDATE cpg_pictures SET caption = REPLACE(caption, 'find this', 'replace with this')
Logged

geffroman

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How Do I Change File Descriptions in MASS ?
« Reply #4 on: April 04, 2009, 11:44:52 pm »

Thank you Nibbler.  I'll do a few tests before applying to a mass edit to see if I have it straight.

I'll post up when successful :)

Logged

geffroman

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How Do I Change File Descriptions in MASS ?
« Reply #5 on: April 06, 2009, 12:39:37 am »

Fellas I took a look at phpMyAdmin.  Looks like a lot to install, configure and learn to apply nibblers very simple query.  Is there a simplier method to getting this done ?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How Do I Change File Descriptions in MASS ?
« Reply #6 on: April 06, 2009, 09:22:27 am »

phpMyAdmin is a no-brainer: pretty straightforward to install. Needed to perform backups (and all sorts of maintenance) anyway.

This being said: if you're too lazy to install phpMyAdmin, use a plain text editor to edit sql/update.sql.
Add the query
Code: [Select]
UPDATE CPG_pictures SET caption = REPLACE(caption, 'find this', 'replace with this') at the very end of the file (into a new line of it's own). Then run http://yoursite.tld/your_coppermine_folder/update.php in your browser. After doing that ONCE, edit sql/update.sql once more and remove the line you have added in the frist place to make sure it doesn't get run for a second time.
However, you should only do as I advised if you have made a backup (dump) of your database. For this, you will probably want to use phpMyAdmin anyway, so you're back to step one.

Don't perform database manipulation if you have no idea about the impact. Don't run a webserver if you have no idea how to maintain it.
Logged

geffroman

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How Do I Change File Descriptions in MASS ?
« Reply #7 on: April 08, 2009, 05:24:55 am »

phpMyAdmin is a no-brainer: pretty straightforward to install. Needed to perform backups (and all sorts of maintenance) anyway.

This being said: if you're too lazy to install phpMyAdmin, use a plain text editor to edit sql/update.sql.
Add the query
Code: [Select]
UPDATE CPG_pictures SET caption = REPLACE(caption, 'find this', 'replace with this') at the very end of the file (into a new line of it's own). Then run http://yoursite.tld/your_coppermine_folder/update.php in your browser. After doing that ONCE, edit sql/update.sql once more and remove the line you have added in the frist place to make sure it doesn't get run for a second time.
However, you should only do as I advised if you have made a backup (dump) of your database. For this, you will probably want to use phpMyAdmin anyway, so you're back to step one.

Don't perform database manipulation if you have no idea about the impact. Don't run a webserver if you have no idea how to maintain it.

Don't reply to forum requests for assistance if you cannot do so without being superior, rude and insulting.  Thank you.
Logged

geffroman

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How Do I Change File Descriptions in MASS ?
« Reply #8 on: April 08, 2009, 06:02:57 am »

Fellas the idea of using update.sql is perfect.  However in my test image the update function did not catch/update the file Description text.  I placed Nibblers code on it's own line at the end of the update.sql file as Muller instructed.

Is the syntax correct that Nibbler suggested ?  Is there a step that Muller missed ?

Your assistance is appreciated.  Jeff
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How Do I Change File Descriptions in MASS ?
« Reply #9 on: April 08, 2009, 08:30:06 am »

Don't reply to forum requests for assistance if you cannot do so without being superior, rude and insulting.  Thank you.
Don't post such rants if you want answers. You're banned for three days from posting. I posted clear instructions what to do. I'm sorry now that I have wasted time to answer your question if the only thing you can do is reply with an insult.
Logged
Pages: [1]   Go Up
 

Page created in 0.094 seconds with 19 queries.