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



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

Scoop Site Scroller: Get one yourself!
Kuro5hin.org
Cooler than Adequacy.org

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