Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
DUPLICATE LISTINGS

 

 


weblinks
User

Nov 15, 2011, 7:49 AM

Post #1 of 12 (762 views)
Shortcut
DUPLICATE LISTINGS Can't Post

Problem is that everything works fine EXCEPT output page displays both test listings TWICE. The code looks to me that something must be deleted but I have tried removing what seemed obvious and just received error messages.

Will very much appreciate your help as I need to get this capability online asap.

CODE WITH APPEARS ON PAGE...

<!-- INSERT PHOTOLINK PHP CODE -->
<?php foreach ($featured_eventsRecords as $record): ?>

<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->




<?php foreach ($featured_eventsRecords as $record): ?>
<b>Date:</b> <?php echo $record['date'] ?><br/><br/>
<b>Event:</b> <?php echo $record['event'] ?><br/>
<b>Location</b>: <?php echo $record['location'] ?><br/>
<b>Address:</b> <?php echo $record['address'] ?><br/>
<b>City or Town:</b> <?php echo $record['town'] ?> VT<br/>


<!-- STEP 2a: Display Uploads for field 'image' (Paste this anywhere inside STEP2 to display uploads) -->
<!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
<?php foreach ($record['image'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" vspace="7" border="1" /><br/>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach?>
<!-- STEP2a: /Display Uploads -->



<b>Description:</b> <?php echo $record['description'] ?><br/><br/>
<b>Start Time</b>: <?php echo $record['start_time'] ?><br/>
<b>Admission</b>: <?php echo $record['admission'] ?><br/>
<b>Phone:</b> <?php echo $record['phone'] ?><br/>
<b>Your Website Address:</b> <?php echo $record['url'] ?><br/>
<b>Email Address:</b> <?php echo $record['email_address'] ?><br/>
<b>Handicap Accessible:</b> <?php echo $record['handicap_accessible'] ?><br/><br/>
<hr />


<?php endforeach; ?>
<?php if (!$featured_eventsRecords): ?>
</p>

<?php endif ?>






<font color="9933FF" class="medium"></font color="9933FF" class="medium"><br/><font color="000000">
<div align="left"><b></b>






<?php endforeach ?>

OUTPUT TEST PAGE...

http://www.linkvermont.com/test15.php

Bob T.


steve99
User

Nov 15, 2011, 8:34 AM

Post #2 of 12 (758 views)
Shortcut
Re: [weblinks] DUPLICATE LISTINGS [In reply to] Can't Post

Hi weblinks.

It looks like you have your main FOREACH wrapped in another FOREACH which would cause it to dup.

Delete your outer FOREACH and all should be fine.


weblinks
User

Nov 15, 2011, 11:10 AM

Post #3 of 12 (748 views)
Shortcut
Re: [steve99] DUPLICATE LISTINGS [In reply to] Can't Post

Steve....REPLY....

Did that yesterday and it didn't work... Removed tag directly below... CODE WITH APPEARS ON PAGE...

<!-- INSERT PHOTOLINK PHP CODE -->
<?php foreach ($featured_eventsRecords as $record): ?> REMOVED THIS TAG


Did it again now, still didn't work and delivered the following error message... Parse error: syntax error, unexpected T_ENDFOREACH in /home/linkve5/public_html/test15.php on line 336

Line 336 is a </div> tag.... I tried removing that... nothing!

Bob


steve99
User

Nov 15, 2011, 11:26 AM

Post #4 of 12 (746 views)
Shortcut
Re: [weblinks] DUPLICATE LISTINGS [In reply to] Can't Post

Make sure you delete the outer closing FOREACH.

That would trigger that error.

Try just this:


Code
<?php foreach ($featured_eventsRecords as $record): ?> 
<b>Date:</b> <?php echo $record['date'] ?><br/><br/>
<b>Event:</b> <?php echo $record['event'] ?><br/>
<b>Location</b>: <?php echo $record['location'] ?><br/>
<b>Address:</b> <?php echo $record['address'] ?><br/>
<b>City or Town:</b> <?php echo $record['town'] ?> VT<br/>


<!-- STEP 2a: Display Uploads for field 'image' (Paste this anywhere inside STEP2 to display uploads) -->
<!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
<?php foreach ($record['image'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" vspace="7" border="1" /><br/>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach?>
<!-- STEP2a: /Display Uploads -->



<b>Description:</b> <?php echo $record['description'] ?><br/><br/>
<b>Start Time</b>: <?php echo $record['start_time'] ?><br/>
<b>Admission</b>: <?php echo $record['admission'] ?><br/>
<b>Phone:</b> <?php echo $record['phone'] ?><br/>
<b>Your Website Address:</b> <?php echo $record['url'] ?><br/>
<b>Email Address:</b> <?php echo $record['email_address'] ?><br/>
<b>Handicap Accessible:</b> <?php echo $record['handicap_accessible'] ?><br/><br/>
<hr />


<?php endforeach; ?>
<?php if (!$featured_eventsRecords): ?>
<?php endif ?>



(This post was edited by steve99 on Nov 15, 2011, 11:29 AM)


weblinks
User

Nov 15, 2011, 11:55 AM

Post #5 of 12 (739 views)
Shortcut
Re: [steve99] DUPLICATE LISTINGS [In reply to] Can't Post

Steve...

Fixed !!! Needed to delete one more line and it worked. Thanks much for the complete code.... and the fast response... Have a great day...

Regards,

Bob


steve99
User

Nov 15, 2011, 11:56 AM

Post #6 of 12 (738 views)
Shortcut
Re: [weblinks] DUPLICATE LISTINGS [In reply to] Can't Post

You're very welcome, Bob. Glad to help.

Take care.


weblinks
User

Nov 30, 2011, 11:02 AM

Post #7 of 12 (616 views)
Shortcut
Re: [steve99] MAKE CONTENT OF FIELD A LINK [In reply to] Can't Post

I forgot how to do this...I have a FIELD which calls for an advertiser to insert his website address... which I wish to make a LINK to be clicked on by a visitor... taking the visitor to the advertisers web site. HOW do I make this field content a link... ie

e.g..... FIELD: Your Website Address: advertiser insterts http://www.linkvermont.com [this being a link]

SEE EXAMPLES OF ADS AT http://www.linkvermont.com/calendar_december2011_WORKING.php Note line that says your website address.

If you provide code please advise me as to precisely where it appears.

If you can possibly reply quickly it will be more than appreciated as I need to get the above examples online today with the web address being a LINK.

Regards,

Bob


Jason
Staff / Moderator


Nov 30, 2011, 11:52 AM

Post #8 of 12 (613 views)
Shortcut
Re: [weblinks] MAKE CONTENT OF FIELD A LINK [In reply to] Can't Post

Hi Bob,

Try this.

Assuming that your field is called website_address, you could create the link like this:


Code
Website Address: <a href = "<?php echo $record['website_address'];?>"><?php echo $record['website_address'];?></a>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

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


steve99
User

Nov 30, 2011, 11:53 AM

Post #9 of 12 (613 views)
Shortcut
Re: [weblinks] MAKE CONTENT OF FIELD A LINK [In reply to] Can't Post

Hi Bob,
Looks like you have your output working as you desire, just minus the link on the URL.

All you need to do is wrap the website URL $VAR (link) with an "A" tag with the $VAR (link) in the "HREF".

Cheers!


weblinks
User

Nov 30, 2011, 12:00 PM

Post #10 of 12 (611 views)
Shortcut
Re: [steve99] MAKE CONTENT OF FIELD A LINK [In reply to] Can't Post

Jason...

Thanks for the quick reply but I am "brain dead" when it comes to some code.... Please give me an example of the complete code. The field Label is Website... The field Name is url... Existing Code Below....

<!-- INSERT PHOTOLINK PHP CODE -->
<?php foreach ($featured_eventsRecords as $record): ?> <b>Date:</b> <?php echo $record['date'] ?><br/><br/> <b>Event:</b> <?php echo $record['event'] ?><br/> <b>Location</b>: <?php echo $record['location'] ?><br/> <b>Address:</b> <?php echo $record['address'] ?><br/> <b>City or Town:</b> <?php echo $record['town'] ?> VT<br/> <!-- STEP 2a: Display Uploads for field 'image' (Paste this anywhere inside STEP2 to display uploads) --> <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 --> <?php foreach ($record['image'] as $upload): ?> <?php if ($upload['hasThumbnail']): ?> <img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" vspace="7" border="1" /><br/> <?php elseif ($upload['isImage']): ?> <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/> <?php else: ?> <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/> <?php endif ?> <?php endforeach?> <!-- STEP2a: /Display Uploads --> <b>Description:</b> <?php echo $record['description'] ?><br/><br/> <b>Start Time</b>: <?php echo $record['start_time'] ?><br/> <b>Admission</b>: <?php echo $record['admission'] ?><br/> <b>Phone:</b> <?php echo $record['phone'] ?><br/> <b>Website:</b> <?php echo $record['url'] ?><br/> <b>Email Address:</b> <?php echo $record['email_address'] ?><br/> <b>Handicap Accessible:</b> <?php echo $record['handicap_accessible'] ?><br/><br/> <hr /> <?php endforeach; ?> <?php if (!$featured_eventsRecords): ?> <?php endif ?>


Regards,

Bob


steve99
User

Nov 30, 2011, 12:09 PM

Post #11 of 12 (607 views)
Shortcut
Re: [weblinks] MAKE CONTENT OF FIELD A LINK [In reply to] Can't Post

Hi Bob,
Here you go:


Code
<!-- INSERT PHOTOLINK PHP CODE --> 
<?php foreach ($featured_eventsRecords as $record): ?> <b>Date:</b> <?php echo $record['date'] ?><br/><br/> <b>Event:</b> <?php echo $record['event'] ?><br/> <b>Location</b>: <?php echo $record['location'] ?><br/> <b>Address:</b> <?php echo $record['address'] ?><br/> <b>City or Town:</b> <?php echo $record['town'] ?> VT<br/> <!-- STEP 2a: Display Uploads for field 'image' (Paste this anywhere inside STEP2 to display uploads) --> <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 --> <?php foreach ($record['image'] as $upload): ?> <?php if ($upload['hasThumbnail']): ?> <img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" vspace="7" border="1" /><br/> <?php elseif ($upload['isImage']): ?> <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/> <?php else: ?> <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/> <?php endif ?> <?php endforeach?> <!-- STEP2a: /Display Uploads --> <b>Description:</b> <?php echo $record['description'] ?><br/><br/> <b>Start Time</b>: <?php echo $record['start_time'] ?><br/> <b>Admission</b>: <?php echo $record['admission'] ?><br/> <b>Phone:</b> <?php echo $record['phone'] ?><br/> <b>Website:</b> <a href="<?php echo $record['url'] ?>" target="_blank"><?php echo $record['url'] ?></a><br/> <b>Email Address:</b> <?php echo $record['email_address'] ?><br/> <b>Handicap Accessible:</b> <?php echo $record['handicap_accessible'] ?><br/><br/> <hr /> <?php endforeach; ?> <?php if (!$featured_eventsRecords): ?> <?php endif ?>



weblinks
User

Dec 1, 2011, 1:09 AM

Post #12 of 12 (535 views)
Shortcut
Re: [steve99] MAKE CONTENT OF FIELD A LINK [In reply to] Can't Post

Steve...

You've made my day... I can't thank you enough.

Best,

Bob