Update of /cvsroot/mxbb/mx_calsnails In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1680/modules/mx_calsnails Modified Files: CalSnails_Lite.pak calendar.php db_install.php db_upgrade.php mx_calendar_events.php mx_calendar_query.php Log Message: added includes/mx_admincp.php minor fixes Index: mx_calendar_events.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/mx_calendar_events.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_calendar_events.php 1 Feb 2005 20:41:56 -0000 1.6 --- mx_calendar_events.php 17 Mar 2005 12:04:26 -0000 1.7 *************** *** 209,213 **** while ( $row = $db->sql_fetchrow( $result ) ) { ! $id = stripslashes( $row['id'] ); $ini_date = my_dateformat( $row['stamp'], $block_datefmt, 1 ); $end_date = my_dateformat( $row['eventspan'], $block_datefmt, 1 ); --- 209,213 ---- while ( $row = $db->sql_fetchrow( $result ) ) { ! $id = stripslashes( $row['event_id'] ); $ini_date = my_dateformat( $row['stamp'], $block_datefmt, 1 ); $end_date = my_dateformat( $row['eventspan'], $block_datefmt, 1 ); Index: mx_calendar_query.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/mx_calendar_query.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_calendar_query.php 9 Jan 2005 21:31:28 -0000 1.5 --- mx_calendar_query.php 17 Mar 2005 12:04:26 -0000 1.6 *************** *** 93,97 **** } $template->assign_block_vars( 'event_row', array( 'ROW_CLASS' => ( $check % 2 == 0 ) ? 'row1' : 'row2', ! 'EVENT_ID' => stripslashes( $row['id'] ), 'SUBJECT' => stripslashes( $row['subject'] ), 'DATE' => my_dateformat( $row['stamp'], $block_datefmt ), --- 93,97 ---- } $template->assign_block_vars( 'event_row', array( 'ROW_CLASS' => ( $check % 2 == 0 ) ? 'row1' : 'row2', ! 'EVENT_ID' => stripslashes( $row['event_id'] ), 'SUBJECT' => stripslashes( $row['subject'] ), 'DATE' => my_dateformat( $row['stamp'], $block_datefmt ), Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/db_upgrade.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** db_upgrade.php 6 Mar 2005 01:11:51 -0000 1.6 --- db_upgrade.php 17 Mar 2005 12:04:26 -0000 1.7 *************** *** 67,70 **** --- 67,71 ---- $upgrade_106 = 0; $upgrade_107 = 0; + $upgrade_108 = 0; // validate before 1.07 if ( !$result = $db->sql_query( "SELECT block_id from " . CALLITE_EVENTS_TABLE ) ) *************** *** 72,76 **** $upgrade_107 = 1; } ! $message = "<b>Upgrading!</b><br/><br/>"; --- 73,81 ---- $upgrade_107 = 1; } ! // validate before 1.08 ! if ( !$result = $db->sql_query( "SELECT event_id from " . CALLITE_EVENTS_TABLE ) ) ! { ! $upgrade_108 = 1; ! } $message = "<b>Upgrading!</b><br/><br/>"; *************** *** 79,82 **** --- 84,89 ---- $message .= "<b>Upgrading to v. 1.07...</b><br/><br/>"; $sql[] = "ALTER TABLE " . CALLITE_EVENTS_TABLE . " ADD block_id mediumint(8) unsigned NOT NULL default '0' "; + + /* // Now add some new parameters for the main LITE block // First get function_id *************** *** 160,163 **** --- 167,178 ---- $sql[] = "REPLACE INTO " . $mx_table_prefix . "block_system_parameter VALUES('" . $block_id . "', '" . $parameter_id1 . "', '0', NULL)"; } + */ + } + + if ( $upgrade_108 == 1 ) + { + $message .= "<b>Upgrading to v. 1.08...</b><br/><br/>"; + $sql[] = "ALTER TABLE " . CALLITE_EVENTS_TABLE . " CHANGE id event_id int(11) DEFAULT '0' NOT NULL auto_increment "; + } else Index: calendar.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/calendar.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** calendar.php 6 Mar 2005 01:11:51 -0000 1.13 --- calendar.php 17 Mar 2005 12:04:26 -0000 1.14 *************** *** 487,494 **** if ( $value == 'yes' ) { ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET valid = 'yes' WHERE id = '$thisid'"; }elseif ( $value == 'del' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$thisid'"; } if ( $sql ) --- 487,494 ---- if ( $value == 'yes' ) { ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET valid = 'yes' WHERE event_id = '$thisid'"; }elseif ( $value == 'del' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$thisid'"; } if ( $sql ) *************** *** 546,550 **** while ( $row = $db->sql_fetchrow( $query ) ) { ! $options = "<select name=id[" . $row['id'] . "]> <option value='hold' SELECTED>Hold</option> <option value='yes'>Accept</option> --- 546,550 ---- while ( $row = $db->sql_fetchrow( $query ) ) { ! $options = "<select name=id[" . $row['event_id'] . "]> <option value='hold' SELECTED>Hold</option> <option value='yes'>Accept</option> *************** *** 598,602 **** message_die( GENERAL_ERROR, $lang['Cal_must_sel_event'], '', __LINE__, __FILE__, $sql ); } ! $sql = "SELECT id, user_id FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$id'"; if ( $caluser < 5 ) { --- 598,602 ---- message_die( GENERAL_ERROR, $lang['Cal_must_sel_event'], '', __LINE__, __FILE__, $sql ); } ! $sql = "SELECT event_id, user_id FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$id'"; if ( $caluser < 5 ) { *************** *** 608,614 **** } $row = $db->sql_fetchrow( $query ); ! if ( $row['id'] != '' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { --- 608,614 ---- } $row = $db->sql_fetchrow( $query ); ! if ( $row['event_id'] != '' ) { ! $sql = "DELETE FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { *************** *** 659,663 **** SUBSTRING(stamp FROM 1 FOR 4) AS theyear, SUBSTRING(eventspan FROM 1 FOR 4) AS theendyear ! FROM " . CALLITE_EVENTS_TABLE . " WHERE id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { --- 659,663 ---- SUBSTRING(stamp FROM 1 FOR 4) AS theyear, SUBSTRING(eventspan FROM 1 FOR 4) AS theendyear ! FROM " . CALLITE_EVENTS_TABLE . " WHERE event_id = '$id'"; if ( !( $query = $db->sql_query( $sql ) ) ) { *************** *** 672,676 **** $zdesc = preg_replace( "/\:(([a-z0-9]:)?)" . $bbcode_uid . "/si", "", $zdesc ); ! $hidden_form_fields = "<input type=hidden name=id value='" . $row['id'] . "'> <input type=hidden name=bbcode_uid value='" . $row['bbcode_uid'] . "'> <input type=hidden name=modify value='Modify'>"; --- 672,676 ---- $zdesc = preg_replace( "/\:(([a-z0-9]:)?)" . $bbcode_uid . "/si", "", $zdesc ); ! $hidden_form_fields = "<input type=hidden name=id value='" . $row['event_id'] . "'> <input type=hidden name=bbcode_uid value='" . $row['bbcode_uid'] . "'> <input type=hidden name=modify value='Modify'>"; *************** *** 1020,1024 **** { ereg_replace( "<br />", "", $event_desc ); ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET stamp='$year-$month-$day $time', subject='$subject', description='$event_desc', eventspan='$endyear-$endmonth-$endday', bbcode_uid='$bbcode_uid', block_id='$block_id' WHERE id = '$id'"; } else --- 1020,1024 ---- { ereg_replace( "<br />", "", $event_desc ); ! $sql = "UPDATE " . CALLITE_EVENTS_TABLE . " SET stamp='$year-$month-$day $time', subject='$subject', description='$event_desc', eventspan='$endyear-$endmonth-$endday', bbcode_uid='$bbcode_uid', block_id='$block_id' WHERE event_id = '$id'"; } else *************** *** 1071,1075 **** if ( $id ) { ! $sql .= "id = '$id'"; } else --- 1071,1075 ---- if ( $id ) { ! $sql .= "event_id = '$id'"; } else *************** *** 1102,1108 **** if ( $cal_config['allow_old'] || strtotime( $row['stamp'] ) >= $today ) { ! $edit_img = '<a href="' . this_mxurl( 'action=Modify_marked&id=' . $row['id'] ) . '"><img src="' . PHPBB_URL . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>'; } ! $delpost_img = '<a href="' . this_mxurl( 'action=Delete_marked&id=' . $row['id'] ) . '"><img src="' . PHPBB_URL . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>'; } else --- 1102,1108 ---- if ( $cal_config['allow_old'] || strtotime( $row['stamp'] ) >= $today ) { ! $edit_img = '<a href="' . this_mxurl( 'action=Modify_marked&id=' . $row['event_id'] ) . '"><img src="' . PHPBB_URL . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>'; } ! $delpost_img = '<a href="' . this_mxurl( 'action=Delete_marked&id=' . $row['event_id'] ) . '"><img src="' . PHPBB_URL . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>'; } else *************** *** 1372,1379 **** } // End UKRag.net function ! $url = append_sid( this_mxurl( 'id=' . $results['id'] . '&mode=display&day=' . $thisday . '&month=' . $today_month . '&year=' . $today_year ) ); // Need to keep the size down $event_list .= "<span class=gensmall><acronym title='" . stripslashes( $results['username'] ) . ": $full_subject'> ! $pt <a href='$url' id='cal_id" . $results['id'] . "' onMouseOver=\"swc('cal_id" . $results['id'] . "',1)\" onMouseOut=\"swc('cal_id" . $results['id'] . "',0)\"> $subject</a></acronym><br></span>\n"; } --- 1372,1379 ---- } // End UKRag.net function ! $url = append_sid( this_mxurl( 'id=' . $results['event_id'] . '&mode=display&day=' . $thisday . '&month=' . $today_month . '&year=' . $today_year ) ); // Need to keep the size down $event_list .= "<span class=gensmall><acronym title='" . stripslashes( $results['username'] ) . ": $full_subject'> ! $pt <a href='$url' id='cal_id" . $results['event_id'] . "' onMouseOver=\"swc('cal_id" . $results['event_id'] . "',1)\" onMouseOut=\"swc('cal_id" . $results['event_id'] . "',0)\"> $subject</a></acronym><br></span>\n"; } Index: CalSnails_Lite.pak =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/CalSnails_Lite.pak,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CalSnails_Lite.pak 15 Jan 2005 23:43:15 -0000 1.4 --- CalSnails_Lite.pak 17 Mar 2005 12:04:26 -0000 1.5 *************** *** 39,42 **** --- 39,44 ---- New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:42=+:44=+:CalSnails Mini=+:Calendar Lite (mini function)=+:mx_calendar_mini.php=+: + parameter=+:45=+:110=+:target_block=+:Function=+:0=+:get_list_formatted("calsnails","{parameter_value}","{parameter_id}[]") + option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - CalSnails Mini=+:Demo block=+:44=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_calsnails/db_install.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** db_install.php 6 Mar 2005 01:11:51 -0000 1.12 --- db_install.php 17 Mar 2005 12:04:26 -0000 1.13 *************** *** 53,57 **** // Table: Calendar Lite Events "CREATE TABLE " . CALLITE_EVENTS_TABLE . " ( ! id int(11) DEFAULT '0' NOT NULL auto_increment, username varchar(255), stamp datetime, --- 53,57 ---- // Table: Calendar Lite Events "CREATE TABLE " . CALLITE_EVENTS_TABLE . " ( ! event_id int(11) DEFAULT '0' NOT NULL auto_increment, username varchar(255), stamp datetime, |