Author Topic: Spaces in upload fields  (Read 6062 times)

0 Members and 1 Guest are viewing this topic.

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Spaces in upload fields
« on: February 11, 2010, 12:35:05 PM »
I need help.

When i fill forms in my upload page, i need to write USA-Washington, instead USA Washington, becouse search of site will search by first word until the space. If i will write
USA Washington
USA New York
it will search result only for USA, and will show as USA Washington, as USA New York. but i need show only USA Washington
When i write USA-Washington it work done, but view not beauty with "-".

How i can realise it?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Spaces in upload fields
« Reply #1 on: February 12, 2010, 07:45:43 AM »
I don't know what fields you are referring to, but here is a quick fix for "keywords" field. But I must mention, I did not fully test it and it might break something on your gallery, you also will need use semicolon instead of space to separate keywords:
some;keywords;keywords can;be with spaces
these modifications should not affect existing keywords

in includes/functions.php find:
    $split_keywords explode(" "$image_row['image_keywords']);
replace it with:
    $split_keywords explode(";"$image_row['image_keywords']);


in includes/search_utils.php find:
  $split_words preg_split("/\s+/"$val);

Replace it with:
  $split_words explode(";"$val);


find:
  foreach ($split_words as $word) {
    if (
$word == "") {


Replace it with:
  foreach ($split_words as $word) {
    
$word trim($word);
    if (
$word == "") {
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline milanNN

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • http://www.planesphotos.net
Re: Spaces in upload fields
« Reply #2 on: January 13, 2011, 09:46:15 AM »
I did it but problem is remained still.
BTW if i write USA- Washington all is OK.
But USA -Washington or USA - Washington is not good(Your search resulted in no matching records).
Can you help me?