modified: redesign2018/markdownExperiment/admin/phpcount/phpcountLog.php - vergeblicher Versuch die fehlerhafte Anzeige bei deaktiviertem JS zu beheben modified: redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl - Anpassungen von Hand für einzelne Spezialfälle (@todo eifachere Individualkonfiguration) modified: redesign2018/markdownExperiment/src/Makefiles/Makefile.ftpUpload modified: redesign2018/markdownExperiment/src/Makefiles/Makefile.vidstabTest - Konzept einer neuen Videogalerie modified: redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py new file: redesign2018/markdownExperiment/src/galleryHelper/videoGallery.tmpl.php new file: redesign2018/markdownExperiment/src/galleryHelper/videoGalleryVue.tmpl.php new file: redesign2018/markdownExperiment/src/galleryHelper/yamlRead.py
84 lines
3.1 KiB
PHP
84 lines
3.1 KiB
PHP
<?php
|
|
$basePath = "/users/cwsvjudo/www";
|
|
|
|
require_once($basePath."/config/cwsvJudo.config.php");
|
|
|
|
require_once($basePath."/ressourcen/phpLib/phplot/phplot.php");
|
|
require_once($basePath."/ressourcen/phpLib/phplot/rgb.inc.php");
|
|
|
|
try{
|
|
$dbConnection = new PDO(
|
|
'mysql:host='.$cwsvJudoConfig["db"]["host"].';dbname='.$cwsvJudoConfig["db"]["name"],
|
|
$cwsvJudoConfig["db"]["user"],
|
|
$cwsvJudoConfig["db"]["password"]
|
|
);
|
|
|
|
$dailyHitsQuery = $dbConnection->prepare(
|
|
"SELECT COUNT(*) AS anz, DATE(timeStamp) as date FROM `phpcount_pageHits` GROUP BY date ORDER BY date DESC;"
|
|
);
|
|
$dailyHitsQuery->execute();
|
|
$dailyHitsList = $dailyHitsQuery->fetchAll(PDO::FETCH_ASSOC);
|
|
/*
|
|
$uniqueHitsQuery = $dbConnection->prepare(
|
|
"SELECT pageid, hitcount FROM `phpcount_hits` WHERE isunique=1 ORDER BY hitcount DESC"
|
|
);
|
|
$uniqueHitsQuery->execute();
|
|
$uniqueHitsList = $uniqueHitsQuery->fetchAll(PDO::FETCH_ASSOC);
|
|
*/
|
|
$whereClauses=array();
|
|
if($_GET['userHash'])
|
|
$whereClauses[]="userHash='".$_GET['userHash']."'";
|
|
if($_GET['date'])
|
|
$whereClauses[]="DATE(timestamp)='".$_GET['date']."'";
|
|
if($_GET['pageId'])
|
|
$whereClauses[]="pageId='".urldecode($_GET['pageId'])."'";
|
|
|
|
$whereClause = join(" AND ", $whereClauses);
|
|
|
|
$pagehitsQuery = $dbConnection->prepare(
|
|
"SELECT DATE(timeStamp) as date, TIME(timestamp) as time, pageId, userHash FROM `phpcount_pageHits` ".
|
|
($whereClause?"WHERE ".$whereClause." ":"").
|
|
"ORDER BY timeStamp DESC;"
|
|
);
|
|
$pagehitsQuery->execute();
|
|
$pagehitsList = $pagehitsQuery->fetchAll(PDO::FETCH_ASSOC);
|
|
|
|
// var_dump($_GET);
|
|
if($_GET['action']=="deleteHitter"){
|
|
//var_dump($_GET['action']);
|
|
$deleteHitterQuery = $dbConnection->prepare(
|
|
"DELETE FROM `phpcount_pageHits` WHERE userHash=:userHash;"
|
|
);
|
|
$deleteHitterQuery->bindParam(':userHash', $_GET['userHash']);
|
|
if($deleteHitterQuery->execute());
|
|
else echo("FEHLER\n");
|
|
}
|
|
}
|
|
catch(PDOException $db_error){
|
|
die( "Error!: " . $db_error->getMessage() );
|
|
}
|
|
//var_dump($dailyHitsList);
|
|
?>
|
|
<html>
|
|
<body>
|
|
<img src="visitorCount.phplot.php" />
|
|
<a href="?">RESET</a>
|
|
<?php if(isset($_GET['userHash']))?><form action="./phpcountLog.php"><input type="hidden" name="userHash" id="userHash" value="<?php echo($_GET['userHash']);?>"><input type="hidden" name="action" id="action" value="deleteHitter"><button type="submit">DeleteHitter</button></form>
|
|
<table>
|
|
<tr><th><?php echo( join( "</th><th>", array_column($dailyHitsList, 'date') ) );?></th></tr>
|
|
<tr><td><?php echo( join( "</td><td>", array_column($dailyHitsList, 'anz') ) );?></td></tr>
|
|
</table>
|
|
<hr />
|
|
<table>
|
|
<tr><th>date</th><th>time</th><th>pageId</th><th>userHash</th></tr>
|
|
<?php foreach($pagehitsList as $pagehitsEntry)
|
|
echo( "\t\t\t\t<tr>".
|
|
"<td><a href=\"?date=".$pagehitsEntry['date']."\">".$pagehitsEntry['date']."</a></td>".
|
|
"<td>".$pagehitsEntry['time']."</td>".
|
|
"<td><a href=\"?pageId=".urlencode( $pagehitsEntry['pageId'] )."\">".urldecode($pagehitsEntry['pageId'])."</a></td>".
|
|
"<td><a href=\"?userHash=".$pagehitsEntry['userHash']."\">".substr($pagehitsEntry['userHash'], 0, 5)."...</a><td></tr>" );
|
|
?>
|
|
</table>
|
|
</body>
|
|
</html>
|