| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
// XSL template |
|---|
| 4 |
|
|---|
| 5 |
require_once(dirname(dirname(__FILE__))."/../includes.php"); |
|---|
| 6 |
header("Content-type: text/xml; charset=utf-8"); |
|---|
| 7 |
|
|---|
| 8 |
global $page_owner; |
|---|
| 9 |
|
|---|
| 10 |
$title = __gettext("RSS Management"); |
|---|
| 11 |
$subelgg = __gettext("To add this feed to your resources page, click here."); |
|---|
| 12 |
$subother = __gettext("To add this feed to an external RSS aggregator, click the link that corresponds to your aggregator:"); |
|---|
| 13 |
$gubbins = __gettext("Summary"); |
|---|
| 14 |
$headertitle = __gettext("This is an RSS feed for "); |
|---|
| 15 |
$exit = __gettext("Didn't mean to come here? Click to exit!"); |
|---|
| 16 |
|
|---|
| 17 |
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; |
|---|
| 18 |
|
|---|
| 19 |
?> |
|---|
| 20 |
|
|---|
| 21 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 22 |
|
|---|
| 23 |
<xsl:template match="/"> |
|---|
| 24 |
<html> |
|---|
| 25 |
<head> |
|---|
| 26 |
<title><?php echo $title; ?></title> |
|---|
| 27 |
<style type="text/css"> |
|---|
| 28 |
|
|---|
| 29 |
body{ |
|---|
| 30 |
padding: 0; |
|---|
| 31 |
font-family: arial, verdana, helvetica, sans-serif; |
|---|
| 32 |
color: #333; |
|---|
| 33 |
background: #fff; |
|---|
| 34 |
width:100%; |
|---|
| 35 |
margin:auto; |
|---|
| 36 |
font-size:80%; |
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
a { |
|---|
| 40 |
text-decoration: none; |
|---|
| 41 |
color: #7289AF; |
|---|
| 42 |
font-family:verdana, arial, helvetica, sans-serif; |
|---|
| 43 |
font-size:100%; |
|---|
| 44 |
|
|---|
| 45 |
} |
|---|
| 46 |
|
|---|
| 47 |
p { |
|---|
| 48 |
font-size: 100%; |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
h1 { |
|---|
| 52 |
margin:0px 0px 15px 0px; |
|---|
| 53 |
padding:0px; |
|---|
| 54 |
font-size:120%; |
|---|
| 55 |
font-weight:900; |
|---|
| 56 |
} |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
h2 { |
|---|
| 60 |
margin:0px 0px 5px 0px; |
|---|
| 61 |
padding:0px; |
|---|
| 62 |
font-size:100% |
|---|
| 63 |
} |
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
h3 { |
|---|
| 67 |
margin:0px 0px 5px 0px; |
|---|
| 68 |
padding:0px; |
|---|
| 69 |
font-size:100% |
|---|
| 70 |
} |
|---|
| 71 |
|
|---|
| 72 |
h4 { |
|---|
| 73 |
margin:0px 0px 5px 0px; |
|---|
| 74 |
padding:0px; |
|---|
| 75 |
font-size:100% |
|---|
| 76 |
} |
|---|
| 77 |
|
|---|
| 78 |
h5 { |
|---|
| 79 |
margin:0px 0px 5px 0px; |
|---|
| 80 |
padding:0px; |
|---|
| 81 |
color:#1181AA; |
|---|
| 82 |
background:#fff; |
|---|
| 83 |
font-size:100% |
|---|
| 84 |
} |
|---|
| 85 |
|
|---|
| 86 |
img { |
|---|
| 87 |
border:0px; |
|---|
| 88 |
} |
|---|
| 89 |
|
|---|
| 90 |
blockquote { |
|---|
| 91 |
padding: 0 1pc 1pc 1pc; |
|---|
| 92 |
border: 1px solid #ddd; |
|---|
| 93 |
background-color: #F0F0F0; |
|---|
| 94 |
color:#000; |
|---|
| 95 |
background-image: url("<?php echo $CFG->wwwroot; ?>_templates/double-quotes.png"); |
|---|
| 96 |
background-repeat: no-repeat; |
|---|
| 97 |
background-position: -10px -7px; |
|---|
| 98 |
} |
|---|
| 99 |
|
|---|
| 100 |
/*--------------------------------------- |
|---|
| 101 |
Wraps the entire page |
|---|
| 102 |
-----------------------------------------*/ |
|---|
| 103 |
|
|---|
| 104 |
#container { |
|---|
| 105 |
margin: 0 auto; |
|---|
| 106 |
width: 100%; |
|---|
| 107 |
min-width: 750px; |
|---|
| 108 |
} |
|---|
| 109 |
|
|---|
| 110 |
/*--------------------------------------------- |
|---|
| 111 |
HEADER |
|---|
| 112 |
------------------------------------------------*/ |
|---|
| 113 |
|
|---|
| 114 |
#header { |
|---|
| 115 |
width: 100%; |
|---|
| 116 |
background-color: #1181AA; |
|---|
| 117 |
color: #333333; |
|---|
| 118 |
border: 0px solid #ccc; |
|---|
| 119 |
border-bottom: 4px solid #FAC83D; |
|---|
| 120 |
padding: 0px; |
|---|
| 121 |
margin: 0px; |
|---|
| 122 |
text-align: left; |
|---|
| 123 |
} |
|---|
| 124 |
|
|---|
| 125 |
#header h1 { |
|---|
| 126 |
padding: 0 0 4px 0; |
|---|
| 127 |
margin: 0px 0 0 10px; |
|---|
| 128 |
background-color: #1181AA; |
|---|
| 129 |
color: #fff; |
|---|
| 130 |
text-align: left; |
|---|
| 131 |
font-size:140%; |
|---|
| 132 |
font-weight:normal; |
|---|
| 133 |
} |
|---|
| 134 |
|
|---|
| 135 |
#header h2 { |
|---|
| 136 |
padding: 0 0 7px 0; |
|---|
| 137 |
margin: 0 0 0 20px; |
|---|
| 138 |
font-weight: normal; |
|---|
| 139 |
background-color: #1181AA; |
|---|
| 140 |
color: #fff; |
|---|
| 141 |
border: none; |
|---|
| 142 |
font-family: "Lucida Grande", arial, sans-serif; |
|---|
| 143 |
font-size:120%; |
|---|
| 144 |
} |
|---|
| 145 |
|
|---|
| 146 |
#intro { |
|---|
| 147 |
padding:10px; |
|---|
| 148 |
} |
|---|
| 149 |
|
|---|
| 150 |
#actions { |
|---|
| 151 |
padding:10px; |
|---|
| 152 |
text-align: center; |
|---|
| 153 |
} |
|---|
| 154 |
|
|---|
| 155 |
#actions p { |
|---|
| 156 |
text-align: center; |
|---|
| 157 |
} |
|---|
| 158 |
|
|---|
| 159 |
#external { |
|---|
| 160 |
padding:10px; |
|---|
| 161 |
} |
|---|
| 162 |
|
|---|
| 163 |
#gubbins { |
|---|
| 164 |
padding:10px; |
|---|
| 165 |
background:#fff; |
|---|
| 166 |
} |
|---|
| 167 |
|
|---|
| 168 |
#subscribe { |
|---|
| 169 |
width: 307px; |
|---|
| 170 |
height: 91px; |
|---|
| 171 |
/*border:1px solid #4473A1;*/ |
|---|
| 172 |
/*padding:15px 0;*/ |
|---|
| 173 |
text-align:center; |
|---|
| 174 |
font-size:1.15em; |
|---|
| 175 |
font-weight:bold; |
|---|
| 176 |
font-size:140%; |
|---|
| 177 |
/* -moz-border-radius: 0.5em;*/ |
|---|
| 178 |
} |
|---|
| 179 |
|
|---|
| 180 |
#subscribe a { |
|---|
| 181 |
background-image: url(<?php echo $CFG->wwwroot; ?>_rss/subscribe.png); |
|---|
| 182 |
background-repeat: no-repeat; |
|---|
| 183 |
display: block; width: 307px; height: 91px; padding:15px 0 0 0; |
|---|
| 184 |
} |
|---|
| 185 |
|
|---|
| 186 |
#subscribe a:hover { |
|---|
| 187 |
background: url(<?php echo $CFG->wwwroot; ?>_rss/subscribe-high.png); |
|---|
| 188 |
background-repeat: no-repeat; |
|---|
| 189 |
display: block; width: 307px; height: 91px; padding:15px 0 0 0; |
|---|
| 190 |
} |
|---|
| 191 |
|
|---|
| 192 |
#mistake { |
|---|
| 193 |
width: 307px; |
|---|
| 194 |
height:91px; |
|---|
| 195 |
/*border:1px solid #E504BD; */ |
|---|
| 196 |
text-align:center; |
|---|
| 197 |
font-size:1.15em; |
|---|
| 198 |
font-weight:bold; |
|---|
| 199 |
font-size:140%; |
|---|
| 200 |
/* -moz-border-radius: 0.5em; */ |
|---|
| 201 |
} |
|---|
| 202 |
|
|---|
| 203 |
#mistake a { |
|---|
| 204 |
background-image: url(<?php echo $CFG->wwwroot; ?>_rss/mistake.png); |
|---|
| 205 |
background-repeat: no-repeat; |
|---|
| 206 |
display: block; width: 307px; height: 91px; padding:15px 0 0 0; |
|---|
| 207 |
} |
|---|
| 208 |
|
|---|
| 209 |
#mistake a:hover { |
|---|
| 210 |
background: url(<?php echo $CFG->wwwroot; ?>_rss/mistake-high.png); |
|---|
| 211 |
background-repeat: no-repeat; |
|---|
| 212 |
display: block; width: 307px; height: 91px; padding:15px 0 0 0; |
|---|
| 213 |
|
|---|
| 214 |
} |
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
</style> |
|---|
| 218 |
</head> |
|---|
| 219 |
<body> |
|---|
| 220 |
<?php |
|---|
| 221 |
|
|---|
| 222 |
$url = $CFG->wwwroot . optional_param('url','',PARAM_LOCALURL); |
|---|
| 223 |
$rssurl = $CFG->wwwroot . optional_param('rssurl','',PARAM_LOCALURL); |
|---|
| 224 |
|
|---|
| 225 |
$output = <<< END |
|---|
| 226 |
<div id="header"><!-- start header --> |
|---|
| 227 |
<h1>$headertitle <xsl:value-of select="rss/channel/title"/></h1> |
|---|
| 228 |
</div><!-- end header --> |
|---|
| 229 |
|
|---|
| 230 |
END; |
|---|
| 231 |
|
|---|
| 232 |
if (logged_on) { |
|---|
| 233 |
|
|---|
| 234 |
$subscribeurl = url . "_rss/subscriptions.php?profile_name=" . $_SESSION['username']; |
|---|
| 235 |
|
|---|
| 236 |
$output .= <<< END |
|---|
| 237 |
|
|---|
| 238 |
<div id="actions"> |
|---|
| 239 |
<p> |
|---|
| 240 |
<div id="subscribe"><a href="{$subscribeurl}&url=$rssurl&action=subscribe-new">$subelgg</a></div> |
|---|
| 241 |
</p> |
|---|
| 242 |
|
|---|
| 243 |
<p> |
|---|
| 244 |
<div id="mistake"><a href="javascript:history.go(-1)">$exit</a></div> |
|---|
| 245 |
</p> |
|---|
| 246 |
</div> |
|---|
| 247 |
|
|---|
| 248 |
END; |
|---|
| 249 |
|
|---|
| 250 |
} |
|---|
| 251 |
|
|---|
| 252 |
$output .= <<< END |
|---|
| 253 |
|
|---|
| 254 |
<div id="external"> |
|---|
| 255 |
<p> |
|---|
| 256 |
$subother |
|---|
| 257 |
</p> |
|---|
| 258 |
<ul> |
|---|
| 259 |
<li><a href="http://www.bloglines.com/sub/$rssurl"><img src="http://solosub.com/img/bloglines.png" alt="Bloglines" /></a></li><li> |
|---|
| 260 |
<a href="http://add.my.yahoo.com/rss?url=$rssurl"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif" alt="My Yahoo" /></a> </li><li> |
|---|
| 261 |
<a href="http://my.msn.com/addtomymsn.armx?id=rss&ut=$rssurl&tt=CENTRALDIRECTORY&ru=http://rss.msn.com'"><img src="http://solosub.com/img/mymsn.gif" alt="MyMSN" /></a></li><li> |
|---|
| 262 |
<a href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=$rssurl"><img src="http://www.newsgator.com/images/ngsub1.gif" alt="Newsgator" /></a> </li> |
|---|
| 263 |
<li><a target="_blank" href="http://solosub.com/sub/$rssurl">Syndicate in any reader via <img src="http://solosub.com/feed_button.gif" alt="SoloSub" /></a></li> |
|---|
| 264 |
</ul> |
|---|
| 265 |
</div> |
|---|
| 266 |
<hr /> |
|---|
| 267 |
<div id="gubbins"> |
|---|
| 268 |
<h2>$gubbins</h2> |
|---|
| 269 |
<h3><xsl:value-of select="rss/channel/title"/></h3> |
|---|
| 270 |
<h4><xsl:value-of select="rss/channel/description"/></h4> |
|---|
| 271 |
<ul> |
|---|
| 272 |
<xsl:for-each select="rss/channel/item"> |
|---|
| 273 |
<li> |
|---|
| 274 |
<p><xsl:value-of select="title"/> |
|---|
| 275 |
<a><xsl:attribute name="href"> |
|---|
| 276 |
<xsl:value-of select="link"/></xsl:attribute> |
|---|
| 277 |
>> |
|---|
| 278 |
</a></p> |
|---|
| 279 |
<xsl:for-each select="enclosure"> |
|---|
| 280 |
<p>File: |
|---|
| 281 |
<a><xsl:attribute name="href"> |
|---|
| 282 |
<xsl:value-of select="@url"/></xsl:attribute> |
|---|
| 283 |
<xsl:value-of select="@url"/> |
|---|
| 284 |
</a> (<xsl:value-of select="@type"/>) |
|---|
| 285 |
</p> |
|---|
| 286 |
</xsl:for-each> |
|---|
| 287 |
</li> |
|---|
| 288 |
</xsl:for-each> |
|---|
| 289 |
</ul> |
|---|
| 290 |
</div> |
|---|
| 291 |
|
|---|
| 292 |
END; |
|---|
| 293 |
|
|---|
| 294 |
echo $output; |
|---|
| 295 |
|
|---|
| 296 |
?> |
|---|
| 297 |
</body> |
|---|
| 298 |
</html> |
|---|
| 299 |
</xsl:template> |
|---|
| 300 |
|
|---|
| 301 |
</xsl:stylesheet> |
|---|