If statement

16 posts by 4 authors in: Forums > CMS Builder
Last Post: June 7, 2010   (RSS)

By design9 - June 1, 2010

Chris,
I am just getting around to this but this is still not working correctly for me. On the index page, it is not pulling in the title that you are clicking on...(it says little otter swim for all advertisers). Then on the details page, it is still not showing ads only for that specific advertiser. It will sometimes show ads for advertisers that you didn't click on. I need it to show only ads, coupons, classifieds for that specific advertiser you clicked on. I have attached my pages as well.

Here are the links:
Main Page:
http://www.charlotteparent.com/test/marketplace/index.php

Details page:
http://www.charlotteparent.com/test/marketplace/detailsfa.php

Can you look and see if I did something incorrectly or if we need different coding?

Thanks!
April
Attachments:

index_020.php 25K

detailsfa.php 22K

Re: [apdance9] If statement

By Jason - June 2, 2010

Hi April,

It looks like the problem is that the same title is being put into each of the links (PetsMart).

Try replacing the line where you're outputting your link with this:

<div id="markettitle"><a href="detailsfa.php?title=<?php echo urlencode($row['title']);?>"><?php echo $row['title'] ?></a></div>

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] If statement

By design9 - June 3, 2010

Thanks Jason!

That did the trick!

April

Re: [apdance9] If statement

By Chris - June 4, 2010 - edited: June 4, 2010

Hi April,

For (1) you can do this:

<?php
if ($marketplaceRecord) {
echo $marketplaceRecord['title'];
}
elseif ($marketplace_couponsRecord) {
echo $marketplace_couponsRecord['title'];
}
elseif ($marketplace_classifiedsRecord) {
echo $marketplace_classifiedsRecord['title'];
}
?>


For (2), I think you just need to make the same change you made to your index page. Try changing this:

<?php if ($record['featured_ad']): ?><a href="<?php echo $record['_link'] ?>"><span class="body3"><b><?php echo $record['title'] ?></b></span></a>

to this:

<?php if ($record['featured_ad']): ?><a href="detailsfa.php?title=<?php echo urlencode($record['title']);?>"><span class="body3"><b><?php echo $record['title'] ?></b></span></a>

Does that help? Please let me know if you have any questions.
All the best,
Chris

By design9 - June 7, 2010

Thanks Chris! That is what I needed! Works great!

April