WordPress.org

Forums

can this module 'all' photo search? (3 posts)

  1. mitsukuni
    Member
    Posted 7 years ago #

    can this module 'all' photo search?
    looks like can't it.

    i make a patch.

    --- flickr-tag.php-orig 2007-11-24 09:50:58.000000000 -0800
    +++ flickr-tag.php      2007-11-24 10:44:10.000000000 -0800
    @@ -113,8 +113,6 @@
                                    $user = null;
                            }
    
    -                       $tags = str_replace("&", ",", $tags);
    -
                            $nsid = null;
                            if($user) {
                                    $params = array(
    @@ -131,18 +129,21 @@
                                    $nsid = $r['user']['nsid'];
                            }
    
    +                       if (eregi("&", $tags)) {
    +                               $tag_mode = "all";
    +                               $temparray = explode("&", $tags);
    +                               $tags = str_replace("#038;", "", implode(",", $t
    emparray));
    +                       } else {
    +                               $tag_mode = "any";
    +                       }
    +
                            $params = array(
                                    'method'                => 'flickr.photos.search
    ',
                                    'tags'                  => $tags,
    +                               'tag_mode'              => $tag_mode,
                                    'format'                => 'php_serial'
                            );
    
    -                       if(strpos($tags, "&") > 0) {
    -                               $params['tag_mode'] = "all";
    -                               $params['tags'] = $tags;
    -                       } else
    -                               $params['tag_mode'] = "any";
    -
                            if($nsid)
                                    $params['user_id'] = $nsid;
    

    ps
    i can't understand why ',' strings change to ',#038;'.
    do you know this?

  2. crimesagainstlogic
    Member
    Posted 7 years ago #

    Hello,

    I'm not sure what you mean by "can it do an all search", but if you mean not restricted to a specific user, yes it can. Just omit the "@username" part.

    Also, as to your question about ,->#038, I think it's because the "&" triggers some special wordpress HTML entity escaping routine. In the new version of the plugin, I've changed the & to + to avoid this problem...

  3. mitsukuni
    Member
    Posted 7 years ago #

    sorry my poor english.

    original code can not AND search.
    my patch fix this problem.

    regards.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags