This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: On-Site-Notifications | |
Plugin URI: http://www.q2apro.com/plugins/on-site-notifications | |
Plugin Description: Facebook-like / Stackoverflow-like notifications on your question2answer forum that can replace all email-notifications. | |
Plugin Version: 1.0 | |
Plugin Date: 2014-03-29 | |
Plugin Author: q2apro.com | |
Plugin Author URI: http://www.q2apro.com/ | |
Plugin License: GPLv3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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">'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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': |
NewerOlder