Scoop -- the swiss army chainsaw of content management
Front Page Everything News Code Help! Wishlist Project Scoop Sites Dev Notes Latest CVS changes Development Activities
Scoop Box Exchange - Show Box: rdf_feeds 1.00

Author: Scoop Developers

Description:

This box displays the rdf feeds that the user chose to view in their display preferences. If you don't have use_rdf_feeds enabled in the Site Controls then this box won show. It also won't show if they have no rdf feeds chosen. If given an argument in the block directly or through the command line then it will display that rdf

Box Code:

return unless $S->{UI}->{VARS}->{use_rdf_feeds};

my $to_display = {};
if (@ARGS || $S->{CGI}->param('rdf')) {
my $rdf_arg = $S->{CGI}->param('rdf');
@ARGS = split(/,/, $rdf_arg) if $rdf_arg;
foreach (@ARGS) {
$to_display->{$_} = 1;
}
}

my $content;
my $channels = $S->rdf_channels();
my $user_feeds = $S->rdf_get_prefs() unless @ARGS;
my $item_limit = defined($S->{prefs}->{rdf_max_headlines}) ?
$S->{prefs}->{rdf_max_headlines} :
defined($S->{UI}->{VARS}->{rdf_max_headlines}) ?
$S->{UI}->{VARS}->{rdf_max_headlines} : 15;

if ($S->have_perm('submit_rdf')) {
$content = qq|<A CLASS="light" HREF="%%rootdir%%/submitrdf">Submit Feed</A><BR><BR>\n|;
}

foreach my $c (@{$channels}) {
if (@ARGS) {
next unless $to_display->{ $c->{rid} };
} else {
next unless $user_feeds->{ $c->{rid} };
}
next unless $c->{title};
unless ($S->have_perm('rdf_admin')) {
next if $c->{submitted} || !$c->{enabled};
}

if ($S->{UI}->{VARS}->{rdf_use_images} && $c->{image_url}) {
$content .= qq~<A HREF="$c->{image_link}"><IMG SRC="$c->{image_url}" ALT="$c->{image_title}" BORDER="1"></a><br>\n~;
} else {
$content .= qq~<B><A CLASS="light" HREF="$c->{link}">$c->{title}</a></b><BR>\n~;
}

my $items = $S->rdf_items($c->{rid}, $item_limit);
foreach my $i (@{$items}) {
$content .= qq~%%dot%% <A CLASS="light" HREF="$i->{link}">$i->{title}</a><BR>\n~;
}

if ($S->{UI}->{VARS}->{rdf_use_forms} && $c->{form_link}) {
$content .= qq~<FORM ACTION="$c->{form_link}" METHOD="GET">$c->{form_title}: <INPUT TYPE="TEXT" NAME="$c->{form_name}"></form><br>\n~;
}

$content .= "<BR>\n";
}

return $content;
Display: Sort:
Developer (none / 0) (#1)
by Elliott291 on Sat Oct 12, 2019 at 06:52:19 AM PST

An experienced developer knows how to solve this problem if he experiences this type of problems first. You can hire australian writings developers who really know how to solve it and they also provide you extra tips about the project.



Menu
create account
faq
search
report bugs
Scoop Administrators Guide
Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
The OpenNIC
Democratically operated Domain Name System; using Scoop since Jan. 2001.

Login
Make a new account
Username:
Password:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest 1999 The Management

create account | faq | search