Baldwin238
Technical User
I am at my wits end. I am using a feed on my site. It contains links as part of the feed. However, I want to replace the links in the feed, with links of my own. Here is the code I use to put the feed onto my site:
Each ['sitelink'] (as it appears from the feed) looks like this:
I want to replace every occurence of that link with:
I am an asp person myself and cannot come to grips with how to replace that string. The only part of the link I want to replace is UP TO THE = sign. The "ID" part at the end can stay the same. So I am just looking to replace the main chunk of the url.
I was thinking I could use str_replace, but no matter which way I try it, I cannot seem to get it to work. I am throwing out my LIFELINE here.... HELP!!!
Jeff Baldwin
Code:
<?php
$file = '[URL unfurl="true"]http://www.freerolls.net/feed.php';[/URL]
require_once('xml.parser.class.php');
$xml = new xml_parser_class();
$xml->parseFile($file);
$tree = $xml->getTree();
unset($xml);
print '<table border="0" cellpadding="2" cellspacing="0" width="" class="tm">';
print '<tr class="caption"><td>Time (Eastern)</td><td>Payouts</td><td>Site</td></tr>';
$i = 0;
foreach($tree['freerolls']['tournament'] as $k)
{
$i++;
print '<tr class="'.(!($i%2)?'rl':'rd').'">';
print '<td>'.$k['time']['value'].'</td>';
print '<td>'.$k['payout']['value'].'</td>';
print '<td><a href="'.$k['sitelink']['value'].'">'.$k['sitename']['value'].'</td>';
print '</tr>';
}
print '</table>';
?>
Each ['sitelink'] (as it appears from the feed) looks like this:
Code:
<sitelink>[URL unfurl="true"]http://www.freerolls.net/fclick/fclick.php?fid=XXX</sitelink>[/URL]
I want to replace every occurence of that link with:
Code:
<sitelink>[URL unfurl="true"]http://www.absolutelyfreerolls.com/fclick/fclick.php?id=XXX</sitelink>[/URL]
I am an asp person myself and cannot come to grips with how to replace that string. The only part of the link I want to replace is UP TO THE = sign. The "ID" part at the end can stay the same. So I am just looking to replace the main chunk of the url.
I was thinking I could use str_replace, but no matter which way I try it, I cannot seem to get it to work. I am throwing out my LIFELINE here.... HELP!!!
Jeff Baldwin