Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorchewbears
    • CommentTimeJun 18th 2008
     
    Sid helped me add a set of EXIF fields to my database, but now when I go to update my search function in plog-functions I keep getting an error.
    For example I would like to use the search to search for a field in MYSQL named EXIF_keyword. Could someone point me in the correct direction to update this. I will have to do this for about 15 fields so just a template that I can go in and edit them all based on would be great.

    Thanks for your time.
    •  
      CommentAuthorsidtheduck
    • CommentTimeJun 18th 2008 edited
     
    Hi chewbears,

    Sorry I didn't respond eariler. To alter your search function, open 'plog-functions.php' and find the following code under the 'plogger_init_search' function (should be around line 1475 in the Beta3.0 code):foreach ($terms as $term) {
    $query .= "
    `path` LIKE '%".mysql_escape_string($term)."%' OR
    `description` LIKE '%".mysql_escape_string($term)."%' OR
    `comment` LIKE '%".mysql_escape_string($term)."%' OR
    `caption` LIKE '%".mysql_escape_string($term)."%' OR ";
    }
    Then just add your new columns to search under it, like so:foreach ($terms as $term) {
    $query .= "
    `path` LIKE '%".mysql_escape_string($term)."%' OR
    `description` LIKE '%".mysql_escape_string($term)."%' OR
    `comment` LIKE '%".mysql_escape_string($term)."%' OR
    `caption` LIKE '%".mysql_escape_string($term)."%' OR
    `EXIF_keyword` LIKE '%".mysql_escape_string($term)."%' OR ";
    }


    OR

    If you want to use the multi-word search like in this post, you could change the above code like so:foreach ($terms as $term) {
    $term = mysql_real_escape_string($term);
    $multi_term = explode("+",$term);

    $path = implode("%' AND `path` LIKE '%",$multi_term);
    $description = implode("%' AND `description` LIKE '%",$multi_term);
    $comment = implode("%' AND `comment` LIKE '%",$multi_term);
    $caption = implode("%' AND `caption` LIKE '%",$multi_term);
    $exif_keyword = implode("%' AND `EXIF_keyword` LIKE '%",$multi_term);

    $query .= "
    `path` LIKE '%".$path."%' OR
    `description` LIKE '%".$description."%' OR
    `comment` LIKE '%".$comment,"%' OR
    `caption` LIKE '%".$caption."%' OR
    `EXIF_keyword` LIKE '%".$exif_keyword."%' OR ";
    }
    • CommentAuthorchewbears
    • CommentTimeJun 19th 2008 edited
     
    SOLVED