| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/modules/mod_bohemianrss/tmpl/ |
Upload File : |
<?php
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
function my_page_URL() {
$URL = 'http';
if ($_SERVER["HTTPS"] == "on") {$page_URL .= "s";}
$URL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$URL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$URL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $URL;
}
my_page_URL();
?>
<style type="text/css" media="screen">
.dataTables_info { padding-top: 0; }
.dataTables_info { padding-top: 0; }
.dataTables_paginate { padding-top: 0; }
.css_right { float: right; }
#example_wrapper .fg-toolbar { font-size: 0.8em }
#theme_links span { float: left; padding: 2px 10px; }
#example_wrapper { -webkit-box-shadow: 2px 2px 6px #666; box-shadow: 2px 2px 6px #666; border-radius: 5px; }
#example tbody {
border-left: 1px solid #AAA;
border-right: 1px solid #AAA;
}
#example thead th:first-child { border-left: 1px solid #AAA; }
#example thead th:last-child { border-right: 1px solid #AAA; }
</style>
<style type="text/css" media="screen">
#example_paginate {float:left;}
</style>
<script type="text/javascript">
function fnFeaturesInit ()
{
/* Not particularly modular this - but does nicely :-) */
$('ul.limit_length>li').each( function(i) {
if ( i > 10 ) {
this.style.display = 'none';
}
} );
$('ul.limit_length').append( '<li class="css_link">Show more<\/li>' );
$('ul.limit_length li.css_link').click( function () {
$('ul.limit_length li').each( function(i) {
if ( i > 5 ) {
this.style.display = 'list-item';
}
} );
$('ul.limit_length li.css_link').css( 'display', 'none' );
} );
}
$(document).ready( function() {
fnFeaturesInit();
$('#example').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 2, "desc" ]]
} );
SyntaxHighlighter.config.clipboardSwf = 'media/javascript/syntax/clipboard.swf';
SyntaxHighlighter.all();
} );
</script>
<div style="clear:both;"></div>
<?php
if($_POST['feeds']){
$urls = mysql_real_escape_string(trim($_POST['feeds']));
$urls = explode(",", trim($urls)); // makes array
} else{
//echo "hi";
$myurls = explode(",",$params->get('modulerss'));
$urls = $myurls;
//print_r($urls);
}
/*foreach ($urls as $url){
$url = trim($url); // trim any whitespace here
$urls2[] = $url;
}*/
if(count($urls) < 4){
foreach ($urls as $url){
$url = trim($url); // trim any whitespace here
$urls2[] = $url;
}
}else{
echo '<div style="margin-top:20px; margin-left:2%;margin-right:2%;color:red;">For testing purposes, you can only enter 3 urls!</div>';
$myurls2 = explode(",",$params->get('modulerss'));
$urls2 = $myurls2;
//$urls2 = array($params->get('modulerss'));
}
//print_r($urls2);
// static option here
/*$urls2 = array('http://kamloops.kijiji.ca/f-SearchAdRss?CatId=152&Location=1700227', 'http://kamloops.en.craigslist.ca/search/web?query=%20&format=rss');*/
//$urls = array_unique($urls);
require('magpie/rss_fetch.inc');
foreach($urls2 as $url) {
$rss = fetch_rss($url);
//print_r($rss->items);
foreach ($rss->items as $item ) {
$title = $item[title];
$title = str_replace(",","",$title);
$url = $item[link];
$description = $item[description];
if($item['dc']['date']==true){
$date = $item['dc']['date'];
}else if($item[pubdate]==true){
$date = date("Y-m-d",strtotime($item[pubdate]));
}
$tot_array[] = $date.",".$title.",".$url.",".$description;
}
}
// print_r($tot_array);
//rsort($tot_array);
?>
<div style="margin-top:20px; margin-left:2%;margin-right:2%;">
<?php
//include('header.inc');
?>
</div>
<?php
echo '<div style="margin-top:20px; margin-left:2%;margin-right:2%;">';
?>
<form method = "post" action = "<?php echo $URL; ?>" >
<textarea style="width:100%; height:50px;" name="feeds">http://bohemiawebsites.com/Subscribe-to-blog-rss-feed.html, http://kamloops.en.craigslist.ca/search/web?query=%20&format=rss, http://kamloops.kijiji.ca/f-SearchAdRss?CatId=152&Location=1700227</textarea>
<input style="margin-top:5px;" type="submit" name="submit" value="Submit" />
</form><br/>
<?php
echo '<table class="display" id="example" align="center" cellspacing="0" cellpadding="5" style="width:100%; background-color:grey;" >
<thead><tr style="background:grey;">
<th align="left"><b>Link</b> </th>
<th align="left"><b>Text</b> </th>
<th align="left"><b>Date</b> </th>
</tr></thead><tbody>';
foreach($tot_array as $tot) {
$all = explode(",",$tot);
$date = date("Y-m-d",strtotime($all[0]));
$title = $all[1];
$url = trim($all[2]);
$description = trim($all[3]);
echo '<tr>';
echo '<td><a href="'.$url.'">'.$title.'</a></td>';
echo '<td>'.$description.'</td>';
echo '<td>'.$date.'</td>';
echo '</tr>';
}
?>
</tbody></table>
</div>