-
Notifications
You must be signed in to change notification settings - Fork 0
/
screenshots.phtml
executable file
·148 lines (130 loc) · 6.9 KB
/
screenshots.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
if (!defined('ABSOLUTELOCATION')) {
define('ABSOLUTELOCATION', dirname(__FILE__));
}
$abspath = ABSOLUTELOCATION;
$serversoftware = $_SERVER['SERVER_SOFTWARE'];
$server_name = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : $_SERVER['SERVER_ADDR'];
$server_addr = $_SERVER['SERVER_ADDR'] ? $_SERVER['SERVER_ADDR'] : $_SERVER['SERVER_NAME'];
$servername = $server_name;
if (preg_match('@10\.0\.0\.\d+|192\.\d\.\d\.\d+|127\.\d\.\d\.\d+@', $server_addr)) {
$abspath = '<code class="info">' . $abspath . '</code>';
} else {
$abspath = 'is simply a PHP value which relies on server variables<code>define( ABSOLUTELOCATION , rtrim(dirname(__FILE__), inc))</code>';
}
date_default_timezone_set('EST');
$page_heading = 'Screenshots in ./assets/screenshots';
$title = 'screenshots rendering page';
$lastMod = "Modified: " . date("D M j Y G:i:s T", getlastmod());
require 'public/class/class-cwthumbs.php';
$cwThumbsClass = new cwThumbs;
if(isset($_POST['imgDirSearch'])){
$newimagesdir = $_POST['imgDirSearch'];
if(is_dir($newimagesdir)){
$cwThumbs = $cwThumbsClass->makeThumbs($newimagesdir,$none=NULL);
$number_of = count($cwThumbs);
$notice_of_images = "<h4>Success:</h4><p>Found $number_of images.</p>";
}
else{
$cwThumbs = $cwThumbsClass->makeThumbs("assets/screenshots",$none=NULL);
$notice_of_images = "<h4>Notice:</h4><p>The directory you entered is not a valid path.</p>";
}
}
else {
$cwThumbs = $cwThumbsClass->makeThumbs("assets/screenshots",$none=NULL);
$number_of = count($cwThumbs);
$notice_of_images = "<h4>Info:</h4><p>Found $number_of screenshots.</p>";
}
$imgDir = $cwThumbsClass->imagesDir;
$imgNumber = $cwThumbsClass->thumbsCount;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
<?php print $title; ?>
</title>
<link rel="icon" type="image/ico" href="favicon.ico">
<link rel="shortcut icon" type="image/ico" href="favicon.ico">
<style>
/** if needed add style here */
</style>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x"
crossorigin="anonymous"> <!-- BOOTSTRAP STYLE -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css">
<link
href="assets/css/notes.css"
rel="stylesheet"
type="text/css">
<script src="assets/js/showme-hideme.js"></script>
</head>
<body>
<div id="pagewidth" class="container">
<section id="header"> <!-- #HEADER -->
<h1 class="bg-dark text-light text-end pe-3"><?php print $page_heading; ?></h1>
<!-- ul class="nobull"><li><a href="http://beelink.wsldebian/index.php" target="_blank">beelink</a></li><li><a href="http://htdocsh.localhost/index.php" target="_blank">htdocsH</a></li><li><a href="http://htdocsl.localhost/index.php" target="_blank">htdocsL</a></li><li><a href="http://portable.localhost/index.php" target="_blank">portable</a></li><li><a href="http://github.localhost/index.php" target="_blank">github</a></li></ul -->
</section>
<section class="content">
<div class="notes">
<?php
if(isset($notice_of_images)) {
echo $notice_of_images;
}
echo '<div class="mt-2 col text-center" id="info_container"><p class="bg-dark text-light">Served by: <span class="bg-dark text-warning">' . $serversoftware . '</span></p>
<p class="bg-dark text-light">PHP Version: <span class="text-warning">' . phpversion() . '</span></p>
<p class="bg-dark text-light">Server Name: <span class="text-info">' . $servername . '</span></p>
<p class="bg-dark text-light">Server Addr: <span class="text-info">' . $server_addr . '</span></p>
</div>';
?>
<dl id="outerDL">
<dt class="pointer">Show Image Contact Sheet: <span class="normal blue pointer" id="morehd2" onclick="showHide('moreinfo2')">[click...]</span></dt>
<dd id="moreinfo2" class="displaynone">
<?php
$contactSheet = "<ul id=\"imgShow\"> \n";
if(isset($cwThumbs) && is_array($cwThumbs)){
foreach($cwThumbs as $cwKey => $cwImg){
$cwImg = $imgDir .'/' . $cwImg;
$imgCounter = $imgNumber[$cwKey];
$contactSheet .= "<li class=\"imgShowItem\"><a onclick=\"popMeUp('".$cwImg.
"')\"><img src=\"".$cwImg."\" alt=\"".$cwImg."\" title=\"img_".$imgCounter.": ".$cwImg."\" /></a></li> \n";
}
}
else{
$contactSheet .= '<li class="bold nobull noBull">Sorry, but there is an error in the source, specific to the image resources contact-sheet previews. <br />Specifically, the ADB PHP-class, <em>cwThumbs</em> fails the logical condition of <br /><pre>
does not exists, is not an array, is has not been properly set.</li>'."\n";
}
$contactSheet .= "</ul> \n";
print $contactSheet;
print " \n <hr id=\"clearImgShow\" /> \n";
?>
</dd>
<dt class="pointer">Change Image Directory: <span class="normal black pointer" id="morehd1" onclick="showHide('moreinfo1')">[click...]</span></dt>
<dd id="moreinfo1" class="displaynone">
<form id="changeImageForm" method="post" action="<?php print $_SERVER['PHP_SELF']; ?>">
<input type="text" id="imgDirSearch" name="imgDirSearch" value="" /><br />
<input type="submit" id="SendImgDir" name="SendImgDir" value="Get New Images!" />
</form>
</dd>
</dl>
<!-- END OUTERDL -->
</div><!-- END CENTERED -->
<?php echo '<p>ABSOLUTELOCATION of this script file: <br><strong><code>' . $abspath . '</code></strong></p>'; ?>
</div> <!-- .notes -->
</section>
<section class="footer px-4"> <!-- .FOOTER -->
<div class="row gx-5">
<div class="col"><div class="p-3 border bg-light"> Based on Notes by <a href="https://github.com/ajaxStardust" target="_blank" title="View original">@ajaxStardust</a> <em>Laravel</em> notes:</div></div>
<div class="col"><div class="p-3 border bg-light text-end"><kbd><?php echo $lastMod; ?></kbd></div></div>
</div>
</section>
</div> <!-- .content -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
</body>
</html>