|
From: Florin C B. <ory...@us...> - 2011-03-03 14:28:42
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/includes
In directory vz-cvs-4.sog:/tmp/cvs-serv24509/album_mod/includes
Modified Files:
album_functions.php album_hierarchy_functions.php
album_hierarchy_sql.php album_image_class.php
Log Message:
some updated for PHP 5.3.0 decapritated functions
Index: album_hierarchy_functions.php
===================================================================
RCS file: /cvsroot/mxbb/mx_smartor/album_mod/includes/album_hierarchy_functions.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** album_hierarchy_functions.php 10 Oct 2008 01:56:05 -0000 1.5
--- album_hierarchy_functions.php 3 Mar 2011 14:28:40 -0000 1.6
***************
*** 370,374 ****
$first_pic_id = album_get_first_pic_id($cur_cat_id);
$last_pic_id = album_get_last_pic_id($ss_cat_id);
! $slideshow_link = mx_append_sid(this_fap_portalurl("smartor_mode=album_showpage" . "&pic_id=" . $last_pic_id . "&slideshow=5"));
$slideshow_link_full = '[<a href="' . $slideshow_link . '">' . $lang['Slideshow'] . '</a>]';
//$slideshow_link_full = '<a href="' . $slideshow_link . '">' . $lang['Slideshow'] . ' ' . $slideshow_img . '</a>';
--- 370,374 ----
$first_pic_id = album_get_first_pic_id($cur_cat_id);
$last_pic_id = album_get_last_pic_id($ss_cat_id);
! $slideshow_link = mx_append_sid(this_smartor_mxurl("smartor_mode=album_showpage" . "&pic_id=" . $last_pic_id . "&slideshow=5", false));
$slideshow_link_full = '[<a href="' . $slideshow_link . '">' . $lang['Slideshow'] . '</a>]';
//$slideshow_link_full = '<a href="' . $slideshow_link . '">' . $lang['Slideshow'] . ' ' . $slideshow_img . '</a>';
***************
*** 618,625 ****
else
{
! $pic_url_sid = mx_append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=" . $last_pic_id));
$pic_target = '_blank';
}
! $pic_thumb_sid = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $last_pic_id));
if ($last_pic_id == 0)
--- 618,625 ----
else
{
! $pic_url_sid = mx_append_sid(this_smartor_mxurl("smartor_mode=album_pic&pic_id=" . $last_pic_id, true));
$pic_target = '_blank';
}
! $pic_thumb_sid = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $last_pic_id, true));
if ($last_pic_id == 0)
***************
*** 641,645 ****
if ( !empty($links) )
{
! if ( ($user_id==ALBUM_PUBLIC_GALLERY && $album_config['show_index_subcats']==1) || ($user_id!=ALBUM_PUBLIC_GALLERY && $album_config['personal_show_subcats_in_index']==1) )
{
$template->assign_block_vars('catmain.catrow.subcat_link', array(
--- 641,645 ----
if ( !empty($links) )
{
! if ( ($user_id==ALBUM_PUBLIC_GALLERY && $album_config['show_index_subcats'] == 1) || ($user_id != ALBUM_PUBLIC_GALLERY && $album_config['personal_show_subcats_in_index'] == 1) )
{
$template->assign_block_vars('catmain.catrow.subcat_link', array(
Index: album_image_class.php
===================================================================
RCS file: /cvsroot/mxbb/mx_smartor/album_mod/includes/album_image_class.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** album_image_class.php 23 Jul 2010 11:29:15 -0000 1.4
--- album_image_class.php 3 Mar 2011 14:28:40 -0000 1.5
***************
*** 172,176 ****
header("Content-type: " . $this->ImageMimeType());
header("Content-Length: " . $this->ImageFilesize());
! header("Content-Disposition: filename=" . $pic_prefix . ereg_replace("[^A-Za-z0-9]", "_", $pic_name) . $pic_suffix . $pic_filetype);
switch ($this->ImageTypeNo()){
case IMG_GIF:
--- 172,176 ----
header("Content-type: " . $this->ImageMimeType());
header("Content-Length: " . $this->ImageFilesize());
! header("Content-Disposition: filename=" . $pic_prefix . preg_replace("/[^A-Za-z0-9]/", "_", $pic_name) . $pic_suffix . $pic_filetype);
switch ($this->ImageTypeNo()){
case IMG_GIF:
***************
*** 201,205 ****
}
header("Content-type: image/jpeg");
! header("Content-Disposition: filename=" . $pic_prefix . ereg_replace("[^A-Za-z0-9]", "_", $pic_name) . $pic_suffix . $pic_filetype);
imagejpeg($this->ImageID, "", $this->JpegQuality($jpg_quality));
return true;
--- 201,205 ----
}
header("Content-type: image/jpeg");
! header("Content-Disposition: filename=" . $pic_prefix . preg_replace("/[^A-Za-z0-9]/", "_", $pic_name) . $pic_suffix . $pic_filetype);
imagejpeg($this->ImageID, "", $this->JpegQuality($jpg_quality));
return true;
Index: album_functions.php
===================================================================
RCS file: /cvsroot/mxbb/mx_smartor/album_mod/includes/album_functions.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** album_functions.php 21 Feb 2011 09:36:45 -0000 1.9
--- album_functions.php 3 Mar 2011 14:28:40 -0000 1.10
***************
*** 1265,1268 ****
--- 1265,1433 ----
}
+
+ function picture_quick_thumb($pic_filename, $pic_thumbnail, $thumbnail_file)
+ {
+ if (USERS_SUBFOLDERS_ALBUM == true)
+ {
+ if (strpos($pic_filename, '/') !== false)
+ {
+ $pic_path[] = array();
+ $pic_path = explode('/', $pic_filename);
+ $pic_filename = $pic_path[count($pic_path) - 1];
+ }
+ }
+
+ $file_part = explode('.', strtolower($pic_filename));
+ $pic_filetype = $file_part[count($file_part) - 1];
+ $pic_filename_only = substr($pic_filename, 0, strlen($pic_filename) - strlen($pic_filetype) - 1);
+ $pic_base_path = ALBUM_UPLOAD_PATH;
+ $pic_extra_path = '';
+ $pic_new_filename = $pic_extra_path . $pic_filename;
+ $pic_fullpath = $pic_base_path . $pic_new_filename;
+ $pic_thumbnail = ($pic_thumbnail != '') ? $pic_thumbnail : (md5($pic_filename) . '.' . $pic_filetype);
+ $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail;
+
+ if (USERS_SUBFOLDERS_ALBUM == true)
+ {
+ if (count($pic_path) == 2)
+ {
+ $pic_extra_path = $pic_path[0] . '/';
+ $pic_thumbnail_path = ALBUM_CACHE_PATH . $pic_extra_path;
+ if (is_dir($pic_thumbnail_path))
+ {
+ $pic_new_filename = $pic_extra_path . $pic_filename;
+ $pic_fullpath = $pic_base_path . $pic_new_filename;
+ $pic_thumbnail_fullpath = $pic_thumbnail_path . $pic_thumbnail;
+ }
+ }
+ }
+
+ if (file_exists($pic_thumbnail_fullpath))
+ {
+ $thumbnail_file = $pic_thumbnail_fullpath;
+ }
+ return $thumbnail_file;
+ }
+
+ function pic_info($pic_filename, $pic_thumbnail, $pic_title = '')
+ {
+ $pic_info = array();
+ $pic_info['exists'] = false;
+ $pic_info['filename'] = $pic_filename;
+ $pic_info['thumbnail'] = $pic_thumbnail;
+ $pic_info['title'] = $pic_title;
+ if (USERS_SUBFOLDERS_ALBUM == true)
+ {
+ if (strpos($pic_info['filename'], '/') !== false)
+ {
+ $pic_path[] = array();
+ $pic_path = explode('/', $pic_info['filename']);
+ $pic_info['filename'] = $pic_path[count($pic_path) - 1];
+ }
+ }
+
+ $file_part = explode('.', strtolower($pic_info['filename']));
+ $pic_info['filetype'] = $file_part[count($file_part) - 1];
+ $pic_info['filename_only'] = substr($pic_info['filename'], 0, strlen($pic_info['filename']) - strlen($pic_info['filetype']) - 1);
+ $pic_info['base_path'] = ALBUM_UPLOAD_PATH;
+ $pic_info['base_t_s_path'] = ALBUM_CACHE_PATH;
+ $pic_info['base_t_m_path'] = ALBUM_MED_CACHE_PATH;
+ $pic_info['base_t_w_path'] = ALBUM_WM_CACHE_PATH;
+ $pic_info['extra_path'] = '';
+ $pic_info['new_filename'] = $pic_info['extra_path'] . $pic_info['filename'];
+ $pic_info['fullpath'] = $pic_info['base_path'] . $pic_info['new_filename'];
+ $pic_info['thumbnail_new'] = md5($pic_info['filename']) . '.' . $pic_info['filetype'];
+ $pic_info['thumbnail'] = ($pic_info['thumbnail'] == '') ? $pic_info['thumbnail_new'] : $pic_info['thumbnail'];
+ $thumbs_prefixes = array('s', 'm', 'w');
+ for ($i = 0; $i < count($thumbs_prefixes); $i++)
+ {
+ $cp = $thumbs_prefixes[$i];
+ $pic_info['thumbnail_' . $cp . '_fullpath'] = $pic_info['base_t_' . $cp . '_path'] . $pic_info['thumbnail'];
+ $pic_info['thumbnail_new_' . $cp . '_fullpath'] = $pic_info['base_t_' . $cp . '_path'] . $pic_info['thumbnail_new'];
+ if ($cp == 'w')
+ {
+ $pic_info['thumbnail_' . $cp . '_f_fullpath'] = $pic_info['base_t_' . $cp . '_path'] . 'full_' . $pic_info['thumbnail'];
+ $pic_info['thumbnail_new_' . $cp . '_f_fullpath'] = $pic_info['base_t_' . $cp . '_path'] . 'full_' . $pic_info['thumbnail_new'];
+ }
+ }
+ $pic_info['title_reg'] = preg_replace("/[^A-Za-z0-9]/", "_", $pic_info['title']);
+
+ if (USERS_SUBFOLDERS_ALBUM == true)
+ {
+ if (count($pic_path) == 2)
+ {
+ $pic_info['extra_path'] = $pic_path[0] . '/';
+ if (is_dir($pic_info['base_path'] . $pic_info['extra_path']))
+ {
+ $pic_info['new_filename'] = $pic_info['extra_path'] . $pic_info['filename'];
+ $pic_info['fullpath'] = $pic_info['base_path'] . $pic_info['new_filename'];
+ }
+ else
+ {
+ $pic_info['exists'] = false;
+ return $pic_info;
+ }
+
+ for ($i = 0; $i < count($thumbs_prefixes); $i++)
+ {
+ $cp = $thumbs_prefixes[$i];
+ $dir_exists = false;
+ $current_t_path = $pic_info['base_t_' . $cp . '_path'] . $pic_info['extra_path'];
+ if (is_dir($current_t_path))
+ {
+ $dir_exists = true;
+ }
+ else
+ {
+ $dir_creation = @mkdir($current_t_path, 0777);
+ if ($dir_creation == true)
+ {
+ @copy($pic_info['base_path'] . 'index.html', $current_t_path . 'index.html');
+ @chmod($current_t_path . 'index.html', 0755);
+ $dir_exists = true;
+ }
+ }
+
+ if ($dir_exists == true)
+ {
+ $pic_info['thumbnail_' . $cp . '_fullpath'] = $current_t_path . $pic_info['thumbnail'];
+ $pic_info['thumbnail_new_' . $cp . '_fullpath'] = $current_t_path . $pic_info['thumbnail_new'];
+ if ($cp == 'w')
+ {
+ $pic_info['thumbnail_' . $cp . '_f_fullpath'] = $current_t_path . 'full_' . $pic_info['thumbnail'];
+ $pic_info['thumbnail_new_' . $cp . '_f_fullpath'] = $current_t_path . 'full_' . $pic_info['thumbnail_new'];
+ }
+ }
+ }
+ }
+ }
+ $pic_info['exists'] = true;
+ return $pic_info;
+ }
+
+ if (!function_exists('setFlag'))
+ {
+ function setFlag($flags, $flag)
+ {
+ return $flags | $flag;
+ }
+ }
+
+ if (!function_exists('clearFlag'))
+ {
+ function clearFlag($flags, $flag)
+ {
+ return ($flags & ~$flag);
+ }
+ }
+
+ if (!function_exists('checkFlag'))
+ {
+ function checkFlag($flags, $flag)
+ {
+ return (($flags & $flag) == $flag) ? true : false;
+ }
+ }
+
/**
* Enter description here...
Index: album_hierarchy_sql.php
===================================================================
RCS file: /cvsroot/mxbb/mx_smartor/album_mod/includes/album_hierarchy_sql.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** album_hierarchy_sql.php 5 Oct 2008 22:59:10 -0000 1.10
--- album_hierarchy_sql.php 3 Mar 2011 14:28:40 -0000 1.11
***************
*** 587,591 ****
// remove all the alpha characters from the string, since they aren't needed anymore
! $check_date = ereg_replace("[A-Z]+", "", trim($check_date));
// doa final test to see if it's a valid checkm further more
--- 587,591 ----
// remove all the alpha characters from the string, since they aren't needed anymore
! $check_date = preg_replace("/[A-Z]+/", "", trim($check_date));
// doa final test to see if it's a valid checkm further more
***************
*** 1369,1373 ****
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $recentrow[$j]['pic_id']));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
--- 1369,1373 ----
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $recentrow[$j]['pic_id'], true));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
***************
*** 1538,1542 ****
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $highestrow[$j]['pic_id']));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
--- 1538,1542 ----
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $highestrow[$j]['pic_id'], true));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
***************
*** 1707,1711 ****
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $mostviewed[$j]['pic_id']));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
--- 1707,1711 ----
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $mostviewed[$j]['pic_id'], true));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
***************
*** 1863,1867 ****
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $randrow[$j]['pic_id']));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
--- 1863,1867 ----
}
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $randrow[$j]['pic_id'], true));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
***************
*** 2059,2063 ****
$image_comment = ($commentsrow[$i]['comments'] == 0) ? $lang['Not_commented'] : $commentsrow[$i]['comments'];
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $commentsrow[$i]['pic_id']));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
--- 2059,2063 ----
$image_comment = ($commentsrow[$i]['comments'] == 0) ? $lang['Not_commented'] : $commentsrow[$i]['comments'];
! $thumbnail_file = mx_append_sid(this_smartor_mxurl("smartor_mode=album_thumbnail&pic_id=" . $commentsrow[$i]['pic_id'], true));
if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) )
{
|