$photoplog_user_ids[$photoplog_inline_perm_array['userid']]++; } else { $photoplog_user_ids[$photoplog_inline_perm_array['userid']] = 1; } } } if (($_REQUEST['do'] == 'approve' || $_REQUEST['do'] == 'unapprove') && $photoplog['canadminforums'] && (($photoplog_inline_perm_array['caneditowncomments'] || $photoplog_inline_perm_array['candeleteowncomments']) && $vbulletin->userinfo['userid'] == $photoplog_inline_perm_array['userid'] || $photoplog_inline_perm_array['caneditothercomments'] || $photoplog_inline_perm_array['candeleteothercomments'])) { $photoplog_comment_sql[] = intval($photoplog_inline_perm_commentid); $photoplog_cat_ids[] = intval($photoplog_inline_perm_array['catid']); $photoplog_file_ids[] = intval($photoplog_inline_perm_array['fileid']); } } $photoplog_comment_sql = array_unique($photoplog_comment_sql); if (empty($photoplog_comment_sql)) { // if no ids then invalid request !!! photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_invalid_request']); } $photoplog_comment_sql = implode(',', $photoplog_comment_sql); if ($_REQUEST['do'] == 'edit') { if ($db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\tSET fileid = " . intval($photoplog_file_id) . "\r\n\t\t\t\tWHERE commentid IN (" . $photoplog_comment_sql . ")\r\n\t\t\t")) { $db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\tSET catid = " . intval($photoplog_cat_id) . "\r\n\t\t\t\tWHERE commentid IN (" . $photoplog_comment_sql . ")\r\n\t\t\t"); $photoplog_cat_ids[] = intval($photoplog_cat_id); $photoplog_file_ids[] = intval($photoplog_file_id); photoplog_update_fileuploads_counts_array($photoplog_file_ids); photoplog_regenerate_counts_table_v2($photoplog_cat_ids); $_REQUEST['do'] = 'wipe'; } } if ($_REQUEST['do'] == 'delete') { if ($db->query_write("DELETE FROM " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\tWHERE commentid IN (" . $photoplog_comment_sql . ")\r\n\t\t\t")) { $photoplog_user_case1 = '';
($hook = vBulletinHook::fetch_hook('photoplog_edit_sqlreplace')) ? eval($hook) : false; if ($db->query_write("REPLACE INTO " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\t\t(fileid, userid, username, title, description, filename, filesize, dateline, views, catid, moderate, dimensions, setid, \r\n\t\t\tfielddata, num_comments0, num_comments1, num_ratings0, num_ratings1, sum_ratings0, sum_ratings1,\r\n\t\t\tlast_comment_dateline0, last_comment_dateline1, last_comment_id0, last_comment_id1, albumids, exifinfo)\r\n\t\t\tVALUES (\r\n\t\t\t\t" . intval($photoplog_file_id) . ",\r\n\t\t\t\t" . intval($photoplog_file_userid) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog_file_username) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_file_title) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_file_description) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_replace_name) . "',\r\n\t\t\t\t" . intval($photoplog_file_size) . ",\r\n\t\t\t\t" . intval($photoplog_file_dateline) . ",\r\n\t\t\t\t" . intval($photoplog_file_views) . ",\r\n\t\t\t\t" . intval($photoplog_file_catid) . ",\r\n\t\t\t\t" . intval($photoplog_file_moderate) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog['dimensions']) . "',\r\n\t\t\t\t" . intval($photoplog_file_setid) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog_fielddata) . "',\r\n\t\t\t\t" . intval($photoplog_file_nc0) . ",\r\n\t\t\t\t" . intval($photoplog_file_nc1) . ",\r\n\t\t\t\t" . intval($photoplog_file_nr0) . ",\r\n\t\t\t\t" . intval($photoplog_file_nr1) . ",\r\n\t\t\t\t" . intval($photoplog_file_sr0) . ",\r\n\t\t\t\t" . intval($photoplog_file_sr1) . ",\r\n\t\t\t\t" . intval($photoplog_file_lcd0) . ",\r\n\t\t\t\t" . intval($photoplog_file_lcd1) . ",\r\n\t\t\t\t" . intval($photoplog_file_lci0) . ",\r\n\t\t\t\t" . intval($photoplog_file_lci1) . ",\r\n\t\t\t\t'" . $db->escape_string($photoplog_albumids) . "',\r\n\t\t\t\t'" . $db->escape_string($photoplog_exifinfo) . "'\r\n\t\t\t)\r\n\t\t")) { if ($photoplog_file_catid_default >= 0 && $photoplog_file_catid != $photoplog_file_catid_default) { $db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_ratecomment\r\n\t\t\t\t\t\tSET catid = " . intval($photoplog_file_catid) . "\r\n\t\t\t\t\t\tWHERE fileid = " . intval($photoplog_file_id) . "\r\n\t\t\t"); photoplog_update_counts_table($photoplog_file_catid_default); } photoplog_update_counts_table($photoplog_file_catid); if ($photoplog_file_moderate == 1 && $vbulletin->options['photoplog_admin_email']) { $photoplog_subject = $photoplog_message = ''; eval(fetch_email_phrases('photoplog_mod_file', -1, '', 'photoplog_')); vbmail($vbulletin->options['webmasteremail'], $photoplog_subject, $photoplog_message, true); } if ($photoplog_file_old && $photoplog_file_edit) { @unlink($photoplog_directory_name . "/" . $photoplog_file_old); @unlink($photoplog_directory_name . "/large/" . $photoplog_file_old); @unlink($photoplog_directory_name . "/medium/" . $photoplog_file_old); @unlink($photoplog_directory_name . "/small/" . $photoplog_file_old); } ($hook = vBulletinHook::fetch_hook('photoplog_edit_doedit_complete')) ? eval($hook) : false; $photoplog_id = intval($photoplog_file_id); $photoplog_url = $photoplog['location'] . '/index.php?' . $vbulletin->session->vars['sessionurl'] . 'n=' . $photoplog_id; exec_header_redirect($photoplog_url); exit; } else { photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_bad_luck']); } } ($hook = vBulletinHook::fetch_hook('photoplog_edit_complete')) ? eval($hook) : false; if ($_REQUEST['do'] != 'edit' && $_POST['do'] != 'doedit') { photoplog_index_bounce(); }
$db->free_result($photoplog_file_infos); $photoplog['block_bits'] = eregi_replace(preg_quote("</tr><tr>") . "\$", "", $photoplog['block_bits']); if ($photoplog_cnt_bits && $photoplog['block_cols'] && $vbulletin->options['photoplog_display_type'] == 1) { $photoplog_cnt_bits_temp = $photoplog_cnt_bits; while ($photoplog_cnt_bits_temp % $photoplog['block_cols'] != 0) { $photoplog['block_bits'] .= "<td class=\"alt1\" align=\"left\" valign=\"bottom\" width=\"" . $photoplog['block_width'] . "%\"> </td>"; $photoplog_cnt_bits_temp++; } unset($photoplog_cnt_bits_temp); } if (!$photoplog_cnt_bits) { if ($vbulletin->options['photoplog_display_type'] == 1) { $photoplog['block_bits'] = '<td colspan="' . $photoplog['block_cols'] . '" class="alt2">' . $vbphrase['photoplog_not_available'] . '</td>'; } else { $photoplog['file_bits'] = '<tr><td colspan="6" class="alt2">' . $vbphrase['photoplog_not_available'] . '</td></tr>'; } } $photoplog_search_results_phrase = $photoplog_search_tot == 1 ? $vbphrase['photoplog_search_result'] : $vbphrase['photoplog_search_results']; $vbphrase[photoplog_file_list] = $photoplog_search_tot . ' ' . $photoplog_search_results_phrase . ' ' . $vbphrase['photoplog_on'] . ' "' . $photoplog_search_query_form . '"'; if ($vbulletin->options['photoplog_display_type'] == 1) { ($hook = vBulletinHook::fetch_hook('photoplog_search_blocklist')) ? eval($hook) : false; photoplog_output_page('photoplog_block_list', $vbphrase['photoplog_search_results']); } else { ($hook = vBulletinHook::fetch_hook('photoplog_search_filelist')) ? eval($hook) : false; photoplog_output_page('photoplog_file_list', $vbphrase['photoplog_search_results']); } } ($hook = vBulletinHook::fetch_hook('photoplog_search_complete')) ? eval($hook) : false; if ($_REQUEST['do'] != 'query' && $_REQUEST['do'] != 'view') { photoplog_index_bounce(); }
$photoplog['fid_next'] = $photoplog_fid_bits[$photoplog_fid_bits_key2]; } $photoplog['fid_list'] = implode(",", $photoplog_fid_bits); $photoplog['fid_button'] = ''; if ($photoplog['fid_previous']) { $photoplog['fid_button'] .= "<input class=\"button\" type=\"submit\" name=\"go\" value=\"" . $vbphrase['photoplog_previous'] . "\" />"; } if ($photoplog['fid_previous'] && $photoplog['fid_next']) { $photoplog['fid_button'] .= " "; } if ($photoplog['fid_next']) { $photoplog['fid_button'] .= "<input class=\"button\" type=\"submit\" name=\"go\" value=\"" . $vbphrase['photoplog_next'] . "\" />"; } $photoplog_search_tot = count($photoplog_fid_bits); $photoplog_search_now = intval($photoplog_fid_bits_key) + 1; $photoplog['fid_locale'] = construct_phrase($vbphrase['photoplog_x_of_y'], $photoplog_search_now, $photoplog_search_tot); $photoplog_navbits = array(); $photoplog_navbits[$photoplog['location'] . '/index.php' . $vbulletin->session->vars['sessionurl_q']] = htmlspecialchars_uni($vbphrase['photoplog_photoplog']); $photoplog_navbits[$photoplog['location'] . '/slideshow.php' . $vbulletin->session->vars['sessionurl_q']] = htmlspecialchars_uni($vbphrase['photoplog_slideshow']); $photoplog_navbits[''] = $photoplog['fid_title']; if ($photoplog['jsactive']) { $photoplog_navbits[''] = $vbphrase['photoplog_slides']; } photoplog_file_link($photoplog_fid_userid, $photoplog['fid_current'], $photoplog_fid_filename); ($hook = vBulletinHook::fetch_hook('photoplog_slideshow_page')) ? eval($hook) : false; photoplog_output_page('photoplog_slideshow_page', $vbphrase['photoplog_slideshow'], '', $photoplog_navbits); } ($hook = vBulletinHook::fetch_hook('photoplog_slideshow_complete')) ? eval($hook) : false; if ($_REQUEST['do'] != 'query' && $_REQUEST['do'] != 'view' && $_POST['do'] != 'show' && $_GET['do'] != 'show') { photoplog_index_bounce(); }
$photoplog_admin_sql1 = ''; $photoplog_admin_sql1a = ''; $photoplog_admin_sql2 = ''; $photoplog_admin_sql2a = ''; $photoplog_admin_sql3 = ''; $photoplog_admin_sql4 = PHOTOPLOG_PREFIX . 'photoplog_fileuploads.num_comments1 AS num_comments, ' . PHOTOPLOG_PREFIX . 'photoplog_fileuploads.num_ratings1 AS num_ratings, ' . PHOTOPLOG_PREFIX . 'photoplog_fileuploads.sum_ratings1 AS sum_ratings, IF(' . PHOTOPLOG_PREFIX . 'photoplog_fileuploads.num_ratings1 > 0,' . PHOTOPLOG_PREFIX . 'photoplog_fileuploads.sum_ratings1 / ' . PHOTOPLOG_PREFIX . 'photoplog_fileuploads.num_ratings1,0) AS ave_ratings, ' . PHOTOPLOG_PREFIX . 'photoplog_fileuploads.last_comment_dateline1 AS last_comment_dateline, ' . PHOTOPLOG_PREFIX . 'photoplog_fileuploads.last_comment_id1 AS last_comment_id'; $photoplog_admin_sql5 = 'AND ' . PHOTOPLOG_PREFIX . 'photoplog_catcounts.moderate = 1'; } // ###################### CHECK FOR PLOG ACTIVE ########################### if (!$vbulletin->options['photoplog_is_active'] && !can_administer('canadminforums')) { photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbulletin->options['photoplog_off_reason']); } $photoplog_off_warn = 0; if (!$vbulletin->options['photoplog_is_active']) { $photoplog_off_warn = 1; } // ################### INITIALIZE SUB NAVBAR LINKS ######################## $vbulletin->input->clean_array_gpc('g', array('n' => TYPE_UINT)); $photoplog_file_id = $vbulletin->GPC['n']; $photoplog_file_info_links = ''; if (!defined('PHOTOPLOG_HTTPD')) { $photoplog_link_catid = 0; if ($photoplog_file_id) { $photoplog_file_info_links = $db->query_first("SELECT catid, userid,\r\n\t\t\tfileid, filename, title, description, fielddata, moderate, username,\r\n\t\t\tdimensions, filesize, dateline, views, exifinfo, setid,\r\n\t\t\t{$photoplog_admin_sql4}\r\n\t\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\t\tWHERE fileid = " . intval($photoplog_file_id) . "\r\n\t\t\t{$photoplog_catid_sql1}\r\n\t\t\t{$photoplog_admin_sql1}\r\n\t\t"); $photoplog_link_catid = intval($photoplog_file_info_links['catid']); }
$photoplog_cat_perm = array(); $photoplog_cat_perm['cancreateunmoderatedcategories'] = 0; $photoplog_cat_opts = array(); $photoplog_cat_opts['openforsubcats'] = 0; if (isset($photoplog_inline_bits[$photoplog_parentid])) { $photoplog_cat_perm = convert_bits_to_array($photoplog_inline_bits[$photoplog_parentid], $photoplog_categoryoptpermissions); } if (!$photoplog_cat_perm['cancreateunmoderatedcategories']) { photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_no_permission']); } unset($photoplog_cat_perm); if (isset($photoplog_ds_catopts[$photoplog_parentid]['options'])) { $photoplog_cat_opts = convert_bits_to_array($photoplog_ds_catopts[$photoplog_parentid]['options'], $photoplog_categoryoptions); } if (!$photoplog_cat_opts['openforsubcats']) { photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_bad_category']); } unset($photoplog_cat_opts); } if ($_POST['do'] == 'dosuggest') { if ($db->query_write("INSERT INTO " . PHOTOPLOG_PREFIX . "photoplog_suggestedcats\r\n\t\t\t\t(userid,title,description,displayorder,parentid,options,dateline)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(\r\n\t\t\t\t\t" . intval($photoplog['userid']) . ",\r\n\t\t\t\t\t'" . $db->escape_string($photoplog['title']) . "',\r\n\t\t\t\t\t'" . $db->escape_string($photoplog['description']) . "',\r\n\t\t\t\t\t" . intval($photoplog_displayorder) . ",\r\n\t\t\t\t\t" . intval($photoplog_parentid) . ",\r\n\t\t\t\t\t" . intval($photoplog_options) . ",\r\n\t\t\t\t\t" . intval(TIMENOW) . "\r\n\t\t\t\t)\r\n\t\t\t")) { if ($vbulletin->options['photoplog_admin_email']) { $photoplog_subject = $photoplog_message = ''; eval(fetch_email_phrases('photoplog_mod_category', -1, '', 'photoplog_')); vbmail($vbulletin->options['webmasteremail'], $photoplog_subject, $photoplog_message, true); } } } if ($_POST['do'] == 'docreate') { if ($db->query_write("INSERT INTO " . PHOTOPLOG_PREFIX . "photoplog_categories\r\n\t\t\t\t(title,description,displayorder,parentid,options)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(\r\n\t\t\t\t\t'" . $db->escape_string($photoplog['title']) . "',\r\n\t\t\t\t\t'" . $db->escape_string($photoplog['description']) . "',\r\n\t\t\t\t\t" . intval($photoplog_displayorder) . ",\r\n\t\t\t\t\t" . intval($photoplog_parentid) . ",\r\n\t\t\t\t\t" . intval($photoplog_options) . "\r\n\t\t\t\t)\r\n\t\t\t")) { $photoplog_catid = $db->insert_id();
($hook = vBulletinHook::fetch_hook('photoplog_report_start')) ? eval($hook) : false; if (!$vbulletin->userinfo['userid'] || !defined('PHOTOPLOG_USER7') || in_array($photoplog_perm_catid, $photoplog_perm_not_allowed_bits)) { photoplog_index_bounce(); } if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'report'; } if ($_REQUEST['do'] == 'report') { $vbulletin->input->clean_array_gpc('g', array('m' => TYPE_UINT, 'n' => TYPE_UINT, 'p' => TYPE_UINT)); $photoplog['commentid'] = $vbulletin->GPC['m']; $photoplog['fileid'] = $vbulletin->GPC['n']; $photoplog['pagenum'] = $vbulletin->GPC['p']; require_once DIR . '/includes/functions_editor.php'; $photoplog['textareacols'] = fetch_textarea_width(); ($hook = vBulletinHook::fetch_hook('photoplog_report_form')) ? eval($hook) : false; photoplog_output_page('photoplog_report_form', $vbphrase['photoplog_report_item']); } if ($_POST['do'] == 'doreport') { $vbulletin->input->clean_array_gpc('p', array('commentid' => TYPE_UINT, 'fileid' => TYPE_UINT, 'pagenum' => TYPE_UINT, 'message' => TYPE_STR)); ($hook = vBulletinHook::fetch_hook('photoplog_report_doreport_start')) ? eval($hook) : false; $photoplog['commentid'] = $vbulletin->GPC['commentid']; $photoplog['fileid'] = $vbulletin->GPC['fileid']; $photoplog['pagenum'] = $vbulletin->GPC['pagenum']; $photoplog_reason = $vbulletin->GPC['message']; $photoplog_return_url = $photoplog['location'] . '/index.php?' . $vbulletin->session->vars['sessionurl'] . 'n=' . $photoplog['fileid']; if ($vbulletin->GPC['message'] == '') { exec_header_redirect($photoplog_return_url); exit; } $photoplog_item_count = $db->query_first_slave("SELECT catid, {$photoplog_admin_sql4}\r\n\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\tWHERE fileid = " . intval($photoplog['fileid']) . "\r\n\t\t{$photoplog_catid_sql1}\r\n\t\t{$photoplog_admin_sql1}\r\n\t"); $photoplog_comment_page = '';
} } if ($_REQUEST['do'] == 'doinsert') { $vbulletin->input->clean_array_gpc('p', array('fileid' => TYPE_UINT, 'albumid' => TYPE_UINT)); ($hook = vBulletinHook::fetch_hook('photoplog_albums_doinsert_start')) ? eval($hook) : false; $photoplog['fileid'] = intval($vbulletin->GPC['fileid']); $photoplog_albumid = intval($vbulletin->GPC['albumid']); $photoplog_file_info = $db->query_first_slave("SELECT albumids\r\n\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\tWHERE fileid = " . intval($photoplog['fileid']) . "\r\n\t\t{$photoplog_catid_sql1}\r\n\t\t{$photoplog_admin_sql1}\r\n\t"); if (!$photoplog_file_info) { photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_mod_queue']); } $photoplog_file_albumids_arr = unserialize($photoplog_file_info['albumids']); $db->free_result($photoplog_file_info); $photoplog_album_info = $db->query_first_slave("SELECT fileids\r\n\t\tFROM " . PHOTOPLOG_PREFIX . "photoplog_useralbums\r\n\t\tWHERE albumid = " . intval($photoplog_albumid) . "\r\n\t\tAND userid = " . intval($vbulletin->userinfo['userid']) . "\r\n\t"); if (!$photoplog_album_info) { photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_mod_queue']); } $photoplog_album_fileids_arr = unserialize($photoplog_album_info['fileids']); $db->free_result($photoplog_album_info); if (!is_array($photoplog_file_albumids_arr)) { $photoplog_file_albumids_arr = array(); } if (!in_array($photoplog_albumid, $photoplog_file_albumids_arr)) { $photoplog_file_albumids_arr[] = intval($photoplog_albumid); } $photoplog_file_albumids = serialize($photoplog_file_albumids_arr); $db->query_write("UPDATE " . PHOTOPLOG_PREFIX . "photoplog_fileuploads\r\n\t\tSET albumids = '" . $db->escape_string($photoplog_file_albumids) . "'\r\n\t\tWHERE fileid = " . intval($photoplog['fileid']) . "\r\n\t"); if (!is_array($photoplog_album_fileids_arr)) { $photoplog_album_fileids_arr = array(); } if (!in_array($photoplog['fileid'], $photoplog_album_fileids_arr)) {
if ($photoplog_ds_catopts[$photoplog['cat_id2']]['title']) { $photoplog['cat_title'] = $photoplog['cat_title'] . htmlspecialchars_uni(' - ' . $photoplog_ds_catopts[$photoplog['cat_id2']]['title']); } } else { $photoplog['cat_title'] = $photoplog['cat_title'] . htmlspecialchars_uni(' - ' . $vbphrase['photoplog_last_thirty_days']); } } } } } } } if ($photoplog['cat_title']) { $photoplog_phrase = $photoplog['cat_title']; } else { $photoplog_phrase = htmlspecialchars_uni($vbphrase[photoplog_file_list]); } if ($vbulletin->options['photoplog_display_type'] == 1) { ($hook = vBulletinHook::fetch_hook('photoplog_index_blocklist')) ? eval($hook) : false; photoplog_output_page('photoplog_block_list', $photoplog_phrase, '', $photoplog_navbits); } else { ($hook = vBulletinHook::fetch_hook('photoplog_index_filelist')) ? eval($hook) : false; photoplog_output_page('photoplog_file_list', $photoplog_phrase, '', $photoplog_navbits); } } } } ($hook = vBulletinHook::fetch_hook('photoplog_index_complete')) ? eval($hook) : false; if ($_REQUEST['do'] != 'view') { photoplog_index_bounce(); }