repeating headline

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 7, 2011   (RSS)

By Joseph - January 7, 2011

Hi Guys

I have a More News box and for some reason it outputs the same headline twice the page can be found here
http://www.socanews.com/articles/article.php?Fantastic-Friday-heads-back-to-the-stadium-167

what would i need to do to change the above?

More News PHP Code:
<?php foreach ($morenews['image'] as $upload): ?>
<img src="<?php echo $upload['urlPath']; ?>" width="190" height="100" style="padding: 5px"/>
<?php break; ?>
<?php endforeach; ?>
<div class="articleContent"><a class="articleContentBold" href="<?php echo $morenews['_link']; ?>"><?php echo $morenews['title']; ?></a><br />
<div style="background-color: #C0DEED; height: 1px; width: 100%; margin: 4px 0 4px 0;"> </div>
<?php foreach ($morenewsRecords as $key => $morenewsextra): ?>
<?php if ($key == 0): ?><?php continue; ?><?php endif; ?>
<a href="<?php echo $morenewsextra['_link']; ?>" class="articleContentBold"><?php echo $morenewsextra['title']; ?></a><br/>
<div style="background-color: #C0DEED; height: 1px; width: 100%; margin: 4px 0 4px 0;"> </div>
<?php endforeach; ?>

Re: [socanews] repeating headline

By Jason - January 7, 2011

Hi,

Could you attach article.php so I can take a look at all of the code.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [socanews] repeating headline

By Jason - January 7, 2011

Hi,

Try using this code:

<?php if ($key == 0 || $morenewsextra['num']==$morenews['num']): ?><?php continue; ?><?php endif; ?>

This should stop you from outputting the same news record twice.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] repeating headline

By Joseph - January 7, 2011

Thanks that works fine problem sorted.