This is my First post (Here)! Yeee...
I have this code running multiple times on my site, collecting data out from a search.
It lists out results in links.
What I would like is to have is to run only once, not the "foreach" but only once, and instead of listing the results as links, I would like to go on the first link that founds.
What I did is I've created a simple HTML forward to another page, but it's not too good becuse the results site is showing up.
Somebody please help me to modify this code.
Can't figure out how to change the "$result->href" to the actually to process the link.
Thank you!
Code: Select all
<?php
foreach( $this->results as $result ) : ?>
<fieldset>
<div>
<?php if ( $result->href ) :
if ($result->browsernav == 1 ) : ?>
<a href="<?php echo JRoute::_($result->href); ?>" target="_blank">
<?php else : ?>
<meta http-equiv="Refresh" content="0; URL=<?php echo JRoute::_($result->href); ?>">
<a href="<?php echo JRoute::_($result->href); ?>">
<?php endif;
echo $this->escape($result->title);
if ( $result->href ) : ?>
</a>
<?php endif;
if ( $result->section ) : ?>
<br />
<?php endif; ?>
<?php endif; ?>
</div>
</fieldset>
<?php endforeach; ?>