//$cat_id = album_get_personal_root_id($album_user_id); $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, $row); //$auth_data = album_get_auth_data($cat_id); $pic_preview = ''; $pic_preview_hs = ''; if ($album_config['lb_preview']) { $slideshow_cat = ''; $slideshow = !empty($slideshow_cat) ? ', { slideshowGroup: \'' . $slideshow_cat . '\' } ' : ''; $pic_preview_hs = ' class="highslide" onclick="return hs.expand(this' . $slideshow . ');"'; $pic_preview = 'onmouseover="showtrail(\'' . append_sid(album_append_uid('album_picm.' . PHP_EXT . '?pic_id=' . $row['pic_id'])) . '\',\'' . addslashes($row[$j]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } //if(!$auth_data['view']) if ($auth_data['view'] >= 0) { $template_vars = array('L_USERNAME' => $row['pic_username'], 'U_PROFILE' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&u=' . $row['pic_user_id']), 'PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview, 'CATEGORY' => $row['cat_user_id'] != ALBUM_PUBLIC_GALLERY ? $lang['Users_Personal_Galleries'] : $row['cat_title'], 'U_PIC_CAT' => $row['cat_id'] == $cat_id ? append_sid(album_append_uid('album_cat.' . PHP_EXT . '?cat_id=' . $row['cat_id'])) : append_sid(album_append_uid('album.' . PHP_EXT)), 'GROUP_NAME' => 'all'); album_build_detail_vars($template_vars, $row); $template->assign_block_vars('switch_search_results.search_results', $template_vars); $in[$numres] = $row['pic_id']; $numres++; } } } while ($row = $db->sql_fetchrow($result)); $template->assign_vars(array('L_NRESULTS' => $numres, 'L_TRESULTS' => $total_pics, 'IMG_FOLDER' => $images['topic_nor_read'], 'L_TCATEGORY' => $lang['Pic_Cat'], 'L_TTITLE' => $lang['Pic_Image'], 'L_TSUBMITER' => $lang['Author'], 'L_TSUBMITED' => $lang['Time'], 'S_THUMBNAIL_SIZE' => $album_config['thumbnail_size'])); } else { message_die(GENERAL_MESSAGE, $lang['No_search_match']); } } else { message_die(GENERAL_ERROR, 'Bad request'); //$template->assign_block_vars('switch_search', array()); } // --------------------------------
break; } $pic_preview = ''; $pic_preview_hs = ''; if ($album_config['lb_preview']) { $slideshow_cat = 'Profile'; $slideshow = !empty($slideshow_cat) ? ', { slideshowGroup: \'' . $slideshow_cat . '\' } ' : ''; $pic_preview_hs = ' class="highslide" onclick="return hs.expand(this' . $slideshow . ');"'; $pic_preview = 'onmouseover="showtrail(\'' . append_sid('album_picm.' . PHP_EXT . '?pic_id=' . $recentrow[$j]['pic_id']) . '\',\'' . addslashes($recentrow[$j]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } $template_vars = array('PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview); album_build_column_vars($template_vars, $recentrow[$j]); $template->assign_block_vars('recent_pics_block.recent_pics.recent_col', $template_vars); $recent_poster = colorize_username($recentrow[$j]['user_id'], $recentrow[$j]['username'], $recentrow[$j]['user_color'], $recentrow[$j]['user_active']); $template_vars = array('POSTER' => $recent_poster, 'PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview, 'GROUP_NAME' => 'profile'); album_build_detail_vars($template_vars, $recentrow[$j]); $template->assign_block_vars('recent_pics_block.recent_pics.recent_detail', $template_vars); } } } else { $album_img = ' '; $album = ''; } } // Mighty Gorgon - Full Album Pack - END $avatar_img = user_get_avatar($profiledata['user_id'], $profiledata['user_level'], $profiledata['user_avatar'], $profiledata['user_avatar_type'], $profiledata['user_allowavatar']); // Mighty Gorgon - Multiple Ranks - BEGIN $user_ranks = generate_ranks($profiledata, $ranks_array); // Mighty Gorgon - Multiple Ranks - END // ONLINE OFFLINE - BEGIN $user_online_status = 'offline';
function album_build_last_comments_info($cats) { global $db, $cache, $config, $template, $user, $lang, $bbcode, $album_config, $album_data; @(include_once IP_ROOT_PATH . 'includes/bbcode.' . PHP_EXT); $number_of_comments = 5; $album_show_pic_url = 'album_showpage.' . PHP_EXT; if ($cats == '') { $sql_where = ''; } else { $sql_where = 'WHERE a.pic_cat_id IN (' . $cats . ')'; } //$sql_group = 'GROUP BY c.comment_pic_id'; $sql_group = ''; // get last comment information, and user, comment and pic informations $sql = "SELECT c.*, u.user_id, u.username, u.user_active, u.user_color, a.*\n\t\tFROM " . ALBUM_COMMENT_TABLE . " AS c\n\t\tLEFT JOIN " . USERS_TABLE . " AS u ON c.comment_user_id = u.user_id\n\t\tLEFT JOIN " . ALBUM_TABLE . " AS a ON c.comment_pic_id = a.pic_id\n\t\t{$sql_where}\n\t\t{$sql_group}\n\t\tORDER BY c.comment_id DESC\n\t\tLIMIT {$number_of_comments}"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $commentsrow[] = $row; } $db->sql_freeresult($result); if (sizeof($commentsrow) > 0) { $template->assign_block_vars('recent_comments_block', array('L_COMMENTS' => $lang['Comments'], 'L_LAST_COMMENT' => $lang['Last_Comment'], 'L_LAST_COMMENT_INFO' => $lang['Last_Comments'])); for ($i = 0; $i < sizeof($commentsrow); $i++) { if ($commentsrow[$i]['comment_username'] == ALBUM_GUEST || $commentsrow[$i]['comment_username'] == '') { $poster = $commentsrow[$i]['comment_username'] == '' ? $lang['Guest'] : $commentsrow[$i]['comment_username']; } else { $poster = colorize_username($commentsrow[$i]['user_id'], $commentsrow[$i]['username'], $commentsrow[$i]['user_color'], $commentsrow[$i]['user_active']); } $info .= '<br />' . $lang['Pic_Image'] . ': <a href="' . append_sid(album_append_uid($album_show_pic_url . '?pic_id=' . $commentsrow[$i]['pic_id'])) . '">' . $commentsrow[$i]['pic_title'] . '</a>'; $pic_preview = ''; $pic_preview_hs = ''; if ($album_config['lb_preview']) { $slideshow_cat = ''; $slideshow = !empty($slideshow_cat) ? ', { slideshowGroup: \'' . $slideshow_cat . '\' } ' : ''; $pic_preview_hs = ' class="highslide" onclick="return hs.expand(this' . $slideshow . ');"'; $pic_preview = 'onmouseover="showtrail(\'' . append_sid(album_append_uid('album_picm.' . PHP_EXT . '?pic_id=' . $commentsrow[$i]['pic_id'])) . '\',\'' . addslashes($commentsrow[$i]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } $commentsrow[$i]['comment_text'] = censor_text($commentsrow[$i]['comment_text']); $html_on = $user->data['user_allowhtml'] && $config['allow_html'] ? 1 : 0; $bbcode_on = $user->data['user_allowbbcode'] && $config['allow_bbcode'] ? 1 : 0; $smilies_on = $user->data['user_allowsmile'] && $config['allow_smilies'] ? 1 : 0; $bbcode->allow_html = $html_on; $bbcode->allow_bbcode = $bbcode_on; $bbcode->allow_smilies = $smilies_on; $commentsrow[$i]['comment_text'] = $bbcode->parse($commentsrow[$i]['comment_text']); $commentsrow[$i]['comment_text'] = strtr($commentsrow[$i]['comment_text'], array_flip(get_html_translation_table(HTML_ENTITIES))); $commentsrow[$i]['comment_text'] = $bbcode->acronym_pass($commentsrow[$i]['comment_text']); $commentsrow[$i]['comment_text'] = $bbcode->autolink_text($commentsrow[$i]['comment_text'], '999999'); $template_vars = array('POSTER' => $poster, 'PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview, 'COMMENT_TEXT' => $commentsrow[$i]['comment_text'], 'GROUP_NAME' => 'comments'); album_build_detail_vars($template_vars, $commentsrow[$i]); // Overwrite the picture time with the comment time $template_vars['TIME'] = create_date_ip($config['default_dateformat'], $commentsrow[$i]['comment_time'], $config['board_timezone']); $template->assign_block_vars('recent_comments_block.comment_row', $template_vars); } } }
$pic_preview_hs = ' class="highslide" onclick="return hs.expand(this' . $slideshow . ');"'; $pic_preview = 'onmouseover="showtrail(\'' . append_sid(album_append_uid('album_picm.' . PHP_EXT . '?pic_id=' . $picrow[$j]['pic_id'])) . '\',\'' . addslashes($picrow[$j]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } $template_vars = array('PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview); album_build_column_vars($template_vars, $picrow[$j]); $template->assign_block_vars('picrow.piccol', $template_vars); // is a personal category that the picture belongs to AND // is it the main category in the personal gallery ? if ($picrow[$j]['cat_user_id'] != 0 && $picrow[$j]['cat_id'] == album_get_personal_root_id($picrow[$j]['cat_user_id'])) { $album_page_url = 'album.' . PHP_EXT; } else { $album_page_url = 'album_cat.' . PHP_EXT; } $image_cat_url = append_sid(album_append_uid($album_page_url . '?cat_id=' . $picrow[$j]['cat_id'] . '&user_id=' . $picrow[$j]['cat_user_id'])); $template_vars = array('PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview, 'CATEGORY' => $picrow[$j]['cat_title'], 'U_PIC_CAT' => $image_cat_url, 'GROUP_NAME' => 'memberlist'); album_build_detail_vars($template_vars, $picrow[$j]); // $template_vars['TITLE'] = htmlspecialchars($picrow[$j]['pic_title']); $template->assign_block_vars('picrow.pic_detail', $template_vars); } } // -------------------------------- // Pagination // -------------------------------- $template->assign_vars(array('PAGINATION' => generate_pagination(append_sid(album_append_uid('album.' . PHP_EXT . '?user_id=' . $album_user_id . '&sort_method=' . $sort_method . '&sort_order=' . $sort_order . $album_view_mode_param . $album_view_type_param)), $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 { $template->assign_block_vars('no_pics', array()); $template->assign_vars(array('S_NO_PICS' => '1')); } /* +---------------------------------------------------------- | Main page...
$pic_preview_hs = ' class="highslide" onclick="return hs.expand(this' . $slideshow . ');"'; $pic_preview = 'onmouseover="showtrail(\'' . append_sid(album_append_uid('album_picm.' . PHP_EXT . '?pic_id=' . $picrow[$j]['pic_id'])) . '\',\'' . addslashes($picrow[$j]['pic_title']) . '\', ' . $album_config['midthumb_width'] . ', ' . $album_config['midthumb_height'] . ')" onmouseout="hidetrail()"'; } $template_vars = array('PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview); album_build_column_vars($template_vars, $picrow[$j], '&sort_order=' . $sort_order . '&sort_method=' . $sort_method); $template->assign_block_vars('picrow.piccol', $template_vars); // is a personal category that the picture belongs to AND // is it the main category in the personal gallery ? if ($picrow[$j]['cat_user_id'] != 0 && $picrow[$j]['cat_id'] == album_get_personal_root_id($picrow[$j]['cat_user_id'])) { $album_page_url = 'album.' . PHP_EXT; } else { $album_page_url = 'album_cat.' . PHP_EXT; } $image_cat_url = append_sid(album_append_uid($album_page_url . '?cat_id=' . $picrow[$j]['cat_id'] . '&user_id=' . $picrow[$j]['cat_user_id'])); $template_vars = array('PIC_PREVIEW_HS' => $pic_preview_hs, 'PIC_PREVIEW' => $pic_preview, 'CATEGORY' => $picrow[$j]['cat_title'], 'U_PIC_CAT' => $image_cat_url, 'GROUP_NAME' => 'all'); album_build_detail_vars($template_vars, $picrow[$j], '&sort_order=' . $sort_order . '&sort_method=' . $sort_method); $template->assign_block_vars('picrow.pic_detail', $template_vars); } } // -------------------------------- // Pagination // -------------------------------- $template->assign_vars(array('PAGINATION' => generate_pagination(append_sid(album_append_uid('album_allpics.' . PHP_EXT . '?cat_id=' . $cat_id . '&sort_method=' . $sort_method . '&sort_order=' . $sort_order . $album_view_mode_param . $album_view_type_param)), $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 { $template->assign_block_vars('no_pics', array()); } /* +---------------------------------------------------------- | Main page... +---------------------------------------------------------- */