https://www.icyphoenix.com/viewtopic.php?f=26&t=2335 ----------------------------------- Artie Fri 22 Jun, 2007 03:27 FAP CUSTOMIZATION - [MOD] Pic comment notification ----------------------------------- Features of Mod Pic Comment Notification. [list][*]Provides pic poster, during pic upload, the option to receive email notifications of comments made to pic. [*]Provides registered users the ability to start or stop comment notification when viewing pic. [*]Provides a URL in the email notification to stop watching the pic for comments. [/list] I've done some preliminary testing of this mod, on both Icy Phoenix and the standard pbpBB w/FAP, and it appears to function without errors. ----------------------------------- felix968 Fri 22 Jun, 2007 08:05 Re: [MOD] Pic Comment Notification ----------------------------------- That's a wonderful mod, great shot from ARTIE. I think 's the best mod for FAP. Thank you Artie! ----------------------------------- lefty74 Fri 22 Jun, 2007 18:11 Re: [MOD] Pic Comment Notification ----------------------------------- That's excellent Artie, thanks very much! Will definitely install that one! ----------------------------------- Mighty Gorgon Wed 27 Jun, 2007 02:42 Re: [MOD] Pic comment notification ----------------------------------- Another great shoot... I've added it on FAP and on this site. ----------------------------------- KugeLSichA Sat 30 Jun, 2007 10:21 Re: [MOD] Pic comment notification ----------------------------------- great work Artie. I love it. thx ----------------------------------- TheSteffen Tue 03 Jul, 2007 13:18 Re: [MOD] Pic comment notification ----------------------------------- [quote user="KugeLSichA" post="17139"]great work Artie. I love it. thx[/quote] Me too, thanks Artie ----------------------------------- mipavluk Tue 11 Sep, 2007 16:46 Re: [MOD] Pic Comment Notification ----------------------------------- Hi Artie. I install this mod today.... and I obtain this error: Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/golfplea/public_html/scrapperszone/Forum/album_showpage.php on line 1225 Can you help me please? Thanks in advance! [code] 0)) || (isset($_POST['slideshow']) && (intval($_POST['slideshow']) > 0))) { $gen_simple_header = true; $show_template = 'album_slideshow_body.tpl'; $nuffimage_pic = ( $picm == false ) ? 'album_pic.' : 'album_picm.'; } else { //$show_template = 'album_showpage_body.tpl'; if ( (isset($_GET['nuffimage']) || isset($_POST['nuffimage'])) & ($album_config['enable_nuffimage'] == 1) ) { include($album_root_path . 'album_nuffimage_box.' . $phpEx); $template->assign_var_from_handle('NUFFIMAGE_BOX', 'nuffimage_box'); $show_template = 'album_pic_nuffed_body.tpl'; $nuffimage_vars = '&nuffimage=true'; $nuffimage_pic = 'album_pic_nuffed.'; $nuff_http_full_string = $nuff_http['full_string']; $template->assign_block_vars('disable_pic_nuffed', array( 'L_PIC_UNNUFFED_CLICK' => $lang['Nuff_UnClick'], 'U_PIC_UNNUFFED_CLICK' => append_sid(album_append_uid('album_showpage.' . $phpEx . '?pic_id=' . $pic_id . $full_size_param)), ) ); } else { $show_template = 'album_showpage_body.tpl'; $nuffimage_vars = ''; $nuffimage_pic = ( $picm == false ) ? 'album_pic.' : 'album_picm.'; $nuff_http_full_string = ''; } } // ------------------------------------ // PREVIOUS & NEXT // ------------------------------------ if( isset($_GET['mode']) ) { //if( ($_GET['mode'] == 'next') && ($no_next_pic == false) ) if($_GET['mode'] == 'next') { //$pic_id = $next_pic_id[0]; $sql_where = 'AND n.pic_id > c.pic_id'; $sql_order = 'ORDER BY n.pic_id ASC LIMIT 1'; } //if( ($_GET['mode'] == 'prev') && ($no_prev_pic == false) ) if($_GET['mode'] == 'prev') { //$pic_id = $prev_pic_id[0]; $sql_where = 'AND n.pic_id < c.pic_id'; $sql_order = 'ORDER BY n.pic_id DESC LIMIT 1'; } $sql = "SELECT n.pic_id, n.pic_cat_id, n.pic_user_id, n.pic_time FROM ". ALBUM_TABLE ." as n, ". ALBUM_TABLE ." AS c WHERE c.pic_id = $pic_id $sql_where AND n.pic_cat_id = c.pic_cat_id $sql_order"; } else { $sql = "SELECT pic_id, pic_cat_id, pic_user_id, pic_time FROM ". ALBUM_TABLE ." WHERE pic_id = $pic_id"; } if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); if( empty($row) ) { message_die(GENERAL_ERROR, $lang['Pic_not_exist']); } $pic_id_old = $pic_id; $pic_id_tmp = $row['pic_id']; $pic_cat_id_tmp = $row['pic_cat_id']; $pic_time_tmp = $row['pic_time']; $pic_user_id_tmp = $row['pic_user_id']; $db->sql_freeresult($result); if( isset($_GET['mode']) ) { if ( ($_GET['mode'] == 'next') || ($_GET['mode'] == 'prev') ) { $pic_id = $pic_id_tmp; } } if ($album_config['show_pics_nav'] == 1) { $template->assign_block_vars('pics_nav', array( 'L_PICS_NAV' => $lang['Pics_Nav'], 'L_PICS_NAV_NEXT' => $lang['Pics_Nav_Next'], 'L_PICS_NAV_PREV' => $lang['Pics_Nav_Prev'], ) ); } // NEXT $sql = "SELECT a.* FROM " . ALBUM_TABLE . " AS a WHERE a.pic_id > " . $pic_id_tmp . " AND a.pic_cat_id = " . $pic_cat_id_tmp . " AND a.pic_approval = 1 ORDER BY pic_id ASC LIMIT 2"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } //$row = $db->sql_fetchrow($result); $next_pic_count = $db->sql_numrows($result); $next_pic_rows = $db->sql_fetchrowset($result); $db->sql_freeresult($result); if ($next_pic_count == 0) { $no_next_pic = true; $sql = "SELECT a.* FROM " . ALBUM_TABLE . " AS a WHERE a.pic_cat_id = " . $pic_cat_id_tmp . " AND a.pic_approval = 1 ORDER BY pic_id ASC LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $first_pic_id = $row['pic_id']; $db->sql_freeresult($result); } else { $no_next_pic = false; if ( $album_config['invert_nav_arrows'] == 0 ) { for($i = $next_pic_count - 1; $i >= 0; $i--) { $next_pic_id[$i] = $next_pic_rows[$i]['pic_id']; $thumbnail_file = append_sid(album_append_uid('album_thumbnail.' . $phpEx . '?pic_id=' . $next_pic_id[$i])); if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) { $pic_filename = $next_pic_rows[$i]['pic_filename']; $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); $pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $next_pic_rows[$i]['pic_thumbnail']; //$pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $next_pic_rows[$i]['pic_thumbnail']; $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; if ( file_exists($pic_thumbnail_fullpath) ) { $thumbnail_file = $pic_thumbnail_fullpath; } } if ($album_config['lb_preview'] == 0) { $pic_preview = ''; } else { $pic_preview = 'onmouseover="showtrail(''. append_sid(album_append_uid('album_picm.' . $phpEx . '?pic_id=' . $next_pic_rows[$i]['pic_id'])) . '','' . addslashes($next_pic_rows[$i]['pic_title']) . '', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } if ($album_config['show_pics_nav'] == 1) { $template->assign_block_vars('pics_nav.next', array( 'U_PICS_THUMB' => $thumbnail_file, 'U_PICS_LINK' => append_sid(album_append_uid('album_showpage.' . $phpEx . '?pic_id=' . $next_pic_id[$i] . $full_size_param . $nuffimage_vars)), 'PIC_PREVIEW' => $pic_preview, ) ); } } } else { for($i = 0; $i < $next_pic_count; $i++) { $next_pic_id[$i] = $next_pic_rows[$i]['pic_id']; $thumbnail_file = append_sid(album_append_uid('album_thumbnail.' . $phpEx . '?pic_id=' . $next_pic_id[$i])); if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) { $pic_filename = $next_pic_rows[$i]['pic_filename']; $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); $pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $next_pic_rows[$i]['pic_thumbnail']; //$pic_thumbnail = ( $next_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $next_pic_rows[$i]['pic_thumbnail']; $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; if ( file_exists($pic_thumbnail_fullpath) ) { $thumbnail_file = $pic_thumbnail_fullpath; } } if ($album_config['lb_preview'] == 0) { $pic_preview = ''; } else { $pic_preview = 'onmouseover="showtrail(''. append_sid(album_append_uid('album_picm.' . $phpEx . '?pic_id=' . $next_pic_rows[$i]['pic_id'])) . '','' . addslashes($next_pic_rows[$i]['pic_title']) . '', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } if ($album_config['show_pics_nav'] == 1) { $template->assign_block_vars('pics_nav.prev', array( 'U_PICS_THUMB' => $thumbnail_file, 'U_PICS_LINK' => append_sid(album_append_uid('album_showpage.' . $phpEx . '?pic_id=' . $next_pic_id[$i] . $full_size_param . $nuffimage_vars)), 'PIC_PREVIEW' => $pic_preview, ) ); } } } } //PREV $sql = "SELECT a.* FROM " . ALBUM_TABLE . " AS a WHERE a.pic_id < " . $pic_id_tmp . " AND a.pic_cat_id = " . $pic_cat_id_tmp . " AND a.pic_approval = 1 ORDER BY pic_id DESC LIMIT 2"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } //$row = $db->sql_fetchrow($result); $prev_pic_count = $db->sql_numrows($result); $prev_pic_rows = $db->sql_fetchrowset($result); $db->sql_freeresult($result); if ($prev_pic_count == 0) { $no_prev_pic = true; $sql = "SELECT a.* FROM " . ALBUM_TABLE . " AS a WHERE a.pic_cat_id = " . $pic_cat_id_tmp . " AND a.pic_approval = 1 ORDER BY pic_id DESC LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $last_pic_id = $row['pic_id']; $db->sql_freeresult($result); } else { $no_prev_pic = false; if ( $album_config['invert_nav_arrows'] == 0 ) { for($i = 0; $i < $prev_pic_count; $i++) { $prev_pic_id[$i] = $prev_pic_rows[$i]['pic_id']; $thumbnail_file = append_sid(album_append_uid('album_thumbnail.' . $phpEx . '?pic_id=' . $prev_pic_id[$i])); if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) { $pic_filename = $prev_pic_rows[$i]['pic_filename']; $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); $pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $prev_pic_rows[$i]['pic_thumbnail']; //$pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $prev_pic_rows[$i]['pic_thumbnail']; $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; if ( file_exists($pic_thumbnail_fullpath) ) { $thumbnail_file = $pic_thumbnail_fullpath; } } if ($album_config['lb_preview'] == 0) { $pic_preview = ''; } else { $pic_preview = 'onmouseover="showtrail(''. append_sid(album_append_uid('album_picm.' . $phpEx . '?pic_id=' . $prev_pic_rows[$i]['pic_id'])) . '','' . addslashes($prev_pic_rows[$i]['pic_title']) . '', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } if ($album_config['show_pics_nav'] == 1) { $template->assign_block_vars('pics_nav.prev', array( 'U_PICS_THUMB' => $thumbnail_file, 'U_PICS_LINK' => append_sid(album_append_uid('album_showpage.' . $phpEx . '?pic_id=' . $prev_pic_id[$i] . $full_size_param . $nuffimage_vars)), 'PIC_PREVIEW' => $pic_preview, ) ); } } } else { for($i = $prev_pic_count - 1; $i >= 0; $i--) { $prev_pic_id[$i] = $prev_pic_rows[$i]['pic_id']; $thumbnail_file = append_sid(album_append_uid('album_thumbnail.' . $phpEx . '?pic_id=' . $prev_pic_id[$i])); if ( ($album_config['thumbnail_cache'] == true) && ($album_config['quick_thumbs'] == true) ) { $pic_filename = $prev_pic_rows[$i]['pic_filename']; $pic_filetype = strtolower(substr($pic_filename, strlen($pic_filename) - 4, 4)); $pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? md5($pic_filename) . $pic_filetype : $prev_pic_rows[$i]['pic_thumbnail']; //$pic_thumbnail = ( $prev_pic_rows[$i]['pic_thumbnail'] == '' ) ? $pic_filename : $prev_pic_rows[$i]['pic_thumbnail']; $pic_thumbnail_fullpath = ALBUM_CACHE_PATH . $pic_thumbnail; if ( file_exists($pic_thumbnail_fullpath) ) { $thumbnail_file = $pic_thumbnail_fullpath; } } if ($album_config['lb_preview'] == 0) { $pic_preview = ''; } else { $pic_preview = 'onmouseover="showtrail(''. append_sid(album_append_uid('album_picm.' . $phpEx . '?pic_id=' . $prev_pic_rows[$i]['pic_id'])) . '','' . addslashes($prev_pic_rows[$i]['pic_title']) . '', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } if ($album_config['show_pics_nav'] == 1) { $template->assign_block_vars('pics_nav.next', array( 'U_PICS_THUMB' => $thumbnail_file, 'U_PICS_LINK' => append_sid(album_append_uid('album_showpage.' . $phpEx . '?pic_id=' . $prev_pic_id[$i] . $full_size_param . $nuffimage_vars)), 'PIC_PREVIEW' => $pic_preview, ) ); } } } } // ------------------------------------ // IMAGES ARRAY // SLIDESHOW SCRIPTS // ------------------------------------ if ( $album_config['slideshow_script'] == 1 ) { $template->assign_block_vars('switch_slideshow_scripts', array()); $pic_link = ( $picm == false ) ? 'album_pic.' : 'album_picm.'; $sql = "SELECT * FROM " . ALBUM_TABLE . " AS a WHERE a.pic_cat_id = " . $pic_cat_id_tmp . " AND a.pic_approval = 1 ORDER BY pic_id ASC"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } $total_pic_count = $db->sql_numrows($result); $total_pic_rows = $db->sql_fetchrowset($result); $db->sql_freeresult($result); $pic_list = ''; $tit_list = ''; $des_list = ''; for($i = 0; $i < $total_pic_count; $i++) { $pic_list .= 'Pic[' . $i . '] = '' . append_sid(album_append_uid($pic_link . $phpEx . '?pic_id=' . $total_pic_rows[$i]['pic_id']), true) . ''; ' . "n"; $tit_list .= 'Tit[' . $i . '] = '' . $total_pic_rows[$i]['pic_title'] . ''; ' . "n"; $des_list .= 'Des[' . $i . '] = '' . $total_pic_rows[$i]['pic_desc'] . ''; ' . "n"; /* $pic_list .= 'Pic[' . $i . '] = '' . ALBUM_UPLOAD_PATH . $total_pic_rows[$i]['pic_filename'] . ''; ' . "n"; */ } $template->assign_vars(array( 'PIC_LIST' => $pic_list, 'TIT_LIST' => $tit_list, 'DES_LIST' => $des_list, ) ); } // ------------------------------------ // SPECIAL FX // ------------------------------------ if ($album_config['enable_nuffimage'] == 1) { $template->assign_block_vars('pic_nuffed_enabled', array( 'L_PIC_NUFFED_CLICK' => $lang['Nuff_Click'], 'U_PIC_NUFFED_CLICK' => append_sid(album_append_uid('album_showpage.' . $phpEx . '?pic_id=' . $pic_id . $full_size_param . '&nuffimage=true')), ) ); } else { $template->assign_block_vars('switch_slideshow_no_scripts', array()); } // ------------------------------------ // Get $pic_id from $comment_id // ------------------------------------ if( isset($comment_id) && $album_config['comment'] == 1 ) { $sql = "SELECT comment_id, comment_pic_id FROM ". ALBUM_COMMENT_TABLE ." WHERE comment_id = '$comment_id'"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query comment and pic information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); if( empty($row) ) { message_die(GENERAL_ERROR, 'This comment does not exist'); } $pic_id = $row['comment_pic_id']; } // ------------------------------------ // Get this pic info and current category info // ------------------------------------ $sql = "SELECT p.*, ac.*, u.user_id, u.username, u.user_rank, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT( DISTINCT c.comment_id) AS comments_count FROM ". ALBUM_CAT_TABLE ." AS ac, ". ALBUM_TABLE ." AS p LEFT JOIN ". USERS_TABLE ." AS u ON p.pic_user_id = u.user_id LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id WHERE pic_id = '$pic_id' AND ac.cat_id = p.pic_cat_id GROUP BY p.pic_id LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query pic information', '', __LINE__, __FILE__, $sql); } $thispic = $db->sql_fetchrow($result); $cat_id = ($thispic['pic_cat_id'] != 0) ? $thispic['pic_cat_id'] : $thispic['cat_id']; $album_user_id = $thispic['cat_user_id']; $total_comments = $thispic['comments_count']; $comments_per_page = $board_config['posts_per_page']; if( empty($thispic) ) { message_die(GENERAL_ERROR, $lang['Pic_not_exist'] . $lang['Nav_Separator'] . $pic_id); } // ------------------------------------ // Check the permissions // ------------------------------------ $check_permissions = ALBUM_AUTH_VIEW|ALBUM_AUTH_RATE|ALBUM_AUTH_COMMENT|ALBUM_AUTH_EDIT|ALBUM_AUTH_DELETE; $auth_data = album_permissions($album_user_id, $cat_id, $check_permissions, $thispic); if ( $auth_data['view'] == 0 ) { if ( !$userdata['session_logged_in'] ) { redirect(append_sid(LOGIN_MG . '?redirect=album_showpage.' . $phpEx . '&pic_id=' . $pic_id)); exit; } else { message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } // ------------------------------------ //RATING: Additional Check: if this user already rated // ------------------------------------ if( $userdata['session_logged_in'] ) { $sql = "SELECT * FROM ". ALBUM_RATE_TABLE ." WHERE rate_pic_id = '$pic_id' AND rate_user_id = '". $userdata['user_id'] ."' LIMIT 1"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not query rating information', '', __LINE__, __FILE__, $sql); } if ($db->sql_numrows($result) > 0) { $already_rated = true; } else { $already_rated = false; } } else { $already_rated = false; } // Watch pic for comments - BEGIN if( $userdata['session_logged_in'] ) { //$can_watch_comment = TRUE; $sql = "SELECT notify_status FROM " . ALBUM_COMMENT_WATCH_TABLE . " WHERE pic_id = $pic_id AND user_id = " . $userdata['user_id']; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain comment watch information", '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $is_watching_comments = true; if ( isset($HTTP_GET_VARS['unwatch']) ) { if ( $HTTP_GET_VARS['unwatch'] == 'comment' ) { $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ''; $sql = "DELETE $sql_priority FROM " . ALBUM_COMMENT_WATCH_TABLE . " WHERE pic_id = $pic_id AND user_id = " . $userdata['user_id']; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not delete comment watch information", '', __LINE__, __FILE__, $sql); } $is_watching_comment = FALSE; } $template->assign_vars(array( 'META' => '') ); $message = $lang['No_longer_watching_comment'] . '

' . sprintf($lang['Click_return_pic'], '', ''); message_die(GENERAL_MESSAGE, $message); } else { $is_watching_comment = TRUE; if ( $row['notify_status'] ) { $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ''; $sql = "UPDATE $sql_priority " . ALBUM_COMMENT_WATCH_TABLE . " SET notify_status = 0 WHERE pic_id = $pic_id AND user_id = " . $userdata['user_id']; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not update comment watch information", '', __LINE__, __FILE__, $sql); } } } } // Set pic for watch request if ( isset($HTTP_GET_VARS['watch']) ) { if ( $HTTP_GET_VARS['watch'] == 'comment' ) { $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ''; $sql = "INSERT $sql_priority INTO " . ALBUM_COMMENT_WATCH_TABLE . " (pic_id, user_id, notify_status) VALUES ($pic_id, " . $userdata['user_id'] . ", 0)"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not insert comment watch information", '', __LINE__, __FILE__, $sql); } } $template->assign_vars(array( 'META' => '') ); $message = $lang['Watching_comment'] . '

' . sprintf($lang['Click_return_pic'], '', ''); message_die(GENERAL_MESSAGE, $message); } } // Watch pic for comments - END /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ album_read_tree($album_user_id); $album_nav_cat_desc = album_make_nav_tree($cat_id, 'album_cat.' . $phpEx, 'nav' , $album_user_id); if ($album_nav_cat_desc != '') { $album_nav_cat_desc = ALBUM_NAV_ARROW . $album_nav_cat_desc; } if( !isset($_POST['comment']) && !isset($_POST['rating']) ) { /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Comments Screen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ // ------------------------------------ // Get the comments thread // Beware: when this script was called with comment_id (without start) // ------------------------------------ if ( $album_config['comment'] == 1 ) { if( !isset($comment_id) ) { if( isset($_GET['start']) ) { $start = intval($_GET['start']); } elseif( isset($_POST['start']) ) { $start = intval($_POST['start']); } else { $start = 0; } } else { // We must do a query to co-ordinate this comment $sql = "SELECT COUNT(comment_id) AS count FROM ". ALBUM_COMMENT_TABLE ." WHERE comment_pic_id = $pic_id AND comment_id < $comment_id"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not obtain comments information from the database', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); if( !empty($row) ) { $start = floor( $row['count'] / $comments_per_page ) * $comments_per_page; } else { $start = 0; } } if( isset($_GET['sort_order']) ) { switch ($_GET['sort_order']) { case 'ASC': $sort_order = 'ASC'; break; default: $sort_order = 'DESC'; } } elseif( isset($_POST['sort_order']) ) { switch ($_POST['sort_order']) { case 'ASC': $sort_order = 'ASC'; break; default: $sort_order = 'DESC'; } } else { $sort_order = 'ASC'; } if ($total_comments > 0) { $template->assign_block_vars('coment_switcharo_top', array()); $limit_sql = ($start == 0) ? $comments_per_page : $start .','. $comments_per_page; $sql = "SELECT c.*, u.* FROM ". ALBUM_COMMENT_TABLE ." AS c LEFT JOIN ". USERS_TABLE ." AS u ON c.comment_user_id = u.user_id WHERE c.comment_pic_id = '$pic_id' ORDER BY c.comment_id $sort_order LIMIT $limit_sql"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not obtain comments information from the database', '', __LINE__, __FILE__, $sql); } $commentrow = array(); while( $row = $db->sql_fetchrow($result) ) { $commentrow[] = $row; } if ( defined('IS_PHPBBXS') ) { $orig_autolink = array(); $replacement_autolink = array(); obtain_autolink_list($orig_autolink, $replacement_autolink, 99999999); if (!$userdata['user_allowswearywords']) { $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); } } for ($i = 0; $i < count($commentrow); $i++) { if( ($commentrow[$i]['user_id'] == ALBUM_GUEST) || ($commentrow[$i]['username'] == '') ) { if ( defined('IS_PHPBBXS') ) { $poster = ($commentrow[$i]['comment_username'] == '') ? $lang['Guest'] : color_group_colorize_name($commentrow[$i]['user_id']); } else { $poster = ($commentrow[$i]['comment_username'] == '') ? $lang['Guest'] : $commentrow[$i]['comment_username']; } } else { if ( defined('IS_PHPBBXS') ) { $poster = color_group_colorize_name($commentrow[$i]['user_id']); } else { $poster = '' . $commentrow[$i]['username'] . ''; } } if ($commentrow[$i]['comment_edit_count'] > 0) { $sql = "SELECT c.comment_id, c.comment_edit_user_id, u.user_id, u.username FROM ". ALBUM_COMMENT_TABLE ." AS c LEFT JOIN ". USERS_TABLE ." AS u ON c.comment_edit_user_id = u.user_id WHERE c.comment_id = '".$commentrow[$i]['comment_id']."' LIMIT 1"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not obtain last edit information from the database', '', __LINE__, __FILE__, $sql); } $lastedit_row = $db->sql_fetchrow($result); $edit_info = ($commentrow[$i]['comment_edit_count'] == 1) ? $lang['Edited_time_total'] : $lang['Edited_times_total']; if ( defined('IS_PHPBBXS') ) { $edit_info = '

» '. sprintf($edit_info, color_group_colorize_name($lastedit_row['user_id']), create_date2($board_config['default_dateformat'], $commentrow[$i]['comment_edit_time'], $board_config['board_timezone']), $commentrow[$i]['comment_edit_count']) .'
'; } else { $edit_info = '

» '. sprintf($edit_info, $lastedit_row['username'], create_date($board_config['default_dateformat'], $commentrow[$i]['comment_edit_time'], $board_config['board_timezone']), $commentrow[$i]['comment_edit_count']) .'
'; } } else { $edit_info = ''; } // Smilies if ( defined('IS_PHPBBXS') ) { global $bbcode; $html_on = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? 1 : 0 ; $bbcode_on = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? 1 : 0 ; $smilies_on = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? 1 : 0 ; $bbcode->allow_html = $html_on; $bbcode->allow_bbcode = $bbcode_on; $bbcode->allow_smilies = $smilies_on; $commentrow[$i]['comment_text'] = $bbcode->parse($commentrow[$i]['comment_text'], $bbcode_uid); $commentrow[$i]['comment_text'] = strtr($commentrow[$i]['comment_text'], array_flip(get_html_translation_table(HTML_ENTITIES))); if( function_exists( 'acronym_pass' ) ) { $commentrow[$i]['comment_text'] = acronym_pass( $commentrow[$i]['comment_text'] ); } if( count($orig_autolink) ) { $commentrow[$i]['comment_text'] = autolink_transform($commentrow[$i]['comment_text'], $orig_autolink, $replacement_autolink); } //$commentrow[$i]['comment_text'] = kb_word_wrap_pass ($commentrow[$i]['comment_text']); $commentrow[$i]['comment_text'] = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $commentrow[$i]['comment_text']) : $commentrow[$i]['comment_text']; $user_sig = ( $board_config['allow_sig'] ) ? trim($commentrow[$i]['user_sig']) : ''; $user_sig_bbcode_uid = $commentrow[$i]['user_sig_bbcode_uid']; if($user_sig != '') { $bbcode->is_sig = ( $config_mg['allow_all_bbcode'] == 0 ) ? true : false; $user_sig = $bbcode->parse($user_sig, $user_sig_bbcode_uid); $bbcode->is_sig = false; } } else { if ($album_config['album_bbcode'] == 1) { global $bbcode; $html_on = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? 1 : 0 ; $bbcode_on = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? 1 : 0 ; $smilies_on = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? 1 : 0 ; $bbcode->allow_html = $html_on; $bbcode->allow_bbcode = $bbcode_on; $bbcode->allow_smilies = $smilies_on; $commentrow[$i]['comment_text'] = $bbcode->parse($commentrow[$i]['comment_text'], $bbcode_uid); $commentrow[$i]['comment_text'] = strtr($commentrow[$i]['comment_text'], array_flip(get_html_translation_table(HTML_ENTITIES))); $user_sig = ( $board_config['allow_sig'] ) ? trim($commentrow[$i]['user_sig']) : ''; $user_sig_bbcode_uid = $commentrow[$i]['user_sig_bbcode_uid']; if($user_sig != '') { //$bbcode->is_sig = true; $user_sig = $bbcode->parse($user_sig, $user_sig_bbcode_uid); //$bbcode->is_sig = false; } } } //email, profile, pm links if ( ($commentrow[$i]['user_viewemail'] == true) || ($userdata['user_level'] == ADMIN) ) { $email_uri = ( $board_config['board_email_form'] ) ? append_sid('profile.' . $phpEx . '?mode=email&' . POST_USERS_URL .'=' . $commentrow[$i]['user_id']) : 'mailto:' . $commentrow[$i]['user_email']; } else { $email_uri = ''; } $profile_url = append_sid('profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $commentrow[$i]['user_id']); $pm_url = append_sid('privmsg.' . $phpEx . '?mode=post&' . POST_USERS_URL . '=' . $commentrow[$i]['user_id']); //avatar $poster_avatar = ''; if ( $commentrow[$i]['user_avatar_type'] && $commentrow[$i]['user_id'] != ANONYMOUS && $commentrow[$i]['user_allowavatar'] ) { switch( $commentrow[$i]['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '' : ''; break; case USER_AVATAR_REMOTE: $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '' : ''; break; case USER_AVATAR_GALLERY: $poster_avatar = ( $board_config['allow_avatar_local'] ) ? '' : ''; break; case USER_GRAVATAR: $poster_avatar = ( $board_config['enable_gravatars'] ) ? '' : ''; break; } } if ((!$poster_avatar) && ($board_config['default_avatar_set'] != 3)) { if (($board_config['default_avatar_set'] == 0) && ($poster_id == -1) && ($board_config['default_avatar_guests_url'])) { $poster_avatar = ''; } elseif (($board_config['default_avatar_set'] == 1) && ($poster_id != -1) && ($board_config['default_avatar_users_url']) ) { $poster_avatar = ''; } elseif ($board_config['default_avatar_set'] == 2) { if (($poster_id == -1) && ($board_config['default_avatar_guests_url'])) { $poster_avatar = ''; } elseif (($poster_id != -1) && ($board_config['default_avatar_users_url'])) { $poster_avatar = ''; } } } //rank & rank image $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_special, rank_min"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain ranks information.', '', __LINE__, __FILE__, $sql); } $ranksrow = array(); while ( $row = $db->sql_fetchrow($result) ) { $ranksrow[] = $row; } $db->sql_freeresult($result); $poster_rank = ''; $rank_image = ''; if ($commentrow[$i]['user_id'] == ANONYMOUS) { $poster_rank = $lang['Guest']; } elseif ( $commentrow[$i]['user_rank'] ) { for($j = 0; $j < count($ranksrow); $j++) { if ( $commentrow[$i]['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] ) { $poster_rank = $ranksrow[$j]['rank_title']; $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '' . $poster_rank . '
' : ''; } } } else { for($j = 0; $j < count($ranksrow); $j++) { if ( $commentrow[$i]['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special'] ) { $poster_rank = $ranksrow[$j]['rank_title']; $rank_image = ( $ranksrow[$j]['rank_image'] ) ? '' . $poster_rank . '
' : ''; } } } // Handle anon users posting with usernames if ( $commentrow[$i]['user_id'] == ANONYMOUS && $commentrow[$i]['post_username'] != '' ) { if ( defined('IS_PHPBBXS') ) { $poster = color_group_colorize_name($commentrow[$i]['user_id']); } else { $poster = $commentrow[$i]['post_username']; } $poster_rank = $lang['Guest']; } if ( defined('IS_PHPBBXS') ) { } else { $lang['JOINED_DATE_FORMAT'] = $lang['DATE_FORMAT']; } $template->assign_block_vars('commentrow', array( 'ID' => $commentrow[$i]['comment_id'], 'POSTER_NAME' => $poster, 'TIME' => create_date2($board_config['default_dateformat'], $commentrow[$i]['comment_time'], $board_config['board_timezone']), 'IP' => ($userdata['user_level'] == ADMIN) ? '' . decode_ip($commentrow[$i]['comment_user_ip']) .'
' : '', //users mesangers, website, email 'PROFILE_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? '' . $lang['Read_profile'] . '' : '', 'PM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? '' . $lang['Send_private_message'] . '' : '', 'AIM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_aim'] ) ? '' . $lang['AIM'] . '' : '' : '', 'YIM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_yim'] ) ? '' . $lang['YIM'] . '' : '' : '', 'MSNM_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_msnm'] ) ? '' . $lang['MSNM'] . '' : '' : '', 'ICQ_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_icq'] ) ? '' . $lang['ICQ'] . '' : '' : '', 'EMAIL_IMG' => ( ($commentrow[$i]['user_id'] != ANONYMOUS) && ($email_uri != '') ) ? '' . $lang['Send_email'] . '' : '', 'WWW_IMG' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? ( $commentrow[$i]['user_website'] ) ? '' . $lang['Visit_website'] . '' : '' : '', 'POSTER_AVATAR' => $poster_avatar, 'POSTER_RANK' => $poster_rank, 'POSTER_RANK_IMAGE' => $rank_image, 'POSTER_JOINED' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Joined'] . ': ' . create_date($lang['JOINED_DATE_FORMAT'], $commentrow[$i]['user_regdate'], $board_config['board_timezone']) : '', 'POSTER_POSTS' => ( $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $commentrow[$i]['user_posts'] : '', 'POSTER_FROM' => ( $commentrow[$i]['user_from'] && $commentrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $commentrow[$i]['user_from'] : '', 'POSTER_SIGNATURE' => $user_sig, 'TEXT' => $commentrow[$i]['comment_text'], 'EDIT_INFO' => $edit_info, 'EDIT' => ( ( $auth_data['edit'] && ($commentrow[$i]['comment_user_id'] == $userdata['user_id']) ) || ($auth_data['moderator'] && ($thispic['cat_edit_level'] != ALBUM_ADMIN) ) || ($userdata['user_level'] == ADMIN) ) ? '' . $lang['Edit_delete_post'] . '' : '', 'DELETE' => ( ( $auth_data['delete'] && ($commentrow[$i]['comment_user_id'] == $userdata['user_id']) ) || ($auth_data['moderator'] && ($thispic['cat_delete_level'] != ALBUM_ADMIN) ) || ($userdata['user_level'] == ADMIN) ) ? '' . $lang['Delete_post'] . '' : '' ) ); } $template->assign_block_vars('switch_comment', array()); $template->assign_vars(array( 'PAGINATION' => generate_pagination(append_sid(album_append_uid('album_showpage.' . $phpEx . '?pic_id=' . $pic_id . '&sort_order=' . $sort_order)), $total_comments, $comments_per_page, $start), 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $comments_per_page ) + 1 ), ceil( $total_comments / $comments_per_page )) ) ); $template->assign_block_vars('coment_switcharo_bottom', array()); } } // Start output of page $page_title = $lang['Album']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array('body' => $show_template)); if ( defined('IS_PHPBBXS') ) { if( ($thispic['pic_user_id'] == ALBUM_GUEST) || ($thispic['username'] == '') ) { $poster = ($thispic['pic_username'] == '') ? $lang['Guest'] : color_group_colorize_name($thispic['user_id']); } else { $poster = color_group_colorize_name($thispic['user_id']); } } else { if( ($thispic['pic_user_id'] == ALBUM_GUEST) || ($thispic['username'] == '') ) { $poster = ($thispic['pic_username'] == '') ? $lang['Guest'] : $thispic['pic_username']; } else { $poster = '' . $thispic['username'] . ''; } } //--------------------------------- // Comment Posting Form //--------------------------------- if ( $auth_data['comment'] == 1 && $album_config['comment'] == 1 ) { $template->assign_block_vars('switch_comment_post', array()); if( !$userdata['session_logged_in'] ) { $template->assign_block_vars('switch_comment_post.logout', array()); } if ( defined('IS_PHPBBXS') ) { } else { //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; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't retrieve smilies list", '', __LINE__, __FILE__, $sql); } $smilies_count = $db->sql_numrows($result); $smilies_data = $db->sql_fetchrowset($result); for ($i = 1; $i < ($smilies_count + 1); $i++) { $template->assign_block_vars('switch_comment_post.smilies', array( 'CODE' => $smilies_data[$i - 1]['code'], 'URL' => $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()); } } } } // Comment Watch 'U_COMMENT_WATCH_LINK' =>($is_watching_comments) ? ''.$lang['Unwatch_pic']. '' : ($userdata['session_logged_in'] ? ''.$lang['Watch_pic']. '' : ''), [/code] ----------------------------------- Artie Wed 12 Sep, 2007 00:19 Re: [MOD] Pic comment notification ----------------------------------- At the very least you didn't apply the code edits properly Review the Mod's instructions. This does not go where you put it. [codeblock]// Comment Watch 'U_COMMENT_WATCH_LINK' =>($is_watching_comments) ? ''.$lang['Unwatch_pic']. '' : ($userdata['session_logged_in'] ? ''.$lang['Watch_pic']. '' : ''), [/codeblock] ----------------------------------- mipavluk Wed 12 Sep, 2007 17:17 Re: [MOD] Pic Comment Notification ----------------------------------- TY Artie!!!!!!! :mrblue: :mrorange: :mrviolet: :mryellow: :mrgreen: :mricy: ----------------------------------- Gianni PB Fri 14 Sep, 2007 13:37 Re: [MOD] Pic Comment Notification ----------------------------------- can create a link that give an option to subscribe a category? ----------------------------------- Artie Wed 19 Sep, 2007 16:59 Re: [MOD] Pic Comment Notification ----------------------------------- [quote user="Gianni PB" post="19641"]can create a link that give an option to subscribe a category?[/quote] That would most likely require a significant amount of effort in recoding the mod. These days, I do not have the time to spare for such a project. ----------------------------------- darkone Fri 21 Sep, 2007 22:18 Re: [MOD] Pic Comment Notification ----------------------------------- Will this mod be ever integrated with FAP perminently so on future upgrades of ICY I don't have to always keep these changes on hand? :) ----------------------------------- Mighty Gorgon Sat 22 Sep, 2007 09:50 Re: [MOD] Pic comment notification ----------------------------------- [quote user="darkone" post="19926"]Will this mod be ever integrated with FAP perminently so on future upgrades of ICY I don't have to always keep these changes on hand? :)[/quote] The mod is already included in the new beta. ----------------------------------- Gianni PB Sun 07 Oct, 2007 21:29 Re: [MOD] Pic Comment Notification ----------------------------------- is this included in Icy Phoenix 1.1.5.20?