'."\n";
?>
'."\n";
}
/****************************************************************/
/* Displays a simple slideshow
/* Array:
/* 'post_url' = post url (permalink)
/* 'server_image' = absolute path to thumbnail
/* 'image_location' = thumbnail url
/* 'alt_text' = post title
/* 'post_ID' = post ID
/* 'the_image' = image url
/* 'show_title' = SHOWTITLE result (html code string)
/****************************************************************/
function pt_slideshow ($arg, $random=false) {
parse_str($arg, $new_args);
$new_args = array_change_key_case($new_args, CASE_UPPER);
// Retrieves specific parameters
if (isset($new_args['WIDTH'])) $width = $new_args['WIDTH']; else $width = 180;
if (isset($new_args['HEIGHT'])) $height = $new_args['HEIGHT']; else $height = 120;
$style = ' style="width: '.$width.'px; height: '.$height.'px;" ';
$html_slideshow = '
';
if ($random)
$html_slideshow .= get_random_thumb($arg);
else
$html_slideshow .= get_recent_thumbs($arg);
$html_slideshow .= '
';
$html_slideshow = str_replace('
The Wordpress file "rss-functions.php" or "rss.php" could not be included.'));
}
/****************************************************************/
/* RSS class for PTR
/*
/****************************************************************/
class ptRSS {
var $rss;
var $feedStr = '';
var $mask = 'TIE';
var $count =5;
/*********************************************************************/
/* Constructor
/*********************************************************************/
function ptRSS ($farg='mask=TIE&count=5', $earg='', $arg='') {
// Retrieves parameters
$new_args = pt_parse_arg($farg);unset($farg);
if (isset($new_args['MASK'])) $this->mask = strtoupper($new_args['MASK']);
if (isset($new_args['COUNT'])) $this->count = (int) $new_args['COUNT'];
$this->earg = $earg; unset($earg);
$thiq->arg = $arg; unset($arg);
if ($this->earg=='') $this->earg = 'words=40&moretag=1&moretext=[Read More]&link=1';
if ($this->arg=='') $this->arg = 'rounded=0&subfolder=feeds&keepratio=0&width=100&height=70&append=0&&altappend=thumbrss_';
}
/*********************************************************************/
/* Formats feed
/*********************************************************************/
function ProcessFeed ($feedurl) {
if ($feedurl == '') return '';
$this->feedurl = $feedurl; unset($feedurl);
// fetches feed
$this->rss = fetch_rss($this->feedurl);
// Process feed
foreach ($this->rss->items as $item) :
if ($this->count == 0) break;
$this->altcounter = $display%2;
$this->ProcessItem($item);
$this->count--;
endforeach;
return $this->feedStr;
}
/*********************************************************************/
/* Formats item
/*********************************************************************/
function ProcessItem ($item) {
$class = ($this->altcounter == 0) ? ' alter' : '';
// Do you have problems with special characters, then comment the follow four lines
$item = encode_html($item);
// Processes all elements of the mask
$this->feedStr .= '';
}
/*********************************************************************/
/* Formats item element
/*********************************************************************/
function ProcessElement ($item, $element) {
switch ($element) :
case 'T' :
$this->feedStr .= ''.$item['title'].'';
break;
case 'I' :
$this->feedStr .= $this->GetThumbRSS($item);
break;
case 'D' :
$this->feedStr .= trim($item['description']);
break;
case 'E' :
$this->feedStr .= $this->GetExcerptRSS($item);
break;
endswitch;
}
/*********************************************************************/
/*
/*********************************************************************/
function GetThumbRSS($item){
$pattern = '@src=[\'"]http([^[:space:]\'">]*)\.(jpg|jpeg|gif|png)[\'"]@i';
if (preg_match($pattern, $item['description'], $match)) {
$rssimg = 'http'.$match[1].'.'.$match[2];
if (remote_file_exists($rssimg)) {
$p = new pt_thumbnail(get_pt_options_all(), $rssimg, $this->arg);
$rssthumb = $p->thumb_url;
unset ($p);
$thumbhtml = '
';
}
}
return $thumbhtml;
}
/*********************************************************************/
/*
/*********************************************************************/
function GetExcerptRSS($item){
$new_args = pt_parse_arg($this->earg);
// Retrieves specific parameters
if (isset($new_args['MORETEXT'])) $more_text = $new_args['MORETEXT']; else $more_text = "...";
$link = isset($new_args['LINK']);
if (isset($new_args['MORETAG'])) $more_tag = $new_args['MORETAG']; else $more_tag = "span";
if (isset($new_args['SHOWDOTS'])) $showdots = '...'; else $showdots = '';
// Create more link or more text
if ($link) {
if ($more_tag == '')
$more_link = '';
else
$more_link = '<' . $more_tag . ' class="more-link">';
$more_link .= '' . $more_text . '';
if ($more_tag != '') $more_link .= '' . $more_tag . '>' . "\n";
} else
$more_link = $more_text;
$more_link = $showdots.$more_link;
return get_pt_excerpt_sub($item['description'], $more_link, $this->earg);
}
}
/****************************************************************/
/* Redefines previous_post_link
/****************************************************************/
function pt_previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') {
if (is_attachment())
$post = & get_post($GLOBALS['post']->post_parent);
else
$post = get_previous_post($in_same_cat, $excluded_categories);
if (!$post) return;
$hs_url = get_permalink($post->ID);
$url_inframe = pt_return_get($hs_url);
$title = apply_filters('the_title', $post->post_title, $post);
$string = '';
$link = str_replace('%title', $title, $link);
$link = $pre . $string . $link . '';
$format = str_replace('%link', $link, $format);
echo $format;
}
/****************************************************************/
/* Redefines next_post_link
/****************************************************************/
function pt_next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') {
$post = get_next_post($in_same_cat, $excluded_categories);
if (!$post) return;
$hs_url = get_permalink($post->ID);
$url_inframe = pt_return_get($hs_url);
$title = apply_filters('the_title', $post->post_title, $post);
$string = '';
$link = str_replace('%title', $title, $link);
$link = $string . $link . '';
$format = str_replace('%link', $link, $format);
echo $format;
}
?>