Skip to content

Commit

Permalink
Merge branch 'feindura2.0'
Browse files Browse the repository at this point in the history
Conflicts:
	library/includes/update.include.php
  • Loading branch information
frozeman committed Dec 5, 2012
2 parents 11dab98 + 23f96a8 commit 527920f
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions library/includes/update.include.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ function until($build) {
// try to MOVE the UPLOAD FOLDER to the new place
$copyError = false;
$copySuccess = false;
sleep(1);
if(!empty($adminConfig['uploadPath']) && is_dir(DOCUMENTROOT.$adminConfig['uploadPath'])) {
copyDir(DOCUMENTROOT.$adminConfig['uploadPath'],dirname(__FILE__).'/../../upload/',$copyError);
$copySuccess = true;
Expand Down Expand Up @@ -180,7 +179,7 @@ function until($build) {
$updateSuccessful = false;
}

// rename the statistics folder
// rename the STATISTICS FOLDER
$copyError = false;
$copySuccess = false;
sleep(1);
Expand All @@ -190,6 +189,7 @@ function until($build) {

if(!$copyError && $copySuccess) {
GeneralFunctions::deleteFolder(dirname(__FILE__).'/../../statistic');
$websiteStatistic = include(dirname(__FILE__).'/../../statistics/website.statistic.php');
} elseif($copyError) {
$updateErrors[] = $langFile['UPDATE_ERROR_RENAMESTATISTICSFOLDER'];
$updateSuccessful = false;
Expand Down Expand Up @@ -605,47 +605,49 @@ function until($build) {
}

// ->> SAVE WEBSITE STATISTIC
$time = $websiteStatistic['firstVisit'];
if(substr($time,4,1) == '-')
$websiteStatistic['firstVisit'] = mktime(substr($time,11,2),substr($time,14,2),substr($time,-2),substr($time,5,2),substr($time,8,2),substr($time,0,4));

$time = $websiteStatistic['lastVisit'];
if(substr($time,4,1) == '-')
$websiteStatistic['lastVisit'] = mktime(substr($time,11,2),substr($time,14,2),substr($time,-2),substr($time,5,2),substr($time,8,2),substr($time,0,4));

$data = $websiteStatistic['browser'];
if(strpos($data,'|#|') !== false)
$websiteStatistic['browser'] = changeToSerializedDataString($data,'|#|');
elseif(strpos($data,'|') !== false)
$websiteStatistic['browser'] = changeToSerializedDataString($data,'|');
elseif(!empty($data) && substr($data,0,2) != 'a:')
$websiteStatistic['browser'] = changeToSerializedDataString($data,' ');
if(until(1002)) {
$time = $websiteStatistic['firstVisit'];
if(substr($time,4,1) == '-')
$websiteStatistic['firstVisit'] = mktime(substr($time,11,2),substr($time,14,2),substr($time,-2),substr($time,5,2),substr($time,8,2),substr($time,0,4));

// rename
$websiteStatistic['robotVisitCount'] = (isset($websiteStatistic['spiderVisitCount'])) ? $websiteStatistic['spiderVisitCount'] : $websiteStatistic['robotVisitCount'];
$time = $websiteStatistic['lastVisit'];
if(substr($time,4,1) == '-')
$websiteStatistic['lastVisit'] = mktime(substr($time,11,2),substr($time,14,2),substr($time,-2),substr($time,5,2),substr($time,8,2),substr($time,0,4));

if($statisticFile = fopen(dirname(__FILE__)."/../../statistics/website.statistic.php","wb")) {
$data = $websiteStatistic['browser'];
if(strpos($data,'|#|') !== false)
$websiteStatistic['browser'] = changeToSerializedDataString($data,'|#|');
elseif(strpos($data,'|') !== false)
$websiteStatistic['browser'] = changeToSerializedDataString($data,'|');
elseif(!empty($data) && substr($data,0,2) != 'a:')
$websiteStatistic['browser'] = changeToSerializedDataString($data,' ');

flock($statisticFile,LOCK_EX);
fwrite($statisticFile,"<?php\n");
// rename
$websiteStatistic['robotVisitCount'] = (isset($websiteStatistic['spiderVisitCount'])) ? $websiteStatistic['spiderVisitCount'] : $websiteStatistic['robotVisitCount'];

fwrite($statisticFile,"\$websiteStatistic['userVisitCount'] = ".XssFilter::int($websiteStatistic["userVisitCount"],0).";\n");
fwrite($statisticFile,"\$websiteStatistic['robotVisitCount'] = ".XssFilter::int($websiteStatistic["robotVisitCount"],0).";\n\n");
if($statisticFile = fopen(dirname(__FILE__)."/../../statistics/website.statistic.php","wb")) {

fwrite($statisticFile,"\$websiteStatistic['firstVisit'] = ".XssFilter::int($websiteStatistic["firstVisit"],0).";\n");
fwrite($statisticFile,"\$websiteStatistic['lastVisit'] = ".XssFilter::int($websiteStatistic["lastVisit"],0).";\n\n");
flock($statisticFile,LOCK_EX);
fwrite($statisticFile,"<?php\n");

fwrite($statisticFile,"\$websiteStatistic['browser'] = '".$websiteStatistic["browser"]."';\n\n");
fwrite($statisticFile,"\$websiteStatistic['userVisitCount'] = ".XssFilter::int($websiteStatistic["userVisitCount"],0).";\n");
fwrite($statisticFile,"\$websiteStatistic['robotVisitCount'] = ".XssFilter::int($websiteStatistic["robotVisitCount"],0).";\n\n");

fwrite($statisticFile,"return \$websiteStatistic;");
fwrite($statisticFile,"\$websiteStatistic['firstVisit'] = ".XssFilter::int($websiteStatistic["firstVisit"],0).";\n");
fwrite($statisticFile,"\$websiteStatistic['lastVisit'] = ".XssFilter::int($websiteStatistic["lastVisit"],0).";\n\n");

fwrite($statisticFile,"\n?>");
flock($statisticFile,LOCK_UN);
fclose($statisticFile);
fwrite($statisticFile,"\$websiteStatistic['browser'] = '".$websiteStatistic["browser"]."';\n\n");

} else {
$updateErrors[] = $langFile['UPDATE_ERROR_SAVEWEBSITESTATISTICS'];
$updateSuccessful = false;
fwrite($statisticFile,"return \$websiteStatistic;");

fwrite($statisticFile,"\n?>");
flock($statisticFile,LOCK_UN);
fclose($statisticFile);

} else {
$updateErrors[] = $langFile['UPDATE_ERROR_SAVEWEBSITESTATISTICS'];
$updateSuccessful = false;
}
}

// ->> refresh the Feeds
Expand Down

0 comments on commit 527920f

Please sign in to comment.