| View previous topic :: View next topic |
| Author |
Message |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Tue Jun 10, 2008 10:26 pm Post subject: Adding Email Event/Tell A Friend To Customized Event View |
|
|
I would lke to add a "Tell A Friend" button to my customized event view page/template, but can't seem to figure out the code for it.
Is this possible? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Wed Jun 11, 2008 3:42 pm Post subject: |
|
|
Hi,
You should be able to include() _CAL_BASE_PATH_."include/event_email.php" in your template. |
|
| Back to top |
|
 |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Fri Jun 13, 2008 12:21 am Post subject: |
|
|
| Where would this go? In the head of the event view template? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Fri Jun 13, 2008 4:24 pm Post subject: |
|
|
Hi,
Err... are you using Joomla Studio or is this a PHP page that you have created on your own? |
|
| Back to top |
|
 |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Fri Jun 13, 2008 7:16 pm Post subject: |
|
|
| It's a page I've created using Dreamweaver. Anything I create in Joomla, I'm having an issue displaying. I imagine whatever is preventing me from viewing the files within Joomla as well as using the direct urls is causing a problem with the code generated. |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Mon Jun 16, 2008 4:06 pm Post subject: |
|
|
This would go anywhere after the event is created inside your event view template.
include(_CAL_BASE_PATH_."include/event_email.php"); |
|
| Back to top |
|
 |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Mon Jun 16, 2008 5:28 pm Post subject: |
|
|
It's returning this error:
Fatal error: Call to a member function can_view() on a non-object in /home/dbriefs/public_html/calendar/thyme/thyme/include/event_email.php on line 31 |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Mon Jun 16, 2008 5:29 pm Post subject: |
|
|
Hi,
At the top of your page, you will have to do:
global $_cal_event;
Then $_cal_event = new _cal_event(...) |
|
| Back to top |
|
 |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Mon Jun 16, 2008 5:36 pm Post subject: |
|
|
Is this at the top of the Event view page or the event_email.php page?
What does "(...)" represent? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Mon Jun 16, 2008 5:57 pm Post subject: |
|
|
Hi,
At the top of your customized event view page.
The (..) represents the event id and instance. It would help if I could see your customized event view code. Could you e-mail this to me please? ian@extros... |
|
| Back to top |
|
 |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Mon Jun 16, 2008 6:07 pm Post subject: |
|
|
| I have sent this. |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Mon Jun 16, 2008 6:18 pm Post subject: |
|
|
I see. In your case, this would be easier. Just after this line:
$e = $cal->get_event($_REQUEST['eid'], $_REQUEST['inst']);
add this ..
| Code: |
global $_cal_event;
$_cal_event =& $e;
|
|
|
| Back to top |
|
 |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Mon Jun 16, 2008 6:33 pm Post subject: |
|
|
Hmmm....well.....
That seems to have added the Send to form directly into my event view. Is there a way to get just the button linked to that form? |
|
| Back to top |
|
 |
adawson
Joined: 02 Jun 2008 Posts: 85
|
Posted: Mon Jun 16, 2008 6:34 pm Post subject: |
|
|
Hmmm....well.....
That seems to have added the Send to form directly into my event view. Is there a way to get just the button linked to that form? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5268
|
Posted: Tue Jun 17, 2008 4:06 pm Post subject: |
|
|
Hi,
At the bottom of the page, add this code:
| Code: |
$_cal_form = new _cal_form();
$_cal_form->print_header();
$_cal_form->print_hidden("eid", $_REQUEST['eid']);
$_cal_form->print_hidden("instance", $_REQUEST['inst']);
echo($_cal_form->submit("event_action", _TELL_A_FRIEND_));
$_cal_form->print_footer();
|
This will give you the button. In place of the include() line, add this:
| Code: |
if($_REQUEST['event_action'] == _TELL_A_FRIEND_) {
include(_CAL_BASE_PATH_."include/event_email.php");
return;
} |
|
|
| Back to top |
|
 |
|