Update of /cvsroot/mxbb/mx_smartor/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9308/modules/mx_smartor/includes Modified Files: album_cat.php album_cat_sort.php album_comment.php album_comment_delete.php album_comment_edit.php album_delete.php album_edit.php album_hotornot.php album_memberlist.php album_modcp.php album_page.php album_personal.php album_personal_cat_admin.php album_personal_index.php album_personal_old.php album_pic.php album_picm.php album_rate.php album_search.php album_showpage.php album_thumbnail.php album_upload.php Log Message: This module is really messy. I have done some general code cleanup and security scrutiny. Still, much to do... Index: album_personal.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_personal.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_personal.php 5 Apr 2006 23:03:49 -0000 1.5 --- album_personal.php 30 Jun 2006 21:10:56 -0000 1.6 *************** *** 9,12 **** --- 9,17 ---- */ + // +-------------------------------------------------------------+ + // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | + // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003-2004 | + // +-------------------------------------------------------------+ + if ( !defined( 'IN_PORTAL' ) ) { *************** *** 33,37 **** // check if personal gallery root category exists if ( ALBUM_ROOT_CATEGORY == ( $check_cat_id = album_get_personal_root_id( $album_user_id ) ) ) ! { // if it doesn't then create the 'fake' category so we can authenticate it $thiscat = init_personal_gallery_cat( $album_user_id ); --- 38,42 ---- // check if personal gallery root category exists if ( ALBUM_ROOT_CATEGORY == ( $check_cat_id = album_get_personal_root_id( $album_user_id ) ) ) ! { // if it doesn't then create the 'fake' category so we can authenticate it $thiscat = init_personal_gallery_cat( $album_user_id ); *************** *** 109,114 **** } ! $template->set_filenames( array( 'body' => 'album_cat_body.tpl' ) ! ); $auth_list = album_build_auth_list( $album_user_id, $cat_id, $auth_data ); --- 114,118 ---- } ! $template->set_filenames( array( 'body' => 'album_cat_body.tpl' ) ); $auth_list = album_build_auth_list( $album_user_id, $cat_id, $auth_data ); *************** *** 246,250 **** // $album_nav_cat_desc .= ALBUM_NAV_ARROW . '<a href="'. append_sid(album_append_uid("album.$phpEx?cat_id$cat_id")) .'" class="nav">'.sprintf($lang['Personal_Gallery_Of_User'], $username)."</a>"; $album_nav_cat_desc .= ALBUM_NAV_ARROW . '<a href="' . this_smartor_mxurl( "user_id=$album_user_id" ) . '" class="nav">' . sprintf( $lang['Personal_Gallery_Of_User'], $username ) . "</a>"; ! } // ------------------------------------------------------------------------ // check if there is _any_ pictures at all in the personal gallery of this user. --- 250,254 ---- // $album_nav_cat_desc .= ALBUM_NAV_ARROW . '<a href="'. append_sid(album_append_uid("album.$phpEx?cat_id$cat_id")) .'" class="nav">'.sprintf($lang['Personal_Gallery_Of_User'], $username)."</a>"; $album_nav_cat_desc .= ALBUM_NAV_ARROW . '<a href="' . this_smartor_mxurl( "user_id=$album_user_id" ) . '" class="nav">' . sprintf( $lang['Personal_Gallery_Of_User'], $username ) . "</a>"; ! } // ------------------------------------------------------------------------ // check if there is _any_ pictures at all in the personal gallery of this user. *************** *** 256,260 **** FROM ' . ALBUM_TABLE . ' AS p, ' . ALBUM_CAT_TABLE . ' AS c WHERE c.cat_user_id = ' . $album_user_id . ' ! AND c.cat_id IN (' . $allowed_cat . ') AND p.pic_cat_id = c.cat_id'; --- 260,264 ---- FROM ' . ALBUM_TABLE . ' AS p, ' . ALBUM_CAT_TABLE . ' AS c WHERE c.cat_user_id = ' . $album_user_id . ' ! AND c.cat_id IN (' . $allowed_cat . ') AND p.pic_cat_id = c.cat_id'; *************** *** 316,385 **** // Do our template info... // ------------------------------------------------------------------------ ! $template->assign_vars( array( 'L_ALBUM' => $lang['Album'], ! ! 'U_VIEW_CAT' => append_sid( album_append_uid( this_smartor_mxurl() ) ), ! // 'U_VIEW_CAT' => append_sid(album_append_uid(this_smartor_mxurl("$album_page_url?cat_id=$cat_id"))), ! 'CAT_TITLE' => ( $is_root_cat || $album_view_mode == ALBUM_VIEW_ALL ) ? sprintf( $lang['Personal_Gallery_Of_User'], $username ) : $thiscat['cat_title'], ! 'ALBUM_NAVIGATION_ARROW' => ALBUM_NAV_ARROW, ! 'NAV_CAT_DESC' => $album_nav_cat_desc, ! ! 'L_PERSONAL_GALLERY_EXPLAIN' => $lang['Personal_Gallery_Explain'], ! ! 'L_MODERATORS' => $lang['Moderators'], ! 'MODERATORS' => $moderators_list, ! ! 'U_UPLOAD_PIC' => append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_upload&cat_id=" . intval( $cat_id ) ) ) ), ! // 'U_UPLOAD_PIC' => append_sid(album_append_uid(this_smartor_mxurl("smartor_mode=album_upload&cat_id=$cat_id"))), ! 'UPLOAD_PIC_IMG' => $images['upload_pic'], ! 'L_UPLOAD_PIC' => $lang['Upload_Pic'], ! 'U_TOGGLE_VIEW_ALL' => $view_mode_url, ! 'TOGGLE_VIEW_ALL_IMG' => $image_toggle_button, ! 'L_TOGGLE_VIEW_ALL' => $view_mode_text, ! 'L_CATEGORY' => sprintf( $lang['Personal_Gallery_Of_User'], $username ), ! 'L_NO_PICS' => $no_picture_message, ! 'L_RECENT_PUBLIC_PICS' => sprintf( $lang['Recent_Personal_Pics'], $username ), ! 'S_COLS' => $album_config['cols_per_page'], ! 'S_COL_WIDTH' => ( 100 / $album_config['cols_per_page'] ) . '%', ! 'L_VIEW' => $lang['View'], ! 'L_PIC_CAT' => $lang['Pic_Cat'], ! 'L_POSTER' => $lang['Poster'], ! 'L_POSTED' => $lang['Posted'], ! 'ALBUM_JUMPBOX' => $album_jumpbox, ! // 'S_ALBUM_ACTION' => append_sid(album_append_uid(this_smartor_mxurl("$album_page_url?cat_id=" . intval($cat_id)))), ! 'S_ALBUM_ACTION' => append_sid( album_append_uid( this_smartor_mxurl( "$album_page_url?cat_id=$cat_id" ) ) ), ! 'TARGET_BLANK' => ( $album_config['fullpic_popup'] ) ? 'target="_blank"' : '', ! 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], ! 'L_ORDER' => $lang['Order'], ! 'L_SORT' => $lang['Sort'], ! 'L_TIME' => $lang['Time'], ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'SORT_TIME' => ( $sort_method == 'pic_time' ) ? 'selected="selected"' : '', ! 'SORT_PIC_TITLE' => ( $sort_method == 'pic_title' ) ? 'selected="selected"' : '', ! 'SORT_VIEW' => ( $sort_method == 'pic_view_count' ) ? 'selected="selected"' : '', ! 'SORT_RATING_OPTION' => $sort_rating_option, ! 'SORT_COMMENTS_OPTION' => $sort_comments_option, ! 'SORT_NEW_COMMENT_OPTION' => $sort_new_comment_option, ! 'SORT_USERNAME_OPTION' => $sort_username_option, ! 'L_ASC' => $lang['Sort_Ascending'], ! 'L_DESC' => $lang['Sort_Descending'], ! 'SORT_ASC' => ( $sort_order == 'ASC' ) ? 'selected="selected"' : '', ! 'SORT_DESC' => ( $sort_order == 'DESC' ) ? 'selected="selected"' : '', ! 'S_AUTH_LIST' => $auth_list ) ! ); ?> \ No newline at end of file --- 320,386 ---- // Do our template info... // ------------------------------------------------------------------------ ! $template->assign_vars( array( ! 'L_ALBUM' => $lang['Album'], ! 'U_VIEW_CAT' => append_sid( album_append_uid( this_smartor_mxurl() ) ), ! // 'U_VIEW_CAT' => append_sid(album_append_uid(this_smartor_mxurl("$album_page_url?cat_id=$cat_id"))), ! 'CAT_TITLE' => ( $is_root_cat || $album_view_mode == ALBUM_VIEW_ALL ) ? sprintf( $lang['Personal_Gallery_Of_User'], $username ) : $thiscat['cat_title'], ! 'ALBUM_NAVIGATION_ARROW' => ALBUM_NAV_ARROW, ! 'NAV_CAT_DESC' => $album_nav_cat_desc, ! 'L_PERSONAL_GALLERY_EXPLAIN' => $lang['Personal_Gallery_Explain'], ! 'L_MODERATORS' => $lang['Moderators'], ! 'MODERATORS' => $moderators_list, ! 'U_UPLOAD_PIC' => append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_upload&cat_id=" . intval( $cat_id ) ) ) ), ! // 'U_UPLOAD_PIC' => append_sid(album_append_uid(this_smartor_mxurl("smartor_mode=album_upload&cat_id=$cat_id"))), ! 'UPLOAD_PIC_IMG' => $images['upload_pic'], ! 'L_UPLOAD_PIC' => $lang['Upload_Pic'], ! 'U_TOGGLE_VIEW_ALL' => $view_mode_url, ! 'TOGGLE_VIEW_ALL_IMG' => $image_toggle_button, ! 'L_TOGGLE_VIEW_ALL' => $view_mode_text, ! 'L_CATEGORY' => sprintf( $lang['Personal_Gallery_Of_User'], $username ), ! 'L_NO_PICS' => $no_picture_message, ! 'L_RECENT_PUBLIC_PICS' => sprintf( $lang['Recent_Personal_Pics'], $username ), ! 'S_COLS' => $album_config['cols_per_page'], ! 'S_COL_WIDTH' => ( 100 / $album_config['cols_per_page'] ) . '%', ! 'L_VIEW' => $lang['View'], ! 'L_PIC_CAT' => $lang['Pic_Cat'], ! 'L_POSTER' => $lang['Poster'], ! 'L_POSTED' => $lang['Posted'], ! 'ALBUM_JUMPBOX' => $album_jumpbox, ! // 'S_ALBUM_ACTION' => append_sid(album_append_uid(this_smartor_mxurl("$album_page_url?cat_id=" . intval($cat_id)))), ! 'S_ALBUM_ACTION' => append_sid( album_append_uid( this_smartor_mxurl( "$album_page_url?cat_id=$cat_id" ) ) ), ! 'TARGET_BLANK' => ( $album_config['fullpic_popup'] ) ? 'target="_blank"' : '', ! 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], ! 'L_ORDER' => $lang['Order'], ! 'L_SORT' => $lang['Sort'], ! 'L_TIME' => $lang['Time'], ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'SORT_TIME' => ( $sort_method == 'pic_time' ) ? 'selected="selected"' : '', ! 'SORT_PIC_TITLE' => ( $sort_method == 'pic_title' ) ? 'selected="selected"' : '', ! 'SORT_VIEW' => ( $sort_method == 'pic_view_count' ) ? 'selected="selected"' : '', ! 'SORT_RATING_OPTION' => $sort_rating_option, ! 'SORT_COMMENTS_OPTION' => $sort_comments_option, ! 'SORT_NEW_COMMENT_OPTION' => $sort_new_comment_option, ! 'SORT_USERNAME_OPTION' => $sort_username_option, ! 'L_ASC' => $lang['Sort_Ascending'], ! 'L_DESC' => $lang['Sort_Descending'], ! 'SORT_ASC' => ( $sort_order == 'ASC' ) ? 'selected="selected"' : '', ! 'SORT_DESC' => ( $sort_order == 'DESC' ) ? 'selected="selected"' : '', + 'S_AUTH_LIST' => $auth_list ) + ); ?> \ No newline at end of file Index: album_edit.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_edit.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_edit.php 5 Apr 2006 23:03:49 -0000 1.5 --- album_edit.php 30 Jun 2006 21:10:55 -0000 1.6 *************** *** 8,12 **** * */ ! if ( !defined( 'IN_PORTAL' ) ) { --- 8,16 ---- * */ ! ! // +------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // +------------------------------------------------------+ ! if ( !defined( 'IN_PORTAL' ) ) { *************** *** 149,156 **** if ( !isset( $HTTP_POST_VARS['pic_title'] ) ) ! { ! // Start output of page ! $page_title = $lang['Album']; if ( !$is_block ) --- 153,160 ---- if ( !isset( $HTTP_POST_VARS['pic_title'] ) ) ! { ! // Start output of page ! $page_title = $lang['Album']; if ( !$is_block ) *************** *** 159,191 **** } ! $template->set_filenames( array( 'body' => 'album_edit_body.tpl' ) ! ); ! $template->assign_vars( array( 'L_EDIT_PIC_INFO' => $lang['Edit_Pic_Info'], ! 'CAT_TITLE' => $thiscat['cat_title'], ! 'U_VIEW_CAT' => append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ), ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'PIC_TITLE' => $thispic['pic_title'], ! 'PIC_DESC' => $thispic['pic_desc'], ! 'L_PIC_DESC' => $lang['Pic_Desc'], ! 'L_PLAIN_TEXT_ONLY' => $lang['Plain_text_only'], ! 'L_MAX_LENGTH' => $lang['Max_length'], ! 'L_UPLOAD_NO_TITLE' => $lang['Upload_no_title'], ! 'L_DESC_TOO_LONG' => $lang['Desc_too_long'], ! 'S_PIC_DESC_MAX_LENGTH' => $album_config['desc_length'], ! 'L_RESET' => $lang['Reset'], ! 'L_SUBMIT' => $lang['Submit'], - 'S_ALBUM_ACTION' => append_sid( this_smartor_mxurl( "smartor_mode=album_edit&pic_id=$pic_id" ) ), - ) - ); - // Generate the page ! $template->pparse( 'body' ); --- 163,194 ---- } ! $template->set_filenames( array( 'body' => 'album_edit_body.tpl' ) ); ! $template->assign_vars( array( ! 'L_EDIT_PIC_INFO' => $lang['Edit_Pic_Info'], ! 'CAT_TITLE' => $thiscat['cat_title'], ! 'U_VIEW_CAT' => append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ), ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'PIC_TITLE' => $thispic['pic_title'], ! 'PIC_DESC' => $thispic['pic_desc'], ! 'L_PIC_DESC' => $lang['Pic_Desc'], ! 'L_PLAIN_TEXT_ONLY' => $lang['Plain_text_only'], ! 'L_MAX_LENGTH' => $lang['Max_length'], ! 'L_UPLOAD_NO_TITLE' => $lang['Upload_no_title'], ! 'L_DESC_TOO_LONG' => $lang['Desc_too_long'], ! 'S_PIC_DESC_MAX_LENGTH' => $album_config['desc_length'], ! 'L_RESET' => $lang['Reset'], ! 'L_SUBMIT' => $lang['Submit'], ! ! 'S_ALBUM_ACTION' => append_sid( this_smartor_mxurl( "smartor_mode=album_edit&pic_id=$pic_id" ) ), ! )); // Generate the page ! $template->pparse( 'body' ); *************** *** 196,200 **** } else ! { // -------------------------------- // Check posted info --- 199,203 ---- } else ! { // -------------------------------- // Check posted info *************** *** 207,211 **** { mx_message_die( GENERAL_ERROR, $lang['Missed_pic_title'] ); ! } // -------------------------------- // Update the DB --- 210,214 ---- { mx_message_die( GENERAL_ERROR, $lang['Missed_pic_title'] ); ! } // -------------------------------- // Update the DB *************** *** 217,221 **** { mx_message_die( GENERAL_ERROR, 'Could not update pic information', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Complete... now send a message to user --- 220,224 ---- { mx_message_die( GENERAL_ERROR, 'Could not update pic information', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Complete... now send a message to user *************** *** 223,228 **** $message = $lang['Pics_updated_successfully']; ! $template->assign_vars( array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) . '">' ) ! ); if ( $album_user_id == ALBUM_PUBLIC_GALLERY ) --- 226,230 ---- $message = $lang['Pics_updated_successfully']; ! $template->assign_vars( array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) . '">' ) ); if ( $album_user_id == ALBUM_PUBLIC_GALLERY ) *************** *** 239,245 **** mx_message_die( GENERAL_MESSAGE, $message ); } - // +------------------------------------------------------+ - // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | - // +------------------------------------------------------+ - ?> \ No newline at end of file --- 241,243 ---- Index: album_comment_edit.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_comment_edit.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_comment_edit.php 5 Apr 2006 23:03:49 -0000 1.5 --- album_comment_edit.php 30 Jun 2006 21:10:55 -0000 1.6 *************** *** 8,12 **** * */ ! if ( !defined( 'IN_PORTAL' ) ) { --- 8,16 ---- * */ ! ! // +------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // +------------------------------------------------------+ ! if ( !defined( 'IN_PORTAL' ) ) { *************** *** 181,188 **** { $poster = '<a href="' . append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $thispic['user_id'] ) . '">' . $thispic['username'] . '</a>'; ! } ! // Start output of page ! $page_title = $lang['Album']; if ( !$is_block ) --- 185,192 ---- { $poster = '<a href="' . append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $thispic['user_id'] ) . '">' . $thispic['username'] . '</a>'; ! } ! // Start output of page ! $page_title = $lang['Album']; if ( !$is_block ) *************** *** 191,208 **** } ! $template->set_filenames( array( 'body' => 'album_comment_body.tpl' ) ! ); ! $template->assign_block_vars( 'switch_comment_post', array() ); // --- Album Category Hierarchy : begin // --- version : 1.1.0 if ( defined( 'ALBUM_SP_CONFIG_TABLE' ) ) { ! $image_rating = ImageRating( $thispic['rating'] ); // begin shows smilies $max_smilies = 20; $sql = 'SELECT emoticon, code, smile_url ! FROM ' . SMILIES_TABLE . ' GROUP BY smile_url ORDER BY smilies_id LIMIT ' . $max_smilies; --- 195,211 ---- } ! $template->set_filenames( array( 'body' => 'album_comment_body.tpl' ) ); ! $template->assign_block_vars( 'switch_comment_post', array() ); // --- Album Category Hierarchy : begin // --- version : 1.1.0 if ( defined( 'ALBUM_SP_CONFIG_TABLE' ) ) { ! $image_rating = ImageRating( $thispic['rating'] ); // begin shows smilies $max_smilies = 20; $sql = 'SELECT emoticon, code, smile_url ! FROM ' . SMILIES_TABLE . ' GROUP BY smile_url ORDER BY smilies_id LIMIT ' . $max_smilies; *************** *** 217,267 **** for ( $i = 1; $i < $smilies_count + 1; $i++ ) { ! $template->assign_block_vars( 'switch_comment_post.smilies', array( 'CODE' => $smilies_data[$i - 1]['code'], ! 'URL' => $phpbb_root_path . $board_config['smilies_path'] . '/' . $smilies_data[$i - 1]['smile_url'], ! 'DESC' => $smilies_data[$i - 1]['emoticon'] ! ) ); if ( is_integer( $i / 5 ) ) $template->assign_block_vars( 'switch_comment_post.smilies.new_col', array() ); } ! } // --- changed $thiscat to $thispic ! $template->assign_vars( array( 'CAT_TITLE' => $thispic['cat_title'], ! 'U_VIEW_CAT' => append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) ), ! // --- Album Category Hierarchy : end ! 'U_THUMBNAIL' => append_sid( this_smartor_mxurl( "smartor_mode=album_thumbnail&pic_id=$pic_id" ) ), ! 'U_PIC' => append_sid( this_smartor_mxurl( "smartor_mode=album_thumbnail&pic_id=$pic_id", true ) ), ! 'PIC_TITLE' => $thispic['pic_title'], ! 'PIC_DESC' => nl2br( $thispic['pic_desc'] ), ! 'POSTER' => $poster, ! 'PIC_TIME' => create_date( $board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone'] ), ! 'PIC_VIEW' => $thispic['pic_view_count'], ! 'PIC_COMMENTS' => $total_comments, ! 'S_MESSAGE' => $thiscomment['comment_text'], ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'L_PIC_DESC' => $lang['Pic_Desc'], ! 'L_POSTER' => $lang['Poster'], ! 'L_POSTED' => $lang['Posted'], ! 'L_VIEW' => $lang['View'], ! 'L_COMMENTS' => $lang['Comments'], ! 'L_POST_YOUR_COMMENT' => $lang['Post_your_comment'], ! 'L_MESSAGE' => $lang['Message'], ! 'L_USERNAME' => $lang['Username'], ! 'L_COMMENT_NO_TEXT' => $lang['Comment_no_text'], ! 'L_COMMENT_TOO_LONG' => $lang['Comment_too_long'], ! 'L_MAX_LENGTH' => $lang['Max_length'], ! 'S_MAX_LENGTH' => $album_config['desc_length'], ! 'L_SUBMIT' => $lang['Submit'], - 'S_ALBUM_ACTION' => append_sid( this_smartor_mxurl( "smartor_mode=album_comment_edit&comment_id=$comment_id" ) ) - ) - ); - // Generate the page ! $template->pparse( 'body' ); --- 220,271 ---- for ( $i = 1; $i < $smilies_count + 1; $i++ ) { ! $template->assign_block_vars( 'switch_comment_post.smilies', array( ! 'CODE' => $smilies_data[$i - 1]['code'], ! 'URL' => $phpbb_root_path . $board_config['smilies_path'] . '/' . $smilies_data[$i - 1]['smile_url'], ! 'DESC' => $smilies_data[$i - 1]['emoticon'] ! ) ); if ( is_integer( $i / 5 ) ) $template->assign_block_vars( 'switch_comment_post.smilies.new_col', array() ); } ! } // --- changed $thiscat to $thispic ! $template->assign_vars( array( ! 'CAT_TITLE' => $thispic['cat_title'], ! 'U_VIEW_CAT' => append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) ), ! // --- Album Category Hierarchy : end ! 'U_THUMBNAIL' => append_sid( this_smartor_mxurl( "smartor_mode=album_thumbnail&pic_id=$pic_id" ) ), ! 'U_PIC' => append_sid( this_smartor_mxurl( "smartor_mode=album_thumbnail&pic_id=$pic_id", true ) ), ! 'PIC_TITLE' => $thispic['pic_title'], ! 'PIC_DESC' => nl2br( $thispic['pic_desc'] ), ! 'POSTER' => $poster, ! 'PIC_TIME' => create_date( $board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone'] ), ! 'PIC_VIEW' => $thispic['pic_view_count'], ! 'PIC_COMMENTS' => $total_comments, ! 'S_MESSAGE' => $thiscomment['comment_text'], ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'L_PIC_DESC' => $lang['Pic_Desc'], ! 'L_POSTER' => $lang['Poster'], ! 'L_POSTED' => $lang['Posted'], ! 'L_VIEW' => $lang['View'], ! 'L_COMMENTS' => $lang['Comments'], ! 'L_POST_YOUR_COMMENT' => $lang['Post_your_comment'], ! 'L_MESSAGE' => $lang['Message'], ! 'L_USERNAME' => $lang['Username'], ! 'L_COMMENT_NO_TEXT' => $lang['Comment_no_text'], ! 'L_COMMENT_TOO_LONG' => $lang['Comment_too_long'], ! 'L_MAX_LENGTH' => $lang['Max_length'], ! 'S_MAX_LENGTH' => $album_config['desc_length'], ! 'L_SUBMIT' => $lang['Submit'], ! ! 'S_ALBUM_ACTION' => append_sid( this_smartor_mxurl( "smartor_mode=album_comment_edit&comment_id=$comment_id" ) ) ! )); // Generate the page ! $template->pparse( 'body' ); *************** *** 282,291 **** { mx_message_die( GENERAL_ERROR, $lang['Comment_no_text'] ); ! } // -------------------------------- // Prepare variables // -------------------------------- $comment_edit_time = time(); ! $comment_edit_user_id = $userdata['user_id']; // -------------------------------- // Update the DB --- 286,295 ---- { mx_message_die( GENERAL_ERROR, $lang['Comment_no_text'] ); ! } // -------------------------------- // Prepare variables // -------------------------------- $comment_edit_time = time(); ! $comment_edit_user_id = $userdata['user_id']; // -------------------------------- // Update the DB *************** *** 298,307 **** { mx_message_die( GENERAL_ERROR, 'Could not update comment data', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Complete... now send a message to user // -------------------------------- ! $template->assign_vars( array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid( this_smartor_mxurl( "smartor_mode=album_showpage&comment_id=$comment_id" ) ) . '#' . $comment_id . '">' ) ! ); $message = $lang['Stored'] . "<br /><br />" . sprintf( $lang['Click_view_message'], "<a href=\"" . append_sid( this_smartor_mxurl( "smartor_mode=album_showpage&comment_id=$comment_id" ) ) . "#$comment_id\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_album_index'], "<a href=\"" . append_sid( album_append_uid( this_smartor_mxurl() ) ) . "\">", "</a>" ); --- 302,310 ---- { mx_message_die( GENERAL_ERROR, 'Could not update comment data', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Complete... now send a message to user // -------------------------------- ! $template->assign_vars( array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid( this_smartor_mxurl( "smartor_mode=album_showpage&comment_id=$comment_id" ) ) . '#' . $comment_id . '">' ) ); $message = $lang['Stored'] . "<br /><br />" . sprintf( $lang['Click_view_message'], "<a href=\"" . append_sid( this_smartor_mxurl( "smartor_mode=album_showpage&comment_id=$comment_id" ) ) . "#$comment_id\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_album_index'], "<a href=\"" . append_sid( album_append_uid( this_smartor_mxurl() ) ) . "\">", "</a>" ); *************** *** 309,316 **** mx_message_die( GENERAL_MESSAGE, $message ); } - // +--------------------------------------------------------+ - // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | - // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003 | - // +--------------------------------------------------------+ - ?> \ No newline at end of file --- 312,314 ---- Index: album_modcp.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_modcp.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_modcp.php 5 Apr 2006 23:03:49 -0000 1.5 --- album_modcp.php 30 Jun 2006 21:10:55 -0000 1.6 *************** *** 8,16 **** * */ ! if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } // ------------------------------------ // Get the $pic_id from GET method then query out the category --- 8,22 ---- [...984 lines suppressed...] } @unlink( ALBUM_UPLOAD_PATH . $filerow[$i]['pic_filename'] ); ! } // Delete DB entry $sql = "DELETE FROM " . ALBUM_TABLE . " *************** *** 1039,1045 **** } } ! // +------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // +------------------------------------------------------+ ! ! ?> \ No newline at end of file --- 1042,1044 ---- } } ! ?> \ No newline at end of file Index: album_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_search.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_search.php 5 Apr 2006 23:03:49 -0000 1.4 --- album_search.php 30 Jun 2006 21:10:56 -0000 1.5 *************** *** 9,12 **** --- 9,17 ---- */ + // +-------------------------------------------------------------+ + // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | + // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003-2004 | + // +-------------------------------------------------------------+ + if ( !defined( 'IN_PORTAL' ) ) { *************** *** 20,27 **** } ! $template->set_filenames( array( 'body' => 'album_search_body.tpl' ) ); ! include_once( $module_root_path . 'album_mod/album_common.' . $phpEx ); // +-+-------------------------------------------------------+-+-+-+-+-+-+-+-+ if ( ( isset( $HTTP_POST_VARS['search'] ) || isset( $HTTP_GET_VARS['search'] ) ) && ( $HTTP_POST_VARS['search'] != '' || $HTTP_GET_VARS['search'] != '' ) ) --- 25,32 ---- } ! $template->set_filenames( array( 'body' => 'album_search_body.tpl' ) ); ! include_once( $module_root_path . 'album_mod/album_common.' . $phpEx ); // +-+-------------------------------------------------------+-+-+-+-+-+-+-+-+ if ( ( isset( $HTTP_POST_VARS['search'] ) || isset( $HTTP_GET_VARS['search'] ) ) && ( $HTTP_POST_VARS['search'] != '' || $HTTP_GET_VARS['search'] != '' ) ) *************** *** 50,54 **** $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_approval, c.cat_id, c.cat_title, c.cat_user_id FROM " . ALBUM_TABLE . ' AS p,' . ALBUM_CAT_TABLE . " AS c ! WHERE p.pic_approval = 1 AND " . $where . " LIKE '%" . $s . "%' AND p.pic_cat_id = c.cat_id OR p.pic_cat_id = 0 AND p.pic_approval = 1 AND " . $where . " LIKE '%" . $s . "%' ORDER BY p.pic_time DESC"; --- 55,59 ---- $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_approval, c.cat_id, c.cat_title, c.cat_user_id FROM " . ALBUM_TABLE . ' AS p,' . ALBUM_CAT_TABLE . " AS c ! WHERE p.pic_approval = 1 AND " . $where . " LIKE '%" . $s . "%' AND p.pic_cat_id = c.cat_id OR p.pic_cat_id = 0 AND p.pic_approval = 1 AND " . $where . " LIKE '%" . $s . "%' ORDER BY p.pic_time DESC"; *************** *** 69,83 **** $album_user_id = $row['cat_user_id']; $user_cat_root_id = album_get_personal_root_id( $album_user_id ); ! $template->assign_block_vars( 'switch_search_results.search_results', array( 'L_USERNAME' => $row['pic_username'], ! 'U_PROFILE' => append_sid( $phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $row['pic_user_id'] ), ! 'L_CAT' => ( $row['cat_user_id'] != ALBUM_PUBLIC_GALLERY ) ? 'User personal' : $row['cat_title'], ! 'U_CAT' => ( $row['cat_id'] == $user_cat_root_id ) ? append_sid( this_smartor_mxurl() ) : append_sid( this_smartor_mxurl( 'smartor_mode=album_cat&cat_id=' . $row['cat_id'] ) ), ! 'L_PIC' => $row['pic_title'], ! 'U_PIC' => append_sid( this_smartor_mxurl( 'smartor_mode=album_showpage&pic_id=' . $row['pic_id'] ) ), ! 'L_TIME' => create_date( $board_config['default_dateformat'], $row['pic_time'], $board_config['board_timezone'] ) ! ) ); $in[$numres] = $row['pic_id']; --- 74,89 ---- $album_user_id = $row['cat_user_id']; $user_cat_root_id = album_get_personal_root_id( $album_user_id ); ! $template->assign_block_vars( 'switch_search_results.search_results', array( ! 'L_USERNAME' => $row['pic_username'], ! 'U_PROFILE' => append_sid( $phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $row['pic_user_id'] ), ! 'L_CAT' => ( $row['cat_user_id'] != ALBUM_PUBLIC_GALLERY ) ? 'User personal' : $row['cat_title'], ! 'U_CAT' => ( $row['cat_id'] == $user_cat_root_id ) ? append_sid( this_smartor_mxurl() ) : append_sid( this_smartor_mxurl( 'smartor_mode=album_cat&cat_id=' . $row['cat_id'] ) ), ! 'L_PIC' => $row['pic_title'], ! 'U_PIC' => append_sid( this_smartor_mxurl( 'smartor_mode=album_showpage&pic_id=' . $row['pic_id'] ) ), ! 'L_TIME' => create_date( $board_config['default_dateformat'], $row['pic_time'], $board_config['board_timezone'] ) ! ) ); $in[$numres] = $row['pic_id']; *************** *** 87,96 **** while ( $row = $db->sql_fetchrow( $result ) ); ! $template->assign_vars( array( 'L_NRESULTS' => $numres, ! 'L_TCATEGORY' => 'Category', ! 'L_TTITLE' => 'Title', ! 'L_TSUBMITER' => 'Submiter', ! 'L_TSUBMITED' => 'Submited on' ! ) ); } else --- 93,103 ---- while ( $row = $db->sql_fetchrow( $result ) ); ! $template->assign_vars( array( ! 'L_NRESULTS' => $numres, ! 'L_TCATEGORY' => 'Category', ! 'L_TTITLE' => 'Title', ! 'L_TSUBMITER' => 'Submiter', ! 'L_TSUBMITED' => 'Submited on' ! ) ); } else *************** *** 102,106 **** { $template->assign_block_vars( 'switch_search', array() ); ! } // +-+-------------------------------------------------------+-+-+-+-+-+-+-+-+ $template->pparse( 'body' ); --- 109,113 ---- { $template->assign_block_vars( 'switch_search', array() ); ! } // +-+-------------------------------------------------------+-+-+-+-+-+-+-+-+ $template->pparse( 'body' ); *************** *** 108,116 **** { include( $phpbb_root_path . 'includes/page_tail.' . $phpEx ); ! } ! // +-------------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003-2004 | ! // +-------------------------------------------------------------+ ! ?> \ No newline at end of file --- 115,118 ---- { include( $phpbb_root_path . 'includes/page_tail.' . $phpEx ); ! } ?> \ No newline at end of file Index: album_delete.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_delete.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_delete.php 5 Apr 2006 23:03:49 -0000 1.5 --- album_delete.php 30 Jun 2006 21:10:55 -0000 1.6 *************** *** 8,12 **** * */ ! if ( !defined( 'IN_PORTAL' ) ) { --- 8,16 ---- * */ ! ! // +------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // +------------------------------------------------------+ ! if ( !defined( 'IN_PORTAL' ) ) { *************** *** 149,153 **** if ( !isset( $HTTP_POST_VARS['confirm'] ) ) ! { // -------------------------------- // If user give up deleting... --- 153,157 ---- if ( !isset( $HTTP_POST_VARS['confirm'] ) ) ! { // -------------------------------- // If user give up deleting... *************** *** 157,164 **** redirect( append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) ) ); exit; ! } ! // Start output of page ! $page_title = $lang['Album']; if ( !$is_block ) --- 161,168 ---- redirect( append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) ) ); exit; ! } ! // Start output of page ! $page_title = $lang['Album']; if ( !$is_block ) *************** *** 167,186 **** } ! $template->set_filenames( array( 'body' => 'confirm_body.tpl' ) ! ); ! $template->assign_vars( array( 'MESSAGE_TITLE' => $lang['Confirm'], ! 'MESSAGE_TEXT' => $lang['Album_delete_confirm'], ! 'L_NO' => $lang['No'], ! 'L_YES' => $lang['Yes'], - 'S_CONFIRM_ACTION' => append_sid( this_smartor_mxurl( "smartor_mode=album_delete&pic_id=$pic_id" ) ), - ) - ); - // Generate the page ! $template->pparse( 'body' ); --- 171,189 ---- } ! $template->set_filenames( array( 'body' => 'confirm_body.tpl' ) ); ! $template->assign_vars( array( ! 'MESSAGE_TITLE' => $lang['Confirm'], ! 'MESSAGE_TEXT' => $lang['Album_delete_confirm'], ! 'L_NO' => $lang['No'], ! 'L_YES' => $lang['Yes'], ! ! 'S_CONFIRM_ACTION' => append_sid( this_smartor_mxurl( "smartor_mode=album_delete&pic_id=$pic_id" ) ), ! )); // Generate the page ! $template->pparse( 'body' ); *************** *** 191,195 **** } else ! { // -------------------------------- // It's confirmed. First delete all comments --- 194,198 ---- } else ! { // -------------------------------- // It's confirmed. First delete all comments *************** *** 200,204 **** { mx_message_die( GENERAL_ERROR, 'Could not delete related comments', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Delete all ratings --- 203,207 ---- { mx_message_die( GENERAL_ERROR, 'Could not delete related comments', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Delete all ratings *************** *** 209,213 **** { mx_message_die( GENERAL_ERROR, 'Could not delete related ratings', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Delete cached thumbnail --- 212,216 ---- { mx_message_die( GENERAL_ERROR, 'Could not delete related ratings', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Delete cached thumbnail *************** *** 216,224 **** { @unlink( ALBUM_CACHE_PATH . $thispic['pic_thumbnail'] ); ! } // -------------------------------- // Delete File // -------------------------------- ! @unlink( ALBUM_UPLOAD_PATH . $thispic['pic_filename'] ); // -------------------------------- // Delete DB entry --- 219,227 ---- { @unlink( ALBUM_CACHE_PATH . $thispic['pic_thumbnail'] ); ! } // -------------------------------- // Delete File // -------------------------------- ! @unlink( ALBUM_UPLOAD_PATH . $thispic['pic_filename'] ); // -------------------------------- // Delete DB entry *************** *** 229,233 **** { mx_message_die( GENERAL_ERROR, 'Could not delete DB entry', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Complete... now send a message to user --- 232,236 ---- { mx_message_die( GENERAL_ERROR, 'Could not delete DB entry', '', __LINE__, __FILE__, $sql ); ! } // -------------------------------- // Complete... now send a message to user *************** *** 235,240 **** $message = $lang['Pics_deleted_successfully']; ! $template->assign_vars( array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) ) . '">' ) ! ); if ( $album_user_id == ALBUM_PUBLIC_GALLERY ) --- 238,242 ---- $message = $lang['Pics_deleted_successfully']; ! $template->assign_vars( array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid( album_append_uid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) ) . '">' ) ); if ( $album_user_id == ALBUM_PUBLIC_GALLERY ) *************** *** 251,257 **** mx_message_die( GENERAL_MESSAGE, $message ); } - // +------------------------------------------------------+ - // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | - // +------------------------------------------------------+ - ?> \ No newline at end of file --- 253,255 ---- Index: album_page.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_page.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** album_page.php 5 Apr 2006 23:03:49 -0000 1.5 --- album_page.php 30 Jun 2006 21:10:55 -0000 1.6 *************** *** 8,12 **** * */ ! if ( !defined( 'IN_PORTAL' ) ) { --- 8,17 ---- * */ ! ! // +-------------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003-2004 | ! // +-------------------------------------------------------------+ ! if ( !defined( 'IN_PORTAL' ) ) { *************** *** 170,174 **** } ! $template->set_filenames( array( 'body' => 'album_page_body.tpl' ) ); --- 175,179 ---- } ! $template->set_filenames( array( 'body' => 'album_page_body.tpl' ) ); *************** *** 182,220 **** } ! $template->assign_vars( array( 'CAT_TITLE' => $thiscat['cat_title'], ! 'U_VIEW_CAT' => ( $cat_id != PERSONAL_GALLERY ) ? append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) : append_sid( this_smartor_mxurl( "smartor_mode=album_personal&user_id=$user_id" ) ), ! ! 'U_PIC' => append_sid( this_smartor_mxurl( "smartor_mode=album_pic&pic_id=$pic_id" ) ), ! ! 'PIC_TITLE' => $thispic['pic_title'], ! 'PIC_DESC' => nl2br( $thispic['pic_desc'] ), ! ! 'POSTER' => $poster, ! ! 'PIC_TIME' => create_date( $board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone'] ), ! ! 'PIC_VIEW' => $thispic['pic_view_count'], ! 'PIC_RATING' => ( $thispic['rating'] != 0 ) ? round( $thispic['rating'], 2 ) : $lang['Not_rated'], ! 'PIC_COMMENTS' => $thispic['comments'], ! 'U_RATE' => append_sid( this_smartor_mxurl( "smartor_mode=album_rate&pic_id=$pic_id" ) ), ! 'U_COMMENT' => append_sid( this_smartor_mxurl( "smartor_mode=album_comment&pic_id=$pic_id" ) ), ! 'U_NEXT' => append_sid( this_smartor_mxurl( "smartor_mode=album_page&pic_id=$pic_id&mode=next" ) ), ! 'U_PREVIOUS' => append_sid( this_smartor_mxurl( "smartor_mode=album_page&pic_id=$pic_id&mode=previous" ) ), ! 'L_NEXT' => $lang['Next'], ! 'L_PREVIOUS' => $lang['Previous'], ! 'L_RATING' => $lang['Rating'], ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'L_PIC_DESC' => $lang['Pic_Desc'], ! 'L_POSTER' => $lang['Poster'], ! 'L_POSTED' => $lang['Posted'], ! 'L_VIEW' => $lang['View'], ! 'L_COMMENTS' => $lang['Comments'] ) ! ); if ( $album_config['rate'] ) --- 187,221 ---- } ! $template->assign_vars( array( ! 'CAT_TITLE' => $thiscat['cat_title'], ! 'U_VIEW_CAT' => ( $cat_id != PERSONAL_GALLERY ) ? append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id" ) ) : append_sid( this_smartor_mxurl( "smartor_mode=album_personal&user_id=$user_id" ) ), ! 'U_PIC' => append_sid( this_smartor_mxurl( "smartor_mode=album_pic&pic_id=$pic_id" ) ), ! 'PIC_TITLE' => $thispic['pic_title'], ! 'PIC_DESC' => nl2br( $thispic['pic_desc'] ), ! 'POSTER' => $poster, ! 'PIC_TIME' => create_date( $board_config['default_dateformat'], $thispic['pic_time'], $board_config['board_timezone'] ), ! 'PIC_VIEW' => $thispic['pic_view_count'], ! 'PIC_RATING' => ( $thispic['rating'] != 0 ) ? round( $thispic['rating'], 2 ) : $lang['Not_rated'], ! 'PIC_COMMENTS' => $thispic['comments'], ! 'U_RATE' => append_sid( this_smartor_mxurl( "smartor_mode=album_rate&pic_id=$pic_id" ) ), ! 'U_COMMENT' => append_sid( this_smartor_mxurl( "smartor_mode=album_comment&pic_id=$pic_id" ) ), ! 'U_NEXT' => append_sid( this_smartor_mxurl( "smartor_mode=album_page&pic_id=$pic_id&mode=next" ) ), ! 'U_PREVIOUS' => append_sid( this_smartor_mxurl( "smartor_mode=album_page&pic_id=$pic_id&mode=previous" ) ), ! 'L_NEXT' => $lang['Next'], ! 'L_PREVIOUS' => $lang['Previous'], ! 'L_RATING' => $lang['Rating'], ! 'L_PIC_TITLE' => $lang['Pic_Title'], ! 'L_PIC_DESC' => $lang['Pic_Desc'], ! 'L_POSTER' => $lang['Poster'], ! 'L_POSTED' => $lang['Posted'], ! 'L_VIEW' => $lang['View'], ! 'L_COMMENTS' => $lang['Comments'] ) ! ); if ( $album_config['rate'] ) *************** *** 236,242 **** include( $mx_root_path . 'includes/page_tail.' . $phpEx ); } - // +------------------------------------------------------+ - // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | - // +------------------------------------------------------+ - ?> \ No newline at end of file --- 237,239 ---- Index: album_pic.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_pic.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** album_pic.php 5 Apr 2006 23:03:49 -0000 1.4 --- album_pic.php 30 Jun 2006 21:10:56 -0000 1.5 *************** *** 8,12 **** * */ ! if ( !defined( 'IN_PORTAL' ) ) { --- 8,17 ---- * */ ! ! // +-------------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003-2004 | ! // +-------------------------------------------------------------+ ! if ( !defined( 'IN_PORTAL' ) ) { *************** *** 16,22 **** if ( defined( 'ALBUM_SP_CONFIG_TABLE' ) ) { ! // // Function for watermark ! // function mergePics( $sourcefile, $insertfile, $pos = 0, $transition = 50, $filetype ) { --- 21,27 ---- if ( defined( 'ALBUM_SP_CONFIG_TABLE' ) ) { ! // // Function for watermark ! // function mergePics( $sourcefile, $insertfile, $pos = 0, $transition = 50, $filetype ) { *************** *** 24,28 **** switch ( $filetype ) ! { // GIF support case '.gif': --- 29,33 ---- switch ( $filetype ) ! { // GIF support case '.gif': *************** *** 37,41 **** default: break; ! } // Get the size of both pics $sourcefile_width = imageSX( $sourcefile_id ); --- 42,46 ---- default: break; ! } // Get the size of both pics $sourcefile_width = imageSX( $sourcefile_id ); *************** *** 92,101 **** default: break; ! } // Merge the two pix ! imageCopyMerge( $sourcefile_id, $insertfile_id, $dest_x, $dest_y, 0, 0, $insertfile_width, $insertfile_height, $transition ); // Create the final image switch ( $filetype ) ! { // GIF support case '.gif': --- 97,106 ---- default: break; ! } // Merge the two pix ! imageCopyMerge( $sourcefile_id, $insertfile_id, $dest_x, $dest_y, 0, 0, $insertfile_width, $insertfile_height, $transition ); // Create the final image switch ( $filetype ) ! { // GIF support case '.gif': *************** *** 113,120 **** ImageDestroy( $sourcefile_id ); ! } ! // // END: Function for watermark ! // } // ------------------------------------ --- 118,125 ---- ImageDestroy( $sourcefile_id ); ! } ! // // END: Function for watermark ! // } // ------------------------------------ *************** *** 135,195 **** /* ! // ------------------------------------ ! // Get this pic info ! // ------------------------------------ ! $sql = "SELECT * ! FROM ". ALBUM_TABLE ." ! WHERE pic_id = '$pic_id'"; ! if( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); ! } ! $thispic = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! $cat_id = $thispic['pic_cat_id']; ! $user_id = $thispic['pic_user_id']; ! $pic_filetype = substr($thispic['pic_filename'], strlen($thispic['pic_filename']) - 4, 4); ! $pic_filename = $thispic['pic_filename']; ! $pic_thumbnail = $thispic['pic_thumbnail']; ! if( empty($thispic) or !file_exists(ALBUM_UPLOAD_PATH . $pic_filename) ) ! { ! mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist']); ! } ! // ------------------------------------ ! // Get the current Category Info ! // ------------------------------------ ! if( $cat_id != PERSONAL_GALLERY ) ! { ! $sql = "SELECT * ! FROM ". ALBUM_CAT_TABLE ." ! WHERE cat_id = '$cat_id'"; ! if( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); ! } ! $thiscat = $db->sql_fetchrow($result); ! } ! else ! { ! $thiscat = init_personal_gallery_cat($user_id); ! } ! if( empty($thiscat) ) ! { ! mx_message_die(GENERAL_MESSAGE, $lang['Category_not_exist']); ! } ! // ------------------------------------ ! // Check the permissions ! // ------------------------------------ ! $album_user_access = album_user_access($cat_id, $thiscat, 1, 0, 0, 0, 0, 0); // VIEW */ // --- Album category Hierarchy : begin --- 140,200 ---- /* ! // ------------------------------------ ! // Get this pic info ! // ------------------------------------ ! $sql = "SELECT * ! FROM ". ALBUM_TABLE ." ! WHERE pic_id = '$pic_id'"; ! if( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); ! } ! $thispic = $db->sql_fetchrow($result); ! $db->sql_freeresult($result); ! $cat_id = $thispic['pic_cat_id']; ! $user_id = $thispic['pic_user_id']; ! $pic_filetype = substr($thispic['pic_filename'], strlen($thispic['pic_filename']) - 4, 4); ! $pic_filename = $thispic['pic_filename']; ! $pic_thumbnail = $thispic['pic_thumbnail']; ! if( empty($thispic) or !file_exists(ALBUM_UPLOAD_PATH . $pic_filename) ) ! { ! mx_message_die(GENERAL_MESSAGE, $lang['Pic_not_exist']); ! } ! // ------------------------------------ ! // Get the current Category Info ! // ------------------------------------ ! if( $cat_id != PERSONAL_GALLERY ) ! { ! $sql = "SELECT * ! FROM ". ALBUM_CAT_TABLE ." ! WHERE cat_id = '$cat_id'"; ! if( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); ! } ! $thiscat = $db->sql_fetchrow($result); ! } ! else ! { ! $thiscat = init_personal_gallery_cat($user_id); ! } ! if( empty($thiscat) ) ! { ! mx_message_die(GENERAL_MESSAGE, $lang['Category_not_exist']); ! } ! // ------------------------------------ ! // Check the permissions ! // ------------------------------------ ! $album_user_access = album_user_access($cat_id, $thiscat, 1, 0, 0, 0, 0, 0); // VIEW */ // --- Album category Hierarchy : begin *************** *** 221,225 **** { mx_message_die( GENERAL_MESSAGE, $lang['Pic_not_exist'] ); ! } // ------------------------------------ // Check the permissions --- 226,230 ---- { mx_message_die( GENERAL_MESSAGE, $lang['Pic_not_exist'] ); ! } // ------------------------------------ // Check the permissions *************** *** 230,234 **** { mx_message_die( GENERAL_MESSAGE, $lang['Not_Authorised'] ); ! } // ------------------------------------ // Check Pic Approval --- 235,239 ---- { mx_message_die( GENERAL_MESSAGE, $lang['Not_Authorised'] ); ! } // ------------------------------------ // Check Pic Approval *************** *** 243,247 **** } } ! } // --- Album category Hierarchy : end // ------------------------------------ --- 248,252 ---- } } ! } // --- Album category Hierarchy : end // ------------------------------------ *************** *** 280,298 **** } ! /* ! +---------------------------------------------------------- ! | Main work here... ! +---------------------------------------------------------- ! */ // ------------------------------------ // Increase view counter // ------------------------------------ ! $sql = "UPDATE " . ALBUM_TABLE . " ! SET pic_view_count = pic_view_count + 1 WHERE pic_id = '$pic_id'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not update pic information', '', __LINE__, __FILE__, $sql ); ! } // ------------------------------------ // Okay, now we can send image to the browser --- 285,303 ---- } ! /* ! +---------------------------------------------------------- ! | Main work here... ! +---------------------------------------------------------- ! */ // ------------------------------------ // Increase view counter // ------------------------------------ ! $sql = "UPDATE " . ALBUM_TABLE . " ! SET pic_view_count = pic_view_count + 1 WHERE pic_id = '$pic_id'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not update pic information', '', __LINE__, __FILE__, $sql ); ! } // ------------------------------------ // Okay, now we can send image to the browser *************** *** 347,355 **** readfile( ALBUM_UPLOAD_PATH . $thispic['pic_filename'] ); ! exit; ! // +--------------------------------------------------------+ ! // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | ! // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003 | ! // +--------------------------------------------------------+ ! ! ?> \ No newline at end of file --- 352,355 ---- readfile( ALBUM_UPLOAD_PATH . $thispic['pic_filename'] ); ! exit; ! ?> \ No newline at end of file Index: album_cat_sort.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_cat_sort.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** album_cat_sort.php 18 Jun 2006 10:47:56 -0000 1.7 --- album_cat_sort.php 30 Jun 2006 21:10:55 -0000 1.8 *************** *** 9,12 **** --- 9,17 ---- */ + // +--------------------------------------------------------+ + // | Powered by Photo Album 2.x.x (c) 2002-2003 Smartor | + // | with Volodymyr (CLowN) Skoryk's Service Pack 1 © 2003 | + // +--------------------------------------------------------+ + define( 'IN_PORTAL', true ); $mx_root_path = '../'; *************** *** 157,163 **** for ( $i = 0; $i < ( count( $auth_data ) - 1 ); $i++ ) // ignore MODERATOR in this loop { ! // we should skip a loop if RATE and COMMENT is disabled ! if ( ( ( $album_config['rate'] == 0 ) and ( $auth_key[$i] == 'rate' ) ) or ( ( $album_config['comment'] == 0 ) and ( $auth_key[$i] == 'comment' ) ) ) { --- 162,168 ---- for ( $i = 0; $i < ( count( $auth_data ) - 1 ); $i++ ) // ignore MODERATOR in this loop { ! // // we should skip a loop if RATE and COMMENT is disabled ! // if ( ( ( $album_config['rate'] == 0 ) and ( $auth_key[$i] == 'rate' ) ) or ( ( $album_config['comment'] == 0 ) and ( $auth_key[$i] == 'comment' ) ) ) { *************** *** 168,172 **** --- 173,180 ---- $auth_list .= '<br />'; } + + // // add Moderator Control Panel here + // if ( ( $userdata['user_level'] == ADMIN ) or ( $auth_data['moderator'] == 1 ) ) { *************** *** 391,409 **** { $approval_mode = ( $picrow[$j]['pic_approval'] == 0 ) ? 'approval' : 'unapproval'; - $approval_link = '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_modcp&mode=$approval_mode&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">'; - $approval_link .= ( $picrow[$j]['pic_approval'] == 0 ) ? '<b>' . $lang['Approve'] . '</b>' : $lang['Unapprove']; - $approval_link .= '</a>'; } } ! $template->assign_block_vars( 'picrow.piccol', array( 'U_PIC' => ( $album_config['fullpic_popup'] ) ? append_sid( this_smartor_mxurl( "smartor_mode=album_pic&pic_id=" . $picrow[$j]['pic_id'] ) ) : append_sid( this_smartor_mxurl( "smartor_mode=album_page&pic_id=" . $picrow[$j]['pic_id'] ) ), ! 'THUMBNAIL' => append_sid( this_smartor_mxurl( "smartor_mode=album_thumbnail&pic_id=" . $picrow[$j]['pic_id'] ) ), ! 'DESC' => $picrow[$j]['pic_desc'], ! 'APPROVAL' => $approval_link, ! ) ! ); if ( ( $picrow[$j]['user_id'] == ALBUM_GUEST ) or ( $picrow[$j]['username'] == '' ) ) --- 399,414 ---- { $approval_mode = ( $picrow[$j]['pic_approval'] == 0 ) ? 'approval' : 'unapproval'; $approval_link = '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_modcp&mode=$approval_mode&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">'; $approval_link .= ( $picrow[$j]['pic_approval'] == 0 ) ? '<b>' . $lang['Approve'] . '</b>' : $lang['Unapprove']; $approval_link .= '</a>'; } } ! $template->assign_block_vars( 'picrow.piccol', array( ! 'U_PIC' => ( $album_config['fullpic_popup'] ) ? append_sid( this_smartor_mxurl( "smartor_mode=album_pic&pic_id=" . $picrow[$j]['pic_id'] ) ) : append_sid( this_smartor_mxurl( "smartor_mode=album_page&pic_id=" . $picrow[$j]['pic_id'] ) ), ! 'THUMBNAIL' => append_sid( this_smartor_mxurl( "smartor_mode=album_thumbnail&pic_id=" . $picrow[$j]['pic_id'] ) ), ! 'DESC' => $picrow[$j]['pic_desc'], ! 'APPROVAL' => $approval_link, ! )); if ( ( $picrow[$j]['user_id'] == ALBUM_GUEST ) or ( $picrow[$j]['username'] == '' ) ) *************** *** 416,447 **** } ! $template->assign_block_vars( 'picrow.pic_detail', array( 'TITLE' => $picrow[$j]['pic_title'], ! 'POSTER' => $pic_poster, ! 'TIME' => create_date( $board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone'] ), ! ! 'VIEW' => $picrow[$j]['pic_view_count'], ! ! 'RATING' => ( $album_config['rate'] == 1 ) ? ( '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_rate&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Rating'] . '</a> : ' . $picrow[$j]['rating'] . '<br />' ) : '', ! ! 'COMMENTS' => ( $album_config['comment'] == 1 ) ? ( '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_comment&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Comments'] . '</a> : ' . $picrow[$j]['comments'] . '<br />' ) : '', ! ! 'EDIT' => ( ( $auth_data['edit'] and ( $picrow[$j]['pic_user_id'] == $userdata['user_id'] ) ) or ( $auth_data['moderator'] and ( $thiscat['cat_edit_level'] != ALBUM_ADMIN ) ) or ( $userdata['user_level'] == ADMIN ) ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_edit&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Edit_pic'] . '</a>' : '', ! ! 'DELETE' => ( ( $auth_data['delete'] and ( $picrow[$j]['pic_user_id'] == $userdata['user_id'] ) ) or ( $auth_data['moderator'] and ( $thiscat['cat_delete_level'] != ALBUM_ADMIN ) ) or ( $userdata['user_level'] == ADMIN ) ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_delete&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Delete_pic'] . '</a>' : '', ! ! 'MOVE' => ( $auth_data['moderator'] ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_modcp&mode=move&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Move'] . '</a>' : '', ! ! 'LOCK' => ( $auth_data['moderator'] ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_modcp&mode=" . ( ( $picrow[$j]['pic_lock'] == 0 ) ? 'lock' : 'unlock' ) . "&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . ( ( $picrow[$j]['pic_lock'] == 0 ) ? $lang['Lock'] : $lang['Unlock'] ) . '</a>' : '', ! ! 'IP' => ( $userdata['user_level'] == ADMIN ) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip( $picrow[$j]['pic_user_ip'] ) . '" target="_blank">' . decode_ip( $picrow[$j]['pic_user_ip'] ) . '</a><br />' : '' ! ) ! ); } } // (watch out Jaime's Initials Mod includes $initial in the pagination link) ! $template->assign_vars( array( 'PAGINATION' => generate_pagination( append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id&sort_method=$sort_method&sort_order=$sort_order&initial=" . ( ( isset( $HTTP_GET_VARS['initial'] ) ) ? ( $HTTP_GET_VARS['initial'] ) : 'all' ) ) ), $total_pics, $pics_per_page, $start ), ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $pics_per_page ) + 1 ), ceil( $total_pics / $pics_per_page ) ) ! ) ! ); } else --- 421,444 ---- } ! $template->assign_block_vars( 'picrow.pic_detail', array( ! 'TITLE' => $picrow[$j]['pic_title'], ! 'POSTER' => $pic_poster, ! 'TIME' => create_date( $board_config['default_dateformat'], $picrow[$j]['pic_time'], $board_config['board_timezone'] ), ! 'VIEW' => $picrow[$j]['pic_view_count'], ! 'RATING' => ( $album_config['rate'] == 1 ) ? ( '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_rate&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Rating'] . '</a> : ' . $picrow[$j]['rating'] . '<br />' ) : '', ! 'COMMENTS' => ( $album_config['comment'] == 1 ) ? ( '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_comment&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Comments'] . '</a> : ' . $picrow[$j]['comments'] . '<br />' ) : '', ! 'EDIT' => ( ( $auth_data['edit'] and ( $picrow[$j]['pic_user_id'] == $userdata['user_id'] ) ) or ( $auth_data['moderator'] and ( $thiscat['cat_edit_level'] != ALBUM_ADMIN ) ) or ( $userdata['user_level'] == ADMIN ) ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_edit&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Edit_pic'] . '</a>' : '', ! 'DELETE' => ( ( $auth_data['delete'] and ( $picrow[$j]['pic_user_id'] == $userdata['user_id'] ) ) or ( $auth_data['moderator'] and ( $thiscat['cat_delete_level'] != ALBUM_ADMIN ) ) or ( $userdata['user_level'] == ADMIN ) ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_delete&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Delete_pic'] . '</a>' : '', ! 'MOVE' => ( $auth_data['moderator'] ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_modcp&mode=move&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . $lang['Move'] . '</a>' : '', ! 'LOCK' => ( $auth_data['moderator'] ) ? '<a href="' . append_sid( this_smartor_mxurl( "smartor_mode=album_modcp&mode=" . ( ( $picrow[$j]['pic_lock'] == 0 ) ? 'lock' : 'unlock' ) . "&pic_id=" . $picrow[$j]['pic_id'] ) ) . '">' . ( ( $picrow[$j]['pic_lock'] == 0 ) ? $lang['Lock'] : $lang['Unlock'] ) . '</a>' : '', ! 'IP' => ( $userdata['user_level'] == ADMIN ) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip( $picrow[$j]['pic_user_ip'] ) . '" target="_blank">' . decode_ip( $picrow[$j]['pic_user_ip'] ) . '</a><br />' : '' ! )); } } // (watch out Jaime's Initials Mod includes $initial in the pagination link) ! $template->assign_vars( array( ! 'PAGINATION' => generate_pagination( append_sid( this_smartor_mxurl( "smartor_mode=album_cat&cat_id=$cat_id&sort_method=$sort_method&sort_order=$sort_order&initial=" . ( ( isset( $HTTP_GET_VARS['initial'] ) ) ? ( $HTTP_GET_VARS['initial'] ) : 'all' ) ) ), $total_pics, $pics_per_page, $start ), ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $pics_per_page ) + 1 ), ceil( $total_pics / $pics_per_page ) ) ! )); } else *************** *** 535,596 **** } ... [truncated message content] |