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
Box: rdf_feeds_boxed Boxes
By phill , Section Code []
Posted on Tue Jun 22, 2004 at 12:00:00 PM PST
I'm not particularly fond of the one rdf box with all the links lumped inside. I had played around with a system to seperate the rdf feeds into boxes and then allow the user to determine their position as well as turn them off from the page they were displayed on. This is a slimed down version of that idea, minus the arrangement options.

There are four parts: rdf_feeds_boxed, rdf_feeds_single, box_rdf_box, and hiderdf_box.

Any improvements or suggestions are welcome.

rdf_feeds_boxed
Type: box
Template: empty_box
Description: This is the main box that all the rdf feeds are nested inside and is losely based on the rdf_feeds box that comes with scoop. Because it is uses the empty_box template, you should not see it. It gets the $S->{prefs}->{rdf_feeds} from the userprefs table and uses that to populate the list of visible rdf feeds.

rdf_feeds_single
Type: box
Template: empty_box
Description: This is the box that formats the rdf feed data into the box. There is not a (known) variable for rdf feed id and this box works around that without modifying the base scoop code. The $c argument in rdf_feeds_boxed ($content.=qq~|BOX,rdf_box_single,$c|~;) feeds rdf_feeds_single the rid to build the box around.

box_rdf_box
Type: block
Category: Box Templates
Theme: default
Description: This is the html that would normally be called as the box template. The '|BOX,hiderdf_box,|RID||' statement calls the hiderdf_box and '|RID|' is replaced by the rdf_feeds_single box with the rdf ID number.


hiderdf_box
Type: box
Template: empty_box
Description: This is a modified version of Hillct's hidebox_box that hides changes the rdf_feeds userpref.


## start rdf_feeds_boxed box
##
## instead of the one box of RDF feeds lumped together, create a box for each feed and incorporate the hidebox_box functionality by Colin Hil l (hillct)
## Version 0.1 by phill brown (pipebox.net)
##
## This box uses the empty_box template
##
return unless $S->{UI}->{VARS}->{use_rdf_feeds};
my $content;
my $channels = $S->rdf_channels();
my @feeds=split(/,/, $S->{prefs}->{rdf_feeds});
foreach my $c(@feeds){
$content.=qq~|BOX,rdf_box_single,$c|~;
}
return $content;
## end rdf_feeds_boxed



## start rdf_feeds_single box
##
## instead of the one box of RDF feeds lumped together, create a box for each feed and incorporate the hidebox_box functionality by Colin Hil l (hillct)
## Version 0.1 by phill brown (pipebox.net)
##
## This box uses the empty_box template
##
my $content;
my $item= $S->rdf_channels($ARGS[0]);
my $title=$item->{title};

if ($S->{UI}->{VARS}->{rdf_use_images} && $item->{image_url}) {
$content .= qq~<A HREF="$item->{image_link}"><IMG SRC="$item->{image_url}" ALT="$item->{image_title}" BORDER="1">< /a><br>\n~;
}

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;

my $links = $S->rdf_items($ARGS[0], $item_limit);
foreach my $i (@{$links}) {
$content .= qq~|dot| <a class="light" href="$i->{link}">$i->{title}</a><br>\n~;
}

my $return=$S->{UI}->{BLOCKS}->{box_rdf_box};
$return =~ s/|content|/$content/g;
$return =~ s/|title|/$title/g;
$return =~ s/|RID|/$ARGS[0]/g;

return $return;
## end rdf_box_single box



## start box_rdf_box block
##
## instead of the one box of RDF feeds lumped together, create a box for each feed and incorporate the hidebox_box functionality by Colin Hil l (hillct)
## Version 0.1 by phill brown (pipebox.net)
##
## I placed this block in the default theme and in the 'Box Templates' category. You might consider doing the same.
##
<TABLE WIDTH="100%" BORDER=1 CELLPADDING=2 CELLSPACING=0>
<TR>
<TD BGCOLOR="#006699">
|box_title_font||title||box_title_font_end||BOX,hiderdf_box,|RID||
</TD>
</TR>
<TR>
<TD>
|smallfont|
|content|
|smallfont_end|
</TD>
</TR>
</TABLE>
<P>
## end box_rdf_box block



## START hiderdf_box ##
# Requires an image name to be defined in the variable 'hidebox_icon'
# This box should be called from within the box rdf_box_single
# The call should be of the form:
# |BOX,hiderdf_box,|RID||
# an example box closer icon can be seen at:
# http://beta.evilplans.net/images/x.gif

### Really Start Hidebox Box ###
# Display a Box CLoser 'X' in box templates
# Version 0.1 by hillct
# Version 0.1a by phill brown (pipebox.net): modified to change RDF preferences
#
#
my($content);
my $uri=$S->apache->uri;
my $arg = $S->apache->args();
$arg =~ s/hide-rdf=\w+//g;
$arg =~ s/;$//;
my $redirect=($arg)?"$uri?$arg":$uri;
$uri .= ($arg) ? "?$arg;hide-rdf=$ARGS[0]" : "?hide-rdf=$ARGS[0]";

if($S->{GID} ne 'Anonymous') { # If logged in
if($S->cgi->param('hide-rdf')=~/$ARGS[0]/){
# Change the user pref for display of this box

my @feeds=split(/,/, $S->{prefs}->{rdf_feeds});
my @rids;

foreach my $c (@feeds){
push(@rids, $c) unless ($c == $ARGS[0]);
}
$S->rdf_set_prefs(\@rids);
# Redirect because we're actually running the box
$S->apache->header_out('location',$redirect);
$S->apache->header_out('connection','close');
$S->apache->status(301); $S->{HEADER_ONLY}=1;
} else {
# Display an 'X' with a link to 'URI' if allowed
$content.=qq{<a href="$uri"><img src="$S->{UI}->{VARS}->{'rootdir'}$S->{UI}->{VARS}->{'imagedir'}/$S->{UI} ->{VARS}->{'hidebox_icon'}" border="0" align="right" alt="close"></a>};

}
return {content => $content};
}

## END hiderdf_box ##

< UnfairAndImbalanced.com: A progressive news portal and community | The Kronicles: your source for news >

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

Login
Make a new account
Username:
Password:

Related Links
· Scoop
· More on Boxes
· Also by phill

Story Views
  50 Scoop users have viewed this story.

Display: Sort:
Box: rdf_feeds_boxed | 12 comments (12 topical, 0 hidden)
wow. (none / 0) (#1)
by phill on Thu Jun 24, 2004 at 07:22:07 AM PST

I just realized how crappy of a description that is.

rdf_feeds_boxed and the sub boxes exist so that you can break up your rdf_feeds into individual boxes. For each of the boxes, there is now the ability to choose not to display the feed from the page that it is displayed on, using a modified version of the hidebox_box.

In short, it is removing feeds from the page like you can remove boxes.

-p



Trying to figure out (none / 0) (#3)
by Ciara on Wed Nov 11, 2015 at 12:53:26 PM PST

I was trying really hard to figure out that description to do everything right, however it still doesn't work for me. Ciara from custom essay.



design (none / 0) (#4)
by scalett on Wed Jun 15, 2016 at 10:13:19 PM PST

It can be absolutely Dior Replica Handbags absorbing to plan with berry chaplet because of their acutely baby sizes. Although you allegation a lot of backbone to plan with these beads, you can be assured that your creations will be outstanding because these chaplet bleed a blazon of adorableness and breeding that no added chaplet do.Most alarming and eye communicable covering handbags are the ones atramentous in tan, amber and atramentous colors. You will aswell louis vuitton replica handbags acquisition altered variations in the aforementioned designs of these handbags. Sturdy, acute and absolutely stylish, these handbags can be agitated with élan for any of the official duties.Priced a little college than a lot of of the handbags, these can abduct Replica Handbags any lady's heart. These are ideal tote to be taken forth on an atramentous to be absorb with the well-to-do. These handbags are in altered shapes and designs. With apprenticed ambit for every product, it is difficult that you will acquisition two of the aforementioned at http://silbermanvoices.com/article-11/ description.



wonderful (none / 0) (#5)
by flamingo123 on Wed Jun 29, 2016 at 03:00:03 AM PST

Great understanding of coding that makes sense here and the URL and other links have valuable tendency! explainer videos for business



Great (none / 0) (#6)
by happywheelsnow on Wed Feb 15, 2017 at 10:06:24 PM PST

Thank you for your post, I look for such article along time, today i find it finally. this post give me lots of advise it is very useful for me happy wheels



check cashing (none / 0) (#7)
by Pervez on Mon Apr 02, 2018 at 04:40:29 AM PST

Many thanks in your wonderful publishing! I really loved reading through this, you're an excellent writer. I wish to motivate that you simply carry on your own excellent function. Right now click here check cashing Possess a good day time!



bathroom renovation near me (none / 0) (#8)
by Pervez on Sun Mar 17, 2019 at 07:15:57 AM PST

With thanks to get establishing the greater material. Most people sought similar to that. I discovered the following quiet appealing, if possible, any person. Now follow-up bathroom renovation near me Thanks a lot, to get going over fine information and facts.



great (none / 0) (#9)
by rozirose124 on Sat Apr 06, 2019 at 04:15:08 PM PST

Please don't take this personally but I don't think there is a single Tree service. I have tried so many companies over the years but I have never been fully satisfied.



great (none / 0) (#10)
by rozirose124 on Fri May 17, 2019 at 04:21:42 PM PST

This is helpful, nonetheless it can be crucial so that you can check out the following website: virtual phone australia



The benefits of using organic skincare products (none / 0) (#11)
by michaelburris on Tue Dec 17, 2019 at 12:00:44 AM PST

Today major brands are catching on to the fact that consumers want to use organic skincare products. One of the major reason for this is because inorganic skincare products contain chemicals which can harm the skin. Whether it is the skin or hair, they require regular moisturising with the best products. According to Xordcosmetics, using organic products have the following benefits. * They avoid irritation as they don't use chemicals and other things to irritate the skin. * They have natural fragrances * They are eco-friendly * Doesn't have side effects Do you know any other benefits of using organic skin products?



Great and informative (none / 0) (#12)
by elliegrayson on Fri Feb 28, 2020 at 08:01:54 AM PST

Such a nice and great kind of informative post, At Saints2clean.com, we care for the security of our customers. Being known as the best residential cleaning company, we make sure to provide our clients with insured and certified staff to work in a dignified and professional manner.



Box: rdf_feeds_boxed | 12 comments (12 topical, 0 hidden)
Display: Sort:

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