$photoplog_fid_querys = $db->query_read_slave("SELECT fileid,catid,title,userid,filename\r\n\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\tWHERE catid IN (" . implode(',', $photoplog_fid_memy_catids) . ")\r\n\t\t{$photoplog_catid_sql1}\r\n\t\t{$photoplog_admin_sql1}\r\n\t\tORDER BY dateline DESC, fileid DESC\r\n\t\t{$photoplog_maxresults}\r\n\t"); if (!$db->num_rows($photoplog_fid_querys)) { photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_no_results']); } $photoplog_fid_bits = array(); $photoplog_fid_cnt = 0; while ($photoplog_fid_query = $db->fetch_array($photoplog_fid_querys)) { if (!$photoplog_fid_cnt) { $photoplog['fid_current'] = intval($photoplog_fid_query['fileid']); $photoplog_fid_catid = intval($photoplog_fid_query['catid']); $photoplog['fid_title'] = strval($photoplog_fid_query['title']); $photoplog_fid_userid = $photoplog_fid_query['userid']; $photoplog_fid_filename = $photoplog_fid_query['filename']; if ($vbulletin->options['lastthreadchars'] != 0 && vbstrlen($photoplog['fid_title']) > $vbulletin->options['lastthreadchars']) { $photoplog['fid_title'] = fetch_trimmed_title($photoplog['fid_title'], $vbulletin->options['lastthreadchars']); $photoplog['fid_title'] = photoplog_regexp_text($photoplog['fid_title']); } $photoplog['fid_title'] = photoplog_process_text($photoplog['fid_title'], $photoplog_fid_catid, true, false); photoplog_file_link($photoplog_fid_userid, $photoplog['fid_current'], $photoplog_fid_filename); if ($vbulletin->options['photoplog_highslide_active'] && $photoplog['do_highslide']) { $photoplog['slideshow_slide1'] = $photoplog[$photoplog_hslink1]; $photoplog['slideshow_href1'] = $photoplog[$photoplog_hslink2]; } else { $photoplog['slideshow_slide1'] = $photoplog['file_mlink']; $photoplog['slideshow_href1'] = $photoplog['location'] . '/index.php?' . $vbulletin->session->vars[sessionurl] . 'n=' . $photoplog['fid_current']; } } $photoplog_fid_bits[] = intval($photoplog_fid_query['fileid']); photoplog_file_link($photoplog_fid_query['userid'], $photoplog_fid_query['fileid'], $photoplog_fid_query['filename']); if ($vbulletin->options['photoplog_highslide_active'] && $photoplog['do_highslide']) { $photoplog['slideshow_slidex'] .= "photoplog_slides[" . $photoplog_fid_cnt . "] = '" . $photoplog[$photoplog_hslink1] . "';\n";
$photoplog_comment_date = ''; $photoplog_comment_time = ''; $photoplog_comment_commentid = ''; $photoplog_comment_page = ''; if (isset($photoplog_comments_array[$photoplog['fileid']])) { $photoplog_comment_userid = $photoplog_comments_array[$photoplog['fileid']]['photoplog_comment_userid']; $photoplog_comment_username = $photoplog_comments_array[$photoplog['fileid']]['photoplog_comment_username']; $photoplog_comment_title = $photoplog_comments_array[$photoplog['fileid']]['photoplog_comment_title']; $photoplog_comment_date = vbdate($vbulletin->options['dateformat'], $photoplog_comments_array[$photoplog['fileid']]['photoplog_comment_dateline'], true); $photoplog_comment_time = vbdate($vbulletin->options['timeformat'], $photoplog_comments_array[$photoplog['fileid']]['photoplog_comment_dateline']); $photoplog_comment_commentid = '#comment' . $photoplog_comments_array[$photoplog['fileid']]['photoplog_comment_commentid']; $photoplog_comment_page = $photoplog_comment_pagenum . $photoplog_comment_commentid; } if ($vbulletin->options['lastthreadchars'] != 0 && vbstrlen($photoplog_comment_title) > $vbulletin->options['lastthreadchars']) { $photoplog_comment_title = fetch_trimmed_title($photoplog_comment_title, $vbulletin->options['lastthreadchars']); $photoplog_comment_title = photoplog_regexp_text($photoplog_comment_title); } $photoplog_comment_title = photoplog_process_text($photoplog_comment_title, $photoplog['catid'], true, false); $photoplog_inline_perm = array(); $photoplog_inline_perm['caneditownfiles'] = 0; $photoplog_inline_perm['candeleteownfiles'] = 0; $photoplog_inline_perm['caneditotherfiles'] = 0; $photoplog_inline_perm['candeleteotherfiles'] = 0; if (isset($photoplog_inline_bits[$photoplog['catid']])) { $photoplog_inline_perm = convert_bits_to_array($photoplog_inline_bits[$photoplog['catid']], $photoplog_categoryoptpermissions); } $photoplog['inlinebox'] = 0; if (($photoplog_inline_perm['caneditownfiles'] || $photoplog_inline_perm['candeleteownfiles']) && $vbulletin->userinfo['userid'] == $photoplog['userid'] || $photoplog_inline_perm['caneditotherfiles'] || $photoplog_inline_perm['candeleteotherfiles']) { $photoplog['inlinebox'] = 1; $photoplog['inlineform'] = 1; if ($photoplog_inline_perm['caneditownfiles'] && $vbulletin->userinfo['userid'] == $photoplog['userid'] || $photoplog_inline_perm['caneditotherfiles']) {
function photoplog_process_text($text, $catid, $is_title = false, $add_dots = false) { global $vbulletin, $vbphrase, $photoplog_categoryoptions, $photoplog_ds_catopts; static $photoplog_parser = false; $do_html = false; $do_smilies = false; $do_bbcode = false; $do_imgcode = false; $do_parseurl = false; $catid = intval($catid); if (!is_array($photoplog_ds_catopts)) { $photoplog_ds_catopts = array(); } if (in_array($catid, array_keys($photoplog_ds_catopts))) { $photoplog_categorybit = $photoplog_ds_catopts[$catid]['options']; $photoplog_catoptions = convert_bits_to_array($photoplog_categorybit, $photoplog_categoryoptions); $do_html = $photoplog_catoptions['allowhtml'] ? true : false; $do_smilies = $photoplog_catoptions['allowsmilies'] ? true : false; $do_bbcode = $photoplog_catoptions['allowbbcode'] ? true : false; $do_imgcode = $photoplog_catoptions['allowimgcode'] ? true : false; $do_parseurl = $photoplog_catoptions['allowparseurl'] ? true : false; } $text = fetch_censored_text($text); $text = fetch_word_wrapped_string($text); require_once DIR . '/includes/functions_newpost.php'; if ($is_title) { $text = fetch_no_shouting_text($text); $max_len = 255; if (vbstrlen($text) > $max_len) { $text = fetch_trimmed_title($text, $max_len); $text = photoplog_regexp_text($text); } if (empty($text)) { $text = $vbphrase['photoplog_untitled']; } $text = htmlspecialchars_uni($text); return $text; } if ($add_dots) { $max_len = 100; if ($vbulletin->options['lastthreadchars'] != 0) { $max_len = $vbulletin->options['lastthreadchars'] * 2; } } else { $max_len = min(vbstrlen($text), 15360000); if ($vbulletin->options['postmaxchars'] != 0) { $max_len = $vbulletin->options['postmaxchars']; } } if (vbstrlen($text) > $max_len) { $text = fetch_trimmed_title($text, $max_len); $text = photoplog_regexp_text($text); } if ($do_parseurl) { $text = convert_url_to_bbcode($text); } if (empty($text)) { $text = $vbphrase['photoplog_not_available']; } $text = fetch_no_shouting_text($text); if (!$photoplog_parser) { require_once DIR . '/includes/class_bbcode.php'; $photoplog_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list()); } $text = $photoplog_parser->do_parse($text, $do_html, $do_smilies, $do_bbcode, $do_imgcode, true, false); return $text; }
$photoplog_catbit_stamp2 = ''; $photoplog_catbit_page2 = ''; $photoplog['do_comments'] = 0; if ($photoplog_comment_count && !empty($photoplog_catbit_info[$photoplog_key]['fileid2'])) { $photoplog_catbit_fileid2 = $photoplog_catbit_info[$photoplog_key]['fileid2']; $photoplog_catbit_userid2 = $photoplog_catbit_info[$photoplog_key]['userid2']; $photoplog_catbit_username2 = $photoplog_catbit_info[$photoplog_key]['username2']; $photoplog_catbit_lasttitle2 = $photoplog_catbit_info[$photoplog_key]['lasttitle2']; $photoplog_catbit_date2 = $photoplog_catbit_info[$photoplog_key]['date2']; $photoplog_catbit_time2 = $photoplog_catbit_info[$photoplog_key]['time2']; $photoplog_catbit_stamp2 = $photoplog_catbit_info[$photoplog_key]['stamp2']; $photoplog_catbit_page2 = $photoplog_catbit_info[$photoplog_key]['page2']; $photoplog['do_comments'] = $photoplog_catbit_info[$photoplog_key]['docoms2']; if ($vbulletin->options['lastthreadchars'] != 0 && vbstrlen($photoplog_catbit_lasttitle2) > $vbulletin->options['lastthreadchars']) { $photoplog_catbit_lasttitle2 = fetch_trimmed_title($photoplog_catbit_lasttitle2, $vbulletin->options['lastthreadchars']); $photoplog_catbit_lasttitle2 = photoplog_regexp_text($photoplog_catbit_lasttitle2); } $photoplog_catbit_lasttitle2 = photoplog_process_text($photoplog_catbit_lasttitle2, $photoplog_catbit_catid, true, false); } if ($vbulletin->userinfo['lastvisitdate'] == -1 || $vbulletin->userinfo['lastvisit'] < $photoplog_catbit_stamp1 || $vbulletin->userinfo['lastvisit'] < $photoplog_catbit_stamp2) { $photoplog_newold_statusicon = 'new'; } else { $photoplog_newold_statusicon = 'old'; } if (!($permissions['photoplogpermissions'] & $vbulletin->bf_ugp_photoplogpermissions['photoplogcanuploadfiles']) && $vbulletin->options['showlocks']) { $photoplog_newold_statusicon .= '_lock'; } if (!in_array($photoplog_catbit_catid, $photoplog_perm_not_allowed_bits)) { $photoplog_divider_bar = 0; $photoplog_parent_catid = intval($photoplog_ds_catopts[$photoplog_catbit_catid]['parentid']); if (!$photoplog_list_flag) {
$photoplog_user_cnt2 = intval($photoplog_members_array_info['photoplog_member_total_comments']); $photoplog_user_title1 = $photoplog_files_array[$photoplog_user_fileid1]['photoplog_file_title']; if ($vbulletin->options['lastthreadchars'] != 0 && vbstrlen($photoplog_user_title1) > $vbulletin->options['lastthreadchars']) { $photoplog_user_title1 = fetch_trimmed_title($photoplog_user_title1, $vbulletin->options['lastthreadchars']); $photoplog_user_title1 = photoplog_regexp_text($photoplog_user_title1); } $photoplog_user_title1 = photoplog_process_text($photoplog_user_title1, $photoplog['catid'], true, false); $photoplog_user_filename = $photoplog_files_array[$photoplog_user_fileid1]['photoplog_file_filename']; $photoplog_user_page = '&page=' . ceil($photoplog_user_cnt2 / 5) . '#comment' . $photoplog_user_commentid; $photoplog_user_fileid2 = $photoplog_comments_array[$photoplog_user_commentid]['photoplog_comment_fileid']; $photoplog_user_userid2 = $photoplog_comments_array[$photoplog_user_commentid]['photoplog_comment_userid']; $photoplog_user_username2 = $photoplog_comments_array[$photoplog_user_commentid]['photoplog_comment_username']; $photoplog_user_title2 = $photoplog_comments_array[$photoplog_user_commentid]['photoplog_comment_title']; if ($vbulletin->options['lastthreadchars'] != 0 && vbstrlen($photoplog_user_title2) > $vbulletin->options['lastthreadchars']) { $photoplog_user_title2 = fetch_trimmed_title($photoplog_user_title2, $vbulletin->options['lastthreadchars']); $photoplog_user_title2 = photoplog_regexp_text($photoplog_user_title2); } $photoplog_user_title2 = photoplog_process_text($photoplog_user_title2, $photoplog['catid'], true, false); $photoplog_user_stamp1 = $photoplog_files_array[$photoplog_user_fileid1]['photoplog_file_dateline']; $photoplog_user_stamp2 = $photoplog_comments_array[$photoplog_user_commentid]['photoplog_comment_dateline']; $photoplog_user_date1 = vbdate($vbulletin->options['dateformat'], $photoplog_user_stamp1, true); $photoplog_user_time1 = vbdate($vbulletin->options['timeformat'], $photoplog_user_stamp1); $photoplog_user_date2 = vbdate($vbulletin->options['dateformat'], $photoplog_user_stamp2, true); $photoplog_user_time2 = vbdate($vbulletin->options['timeformat'], $photoplog_user_stamp2); if ($vbulletin->userinfo['lastvisitdate'] == -1 || $vbulletin->userinfo['lastvisit'] < $photoplog_user_stamp1 || $vbulletin->userinfo['lastvisit'] < $photoplog_user_stamp2) { $photoplog_newold_statusicon = 'new'; } else { $photoplog_newold_statusicon = 'old'; } if (!($permissions['photoplogpermissions'] & $vbulletin->bf_ugp_photoplogpermissions['photoplogcanuploadfiles']) && $vbulletin->options['showlocks']) { $photoplog_newold_statusicon .= '_lock';