Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

function doctype(){
if ($this->template === 'question' && isset($this->content['q_view'])) {
$this->addCategoryPrefixToTitleInList($this->content['q_view'], isset($this->content['title']));
}
qa_html_theme_base::doctype();
}
function addCategoryPrefixToTitleInList(&$q_item, $shouldChangeTitle) {
if (isset($q_item['raw']['categoryid'], $q_item['raw']['categoryname'], $q_item['title'])) {
$categoryId = $q_item['raw']['categoryid'];
function stripAnchors($text) {
return preg_replace("/<a.*?>(.*?)?<\/a>/im", "$1", $text);
}
function post_meta($post, $class, $prefix=null, $separator='<br/>') {
$this->output('<span class="'.$class.'-meta">');
if (isset($prefix))
$this->output($prefix);
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
require_once QA_INCLUDE_DIR.'qa-db-selects.php';
$populartags=qa_db_single_select(qa_db_popular_tags_selectspec(0, (int)qa_opt('tag_cloud_count_tags')));
reset($populartags);
$maxcount=current($populartags);
$themeobject->output(
function ranking($ranking)
{
$this->part_title($ranking);
$class=(@$ranking['type']=='users') ? 'qa-top-users' : 'qa-top-tags';
$rows=min($ranking['rows'], count($ranking['items']));
if ($rows>0) {
$this->output('<table class="'.$class.'-table">');
require_once QA_INCLUDE_DIR.'qa-db-selects.php';
require_once QA_INCLUDE_DIR.'qa-db-admin.php';
$query = "SHOW INDEX FROM ^messages WHERE key_name = 'tohidden'";
$result = qa_db_read_one_value(qa_db_query_sub($query), true);
$shouldRun = !isset($result);
if ($shouldRun) {
echo "Running the update...<br>";
qa_db_query_sub('DROP INDEX fromhidden on ^messages');
qa_db_query_sub('ALTER TABLE qa_messages ADD KEY fromhidden (fromhidden), ADD KEY tohidden (tohidden)');
function title()
{
if (isset($this->content['title'])) {
$this->output($this->content['title']);
if (isset($this->content['q_view']['closed']) && !empty($this->content['q_view']['closed']))
$this->output(' [' . qa_lang_html('main/closed') . ']');
}
}
function q_item_title($q_item)
function page_title_error()
{
$favorite=@$this->content['favorite'];
if (isset($favorite))
$this->output('<form '.$favorite['form_tags'].'>');
echo 'Template: ' . $this->template . ' ';
switch ($this->template) {
case 'qa':