personal-site /admin/home.php

Language PHP Lines 191
MD5 Hash 3e178fa016af02115fadea2ebd9bf5af Estimated Cost $1,805 (why?)
Repository https://bitbucket.org/daao87/personal-site.git View Raw File View Project SPDX
  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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
session_start();
if(!isset($_SESSION['username'])){
	header("Location: index.php");
	die("You are not logged in. Please go to <a href='index.php'>login</a>");
}
$valid_ext = array("TXT","txt","htm","HTM","html","HTML","shtm","SHTM","shtml","SHTML","pl","PL","cgi","CGI","CSS","css","conf","CONF","ASP","asp","JSP","jsp","js","JS","php","PHP","php3","PHP3","PHTML","phtml","ini","INI","cfm","CFM","inc","INC","xml","XML");

function drawFolder($dir,$valid_ext){
	drawLinks(glob($dir."*.*"),$valid_ext);
	$folders = glob($dir . "*");
	foreach($folders as $folder){
		drawLinks(glob($folder."/" . "*.*"),$valid_ext);
	}
}
function drawLinks($pages,$valid_ext){
	if(!empty($pages)){
		foreach($pages as $page){
			$page = substr($page,2);
	    	$ext = substr(strrchr($page, '.'), 1);
			$pageText = "<span style='font-size:11px;'><em>".substr($page, 0, strrpos( $page, '/') )."/</em></span>&nbsp;".substr(strrchr($page, '/'), 1);
			if (in_array($ext,$valid_ext) && is_writable("../".$page)) {
				echo '<a class="pageLink" title="Edit now!" href="code-editor.php?p='.'..'.$page.'">'.$pageText.'</a><br />';
			}
		}
	}
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Admin Area - Overview</title>
	<link rel="stylesheet" type="text/css" href="css/main.css" />
	<link rel="stylesheet" type="text/css" href="css/home.css" />
	<script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    <script type="text/javascript">window.jQuery || document.write('<script type="text/javascript" src="../js/inc/jquery181.js"><\/script>')</script>
	<script type="text/javascript" language="javascript" src="js/main.js"></script>
    <script type="text/javascript" language="javascript" src="js/home.js"></script>
</head> 
<body>
<div id="headerWrapper"><div id="header">
<h1>
<a href="home.php">Admin</a>  
<a href="../" target='_blank' style='font-size:16px; margin-left:30px;'>Visit site</a>
<a href="../mobile.php" target='_blank' style='font-size:16px; margin-left:30px;'>Visit mobile site</a> 
<a href="sitemap.php" target='_blank' style='font-size:16px; margin-left:30px;'>Build Sitemap</a>
</h1>
<a id="logoutLink" href="#" onclick='logout();'>Logout</a>
</div></div>
<div id="wrapper">
	
<table width="100%" >
    <thead valign="top" align="left">
    <tr >
		<th style='width:50%;'>
			<h2>Your Pages</h2>
    	</th>
        <th>
        	<h2>Other Files</h2>
        </th>
        <th>
        </th>
   </tr>
   </thead>     
   <tbody>
   <tr valign="top">
   <td style='padding:0 10px;'>
		<?php
		//get all pages
				
		$pages = glob("../pages/*.*");
		if(!empty($pages)){
			foreach($pages as $page){
				$page = substr($page,2);
		    	$ext = substr(strrchr($page, '.'), 1);
				$pageText = "<span style='font-size:11px;'><em>pages/</em></span>&nbsp;".substr(strrchr($page, '/'), 1);
				if (in_array($ext,$valid_ext) && is_writable("../".$page)) {
					echo '<a class="pageLink" title="Edit now!" href="page-editor.php?p='.substr($page,7).'">'.$pageText.'</a><br />';
				}
			}
		}
		
		$folders = glob("../pages/*");
		foreach($folders as $folder){
			$pages = glob($folder."/" . "*.*");
			if(!empty($pages)){
				foreach($pages as $page){
					$page = substr($page,2);
		    		$ext = substr(strrchr($page, '.'), 1);
					$pageText = "<span style='font-size:11px;'><em>".substr($page, 0, strrpos( $page, '/') )."/</em></span>&nbsp;".substr(strrchr($page, '/'), 1);
					if (in_array($ext,$valid_ext) && is_writable("../".$page)) {
						echo '<a class="pageLink" title="Edit now!" href="page-editor.php?p='.substr($page,7).'">'.$pageText.'</a><br />';
					}
				}
			}
		}
		
		?><br />
	    <a href="#" id="newPage">New page</a>
	    <div id="newPageWrapper"><em>The page will be made in /pages/ directory</em><br /><br />
	      filename: <input id="newPageName" size="25"/><br /><br />
	    <button id="newPageSubmit">Create</button><span id="newPageMsgbox"></span>
	    </div>
   </td><td style='padding:0 10px;' width="50%">
  		<h3  style='margin-top:0px;'>Config</h3>
        <?php
		drawFolder("../config/",$valid_ext);
		?>
	    <br />
	    <h3>Javascript</h3>
	    <?php
		drawFolder("../js/",$valid_ext);
		?>
	    <br />
	    <h3>CSS</h3>
	    <?php
		drawFolder("../css/",$valid_ext);
		?><br />
        
    </td><td style='padding:0 10px;' width="50%">
    	<h3 style='margin-top:0px;'>Root</h3>
	    <?php
		$directory = "../";
		drawLinks(glob($directory . "*.*"),$valid_ext);
		?><br /> 
        <h3>Mobile</h3>
	    <?php
		drawFolder("../mobile/",$valid_ext);
		?><br /> 
        
        
          
	    <h3>Path</h3>
	    <form id="goPathForm"><input id="goPathLink" size="40" /><button type="submit" id="goPathSubmit">Open</button></form>
    </td></tr></tbody></table>
    
    <hr />
    <table width="100%">
    <tr><td colspan="2" width="50%"><h2>Plugins</h2></td><td colspan="2" width="50%"><h2>Themes</h2></td></tr>
    <tr valign="top">
    <td width="25%">
    <h3 style="margin-top:0;">Config</h3>    
    <?php
	$folders = glob("../plugins/*");
	foreach($folders as $folder){
		if(file_exists($folder."/settings.php")){
			if (is_writable($folder."/settings.php")) {
				echo '<a class="pageLink" title="Edit now!" href="code-editor.php?p='.$folder."/settings.php".'">'.str_replace("../plugins/","",$folder).'</a><br />';
			}
		}
	}
	?>
    </td><td>
   	<h3 style="margin-top:0;">Files</h3>
    <?php
	$folders = glob("../plugins/*");
	foreach($folders as $key=>$folder){
		echo "<a href='#' id='plugindir".$key."' class='plugindirs'>".$folder."</a><div class='pluginfiles' id='pluginlink".$key."'>";
		drawFolder($folder."/" . "*",$valid_ext);
		echo "</div>";
	}
	?>
    </td>
    <td>
    <h3 style="margin-top:0;"">Files</h3>
    <?php
	$folders = glob("../themes/*");
	foreach($folders as $key=>$folder){
		echo "<a href='#' id='themedir".$key."' class='themedirs'>".$folder."</a><div class='themefiles' id='themelink".$key."'>";
		drawFolder($folder."/" . "*",$valid_ext);
		echo "</div>";
	}
	?>
    </td>
    </tr>
    </table>
    <hr />
    <h2>Compressing</h2>
    <em>This framework can compress and combine CSS and JS files. By compressing they have a smaller size and it makes your site faster to load. The framework caches the compressed files and wont make any changes to your original files, so you can edit them. The script should detect when a file is changed to update the cache. If you don't see your change, try pressing the 'Flush Cache' button. If you have the no-javascript version enabled, you must click "Rebuild NoJS" everytime you did a change to the tile config of the mobile version. To enable caching, open config.php in the root folder and set $enableCompressionCss and/or $enableCompressionJs to true.</em>
    <br /><br />
    <button id="flushCacheButton" >Flush cache!</button>
    <span id='flushMsgbox'></span>
</div>
<a id="footer" href="http://metro-webdesign.info" target="_blank">ŠThomas Verelst; only for donators</a>
<!-- Please leave this line -->
</body>
</html>
Back to Top