View Single Post
Old 03-14-2008, 07:04 AM   #5 (permalink)
satimis
The Wanderer
 
Join Date: Mar 2008
Posts: 8
Thanks: 0
satimis is on a distinguished road
Default

Quote:
Originally Posted by Haris View Post
Elaborate completely satimis! What are you trying to achieve?
OK.


I made mistake on entering the titles of my 2 postings. Now I repeat what I'm searching for as follows;


I have 2 PHP scripts for RSS feeds, one with the news displaying on single column and another on twin column. The news are scrolling on a marquee container/window/tag written on javascript (another script).


Both PHP scripts are working. I won't run them at the same time. (This is a test only)


1)
Single column PHP script
Code:
<?php
function ShowOneRSS($url) {
global $rss;
if ($rs = $rss->get($url)) {
echo '<h2><a href="'.$rs['link'].'">'.$rs['title']."</a></h2>\n";
echo $rs['description']."<br>\n";
echo "<ul>\n";
foreach ($rs['items'] as $item) {
echo '<li><a href="'.$item['link'].'" title="'.$item['description'].'">'.$item['title'].'</a></li>';
}
if ($rs['items_count'] <= 0) { echo "<li>Sorry, no items found in the RSS file :-(</li>"; }
echo "</ul>\n";
}
}
// ===
// include lastRSS
include "lastRSS.php";
// List of RSS URLs
$rss_left = array(
'http://www.rte.ie/rss/gaa.xml',
'http://www.independent.ie/sport/hurling/rss',
'http://www.freshfolder.com/rss.php'
);

// Create lastRSS object
$rss = new lastRSS;
// Set cache dir, cache interval and character encoding
$rss->cache_dir = 'cache';
$rss->cache_time = 14000; // (4hrs)
$rss->cp = '';
$rss->items_limit = 5;
// Show all rss files
echo '<table class="rss_section" cellpadding="5" border="0"><tr><td width="50%" valign="top">';
foreach ($rss_left as $url) ShowOneRSS($url);
echo '</td></tr></table>';
?>
I need adding blank lines between each sites. So they don't look as stacked on top of another site.



2)
Twin column (2 columns) PHP script
Code:
<?php

function ShowOneRSS($url) {

global $rss;

if ($rs = $rss->get($url)) {

echo '<h2><a href="'.$rs['link'].'">'.$rs['title']."</a></h2>\n";

echo $rs['description']."<br>\n";

echo "<ul>\n";

foreach ($rs['items'] as $item) {

echo '<li><a href="'.$item['link'].'" title="'.$item['description'].'">'.$item['title'].'</a></li>';

}

if ($rs['items_count'] <= 0) { echo "<li>Sorry, no items found in the RSS file :-(</li>"; }

echo "</ul>\n";

}

}

// ===

// include lastRSS

include "lastRSS.php";

// List of RSS URLs

$rss_left = array(

'http://www.rte.ie/rss/gaa.xml',

'http://www.freshfolder.com/rss.php'

);

$rss_right = array(

'http://www.independent.ie/sport/hurling/rss',

'http://phpbuilder.com/rss_feed.php'

);

// Create lastRSS object

$rss = new lastRSS;

// Set cache dir, cache interval and character encoding

$rss->cache_dir = 'cache';

$rss->cache_time = 14000; // (4hrs)

$rss->cp = '';

$rss->items_limit = 5;

// Show all rss files

echo '<table class="rss_section" cellpadding="5" border="0"><tr><td width="50%" valign="top">';

foreach ($rss_left as $url) ShowOneRSS($url);

echo '</td><td width="50%" valign="top">';

foreach ($rss_right as $url) ShowOneRSS($url);

echo '</td></tr></table>';

?>
The URLs on left and right columns are too close. I'm trying making them apart. I'm searching a solution adding a blank narrow column between them OR with some other methods.


B.R.
satimis
satimis is offline  
Reply With Quote