PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   General Discussion (http://www.photopost.com/forum/general-discussion/)
-   -   Long file name keywords (http://www.photopost.com/forum/general-discussion/138451-long-file-name-keywords.html)

skidpics November 11th, 2008 05:10 PM

Long file name keywords
 
If I have a filename such as: ENDANGERED_PEREGRINE_FALCON_Falco_peregrinus_WITH_PARTRIDGE_PREY_EUROPE

How can I get it to make the keywords without the _ attaching the words, so instead, make the entire filename split the words to:

ENDANGERED PEREGRINE FALCON Falco peregrinus WITH PARTRIDGE PREY EUROPE

Chuck S November 11th, 2008 05:20 PM

well you would need to actually enter the keywords. We only use a title on showphoto if keywords are empty.

skidpics November 11th, 2008 05:23 PM

correct, but can we not put a preg_replace or something to get rid of the underscore?

There should be an admin setting for banned characters, which would remove such characters and replace them with a space.

Either way, can that not be done before the keyword based on the filename is generated?

skidpics November 11th, 2008 05:55 PM

After digging around, I found the answer in one of my previous posts concerning something else..however, the syntax express was wrong..

Find in showphoto.php:

if ( empty($keywords) )


Add above:
// preg_replace below strip out any punctuation and spaces from title, replacing such characters with spaces for better keywords
$title = preg_replace("/[^0-9A-Za-z]/", " ", $title);


this will strip out any symbol (not a number or a letter), and convert it to a space..

Now, how do we get the filename to be added to the keywords one may enter as additional to the keyword listing? I need some sort of function to add the $title to the $keywords to equal the new $keys?

Chuck S November 11th, 2008 08:04 PM

On showphoto as posted the title is used if there are no keywords otherwise you need to enter keywords on upload.

You can use something similar on image-inc.php has for keywords to be a filename?

Code:

Content visible to verified customers only.


All times are GMT -5. The time now is 02:48 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97