Hi all - newbie doesn't even begin to describe it! I've invested in Php for Dummies, and am at the place where I have all this "stuff" rattling round in my head with no practical application whatsoever. No doubt it will start to make sense but I'm running out of time. I need to create review submission form (book reviews). I have a Joomla based website, and am using Mighty Resources (figured it would be easier than trying to start from scratch). I've created a form ok, but cannot figure out how to specify the layout! I've gathered it has something to do with table layout, which would be an html issue?? (or css for that matter, who knows, I'm now thoroughly confused!) I just have no idea, when looking at the .php file (template) where to insert or what to insert in order to make it display the way I want. I'm sure it's something fairly simple but I need to "see" something in order for the process to make sense. I've included the template file as an attachment, as well as a Word doc which shows the way I need it to look. If needed, you can view the actual form as it is right now at: http://www.classicromancerevival.com/submit-a-review.html
What I ultimately want is a form that allows the cover image (large in the Word doc) to be uploaded, with all field compulsory, and the small butterfly image as part of the form. Once submitted, it then becomes an article. It would be great if the form "mirrors" the article display, i.e. the layout is exactly as the article should look.
Ok, I can't upload the php file, so I've copied it below:
<?php defined('_JEXEC') or die('Restricted access'); $this->newform = TRUE;?>
<div class="componentheading"><?php echo ($this->isNew ? JText::_('Submit New Item') : JText::_('Edit Item'))?>: <?php echo $this->type ?></div>
<TABLE class="admintable" width="100%">
<!--<tr>
<td colspan="2" class="contentheading"><?php echo JText::_('Item Core Fields')?></td>
</tr>-->
<TR>
<TD class="key"><?php echo $this->params->get('title_name'); ?>:</TD>
<td><input type="text" name="title" style="width:100%" value="<?php echo JRequest::getVar('title', htmlspecialchars($this->item->title)) ?>" /></td>
</TR>
<?php if($this->shows['category']):?>
<TR valign="top">
<TD class="key"><?php echo $this->params->get('category_name'); ?>:</TD>
<td><?php echo $this->lists['category'] ?></td>
</TR>
<?php else:?>
<tr>
<td colspan="2">
<input type="hidden" name="categories[]" value="<?php echo JRequest::getInt('category_id', $this->section_id);?>" />
</td>
</tr>
<?php endif; ?>
<?php if($this->shows['ucategory']):?>
<TR valign="top">
<TD class="key"><?php echo $this->params->get('pcat_mean'); ?>:</TD>
<td><?php echo $this->lists['usercategory'] ?></td>
</TR>
<?php endif; ?>
<?php if($this->params->get('create_time')):?>
<?php JHTML::_('behavior.calendar');?>
<TR>
<TD class="key"><?php echo $this->params->get('ctime_name', JText::_('Create Date')); ?>:</TD>
<td><?php echo $this->lists['ctime'] ?></td>
</TR>
<?php endif;?>
<?php if($this->params->get('expire_time')):?>
<?php JHTML::_('behavior.calendar');?>
<TR>
<TD class="key"><?php echo $this->params->get('extime_name',JText::_('Expire Date')); ?>:</TD>
<td><?php echo $this->lists['extime'] ?></td>
</TR>
<?php endif;?>
<?php if($this->params->get('item_tag')):?>
<TR>
<TD class="key"><?php echo JText::_('Tags'); ?>:</TD>
<td><textarea style="width:100%" rows="1" name="tags"><?php echo $this->lists['tags'] ?></textarea></td>
</TR>
<?php endif;?>
<?php
$hidden_fields = $this->params->get ( 'hidden_fields' );
$hidden_fields = str_replace( array( " ", "\r" ), "", $hidden_fields );
$hidden_fields = explode( "\n", $hidden_fields );
//var_dump( $hidden_fields );
?>
<?php
foreach ($this->fields AS $key => $field)
{
$is_hidden = in_array( $field->id, $hidden_fields );
$params = new JParameter($field->params);
if($params->get('frequired')) { $r = ' <span style="color:red"><big>*</big></span>'; } else { $r = '';}
?>
<?php if( in_array( $field->type, array('taber', 'separator' ) ) ) : ?>
<?php //if(@$this->fields[$key + 1]):?>
</table>
<?php //endif;?>
<span <?php echo $is_hidden ? "style='display:none;'" : ""; ?>>
<?php ResViewRecord::renderField($field); ?>
</span>
<?php //if(@$this->fields[$key + 1]):?>
<TABLE class="admintable" width="100%">
<?php //endif;?>
<?php continue; ?>
<?php endif;?>
<tr <?php echo $is_hidden ? "style='display:none;'" : ""; ?> valign="top">
<?php if($field->type != 'html'):?><td class="key" width="25%"><?php echo $field->title ?>:<?php echo $r ?></td><?php endif;?>
<td<?php if($field->type == 'html') echo ' colspan="2" '?>><?php if($field->type == 'html') echo $field->title.$r.'<br>'?><?php ResViewRecord::renderField($field) ?>
<?php if($params->get('description')) echo sprintf('<br><span class="small">%s</span>', $params->get('description'));?>
</td>
</tr>
<?php
}
?>
</table>
<?php if(($this->user->get('aid') > 1) && $this->user->get('gid') >= 23):?>
<span><?php echo JText::_('Administrator Fields') ?></span>
<TABLE class="admintable" width="100%" style="border: 1px solid gray;">
<TR>
<TD class="key"><?php echo JText::_('Publish'); ?>:</TD>
<td><?php echo $this->lists['publish'] ?></td>
</TR>
<TR>
<TD class="key"><?php echo JText::_('Featured'); ?>:</TD>
<td><?php echo $this->lists['featured'] ?></td>
</TR>
<TR>
<TD class="key"><?php echo JText::_('Access'); ?>:</TD>
<td><?php echo $this->lists['access'] ?></td>
</TR>
<TR>
<TD class="key"><?php echo JText::_('Author'); ?>:</TD>
<td><?php echo $this->lists['author'] ?></td>
</TR>
<TR>
<TD class="key"><?php echo JText::_('Language'); ?>:</TD>
<td><?php echo $this->lists['lang'] ?></td>
</TR>
<?php if(!$this->params->get('create_time')): ?>
<TR>
<TD class="key"><?php echo $this->params->get('ctime_name', JText::_('Create Date')); ?>:</TD>
<td><?php echo $this->lists['ctime'] ?></td>
</TR>
<?php endif; ?>
<?php if(!$this->params->get('expire_time')): ?>
<TR>
<TD class="key"><?php echo $this->params->get('extime_name', JText::_('Expire Date')); ?>:</TD>
<td><?php echo $this->lists['extime'] ?></td>
</TR>
<?php endif; ?>
</TABLE>
<?php else:?>
<?php if(!$this->params->get('expire_time')): ?>
<input type="hidden" name="extime" value="<?php echo $this->item->extime?>" />
<?php endif; ?>
<?php if(!$this->params->get('create_time')): ?>
<input type="hidden" name="ctime" value="<?php echo $this->item->ctime?>" />
<?php endif; ?>
<input type="hidden" name="featured" value="<?php echo $this->item->featured?>" />
<input type="hidden" name="user_id" value="<?php echo $this->item->user_id?>" />
<input type="hidden" name="published" value="<?php echo $this->item->published?>" />
<input type="hidden" name="access" value="<?php echo $this->item->access?>" />
<input type="hidden" name="langs" value="<?php echo $this->item->langs?>" />
<?php endif;?>
That's it. I may be pushing my luck here, but desperation is as desperation does, and I'm really hoping that someone out there can point this little nose in the right direction...
Thanks!