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_boxed 1.00

Author: phill [Info]

Description:

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. 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.

Box Code:

## 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 Hill (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 Hill (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 Hill (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 ##
Display: Sort:
Reader (none / 0) (#1)
by Loesllair on Thu May 10, 2018 at 01:47:19 AM PST

This blog is something about a scoop box. I know very less about the scoop box but this blog would be understood after a complete reading and its connection with bestdissertation. So that readers will come to know about the basic idea of this blog.



Reader (none / 0) (#2)
by Loesllair on Fri May 25, 2018 at 03:33:08 PM PST

Once in a while malignancy consequences for our resistant framework and we are seriously wiped out in this condition. On the off chance that we think about this studyislight.com we find out about this issue in people and may have the capacity to cure ourselves. We should elevate such data to others so they come to comprehend the fundamentals of this malady and they should ready to get cure from this.



car battery replacement (none / 0) (#3)
by muhammadsaeed on Sun Jan 19, 2020 at 01:59:53 AM PST

Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. car battery replacement



yep (none / 0) (#4)
by otis on Fri Sep 09, 2022 at 10:59:24 PM PST

Thanks for sharing this quality information framed game with us. I really enjoyed reading. Will surely going to share this URL with my friends



Free online Lol Beans game (none / 0) (#5)
by wiles68183 on Mon Sep 19, 2022 at 06:55:46 AM PST

Btw lol beans io can be played solo, with friends or with online players all over the world. Unlocked and fully accessible version without lags.



marth (none / 0) (#6)
by marianlisa on Wed Oct 12, 2022 at 04:48:36 AM PST

Your writings and news are lolbeans really interesting to me. There are numerous advantages to the contents. Thank you so much.



great (none / 0) (#7)
by davidjohn on Mon Feb 20, 2023 at 09:03:07 PM PST

The fascinating and easily understood stuff in your writings definitely incredibox stands out to me. Although perusing numerous other websites, I continue to choose yours.



good (none / 0) (#8)
by davidjohn on Wed May 24, 2023 at 11:43:53 PM PST

greag



an (none / 0) (#9)
by otis on Fri Jun 02, 2023 at 03:42:53 AM PST

The provided bloxd io information contains technical details and code snippets that describe the structure and functionality of different box types.



the games (none / 0) (#10)
by zeldaiuytt on Thu Jun 22, 2023 at 11:47:06 PM PST

The sleek and minimalist aesthetic rankdle of the second-generation Devialet not only complements any interior decor but also serves as a testament to the brand's dedication to craftsmanship.



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

Scoop Site Scroller: Get one yourself!
Scoop::Ads
Almost there...

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