Exclude directories in searchnew.php Exclude directories in searchnew.php
 

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

Exclude directories in searchnew.php

Started by JohannM, June 11, 2007, 05:40:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JohannM

Hi there

I would like to exclude the _vti_cnf and some other directories under my albums/ directory in searchnew.php.

How do I do this ?

Thanx in advance

Joachim Müller

Add the exceptions (the folder names that searchnew.php is not suppossed to scan) to the code like this:

Findif ($file != "." && $file != ".." && $CONFIG['fullpath'] . $folder . $file != $CONFIG['fullpath'].'/edit' && $CONFIG['fullpath'] . $folder . $file != $CONFIG['fullpath'].'/'.substr($CONFIG['userpics'],0,strlen($CONFIG['userpics'])-1)) {and replace withif ($file != "." && $file != ".." && $CONFIG['fullpath'] . $folder . $file != $CONFIG['fullpath'].'/edit' && $CONFIG['fullpath'] . $folder . $file != $CONFIG['fullpath'].'/'.substr($CONFIG['userpics'],0,strlen($CONFIG['userpics'])-1) && $file != "_vti_cnf") {

Then find            strpos($file,'edit') === FALSE &&and add after it (into a new line)            strpos($file,'_vti_cnf') === FALSE &&(code untested, please report/feedback).

Even better method though (if you don't need the Frontpage extensions) is to disable them entirely (if the server isn't yours to administer, you'll have to ask your webhost to do this for you).

JohannM

Thanx GauGau

If you don't mind ... another question ...

I have about 356 000 pics on my site ( www.youth-sport-fotos.com ) 32 categories and about 120 albums. When I started originally with the site, I had long folder names in my albums/ root (e.g. 067-SA-SCHOOL-GAMES-BASKETBALL-6DEC2006 ). I want to change this to J067 (manually), question: is there a simple mySQL command that I can use to change all text in the albums table containing "067-SA-SCHOOL-GAMES-BASKETBALL-6DEC2006" to "J067" ?

The reason for this is not to re-upload or delete the album. I figured to just change the data in the database would be the easiest.


Nibbler

One question per thread. Your question has already been asked and answered several times, so search the board.

JohannM

Sorry Nibs

Anyway, I figured it our ....

#DO CHANGES AND RUN THIS SQL COMMAND IN MAIN DATABASE

UPDATE cpg1410_pictures SET filepath = replace( filepath, "old_directoryname", "new_directoryname" );

Joachim Müller

Quote from: JohannM on June 12, 2007, 12:02:42 PM
If you don't mind ... another question ...
In fact I do mind. Nibbler told you about the strict "one question per thread" policy. Insisting to clutter this thread with unrelated stuff even though you have been told that you mustn't is rude. Respect board rules in the future. Locking!