Permalink
Browse files

more preferredtitle tweaks

  • Loading branch information...
dhawes
dhawes committed Jan 28, 2005
1 parent 7eca7e1 commit dfedf5fdff016222bf99a3d8d22935b09433b060
Showing with 16 additions and 10 deletions.
  1. +10 −8 blocks/rss_client/block_rss_client.php
  2. +6 −2 blocks/rss_client/config_instance.html
@@ -150,19 +150,21 @@ function get_rss_by_id($rssid, $display_description, $shownumentries, $showtitle
}
return;
}
-
- if ($showtitle) {
- $returnstring .= '<div class="rssclienttitle">'. $rss_record->title .'</div><br /><br />';
- }
+
if ($shownumentries > 0 && $shownumentries < count($rss->items) ) {
$rss->items = array_slice($rss->items, 0, $shownumentries);
}
if (empty($rss_record->preferredtitle)) {
- $feedtitle = stripslashes_safe($rss_record->preferredtitle);
- } else {
$feedtitle = stripslashes_safe(rss_unhtmlentities($rss->channel['title']));
- }
+ } else {
+ $feedtitle = stripslashes_safe($rss_record->preferredtitle);
+ }
+
+ if ($showtitle) {
+ $returnstring .= '<div class="rssclienttitle">'. $feedtitle .'</div><br /><br />';
+ }
+
foreach ($rss->items as $item) {
$item['title'] = stripslashes_safe(rss_unhtmlentities($item['title']));
$item['description'] = stripslashes_safe(rss_unhtmlentities($item['description']));
@@ -205,4 +207,4 @@ function get_rss_by_id($rssid, $display_description, $shownumentries, $showtitle
return $returnstring;
}
}
-?>
+?>
@@ -54,8 +54,12 @@
}
if ($rssfeeds = get_records('block_rss_client')) {
foreach($rssfeeds as $rssfeed){
- if ($rss
- $feedoptions[$rssfeed->id] = $rssfeed->title;
+ if (!empty($rssfeed->preferredtitle)) {
+ $feedtitle = $rssfeed->preferredtitle;
+ } else {
+ $feedtitle = $rssfeed->title;
+ }
+ $feedoptions[$rssfeed->id] = $feedtitle;
}
$dropdownmenustring = choose_from_menu($feedoptions, 'rssid[]', '', '', '', '0', true);

0 comments on commit dfedf5f

Please sign in to comment.