Skip to content

Commit

Permalink
refs #1698 : Merge TinyMCE-EX into TinyMCE
Browse files Browse the repository at this point in the history
 refs #1701 : more static implications

 -
  • Loading branch information
inureyes committed Dec 9, 2014
1 parent bb58ad3 commit 25a0a25
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
22 changes: 11 additions & 11 deletions framework/legacy/Textcube.Function.Respond.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
class Respond {
function ResultPage($errorResult) {
static function ResultPage($errorResult) {
if (is_array($errorResult) && count($errorResult) < 2) {
$errorResult = array_shift($errorResult);
}
Expand All @@ -23,7 +23,7 @@ function ResultPage($errorResult) {
exit;
}

function PrintResult($result, $useCDATA=true) {
static function PrintResult($result, $useCDATA=true) {
header('Content-Type: text/xml; charset=utf-8');
$xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$xml .= "<response>\n";
Expand All @@ -32,20 +32,20 @@ function PrintResult($result, $useCDATA=true) {
die($xml);
}

function NotFoundPage($isAjaxCall = false) {
static function NotFoundPage($isAjaxCall = false) {
if($isAjaxCall) {Respond::ResultPage(-1);exit;}
header('HTTP/1.1 404 Not Found');
header("Connection: close");
exit;
}

function ForbiddenPage() {
static function ForbiddenPage() {
header('HTTP/1.1 403 Forbidden');
header("Connection: close");
exit;
}

function MessagePage($message) {
static function MessagePage($message) {
global $service;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Expand All @@ -70,7 +70,7 @@ function MessagePage($message) {
exit;
}

function AlertPage($message) {
static function AlertPage($message) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
Expand All @@ -88,7 +88,7 @@ function AlertPage($message) {
exit;
}

function ErrorPage($message=NULL, $buttonValue=NULL, $buttonLink=NULL, $isAjaxCall = false) {
static function ErrorPage($message=NULL, $buttonValue=NULL, $buttonLink=NULL, $isAjaxCall = false) {
global $service;
if($isAjaxCall) {Respond::ResultPage(-1);exit;}
?>
Expand All @@ -114,7 +114,7 @@ function ErrorPage($message=NULL, $buttonValue=NULL, $buttonLink=NULL, $isAjaxCa
exit;
}

function NoticePage($message, $redirection) {
static function NoticePage($message, $redirection) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
Expand All @@ -133,7 +133,7 @@ function NoticePage($message, $redirection) {
exit;
}

function PrintValue($array, $useCDATA=true) {
static function PrintValue($array, $useCDATA=true) {
$xml = '';
if(is_array($array)) {
foreach($array as $key => $value) {
Expand All @@ -156,11 +156,11 @@ function PrintValue($array, $useCDATA=true) {
return $xml;
}

function escapeJSInAttribute($str) {
static function escapeJSInAttribute($str) {
return htmlspecialchars(str_replace(array('\\', '\r', '\n', '\''), array('\\\\', '\\r', '\\n', '\\\''), $str));
}

function escapeCData($str) {
static function escapeCData($str) {
return str_replace(']]>', ']]&gt;', $str);
}
}
Expand Down
18 changes: 9 additions & 9 deletions framework/legacy/Textcube.Model.Statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Dependency : Textcube.Model.Paging (getRefererLogsWithPage)

class Statistics {
function getStatistics($blogid) {
static function getStatistics($blogid) {
global $database;
$stats = array('total' => 0, 'today' => 0, 'yesterday' => 0);
$result = POD::queryCell("SELECT visits FROM {$database['prefix']}BlogStatistics WHERE blogid = $blogid");
Expand All @@ -22,7 +22,7 @@ function getStatistics($blogid) {
return $stats;
}

function getDailyStatistics($period) {
static function getDailyStatistics($period) {
global $database, $blogid;
return POD::queryAll("SELECT datemark, visits
FROM {$database['prefix']}DailyStatistics
Expand All @@ -31,14 +31,14 @@ function getDailyStatistics($period) {
ORDER BY datemark DESC");
}

function getWeeklyStatistics() {
static function getWeeklyStatistics() {
global $database, $blogid;
$now_day = date('Ymd', strtotime("now"));
$old_day = date('Ymd', strtotime("-1 week"));
return POD::queryAll("SELECT datemark, visits FROM {$database['prefix']}DailyStatistics WHERE blogid = $blogid AND datemark BETWEEN $old_day AND $now_day ORDER BY datemark DESC");
}

function getMonthlyStatistics($blogid) {
static function getMonthlyStatistics($blogid) {
global $database;
$statistics = array();
if ($result = POD::queryAll("SELECT left(datemark, 6) datemark, sum(visits) visits
Expand All @@ -52,7 +52,7 @@ function getMonthlyStatistics($blogid) {
return $statistics;
}

function getRefererStatistics($blogid) {
static function getRefererStatistics($blogid) {
global $database;
$statistics = array();
if ($result = POD::queryAll("SELECT host, count FROM {$database['prefix']}RefererStatistics WHERE blogid = $blogid ORDER BY COUNT DESC LIMIT 20")) {
Expand All @@ -62,17 +62,17 @@ function getRefererStatistics($blogid) {
return $statistics;
}

function getRefererLogsWithPage($page, $count) {
static function getRefererLogsWithPage($page, $count) {
global $database, $blogid;
return Paging::fetch("SELECT host, url, referred FROM {$database['prefix']}RefererLogs WHERE blogid = $blogid ORDER BY referred DESC", $page, $count);
}

function getRefererLogs() {
static function getRefererLogs() {
global $database;
return POD::queryAll("SELECT host, url, referred FROM {$database['prefix']}RefererLogs WHERE blogid = ".getBlogId()." ORDER BY referred DESC LIMIT 1500");
}

function updateVisitorStatistics($blogid) {
static function updateVisitorStatistics($blogid) {
global $database, $blogURL;
if (!fireEvent('UpdatingVisitorStatistics', true))
return;
Expand Down Expand Up @@ -108,7 +108,7 @@ function updateVisitorStatistics($blogid) {
}
}

function setTotalStatistics($blogid) {
static function setTotalStatistics($blogid) {
global $database;
POD::execute("DELETE FROM {$database['prefix']}DailyStatistics WHERE blogid = $blogid");
$prevCount = POD::queryCell("SELECT visits FROM {$database['prefix']}BlogStatistics WHERE blogid = $blogid");
Expand Down

0 comments on commit 25a0a25

Please sign in to comment.