Sign Up for OSTraining

Welcome, Guest
Username: Password: Remember me

TOPIC: message function in php file

message function in php file 11 months 1 week ago #49080

  • mash
  • mash's Avatar
  • OFFLINE
  • OSTycoon
  • Posts: 238
  • Karma: 0
If I'm to place code $this->showToolBar();
immediately after the 'message function' in this php file, where would that be?:

<?php
/**
* copyright (C) 2008 GWE Systems Ltd - All rights reserved
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

include_once(JPATH_COMPONENT_ADMINISTRATOR."/views/".basename(dirname(__FILE__))."/".basename(__FILE__));

/**
* HTML View class for the component
*
* @static
*/
class FrontAttendeesViewAttendees extends AdminAttendeesViewAttendees
{
function __construct($config = array()){
parent::__construct($config);
include_once(JPATH_ADMINISTRATOR . DS . "includes" . DS . "toolbar.php");
JHTML::stylesheet( 'rsvppro.css', 'components/'.RSVP_COM_COMPONENT.'/assets/css/' );
JHTML::stylesheet("pagination.css",JURI::root()."administrator/components/com_rsvppro/assets/pagination/css/");

JHTML::stylesheet("admin.css",JURI::root()."components/com_rsvppro/assets/adminsim/css/");
JHTML::stylesheet("pagination.css", JURI::root() . "administrator/components/com_rsvppro/assets/pagination/css/");


}


function overview($tpl = null)
{
$document =& JFactory::getDocument();
$params = JComponentHelper::getParams('com_rsvppro');
$document->setTitle($params->get('page_title',JText::_('RSVP_ATTENDEES')));

include_once(JPATH_COMPONENT_ADMINISTRATOR."/libraries/JevPagination.php");
$this->pageNav = new JevPagination( $this->pageNav->total, $this->pageNav->limitstart, $this->pageNav->limit,true);

$params = JComponentHelper::getParams(RSVP_COM_COMPONENT);
$this->assignRef("params",$params);

parent::overview($tpl);
Quincy
Please become a member of OSTraining to reply to this post.

message function in php file 11 months 1 week ago #49087

  • Nick
  • Nick's Avatar
  • OFFLINE
  • Administrator
  • Posts: 16822
  • Thank you received: 391
  • Karma: 56
Hi Quincy,

Which tutorial are you following?

What Joomla version are you using?

Which template are you using?

The message function is usually right above the component function like so:
<jdoc:include type="message" />
<jdoc:include type="component" />

Those are usually located in the index.php of the template folder.

Kind regards,
Nick
Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

message function in php file 11 months 1 week ago #49137

  • mash
  • mash's Avatar
  • OFFLINE
  • OSTycoon
  • Posts: 238
  • Karma: 0
it is a jevents php file (joomla 1.5.25) I need to place:

$this->showToolBar();

after the 'message function' in this php file:



<?php
/**
* JEvents Component for Joomla 1.5.x
*
* @version $Id: edit.php 1438 2009-05-02 09:25:42Z geraint $
* @package JEvents
* @copyright Copyright (C) 2008-2009 GWE Systems Ltd
* @license GNU/GPLv2, see www.gnu.org/licenses/gpl-2.0.html
* @link www.jevents.net
*/
defined('_JEXEC') or die('Restricted Access');

$editor = & JFactory::getEditor();
?>
<div class='jevrsvppro'>
<div id="jevents">
<form action="index.php" method="post" name="adminForm" >
<table width="90%" border="0" cellpadding="2" cellspacing="2" class="adminform">
<tr>
<td>
<input type="hidden" name="customise" value="<?php echo JRequest::getInt("customise"); ?>" />
<?php foreach ($this->cid as $cid){ ?>
<input name="cid[]" type="hidden" value ="<?php echo $cid; ?>" />
<?php } ?>
<input type="hidden" name="rp_id" id="evid" value="<?php echo $this->rp_id; ?>" />
<input type="hidden" name="atd_id[]" value="<?php echo $this->atd_id . "|" . $this->rp_id ;?>" />
<input type="hidden" name="repeating" value="<?php echo $this->repeating; ?>" />

<script type="text/javascript" language="Javascript">
function submitbutton(pressbutton) {
if (pressbutton == 'cancel' || pressbutton == 'attendees.overview') {
submitform( pressbutton );
return;
}
var form = document.adminForm;
<?php
echo $editor->getContent('message');
?>
// do field validation
if (form.message.value == "") {
alert ( "<?php echo html_entity_decode(JText::_('RSVP_MISSING_MESSAGE')); ?>" );
}
else {
submitform(pressbutton);
}
}

</script>
<div class="adminform" align="left">
<h4><?php echo JText::_("RSVP_EDIT_ATTENDEE_MESSAGE_SUBJECT"); ?> : </h4>
<input name="subject" id="subject" value="<?php echo htmlspecialchars($this->subject, ENT_QUOTES, 'UTF-8');?> " size="80" maxlength="250"/>
<h4><?php echo JText::_("RSVP_EDIT_ATTENDEE_MESSAGE_BODY"); ?> : </h4>
<?php
echo $editor->display('message', htmlspecialchars($this->message, ENT_QUOTES, 'UTF-8'), 500, 150, '70', '10', false);
?>
<h4><?php echo JText::_("RSVP_SELECT_FIELD_TO_INSERT"); ?> : </h4>
<select onchange="ticketsEditorPlugin.insert('message','messagefields' )" id="messagefields">
<option value="Select ...:">Select ...</option>
<optgroup label="<?php echo JText::_("RSVP_EVENT_FIELDS", true); ?>" >
<option value="NAME"><?php echo JText::_("RSVP_ATTENDEE_NAME"); ?></option>
<option value="EVENT"><?php echo JText::_("RSVP_EVENT_TITLE"); ?></option>
<option value="DATE}%Y %m %d{/DATE"><?php echo JText::_("RSVP_EVENT_DATE"); ?></option>
<option value="LOCATION"><?php echo JText::_("RSVP_EVENT_LOCATION"); ?></option>
<option value="LINK"><?php echo JText::_("RSVP_EVENT_LINK"); ?></option>
<option value="CREATOR"><?php echo JText::_("RSVP_EVENT_CREATOR"); ?></option>
<option value="REPEATSUMMARY"><?php echo JText::_("RSVP_EVENT_REPEATSUMMARY"); ?></option>
</optgroup>
<!--
<optgroup label="<?php echo JText::_("RSVP_TEMPLATE_FIELDS", true); ?>" class="templatefields">
</optgroup>
//-->
</select>

</div>
</td>
</tr>
</table>
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="attendees.message" />
<input type="hidden" name="option" value="<?php echo RSVP_COM_COMPONENT; ?>" />
<input type="hidden" name="Itemid" value="<?php echo JRequest::getInt("Itemid", 0); ?>" />
</form>
</div>
</div>
Quincy
Please become a member of OSTraining to reply to this post.

message function in php file 11 months 1 week ago #49142

  • edandrea
  • edandrea's Avatar
  • OFFLINE
  • OSTop Dog
  • Posts: 3106
  • Thank you received: 7
  • Karma: 0
Quincy,

Where did you get the instructions to do this?

Ed
Please become a member of OSTraining to reply to this post.

message function in php file 11 months 1 week ago #49145

  • tessa
  • tessa's Avatar
  • NOW ONLINE
  • Moderator
  • Posts: 3953
  • Thank you received: 134
  • Karma: 9
Hi Quincy,

Answering Ed's question would be necessary with being able to get a more accurate answer for you.

However, this looks like the message function to me:
<script type="text/javascript" language="Javascript">
function submitbutton(pressbutton) {
if (pressbutton == 'cancel' || pressbutton == 'attendees.overview') {
submitform( pressbutton );
return;
}
var form = document.adminForm;
<?php
echo $editor->getContent('message');
?>
// do field validation
if (form.message.value == "") {
alert ( "<?php echo html_entity_decode(JText::_('RSVP_MISSING_MESSAGE')); ?>" );
}
else {
submitform(pressbutton);
}
}

</script>

Have you tried putting that code in different spots, such as after this script?
Warm Regards,

Tessa Mero



Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

message function in php file 11 months 1 week ago #49148

  • mash
  • mash's Avatar
  • OFFLINE
  • OSTycoon
  • Posts: 238
  • Karma: 0
it's from geraint (the developer) at jevents - I can ask him. no big deal.
Quincy
Please become a member of OSTraining to reply to this post.

message function in php file 11 months 1 week ago #49150

  • Nick
  • Nick's Avatar
  • OFFLINE
  • Administrator
  • Posts: 16822
  • Thank you received: 391
  • Karma: 56
Thanks, Quincy! Yes, it's best to ask Geraint, as he would know his code best and this is technically above our support scope (www.ostraining.com/support-faq).

Kind regards,
Nick
Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining
Please become a member of OSTraining to reply to this post.

Sign Up for OSTraining

Powered by Kunena Forum

Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.

Copyright 2013 Open Source Training, LLC. All rights reserved.