Permalink
Browse files

misc fixes

  • Loading branch information...
1 parent ae22dd3 commit f73a96899f6a202855b884431fa3683c164b8019 @chrisgraham committed May 6, 2012
View
@@ -176,6 +176,7 @@ function login_after()
{
$title=get_page_title('LOGGED_IN');
$url=enforce_sessioned_url(either_param('redirect'));
+ //set_session_id(get_session_id()); // Just in case something earlier set it to a pre-logged-in one Not needed
if (count($_POST)<=4) // Only the login username, password, remember-me and redirect
{
@@ -1413,15 +1413,15 @@ function view_event()
$explode=explode('-',$day);
if (count($explode)==3)
{
- if (is_null($event['e_start_hour'])) // All day event
+ /*if (is_null($event['e_start_hour'])) // All day event //CODE COMMENTED, BECAUSE NOT WORKING OUT e_end_hour and e_end_minute, and not even needed
{
if (is_null($event['e_end_year']) || is_null($event['e_end_month']) || is_null($event['e_end_day']))
{
$event['e_end_day']=$event['e_start_day'];
$event['e_end_month']=$event['e_start_month'];
$event['e_end_year']=$event['e_start_year'];
}
- }
+ }*/
if (!is_null($event['e_end_year']) && !is_null($event['e_end_month']) && !is_null($event['e_end_day']))
{
$event['e_end_year']+=intval($explode[0])-$event['e_start_year'];
@@ -477,7 +477,6 @@ function category_screen()
return do_template('DOWNLOAD_CATEGORY_SCREEN',array('_GUID'=>'ebb3c8708695f6a30dbd4a03f8632047','ID'=>strval($id),'SUBDOWNLOADS'=>$subdownloads,'TAGS'=>get_loaded_tags('download_categories'),'TITLE'=>$title,'SUBMIT_URL'=>$submit_url,'ADD_CAT_URL'=>$add_cat_url,'EDIT_CAT_URL'=>$edit_cat_url,'DESCRIPTION'=>$description,'SUBCATEGORIES'=>$subcategories,'DOWNLOADS'=>$downloads,'SORTING'=>$sorting));
}
-
/**
* The UI to view a download index.
*
@@ -216,7 +216,7 @@ function run()
if ($hook!='')
{
- require_code('hooks/modules/pointstore/'.filter_naughty_harsh($hook));
+ require_code('hooks/modules/pointstore/'.filter_naughty_harsh($hook),true);
$object=object_factory('Hook_pointstore_'.filter_naughty_harsh($hook));
$object->init();
breadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('POINT_STORE'))));
@@ -243,7 +243,7 @@ function do_module_gui()
$_hooks=find_all_hooks('modules','pointstore');
foreach (array_keys($_hooks) as $hook)
{
- require_code('hooks/modules/pointstore/'.filter_naughty_harsh($hook));
+ require_code('hooks/modules/pointstore/'.filter_naughty_harsh($hook),true);
$object=object_factory('Hook_pointstore_'.filter_naughty_harsh($hook),true);
if (is_null($object)) continue;
$object->init();
View
@@ -164,6 +164,12 @@ function find_periods_recurrence($timezone,$do_timezone_conv,$start_year,$start_
);
if ((is_null($start_hour)) && (is_null($end_year) || is_null($end_month) || is_null($end_day))) // All day event with no end date, should be same as start date
{
+ // Should not be needed, but normalise possible database error
+ $start_minute=NULL;
+ $start_hour=NULL;
+ $end_minute=NULL;
+ $end_hour=NULL;
+
$end_day=$start_day;
$end_month=$start_month;
$end_year=$start_year;
View
@@ -697,7 +697,11 @@ function _fatal_exit($text,$return=false)
$echo->evaluate_echo();
if (get_param_integer('keep_fatalistic',0)==0)
+ {
+ $trace=get_html_trace();
+ $error_tpl=do_template('FATAL_SCREEN',array('_GUID'=>'9fdc6d093bdb685a0eda6bb56988a8c5','TITLE'=>$title,'WEBSERVICE_RESULT'=>get_webservice_result($text),'MESSAGE'=>$text,'TRACE'=>$trace));
relay_error_notification((is_object($text)?$text->evaluate():$text).'[html]'.$error_tpl->evaluate().'[/html]');
+ }
if (!$return) exit();
}
@@ -1740,9 +1740,13 @@ function import_permissions($db,$table_prefix,$file_base)
case 'catalogues_catalogue':
$module='catalogue';
break;
+ case 'forums':
+ $module='forum';
+ break;
}
$id_new=import_id_remap_get($module,$row['category_name'],true);
- if (!is_null($id_new)) $row['category_name']=strval($id_new);
+ if (is_null($id_new)) continue;
+ $row['category_name']=strval($id_new);
}
$GLOBALS['SITE_DB']->query_delete('group_category_access',$row,'',1);
$GLOBALS['SITE_DB']->query_insert('group_category_access',$row);
@@ -89,6 +89,7 @@ function get_file_list()
'web.config',
'data/html5.js',
'themes/default/images/bottom/ocpchat.png',
+ 'themes/default/images/no_image.png',
'install.css',
'lang/EN/installer.ini',
'sources/group_member_timeouts.php',
@@ -117,7 +117,6 @@ function get_file_list()
'themes/default/images/bigicons/orders.png',
'themes/default/images/bigicons/show_orders.png',
'themes/default/images/bigicons/undispatched.png',
- 'themes/default/images/no_image.png',
'themes/default/images/results/add_note.png',
'themes/default/images/results/delete.gif',
'themes/default/images/results/dispatch.png',
@@ -41,7 +41,7 @@ function run($full_title,$cutoff,$prefix,$date_string,$max)
$hook=convert_ocportal_type_codes('feedback_type_code',$parts[0],'cma_hook');
if ($hook!='')
{
- require_code('hooks/systems/content_meta_aware/'.filter_naughty_harsh($hook));
+ require_code('hooks/systems/content_meta_aware/'.filter_naughty_harsh($hook),true);
$ob=object_factory('Hook_content_meta_aware_'.filter_naughty_harsh($hook),true);
if (is_null($ob)) return NULL;
$info=$ob->info();
View
@@ -265,9 +265,10 @@ function update_stock($order_id)
{
$hook=$ordered_items['p_type'];
- require_code('hooks/systems/ecommerce/'.filter_naughty_harsh($hook));
+ require_code('hooks/systems/ecommerce/'.filter_naughty_harsh($hook),true);
- $object=object_factory('Hook_'.$hook);
+ $object=object_factory('Hook_'.$hook,true);
+ if (is_null($object)) continue;
if (method_exists($object,'update_stock')) // TODO: This is silly, we should recurse to the proper handler in the eCommerce hook, for whatever delivery is needed
$object->update_stock($ordered_items['p_id'],$ordered_items['p_quantity']);
@@ -326,9 +327,10 @@ function payment_form()
$hook=$item['product_type'];
- require_code('hooks/systems/ecommerce/'.filter_naughty_harsh($hook));
+ require_code('hooks/systems/ecommerce/'.filter_naughty_harsh($hook),true);
- $object=object_factory('Hook_'.filter_naughty_harsh($hook));
+ $object=object_factory('Hook_'.filter_naughty_harsh($hook),true);
+ if (is_null($object)) continue;
$temp=$object->get_products(false,$product);
View
@@ -1786,7 +1786,7 @@ function has_cookies() // Will fail on users first visit, but then will catch on
return false;
}*/
- if (count($_COOKIE)>0)
+ if (isset($_COOKIE['has_cookies']))
{
$HAS_COOKIES=true;
return true;
View
@@ -285,7 +285,7 @@ function ticket_add_post($member,$ticket_id,$ticket_type,$title,$post,$ticket_ur
);
$topic_id=$GLOBALS['LAST_TOPIC_ID'];
$is_new=$GLOBALS['LAST_TOPIC_IS_NEW'];
- if ($is_new)
+ if (($is_new) && ($ticket_type!=-1))
{
$GLOBALS['SITE_DB']->query_insert('tickets',array('ticket_id'=>$ticket_id,'forum_id'=>$fid,'topic_id'=>$topic_id,'ticket_type'=>$ticket_type));
}
@@ -313,7 +313,7 @@ function send_ticket_email($ticket_id,$title,$post,$ticket_url,$email,$ticket_ty
$new_ticket=($ticket_type_if_new!=-1);
- $ticket_type_id=$GLOBALS['SITE_DB']->query_value('tickets','ticket_type',array('ticket_id'=>$ticket_id));
+ $ticket_type_id=$GLOBALS['SITE_DB']->query_value_null_ok('tickets','ticket_type',array('ticket_id'=>$ticket_id));
$ticket_type_text=mixed();
View
@@ -1774,7 +1774,6 @@ function upgrade_theme($theme,$from_version,$to_version,$test_run=true)
".menu_type__zone {\n font-size: 0.9em;\n}"=>".menu_type__zone {\n font-size: 0.9em;\n max-height: 15px;\n}",
".menu_type__zone li {\n display: inline;\n padding: 0;\n list-style-type: none;\n}"=>".menu_type__zone li {\n display: inline;\n padding: 0;\n list-style-type: none;\n list-style-image: none;\n}\n\n.menu_type__zone li * {\n vertical-align: middle;\n}",
".edit_menu_link_inline {\n position: absolute;\n right: 1px;\n}"=>"*>.edit_menu_link_inline {\n display: none;\n}\n\n*:hover>.edit_menu_link_inline {\n display: block;\n}\n\n.edit_menu_link_inline {\n position: absolute;\n right: 1px;\n z-index: 10000;\n}",
- ".ocf_post_details_unvalidated {\n float: {!en_left};\n }"=>".ocf_post_details_unvalidated {\n float: {!en_left};\n padding-{!en_left}: 7px;\n }",
".radio_list_picture {\n float: {!en_left};\n white-space: nowrap;\n padding: 3px;\n min-width: 35px;\n min-height: 35px;\n}"=>".radio_list_picture {\n float: {!en_left};\n white-space: nowrap;\n padding: 3px;\n min-width: 40px;\n min-height: 40px;\n font-size: 0.8em;\n min-height: 65px;\n min-width: 85px;\n}",
),
'news.css'=>array(
@@ -1785,6 +1784,7 @@ function upgrade_theme($theme,$from_version,$to_version,$test_run=true)
".ocf_information_bar { /* {\$,either OCF_GUEST_BAR.tpl or OCF_MEMBER_BAR.tpl} */\n background-color: #eef2f7; /* {\$,wizard, 60% bgcol + 40% W/B} */\n font-size: 0.85em;\n border-collapse: collapse;\n white-space: nowrap;\n width: 100%;\n}"=>".ocf_information_bar { /* {\$,either OCF_GUEST_BAR.tpl or OCF_MEMBER_BAR.tpl} */\n background-color: #eef2f7; /* {\$,wizard, 60% bgcol + 40% W/B} */\n font-size: 0.85em;\n border-collapse: collapse;\n white-space: nowrap;\n width: 100%;\n padding: 0;\n}",
".ocf_member_column_d {\n {+START,IF,{\$NOT,{\$MOBILE}}}\n width: 11.3em;\n {+END}\n {+START,IF,{\$MOBILE}}\n float: left;\n {+END}\n white-space: nowrap;\n}"=>".ocf_member_column_d {\n white-space: nowrap;\n}",
".ocf_member_column_e {\n white-space: nowrap;\n}\n\n"=>"",
+ ".ocf_post_details_unvalidated {\n float: {!en_left};\n }"=>".ocf_post_details_unvalidated {\n float: {!en_left};\n padding-{!en_left}: 7px;\n }",
),
'points.css'=>array(
".points_give_choices .sub_option {\n font-size: 0.9em;\n}"=>".points_give_choices .sub_option {\n font-size: 0.9em;\n white-space: nowrap;\n}",
View
@@ -224,7 +224,7 @@ function skippable_keep($key,$val)
return true;
}
- return (($key=='keep_session') || (($key=='keep_has_js') && ($val=='1'))) && ((isset($_COOKIE['js_on'])) || (get_option('detect_javascript')=='0'));
+ return ((($key=='keep_session') && (isset($_COOKIE['has_cookies']))) || (($key=='keep_has_js') && ($val=='1'))) && ((isset($_COOKIE['js_on'])) || (get_option('detect_javascript')=='0'));
}
/**
@@ -263,7 +263,8 @@ function ocp_setcookie($name,$value,$session=false,$http_only=false)
}
}
}
- $_COOKIE[$name]=get_magic_quotes_gpc()?addslashes($value):$value;
+ if ($name!='has_cookies')
+ $_COOKIE[$name]=get_magic_quotes_gpc()?addslashes($value):$value;
return $output;
}

0 comments on commit f73a968

Please sign in to comment.