diff options
author | V.Krishn <vkrishn@insteps.net> | 2024-11-01 08:48:28 -0400 |
---|---|---|
committer | V.Krishn <vkrishn@insteps.net> | 2024-11-01 08:48:28 -0400 |
commit | 820eaaced0190d4e1cc6da8563e7c0b0ffe62ada (patch) | |
tree | 2b97703e037d2188f2c7c0833b9b72e4368ad364 | |
parent | 96e4bd903b319958ee453f2bb7b802345e54c9b1 (diff) | |
download | scripts-820eaaced0190d4e1cc6da8563e7c0b0ffe62ada.tar.bz2 |
minor fix, add active dt class
-rw-r--r-- | alpine/irc/log/ircdaily.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/alpine/irc/log/ircdaily.php b/alpine/irc/log/ircdaily.php index 2e574e2..3389e5f 100644 --- a/alpine/irc/log/ircdaily.php +++ b/alpine/irc/log/ircdaily.php @@ -8,21 +8,21 @@ $ConfigAll['base']['install']['path'] = realpath($_SERVER['DOCUMENT_ROOT']); $ConfigAll['base']['install']['url']['http'] = 'http://' . $domain; $ConfigAll['base']['install']['url']['https'] = 'https://' . $domain; $ConfigAll['base']['install']['url']['current'] = $ConfigAll['base']['install']['url']['http']; -$ConfigAll['application']['install']['path'] = $ConfigAll['base']['install']['path'].'/irclogs/alpine'; + +$dirurl = dirname($_SERVER['SCRIPT_NAME']); +$ConfigAll['application']['install']['path'] = $ConfigAll['base']['install']['path'].$dirurl; $ConfigAll['application']['script'] = $ConfigAll['base']['install']['url']['current'].$_SERVER['SCRIPT_NAME']; -$filename = basename($_SERVER['SCRIPT_NAME']); -$thisfile = $ConfigAll['application']['install']['path'].'/'.$filename; +$scriptname = basename($_SERVER['SCRIPT_NAME']); +$thisfile = $ConfigAll['application']['install']['path'].'/'.$scriptname; if (! file_exists($thisfile)) { echo "$thisfile not found."; exit; } -$arr_logname = explode('.', $filename); +$arr_logname = explode('.', $scriptname); $logname = $arr_logname[0]; $YYMM = date('Y-m'); $date = 1; -if (! empty($_GET['dt'])) { - $date = (int) $_GET['dt']; -} +if (! empty($_GET['dt'])) { $date = (int) $_GET['dt']; } if ($date <= 1 || $date >= 32) $date = 1; if ($date <= 9) $date = '0'.$date; //print_r($logname); exit; @@ -34,9 +34,10 @@ $fp = @fopen($file, "r"); $a = 0; $str_dts = ''; $sn = $ConfigAll['application']['script']; while ($a <= 30) { - $a++; + $a++; if ($a <= 9) $a = '0'.$a; $href = "$sn?dt=$a"; - $str_dts = $str_dts. "<span class='date'><a href='".$href."'>$a</a></span>"; + $cls = ($a === $date) ? 'active' : ''; + $str_dts = $str_dts. "<span class='date ".$cls."'><a href='".$href."'>$a</a></span>"; } if ($fp) { # first 3 line, html header @@ -51,6 +52,7 @@ if ($fp) { # first 3 line, html header .date {line-height: 110%; float: left; padding: 1px 2px; border: 2px solid #333; color: blue;} .date a { text-decoration: none; display: block; padding: 4px 8px; } .date a:hover { background-color: #eee; } +span.active a { background-color: #999; } .br { height:1px; clear:both; font-size:1px; } </style> <?php @@ -71,9 +73,6 @@ if ($fp) { } fclose($fp); } - -$f = file_get_contents('footer.html'); -echo $f; ?> </ul> </div></body></html> |