|
From: Jon O. <jon...@us...> - 2006-06-18 10:47:17
|
Update of /cvsroot/mxbb/mx_profilecp/profilcp/def In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26950/modules/mx_profilecp/profilcp/def Modified Files: def_userfuncs_album.php Log Message: update Index: def_userfuncs_album.php =================================================================== RCS file: /cvsroot/mxbb/mx_profilecp/profilcp/def/def_userfuncs_album.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** def_userfuncs_album.php 5 Apr 2006 23:04:42 -0000 1.4 --- def_userfuncs_album.php 18 Jun 2006 10:47:13 -0000 1.5 *************** *** 18,39 **** ! //----------------------------------- ! // ! // user_gallery output function ! // ! //----------------------------------- ! function pcp_output_gallery($field_name, $view_userdata, $map_name='') ! { ! global $board_config, $phpbb_root_path, $mx_root_path, $phpEx, $lang, $images, $userdata; ! global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields; global $db, $album_config, $mx_table_prefix; ! include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_functions.'.$phpEx); ! include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_constants.'.$phpEx); ! $txt = ''; ! $img = ''; ! $res = ''; ! if ( $view_userdata['user_id'] != ANONYMOUS ) { //fill Album_config --- 18,39 ---- ! //----------------------------------- ! // ! // user_gallery output function ! // ! //----------------------------------- ! function pcp_output_gallery($field_name, $view_userdata, $map_name='') ! { ! global $board_config, $phpbb_root_path, $mx_root_path, $phpEx, $lang, $images, $userdata; ! global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields; global $db, $album_config, $mx_table_prefix; ! include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_functions.'.$phpEx); ! include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_constants.'.$phpEx); ! $txt = ''; ! $img = ''; ! $res = ''; ! if ( $view_userdata['user_id'] != ANONYMOUS ) { //fill Album_config *************** *** 50,56 **** $album_config[$album_config_name] = $album_config_value; } ! // end fill album_config ! // check if the user is allowed to see personal gallerys $personal_gallery_access = personal_gallery_access(1,0); --- 50,56 ---- $album_config[$album_config_name] = $album_config_value; } ! // end fill album_config ! // check if the user is allowed to see personal gallerys $personal_gallery_access = personal_gallery_access(1,0); *************** *** 63,67 **** } else ! { $sql = 'SELECT p.* FROM '. ALBUM_TABLE .' AS p, ' . ALBUM_CAT_TABLE .' AS c --- 63,67 ---- } else ! { $sql = 'SELECT p.* FROM '. ALBUM_TABLE .' AS p, ' . ALBUM_CAT_TABLE .' AS c *************** *** 69,90 **** AND c.cat_id = p.pic_cat_id AND c.cat_user_id = p.pic_user_id'; ! /* ! $sql = "SELECT * FROM " . ALBUM_TABLE . " WHERE pic_user_id =" . $view_userdata['user_id'] . " AND pic_cat_id = ". PERSONAL_GALLERY ; */ if ( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not read album table', '', __LINE__, __FILE__, $sql); ! } $number_gals = 0; $number_gals = ($db->sql_numrows($result)); $is_gallery = ( $row = $db->sql_fetchrow($result) ); ! if ( $is_gallery ) ! { ! ! // GET SMARTOR PAGE ID $sql = "SELECT * FROM " . FUNCTION_TABLE . " WHERE function_file = 'album.php' LIMIT 1"; if(!$result = $db->sql_query($sql)) --- 69,90 ---- AND c.cat_id = p.pic_cat_id AND c.cat_user_id = p.pic_user_id'; ! /* ! $sql = "SELECT * FROM " . ALBUM_TABLE . " WHERE pic_user_id =" . $view_userdata['user_id'] . " AND pic_cat_id = ". PERSONAL_GALLERY ; */ if ( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not read album table', '', __LINE__, __FILE__, $sql); ! } $number_gals = 0; $number_gals = ($db->sql_numrows($result)); $is_gallery = ( $row = $db->sql_fetchrow($result) ); ! if ( $is_gallery ) ! { ! ! // GET SMARTOR PAGE ID $sql = "SELECT * FROM " . FUNCTION_TABLE . " WHERE function_file = 'album.php' LIMIT 1"; if(!$result = $db->sql_query($sql)) *************** *** 94,98 **** $row = $db->sql_fetchrow($result); $function_id = $row['function_id']; ! // ------------ $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE function_id = '$function_id' LIMIT 1"; --- 94,98 ---- $row = $db->sql_fetchrow($result); $function_id = $row['function_id']; ! // ------------ $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE function_id = '$function_id' LIMIT 1"; *************** *** 124,170 **** break; } ! } ! } */ ! ! $temp_url = append_sid($mx_root_path ."index.$phpEx?page=".$smartor_page_id."&user_id=" . $view_userdata['user_id']); ! $txt = '<a href="' . $temp_url . '" title="' . $number_gals . $lang['gal_pic_in'] . $lang['gallery'] . '">' . $number_gals . $lang['gal_pic'] . '</a>'; ! $img = '<a href="' . $temp_url . '"><img src="' . $images['profilecp_icon_gallery'] . '" alt="' . $number_gals . $lang['gal_pic'] . '" title="' . $number_gals . $lang['gal_pic_in']. $lang['gallery'] . '" border="0" /></a>'; $res = pcp_output_format($field_name, $txt, $img, $map_name); } } ! } ! return $res; } ! // end user_gallery output function ! //----------------------------------- ! // ! // user_no_of_pics output function ! // ! //----------------------------------- ! function pcp_output_nom_pic($field_name, $view_userdata, $map_name='') ! { ! global $board_config, $phpbb_root_path, $mx_root_path, $phpEx, $lang, $images, $userdata; ! global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields; global $db, $album_config, $mx_table_prefix; include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_functions.'.$phpEx); include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_constants.'.$phpEx); - - // init_userprefs($userdata); - // include_once($phpbb_root_path . 'album_mod/album_common.'.$phpEx); - $txt = ''; - $img = ''; - $res = ''; ! $user_id = $view_userdata['user_id']; ! //fill Album_config ! if ( $view_userdata['user_id'] != ANONYMOUS ) ! { $sql = "SELECT * FROM ". ALBUM_CONFIG_TABLE; --- 124,170 ---- break; } ! } ! } */ ! ! $temp_url = append_sid($mx_root_path ."index.$phpEx?page=".$smartor_page_id."&user_id=" . $view_userdata['user_id']); ! $txt = '<a href="' . $temp_url . '" title="' . $number_gals . $lang['gal_pic_in'] . $lang['gallery'] . '">' . $number_gals . $lang['gal_pic'] . '</a>'; ! $img = '<a href="' . $temp_url . '"><img src="' . $images['profilecp_icon_gallery'] . '" alt="' . $number_gals . $lang['gal_pic'] . '" title="' . $number_gals . $lang['gal_pic_in']. $lang['gallery'] . '" border="0" /></a>'; $res = pcp_output_format($field_name, $txt, $img, $map_name); } } ! } ! return $res; } ! // end user_gallery output function ! //----------------------------------- ! // ! // user_no_of_pics output function ! // ! //----------------------------------- ! function pcp_output_nom_pic($field_name, $view_userdata, $map_name='') ! { ! global $board_config, $phpbb_root_path, $mx_root_path, $phpEx, $lang, $images, $userdata; ! global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields; global $db, $album_config, $mx_table_prefix; include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_functions.'.$phpEx); include_once($mx_root_path . 'modules/mx_smartor/album_mod/album_constants.'.$phpEx); ! // init_userprefs($userdata); ! // include_once($phpbb_root_path . 'album_mod/album_common.'.$phpEx); ! $txt = ''; ! $img = ''; ! $res = ''; ! ! $user_id = $view_userdata['user_id']; ! //fill Album_config ! if ( $view_userdata['user_id'] != ANONYMOUS ) ! { $sql = "SELECT * FROM ". ALBUM_CONFIG_TABLE; *************** *** 179,188 **** $album_config[$album_config_name] = $album_config_value; } ! // end fill album_config // Check the catagorys if there are any pics the user is allowed to see $sql = "SELECT c.*, COUNT(p.pic_id) AS count FROM ". ALBUM_CAT_TABLE ." AS c LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id ! WHERE c.cat_user_id = $user_id AND c.cat_id = p.pic_cat_id GROUP BY c.cat_id --- 179,188 ---- $album_config[$album_config_name] = $album_config_value; } ! // end fill album_config // Check the catagorys if there are any pics the user is allowed to see $sql = "SELECT c.*, COUNT(p.pic_id) AS count FROM ". ALBUM_CAT_TABLE ." AS c LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id ! WHERE c.cat_user_id = $user_id AND c.cat_id = p.pic_cat_id GROUP BY c.cat_id *************** *** 199,203 **** while( $row = $db->sql_fetchrow($result) ) ! { $album_user_access = album_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0); // VIEW if ($album_user_access['view'] == 1) --- 199,203 ---- while( $row = $db->sql_fetchrow($result) ) ! { $album_user_access = album_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0); // VIEW if ($album_user_access['view'] == 1) *************** *** 208,214 **** $total_pics = $total_pics + $thiscat[$i]['count']; } ! } ! ! if (empty($thiscat)) { $nocat_pic = TRUE; // If the user has not uploaded any pictures in catagories --- 208,214 ---- $total_pics = $total_pics + $thiscat[$i]['count']; } ! } ! ! if (empty($thiscat)) { $nocat_pic = TRUE; // If the user has not uploaded any pictures in catagories *************** *** 231,235 **** FROM '. ALBUM_TABLE .' AS p, ' . ALBUM_CAT_TABLE .' AS c WHERE c.cat_user_id = '.$view_userdata['user_id'].' ! AND c.cat_id = p.pic_cat_id'; /* $sql = "SELECT COUNT(pic_id) AS count --- 231,235 ---- FROM '. ALBUM_TABLE .' AS p, ' . ALBUM_CAT_TABLE .' AS c WHERE c.cat_user_id = '.$view_userdata['user_id'].' ! AND c.cat_id = p.pic_cat_id'; /* $sql = "SELECT COUNT(pic_id) AS count *************** *** 248,269 **** $total_pics = $total_pics + $row['count']; } ! ! if ( $total_pics > 0 ) ! { $temp_url = append_sid("./album_by.$phpEx?user_id=" . $view_userdata['user_id']); ! $txt = '<a href="' . $temp_url . '" title="' . $total_pics . $lang['pics_up'] . '">' . $total_pics . '</a>'; ! //$img = '<a href="' . $temp_url . '"><img src="' . $images['profilecp_icon_gallery'] . '" alt="' . $number_gals . $lang['gal_pic'] . '" title="' . $number_gals . $lang['gal_pic_in']. $lang['gallery'] . '" border="0" /></a>'; $res = pcp_output_format($field_name, $txt, $img, $map_name); } else { ! $txt = $total_pics; ! //$img = '<a href="' . $temp_url . '"><img src="' . $images['profilecp_icon_gallery'] . '" alt="' . $number_gals . $lang['gal_pic'] . '" title="' . $number_gals . $lang['gal_pic_in']. $lang['gallery'] . '" border="0" /></a>'; $res = pcp_output_format($field_name, $txt, $img, $map_name); ! } ! } ! return $res; } --- 248,269 ---- $total_pics = $total_pics + $row['count']; } ! ! if ( $total_pics > 0 ) ! { $temp_url = append_sid("./album_by.$phpEx?user_id=" . $view_userdata['user_id']); ! $txt = '<a href="' . $temp_url . '" title="' . $total_pics . $lang['pics_up'] . '">' . $total_pics . '</a>'; ! //$img = '<a href="' . $temp_url . '"><img src="' . $images['profilecp_icon_gallery'] . '" alt="' . $number_gals . $lang['gal_pic'] . '" title="' . $number_gals . $lang['gal_pic_in']. $lang['gallery'] . '" border="0" /></a>'; $res = pcp_output_format($field_name, $txt, $img, $map_name); } else { ! $txt = $total_pics; ! //$img = '<a href="' . $temp_url . '"><img src="' . $images['profilecp_icon_gallery'] . '" alt="' . $number_gals . $lang['gal_pic'] . '" title="' . $number_gals . $lang['gal_pic_in']. $lang['gallery'] . '" border="0" /></a>'; $res = pcp_output_format($field_name, $txt, $img, $map_name); ! } ! } ! return $res; } |