MDL-14237: Removing calls to html_entity_decode, along with some syntax cleanup (merge from 1.9)

This commit is contained in:
scyrma 2008-07-07 07:19:24 +00:00
parent 97f7393dcc
commit 0c9bba1c76
2 changed files with 18 additions and 20 deletions

View File

@ -43,21 +43,21 @@ class block_tag_flickr extends block_base {
$tag = optional_param('tag', '', PARAM_TAG); // tag
if ($tag) {
$tag_object = tag_get('name', $tag);
$tagobject = tag_get('name', $tag);
} else if ($tagid) {
$tag_object = tag_get('id', $tagid);
$tagobject = tag_get('id', $tagid);
}
if (empty($tag_object)) {
if (empty($tagobject)) {
print_error('tagnotfound');
}
//include related tags in the photo query ?
$tags_csv = html_entity_decode(tag_display_name($tag_object));
$tagscsv = $tagobject->name;
if (!empty($this->config->includerelatedtags)) {
$tags_csv .= ',' . tag_get_related_tags_csv(tag_get_related_tags($tag_object->id), TAG_RETURN_TEXT);
$tagscsv .= ',' . tag_get_related_tags_csv(tag_get_related_tags($tagobject->id), TAG_RETURN_TEXT);
}
$tags_csv = urlencode($tags_csv);
$tagscsv = urlencode($tagscsv);
//number of photos to display
$numberofphotos = DEFAULT_NUMBER_OF_PHOTOS;
@ -91,12 +91,12 @@ class block_tag_flickr extends block_base {
$photos = array_values($search['photoset']['photo']);
}
//search for photos tagged with $tags_csv
//search for photos tagged with $tagscsv
else{
$request = 'http://api.flickr.com/services/rest/?method=flickr.photos.search';
$request .= '&api_key='.FLICKR_DEV_KEY;
$request .= '&tags='.$tags_csv;
$request .= '&tags='.$tagscsv;
$request .= '&per_page='.$numberofphotos;
$request .= '&sort='.$sortby;
$request .= '&format=php_serial';

View File

@ -82,17 +82,16 @@ class block_tag_youtube extends block_base {
$tag = optional_param('tag', '', PARAM_TAG); // tag
if ($tag) {
$tag_object = tag_get('name', $tag);
$tagobject = tag_get('name', $tag);
} else if ($tagid) {
$tag_object = tag_get('id', $tagid);
$tagobject = tag_get('id', $tagid);
}
if (empty($tag_object)) {
if (empty($tagobject)) {
print_error('tagnotfound');
}
$query_tag = html_entity_decode(tag_display_name($tag_object));
$query_tag = urlencode($query_tag);
$querytag = urlencode($tagobject->name);
$numberofvideos = DEFAULT_NUMBER_OF_VIDEOS;
if ( !empty($this->config->numberofvideos) ) {
@ -101,7 +100,7 @@ class block_tag_youtube extends block_base {
$request = 'http://www.youtube.com/api2_rest?method=youtube.videos.list_by_tag';
$request .= '&dev_id='. YOUTUBE_DEV_KEY;
$request .= "&tag={$query_tag}";
$request .= "&tag={$querytag}";
$request .= "&page=1";
$request .= "&per_page={$numberofvideos}";
@ -114,17 +113,16 @@ class block_tag_youtube extends block_base {
$tag = optional_param('tag', '', PARAM_TAG); // tag
if ($tag) {
$tag_object = tag_get('name', $tag);
$tagobject = tag_get('name', $tag);
} else if ($tagid) {
$tag_object = tag_get('id', $tagid);
$tagobject = tag_get('id', $tagid);
}
if (empty($tag_object)) {
if (empty($tagobject)) {
print_error('tagnotfound');
}
$query_tag = html_entity_decode(tag_display_name($tag_object));
$query_tag = urlencode($query_tag);
$querytag = urlencode($tagobject->name);
$numberofvideos = DEFAULT_NUMBER_OF_VIDEOS;
if( !empty($this->config->numberofvideos)) {
@ -134,7 +132,7 @@ class block_tag_youtube extends block_base {
$request = 'http://www.youtube.com/api2_rest?method=youtube.videos.list_by_category_and_tag';
$request .= '&category_id='.$this->config->category;
$request .= '&dev_id=' . YOUTUBE_DEV_KEY;
$request .= "&tag={$query_tag}";
$request .= "&tag={$querytag}";
$request .= "&page=1";
$request .= "&per_page={$numberofvideos}";