function cb_hlcode($matches) { global $lang, $scache; $pid = $this->noparse_id(); list(, , $sclang, $code, $nl) = $matches; $code = trim($code, "\r\n"); $rows = explode("\n", $code); if (count($rows) > 1) { $scache->loadClass('UniversalCodeCache'); $cache = new UniversalCodeCache(); $cache->setData($code, $sclang); $data = $cache->get(); if ($cache->hasLanguage()) { $lang->assign('lang_name', $data['language']); $title = $lang->phrase('geshi_hlcode_title'); } else { $title = $lang->phrase('bb_sourcecode'); } $html = '<div class="highlightcode"><a class="bb_blockcode_options" href="misc.php?action=download_code&fid=' . $cache->getHash() . '">' . $lang->phrase('geshi_hlcode_txtdownload') . '</a>'; $html .= '<strong>' . $title . '</strong>'; $html .= '<div class="bb_blockcode">' . $data['parsed'] . '</div></div>'; $this->noparse[$pid] = $html; } else { $code = trim($code); $code = $this->code_prepare($code, count($rows) <= 1); $this->noparse[$pid] = '<code class="bb_inlinecode">' . $code . '</code>'; if (!empty($nl)) { $this->noparse[$pid] .= '<br />'; } } return '<!PID:' . $pid . '>'; }
ok($lang->phrase('goboardpw_success'), 'showforum.php?id=' . $board); } else { error($lang->phrase('goboardpw_wrong_password')); } } else { $slog->updatelogged(); $db->close(); viscacha_header('Location: showforum.php?id=' . $board . SID2URL_JS_x); exit; } } elseif ($_GET['action'] == "download_code") { if (strlen($_GET['fid']) != 32) { error($lang->phrase('query_string_error')); } $scache->loadClass('UniversalCodeCache'); $cache = new UniversalCodeCache(); if (!$cache->setHash($_GET['fid'])) { error($lang->phrase('no_upload_found')); } $sourcecode = $cache->get(); $slog->updatelogged(); $db->close(); viscacha_header('Content-Type: text/plain'); viscacha_header('Content-Length: ' . strlen($sourcecode['source'])); viscacha_header('Content-Disposition: attachment; filename="' . gmdate('d-m-Y_H-i', times()) . '.txt"'); echo $sourcecode['source']; exit; } elseif ($_GET['action'] == "report_post" || $_GET['action'] == "report_post2") { ($code = $plugins->load('showtopic_topic_query')) ? eval($code) : null; $result = $db->query("SELECT r.id, r.report, r.topic_id, r.tstart, r.topic AS title, t.topic, t.status, t.board, t.prefix FROM {$db->pre}replies AS r LEFT JOIN {$db->pre}topics AS t ON r.topic_id = t.id WHERE r.id = '{$_GET['id']}' LIMIT 1", __LINE__, __FILE__); $info = $gpc->prepare($db->fetch_assoc($result));
} else { error($lang->phrase('goboardpw_wrong_password')); } } else { $slog->updatelogged(); $db->close(); sendStatusCode(307, $config['furl'] . '/showforum.php?id=' . $board . SID2URL_JS_x); exit; } } elseif ($_GET['action'] == "download_code") { $fid = $gpc->get('fid', str); if (!is_hash($fid)) { error($lang->phrase('query_string_error')); } $scache->loadClass('UniversalCodeCache'); $cache = new UniversalCodeCache(); if (!$cache->setHash($fid)) { error($lang->phrase('no_upload_found')); } $sourcecode = $cache->get(); $slog->updatelogged(); $db->close(); viscacha_header('Content-Type: text/plain'); viscacha_header('Content-Length: ' . strlen($sourcecode['source'])); viscacha_header('Content-Disposition: attachment; filename="' . gmdate('d-m-Y_H-i', times()) . '.txt"'); echo $sourcecode['source']; exit; } elseif ($_GET['action'] == "report_post" || $_GET['action'] == "report_post2") { ($code = $plugins->load('showtopic_topic_query')) ? eval($code) : null; $result = $db->query("SELECT r.id, r.report, r.topic_id, r.tstart, r.topic AS title, t.topic, t.status, t.board, t.prefix FROM {$db->pre}replies AS r LEFT JOIN {$db->pre}topics AS t ON r.topic_id = t.id WHERE r.id = '{$_GET['id']}' LIMIT 1"); $info = $gpc->prepare($db->fetch_assoc($result));