Skip to content
Permalink
Browse files

MDL-14237: Removing calls to html_entity_decode, along with some synt…

…ax cleanup (merge from 1.9)
  • Loading branch information...
scyrma
scyrma committed Jul 7, 2008
1 parent 97f7393 commit 0c9bba1c767eb1b7b08d6ae67357b03a7383f1a8
Showing with 18 additions and 20 deletions.
  1. +8 −8 blocks/tag_flickr/block_tag_flickr.php
  2. +10 −12 blocks/tag_youtube/block_tag_youtube.php
@@ -43,21 +43,21 @@ function get_content() {
$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 @@ function get_content() {
$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';
@@ -82,17 +82,16 @@ function get_videos_by_tag(){
$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 @@ function get_videos_by_tag(){
$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 @@ function get_videos_by_tag_and_category(){
$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 @@ function get_videos_by_tag_and_category(){
$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}";

0 comments on commit 0c9bba1

Please sign in to comment.
You can’t perform that action at this time.