Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
unexpected T_ENDFOREACH

 

 


justritedesign
User

Apr 8, 2008, 12:31 PM

Post #1 of 2 (226 views)
Shortcut
unexpected T_ENDFOREACH Can't Post

Could you look at a test page I have http://efreewillmar.org/youthtest.php
It is returning an error message.
Its a listed view of WMV's that will be uploaded by the client. I do not see what is causing the problem.

Here is the section of code that is causing the error.

Code
<?php 
require_once "C:/Webspace/resadmin/mmoyers/efreewillmar.org/www/cmsAdmin/lib/viewer_functions.php";
$options = array(); // NOTE: see online documentation for more details on these options
$options['tableName'] = 'about_us_004'; // (REQUIRED) MySQL tablename to list record from. Example: 'article';
$options['titleField'] = 'title'; // (optional) MySQL fieldname used in viewer url for search engines. Example: 'title' would display: viewer.php/article_title_here-123
$options['viewerUrl'] = 'about_us_004Page.php'; // (optional) URL of viewer page. Example: '/articles/view.php';
$options['perPage'] = ''; // (optional) The number of records to display per page. Example: '5'; Defaults to 10.
$options['orderBy'] = 'title'; // (optional) Fieldnames to sort by. Example: 'field1, field2 DESC, field3';
$options['pageNum'] = ''; // (optional) Page number of results to display. Example: '1'; Defaults to ?page=# value, or 1 if undefined
$options['where'] = ''; // (ADVANCED) Additional MySQL WHERE conditions. Example: 'fieldname = "value"'
$options['useSeoUrls'] = ''; // (ADVANCED) Set this to '1' for search engine friendly urls: view.php/123 instead of view.php?123 (not supported on all web servers)
list($listRows, $listDetails) = getListRows($options);
?>
<div align="center">
<?php foreach ($listRows as $record): ?>
<?php if ($record): ?>
<?php foreach (getUploads($options['tableName'], 'upload_videos', $record['num']) as $upload): ?><?php if ($upload['extension'] == 'wmv'): ?>
<br/>
<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="320" height="290">
<param name="FileName" value="<?php echo $upload['urlPath'] ?>">
<param name="AutoStart" value="False">
<param name="ShowControls" value="True">
<param name="ShowStatusBar" value="False">
<param name="ShowDisplay" value="False">
<param name="AutoRewind" value="True">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
autostart="True" filename="<?php echo $upload['urlPath'] ?>"
src="<?php echo $upload['urlPath'] ?>"
width="320" height="290" showcontrols="True" showstatusbar="False" showdisplay="False" autorewind="True"> </embed>
</object>
<br/>
<span class="style7"><?php echo $upload['info1'] ?><br/>
<br/>
<?php echo $upload['info2'] ?></span><br/>
<br/>
<?php endforeach ?>
<?php endif ?><?php endforeach ?>


Thanks for your help on this,
Michael Moyers
Owner/Administrator
Just Rite Design & Just Rite Productions
A growing network of professionals in Web development, Programming, Graphic Design, Flash, and Audio and Video Productions


Dave
Staff / Moderator


Apr 8, 2008, 2:09 PM

Post #2 of 2 (220 views)
Shortcut
Re: [justritedesign] unexpected T_ENDFOREACH [In reply to] Can't Post

Hi Michael,

It's the extra <?php if ($upload['extension'] == 'wmv'): ?> tag you have on the end. It doesn't have a closing <?php endif ?> tag. You can either add a <?php endif ?> before the first endforeach or just replace the if tag with this:


Code
<?php if ($upload['extension'] != 'wmv') { continue; } ?>


Which basically says, if it's not a wmv file, continue with the next one and skip this one.

Hope that helps. Let me know if you need more detail with the code or anything like that.

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4