ify"> $ data_info [$ i] [ s_hour ]=date ( H raquo ;, strtotime ($ data_info [$ i] [ date ]));
$ data_info [$ i] [ s_minute ]=date ( i raquo ;, strtotime ($ data_info [$ i] [ date ]));
}
($ exist_image)
{
$ data_info [$ i] [ image_size ]=(! empty ($ data_info [$ i] [ image ]))? $ GLOBALS [ images ] - gt; get_image_size ($ data_info [$ i] [ image ]): null;
($ exist_name)
$ data_info [$ i] [ name_image ]=str_replace (array ( amp; raquo ;, « raquo ;,« »), array ( laquo ;, «,«), $ data_info [$ i] [ name ']);
}
$ data_info [$ i] [ line_pos ]=$ i% (int) $ GLOBALS [ in_line ];
}
$ data_info;
}
/**
* Отримати список імен і ід з бази
*/function get_few_name_data ($ where_arr=array ())
{
$ data_info=array ();
$ where_str=$ this- gt; _get_where ($ where_arr);
$ sql=«SELECT id, name». $ this- gt; table_name. »
$ where_str »;
$ result=mysql_query ($ sql); (! $ result)
$ this- gt; _execute_query ($ sql, __FILE __);
($ i=0; $ i lt; mysql_num_rows ($ result); $ i ++)
{
$ row=mysql_fetch_array ($ result);
$ data_info [$ row [ id ]]=$ row [ name ];
}
$ data_info;
}
/**
* Отримати одну запис з бази
*/function get_one_data ($ where_arr=array ())
{
$ data_info=array ();
$ where_str=$ this- gt; _get_where ($ where_arr);
$ fields_str=$ this- gt; _get_fields ();
$ sql=«SELECT $ fields_str». $ this- gt; table_name. »
$ where_str »;
$ result=$ this- gt; _execute_query ($ sql, __LINE__);
(mysql_num_rows ($ result) gt; 0)
{
$ data_info=mysql_fetch_array ($ result);
($ this- gt; _exist_field ( date ))
{
$ data_info [ s_day ]=date ( d raquo ;, strtotime ($ data_info [ date ]));
$ data_info [ s_month ]=date ( m raquo ;, strtotime ($ data_info [ date ]));
$ data_info [ s_year ]=date ( Y raquo ;, strtotime ($ data_info [ date ]));
$ data_info [ s_hour ]=date ( H raquo ;, strtotime ($ data_info [ date ]));
$ data_info [ s_minute ]=date ( i raquo ;, strtotime ($ data_info [ date ]));
}
($ this- gt; _exist_field ( image ))
{
$ data_info [ image_save ]=$ data_info [ image ];
$ data_info [ image_size ]=(! empty ($ data_info [ image ]))? $ GLOBALS [ images ] - gt; get_image_size ($ data_info [ image ]): null;
($ this- gt; _exist_field ( name ))
$ data_info [ name_image ]=str_replace (array ( amp; raquo ;, « raquo ;,« »), array ( laquo ;,« , «), $ data_info [ name ']);
}
} false;
$ data_info;
}
/**
* Отримати попередню й наступну ід для обраної записи
*/get_next_prev_ids ($ id, $ where_arr=array (), $ order_arr=array ( status = gt; ASC raquo ;, id = gt; ASC ))
{
$ data_info=array ();
$ ids_info=array ();
$ current_i=- 1;
$ where_str=$ this- gt; _get_where ($ where_arr);
$ order_str=$ this- gt; _get_order ($ order_arr);
$ sql=«SELECT id». $ this- gt; table_name. »
$ where_str
$ order_str »;
$ result=$ this- gt; _execute_query ($ sql, __LINE__);
($ i=0; $ i lt; mysql_num_rows ($ result); $ i ++)
{
$ row=mysql_fetch_array ($ result);