Friggin' AWSOME!!

Works with CB.

The directions are a bit difficult to understand for the codeing challenged.....me
ADD THE TABLE AS DESCRIBED IN THE ORIGINAL POST OR YOU WILL GET DATABASE ERROR WHEN SUBMITING NOTE: This only works with new submissions, since this is a new field in the table. If you want it to be retroactive you will have to edit that field with the correct userid's.
So it works with anything newly submitted. Because now when a user submits an event his/her id # is attaced to the event. Which is very very COOL. Like the Fonz.

top of file should look like...
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $database, $my;
if (!defined('ADMIN_EVENTS_PHP')) {
define('ADMIN_EVENTS_PHP', true);
include $CONFIG_EXT['LANGUAGES_DIR']."{$CONFIG_EXT['lang']}/index.php";
}
Make the case 'edit look like....
case 'edit':
$query = "SELECT * FROM jos_jcalpro_events WHERE extid= $extid";
$database->setQuery($query);
$rows = $database->loadObjectList();
$row = $rows[0];
if ($my->id == $row->joomla_userid || $my->usertype === "Administrator" || $my->usertype === "Super Administrator") {
} else {
?> <script language="javascript" type="text/javascript">alert("Only the original poster and system administrators are able to edit this event.")
javascript:history.go(-1)</script>
<?php
return;
}
if(!empty($extid) && require_priv('edit')) {
$event_mode = 'view';
pageheader($lang_event_admin_data['edit_event'] . " :: " . $lang_event_admin_data['section_title']);
print_edit_event_form($extid);
} else if (has_priv('Administrator')) {
pageheader($lang_event_admin_data['section_title']);
print_event_list();
}
break;
// Functions area should look like...
/ Functions
function print_admin_add_event_form($date = '') {
// function to display events under a specific category
global $my;
$userid = $my->id;
global $database, $CONFIG_EXT, $today, $lang_add_event_view, $lang_system;
global $lang_general, $extmode, $errors, $lang_settings_data;
End of that function should look like...
$query = "
INSERT INTO ".$CONFIG_EXT['TABLE_EVENTS']." (
title, description, contact, url, email, picture, cat, day, month, year, start_date, end_date, approved, recur_type, recur_val, recur_end_type, recur_count, recur_until, published, joomla_userid
) VALUES (
'$title','$description','$contact','$url','$email','$picture','$cat','$day','$month','$year','$start_date','$end_date','$approve','$recur_type','$recur_val','$recur_end_type','$recur_count','$recur_until', '1', '$userid'
)";
extcal_db_query($query);
But that's not all --- this also works for event deletes. Back up top in the case area --
case 'del' : should look like....
case 'del' :
$query = "SELECT * FROM jos_jcalpro_events WHERE extid= $extid";
$database->setQuery($query);
$rows = $database->loadObjectList();
$row = $rows[0];
if ($my->id == $row->joomla_userid || $my->usertype === "Administrator" || $my->usertype === "Super Administrator") {
} else {
?> <script language="javascript" type="text/javascript">alert("Only the original poster and system administrators are authorized to delete this event. ")
javascript:history.go(-1)</script>
<?php
return;
}
if( !empty($extid) && require_priv('delete') ) {
$event_mode = 'view';
pageheader($lang_event_admin_data['delete_event'] . " :: " . $lang_event_admin_data['section_title']);
delete_event($extid);
} else if (has_priv('Administrator')) {
pageheader($lang_event_admin_data['section_title']);
print_event_list();
}
break;
You can change the javascript alert box to say what ever suits your site or style.
GREAT WORK LUDO