Pārlūkot izejas kodu

adding the new control panel (2)

pecesama 18 gadus atpakaļ
vecāks
revīzija
30bb631e5b

+ 0 - 197
admin/add.php Parādīt failu

@@ -1,197 +0,0 @@
1
-<?
2
-/* ===========================
3
-
4
-  gelato CMS development version
5
-  http://www.gelatocms.com/
6
-
7
-  gelato CMS is a free software licensed under GPL (General public license)
8
-
9
-  =========================== */
10
-?>
11
-<?
12
-require_once('../config.php');
13
-include("../classes/user.class.php");
14
-include("../classes/gelato.class.php");
15
-include("../classes/templates.class.php");
16
-require_once("../classes/configuration.class.php");
17
-
18
-$user = new user();
19
-$tumble = new gelato();
20
-$conf = new configuration();
21
-$template = new plantillas("admin");
22
-
23
-if ($user->isAdmin()) {
24
-
25
-	if(isset($_POST["btnAdd"]))	{
26
-		unset($_POST["btnAdd"]);
27
-		
28
-		
29
-		if ($_POST["type"]=="2") { // is Photo type			
30
-			if (isset($_POST["url"]) && $_POST["url"]!="")  {			
31
-				$photoName = getFileName($_POST["url"]);
32
-				if (!$tumble->savePhoto($_POST["url"])) {
33
-					header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
34
-					die();
35
-				}
36
-				$_POST["url"] = $conf->urlGelato."/uploads/".$photoName;
37
-			}
38
-			
39
-			if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".$_FILES['photo']['name'] ) ) {
40
-				$_POST["url"] = $conf->urlGelato."/uploads/".$_FILES['photo']['name'];
41
-			}
42
-			
43
-			unset($_POST["photo"]);
44
-			unset($_POST["MAX_FILE_SIZE"]);
45
-		}
46
-		
47
-		if ($_POST["type"]=="7") { // is MP3 type
48
-			set_time_limit(300);
49
-			$mp3Name = getFileName($_POST["url"]);
50
-			if (!$tumble->saveMP3($_POST["url"])) {
51
-				header("Location: ".$conf->urlGelato."/admin/index.php?mp3=false");
52
-				die();
53
-			}
54
-			$_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
55
-		}
56
-		
57
-		if (get_magic_quotes_gpc()) {
58
-			$_POST["title"] = htmlspecialchars(stripslashes($_POST["title"]));
59
-			$_POST["description"] = htmlspecialchars(stripslashes($_POST["description"]));
60
-		} else {
61
-			$_POST["title"] = htmlspecialchars($_POST["title"]);
62
-			$_POST["description"] = htmlspecialchars($_POST["description"]);
63
-		}
64
-		
65
-		$_POST["title"] = strip_tags($_POST["title"]);
66
-		$_POST["description"] = strip_tags($_POST["description"]);
67
-		
68
-		
69
-		if (isset($_POST["id_post"])) {
70
-			//$tumble->modifyPost($_POST, $_POST["id_post"]);
71
-		} else {			
72
-			if ($tumble->addPost($_POST)) {
73
-				header("Location: ".$conf->urlGelato."/admin/index.php?added=true");
74
-				die();
75
-			} else {
76
-				header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$this->merror);
77
-				die();
78
-			}
79
-		}	
80
-	} elseif (isset($_GET["new"])) {	
81
-?>
82
-		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
83
-		<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
84
-		<head>
85
-			<title>gelato</title>
86
-			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
87
-			<link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />			
88
-			<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/tools.js"></script>
89
-			<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>			
90
-			<style type="text/css" media="screen">	
91
-				@import "<?=$conf->urlGelato;?>/admin/css/style-codice.css";
92
-			</style>
93
-		</head>
94
-		<body>
95
-			<div id="div-process" style="display:none;">Processing request...</div>
96
-			<div id="titulo">
97
-				<img src="<?=$conf->urlGelato;?>/images/logo.jpg" alt="gelato CMS" title="gelato CMS" />	
98
-			</div>
99
-			
100
-			<div id="menuContenedor">
101
-				<ul>
102
-					<li id="active"><a href="#" id="current">Posts</a></li>
103
-						<ul>
104
-							<li id="subactive"><a href="#" id="subcurrent">Add</a></li>
105
-						</ul>
106
-					</li>
107
-					<li><a href="index.php">Control Panel</a></li>
108
-				</ul>
109
-			</div>
110
-			
111
-			<div id="contenido">
112
-				<div class="center">
113
-					<div  class="ventana">
114
-						<p class="titulo"><span class="handle">Add content</span></p>
115
-						<div id="formulario">
116
-							<form action="add.php" method="post" <?=($_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd">
117
-								<fieldset>
118
-<?
119
-						switch ($_GET["new"]) {
120
-							case "post":
121
-								$input = array("{type}", "{date}", "{id_user}");
122
-								$output = array("1", time(), $_SESSION['user_id']);
123
-								
124
-								$template->cargarPlantilla($input, $output, "template_add_post");
125
-								$template->mostrarPlantilla();
126
-							   	break;
127
-							case "photo":
128
-								$input = array("{type}", "{date}", "{id_user}");
129
-								$output = array("2", time(), $_SESSION['user_id']);
130
-								
131
-								$template->cargarPlantilla($input, $output, "template_add_photo");
132
-								$template->mostrarPlantilla();							   
133
-							   	break;
134
-							case "quote":
135
-							   	$input = array("{type}", "{date}", "{id_user}");
136
-								$output = array("3", time(), $_SESSION['user_id']);
137
-								
138
-								$template->cargarPlantilla($input, $output, "template_add_quote");
139
-								$template->mostrarPlantilla();
140
-							   	break;
141
-							case "url":
142
-							   	$input = array("{type}", "{date}", "{id_user}");
143
-								$output = array("4", time(), $_SESSION['user_id']);
144
-								
145
-								$template->cargarPlantilla($input, $output, "template_add_link");
146
-								$template->mostrarPlantilla();
147
-							   	break;
148
-							case "conversation":
149
-							   	$input = array("{type}", "{date}", "{id_user}");
150
-								$output = array("5", time(), $_SESSION['user_id']);
151
-								
152
-								$template->cargarPlantilla($input, $output, "template_add_conversation");
153
-								$template->mostrarPlantilla();
154
-							   	break;
155
-							case "video":
156
-							   	$input = array("{type}", "{date}", "{id_user}");
157
-								$output = array("6", time(), $_SESSION['user_id']);
158
-								
159
-								$template->cargarPlantilla($input, $output, "template_add_video");
160
-								$template->mostrarPlantilla();
161
-							   	break;
162
-							case "mp3":
163
-							   	$input = array("{type}", "{date}", "{id_user}");
164
-								$output = array("7", time(), $_SESSION['user_id']);
165
-								
166
-								$template->cargarPlantilla($input, $output, "template_add_mp3");
167
-								$template->mostrarPlantilla();
168
-							   	break;
169
-							default:
170
-								echo "<div class=\"error\">The specified type is not valid.</div>";
171
-								break;
172
-						}
173
-?>
174
-									<p>
175
-										<input class="submit" type="submit" name="btnAdd" value="Create post" />&nbsp;&nbsp;
176
-										<a href="#" onclick="if (confirm('Cancel editing this post?  All changes will be lost.'))
177
-	{location.href='index.php';}; return false;">Cancel</a>
178
-									</p>
179
-								</fieldset>
180
-							</form>
181
-						</div>
182
-					</div> 
183
-				</div> 		
184
-				<div id="pie">
185
-					<p>
186
-						<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
187
-					</p>
188
-				</div>				
189
-			</div>
190
-		</body>
191
-		</html>
192
-<?
193
-	}
194
-} else {
195
-	header("Location: ".$conf->urlGelato."/login.php");
196
-}
197
-?>

Binārs
admin/css/images/Thumbs.db Parādīt failu


Binārs
admin/css/images/delete.png Parādīt failu


Binārs
admin/css/images/edit.png Parādīt failu


admin/css/images/page_white_text.png → admin/css/images/page.png Parādīt failu


Binārs
admin/css/images/page_white_text.gif Parādīt failu


Binārs
admin/css/images/quote.png Parādīt failu


+ 85 - 3
admin/css/style.css Parādīt failu

@@ -1,4 +1,11 @@
1
-/* CSS Document created by Jorge Condomi */
1
+/* ===========================
2
+
3
+  gelato CMS development version
4
+  http://www.gelatocms.com/
5
+
6
+  gelato CMS is a free software licensed under GPL (General public license)
7
+
8
+  =========================== */
2 9
 
3 10
 
4 11
 /************ BASICS *************/
@@ -62,8 +69,14 @@ form.newpost textarea{background: #fff url(images/grad-big.png) top left repeat-
62 69
 .entry{ background-color:#efefef; border:1px solid #ccc; margin:20px 15px;}
63 70
 .info{ border-bottom:1px solid #aaa; position:relative; display:block; padding:4px 10px; height:20px; }
64 71
 .info p{font-size:0.8em; color:#297aab; display:inline;}
65
-form.compact{ float:right; margin:-2px 0 0 0; padding:0;}
66 72
 
73
+.compact{ float:right; margin:-2px 0 0 0; padding:0;}
74
+.compact img{ border:0px; }
75
+.compact a { color:#297aab; font-size:0.8em; }
76
+.compact a:link { color:#297aab; font-size:0.8em; }
77
+.compact a:visited { color:#297aab; font-size:0.8em; }
78
+.compact a:active { color:#297aab; font-size:0.8em; }
79
+.compact a:hover { color:#297aab;  font-size:0.8em; }
67 80
 
68 81
 .post{ padding:10px;}
69 82
 .post h4{ font-style:italic; font-weight:bold; }
@@ -98,7 +111,10 @@ form.compact{ float:right; margin:-2px 0 0 0; padding:0;}
98 111
 	color:#011940;
99 112
 }
100 113
 
101
-/* Mensajes para el usuario */
114
+a.linkFrm, a.linkFrm:link, a.linkFrm:visited, a.linkFrm:active{ color:#297aab; text-decoration:none; outline:none;}
115
+a.linkFrm:hover{ text-decoration:underline; color:#297aab;  outline:none;}
116
+
117
+/* User messages */
102 118
 
103 119
 .error {
104 120
 	width:80%;
@@ -126,3 +142,69 @@ form.compact{ float:right; margin:-2px 0 0 0; padding:0;}
126 142
 	margin: 0 auto;
127 143
 	padding: 5px 20px 5px 45px;
128 144
 }
145
+
146
+/* Pagination */
147
+
148
+div.pagination {
149
+	text-align:center;
150
+	padding:3px;
151
+	margin:3px;
152
+}
153
+
154
+div.pagination a {
155
+	padding: 2px 5px 2px 5px;
156
+	margin-right: 2px;
157
+	border: 1px solid #ddd;
158
+	
159
+	text-decoration: none;
160
+	color: #aaa;
161
+}
162
+
163
+div.pagination a:hover, div.pagination a:active {
164
+	padding: 2px 5px 2px 5px;
165
+	margin-right: 2px;
166
+	border: 1px solid #a0a0a0;
167
+}
168
+
169
+div.pagination span.current {
170
+	padding: 2px 5px 2px 5px;
171
+	margin-right: 2px;
172
+	border: 1px solid #e0e0e0;
173
+	font-weight: bold;
174
+	background-color: #f0f0f0;
175
+	color: #aaa;
176
+}
177
+
178
+div.pagination span.disabled {
179
+	padding: 2px 5px 2px 5px;
180
+	margin-right: 2px;
181
+	border: 1px solid #f3f3f3;
182
+	color: #ccc;
183
+}
184
+
185
+/* Conversation Post */
186
+div.conversation ul {
187
+	list-style-type: none;
188
+	margin: 0px;
189
+	padding: 0px 0px 0px 1px;
190
+	border-left: solid 5px #555;
191
+}
192
+
193
+	div.conversation ul li {
194
+		font-size: 12px;
195
+		padding: 4px 0px 4px 8px;
196
+		color: #000;
197
+		margin-bottom: 1px;
198
+	}
199
+
200
+		div.conversation ul li span.label {
201
+			font-weight: bold;
202
+		}
203
+
204
+		div.conversation ul li.odd {
205
+			background-color: #f4f4f4;
206
+		}
207
+
208
+		div.conversation ul li.even {
209
+			background-color: #e8e8e8;
210
+		}

+ 118 - 41
admin/index.php Parādīt failu

@@ -11,7 +11,9 @@
11 11
 <?
12 12
 require_once('../config.php');
13 13
 include("../classes/user.class.php");
14
+include("../classes/pagination.php");
14 15
 include("../classes/gelato.class.php");
16
+include("../classes/textile.class.php");
15 17
 include("../classes/templates.class.php");
16 18
 require_once("../classes/configuration.class.php");
17 19
 
@@ -88,6 +90,7 @@ if ($user->isAdmin()) {
88 90
 		<link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />
89 91
 		<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/tools.js"></script>
90 92
 		<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>
93
+		<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/slimbox.js"></script>
91 94
 		<script type="text/javascript">
92 95
 		<!--
93 96
 			function exit(el, path) {
@@ -107,7 +110,6 @@ if ($user->isAdmin()) {
107 110
 				contenedor = new Fx.Style('divMessages', 'opacity', {duration: 5000, onComplete:
108 111
 					function() {
109 112
 						document.getElementById('divMessages').style.display="none";
110
-						document.getElementById('pMessages').style.display="none";
111 113
 					}
112 114
 				});
113 115
 				contenedor.custom(1,0);
@@ -116,6 +118,7 @@ if ($user->isAdmin()) {
116 118
 		</script>
117 119
 		<style type="text/css" media="screen">	
118 120
 			@import "<?=$conf->urlGelato;?>/admin/css/style.css";
121
+			@import "<?=$conf->urlGelato;?>/admin/css/slimbox.css";
119 122
 		</style>
120 123
 	</head>
121 124
 	
@@ -126,56 +129,56 @@ if ($user->isAdmin()) {
126 129
 				<h1><a href="<?=$conf->urlGelato;?>/admin/index.php" title="gelato :: home">gelato cms</a></h1>
127 130
 				<ul id="nav">
128 131
 					<li><a href="<?=$conf->urlGelato;?>/" title="Take me to the tumblelog">View Tumblelog</a></li>
129
-					<li><a href="close.php" onclick="return exit('div-process','<?=$conf->urlGelato;?>/admin/ajax.php?action=close');">Log out</a></li>
130
-			  </ul>
132
+					<li><a href="close.php" title="Log off" onclick="return exit('div-process','<?=$conf->urlGelato;?>/admin/ajax.php?action=close');">Log out</a></li>
133
+			  	</ul>
131 134
 			</div>
132 135
 			<div id="main">
133 136
 				<div class="box">
134 137
 					<ul class="menu">
135
-					<h3>New Post</h3>
136
-					<li><a href="<?=$conf->urlGelato;?>/admin/index.php?new=conversation"><img src="css/images/comments.png" alt="New chat" /> Chat</a></li>
137
-					<li><a href="<?=$conf->urlGelato;?>/admin/index.php?new=quote"><img src="css/images/comments.png" alt="New qoute" /> Quote</a></li>
138
-					<li><a href="<?=$conf->urlGelato;?>/admin/index.php?new=url"><img src="css/images/world.png" alt="New link" /> Link</a></li>
139
-					<li><a href="<?=$conf->urlGelato;?>/admin/index.php?new=mp3"><img src="css/images/music.png" alt="New audio" /> Audio</a></li>
140
-					<li><a href="<?=$conf->urlGelato;?>/admin/index.php?new=video"><img src="css/images/film.png" alt="New video" /> Video</a></li>
141
-					<li><a href="<?=$conf->urlGelato;?>/admin/index.php?new=photo"><img src="css/images/image.png" alt="New picture" /> Picture</a></li>
142
-					<li class="selected"><a href="<?=$conf->urlGelato;?>/admin/index.php?new=post"><img src="css/images/page_white_text.png" alt="New post" /> Regular</a></li>
138
+					<h3>New Post</h3>					
139
+					<li <? echo ($_GET["new"]=="conversation") ? "class=\"selected\"" : ""; ?>><a href="<?=$conf->urlGelato;?>/admin/index.php?new=conversation"><img src="css/images/comments.png" alt="New chat" /> Chat</a></li>
140
+					<li <? echo ($_GET["new"]=="quote") ? "class=\"selected\"" : ""; ?>><a href="<?=$conf->urlGelato;?>/admin/index.php?new=quote"><img src="css/images/quote.png" alt="New qoute" /> Quote</a></li>
141
+					<li <? echo ($_GET["new"]=="url") ? "class=\"selected\"" : ""; ?>><a href="<?=$conf->urlGelato;?>/admin/index.php?new=url"><img src="css/images/world.png" alt="New link" /> Link</a></li>
142
+					<li <? echo ($_GET["new"]=="mp3") ? "class=\"selected\"" : ""; ?>><a href="<?=$conf->urlGelato;?>/admin/index.php?new=mp3"><img src="css/images/music.png" alt="New audio" /> Audio</a></li>
143
+					<li <? echo ($_GET["new"]=="video") ? "class=\"selected\"" : ""; ?>><a href="<?=$conf->urlGelato;?>/admin/index.php?new=video"><img src="css/images/film.png" alt="New video" /> Video</a></li>
144
+					<li <? echo ($_GET["new"]=="photo") ? "class=\"selected\"" : ""; ?>><a href="<?=$conf->urlGelato;?>/admin/index.php?new=photo"><img src="css/images/image.png" alt="New picture" /> Picture</a></li>
145
+					<li <? echo ($_GET["new"]=="post") ? "class=\"selected\"" : ""; echo (!isset($_GET["new"])) ? "class=\"selected\"" : ""; ?>><a href="<?=$conf->urlGelato;?>/admin/index.php?new=post"><img src="css/images/page.png" alt="New post" /> Regular</a></li>
143 146
 					</ul>
144
-					
147
+					<p>&nbsp;</p>					
145 148
 <?					
146 149
 					if (isset($_GET["deleted"])) {
147 150
 						if ($_GET["deleted"]=="true") {
148
-							echo "<p id=\"pMessages\">&nbsp;</p><div class=\"exito\" id=\"divMessages\">The article has been eliminated successfully.</div>";
151
+							echo "<div class=\"exito\" id=\"divMessages\">The article has been eliminated successfully.</div>";
149 152
 						}
150 153
 					}
151 154
 					
152 155
 					if (isset($_GET["modified"])) {
153 156
 						if ($_GET["modified"]=="true") {
154
-							echo "<p id=\"pMessages\">&nbsp;</p><div class=\"exito\" id=\"divMessages\">The article has been modified successfully.</div>";
157
+							echo "<div class=\"exito\" id=\"divMessages\">The article has been modified successfully.</div>";
155 158
 						}
156 159
 					}
157 160
 					
158 161
 					if (isset($_GET["added"])) {
159 162
 						if ($_GET["added"]=="true") {
160
-							echo "<p id=\"pMessages\">&nbsp;</p><div class=\"exito\" id=\"divMessages\">The article has been added successfully.</div>";
163
+							echo "<div class=\"exito\" id=\"divMessages\">The article has been added successfully.</div>";
161 164
 						}
162 165
 					}
163 166
 					
164 167
 					if (isset($_GET["error"])) {
165 168
 						if ($_GET["error"]==2) {
166
-							echo "<p id=\"pMessages\">&nbsp;</p><div class=\"error\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
169
+							echo "<div class=\"error\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
167 170
 						}
168 171
 					}
169 172
 					
170 173
 					if (isset($_GET["mp3"])) {
171 174
 						if ($_GET["mp3"]=="false") {
172
-							echo "<p id=\"pMessages\">&nbsp;</p><div class=\"error\" id=\"divMessages\">Not an MP3 file or an upload problem.</div>";
175
+							echo "<div class=\"error\" id=\"divMessages\">Not an MP3 file or an upload problem.</div>";
173 176
 						}
174 177
 					}
175 178
 					
176 179
 					if (isset($_GET["photo"])) {
177 180
 						if ($_GET["photo"]=="false") {
178
-							echo "<p id=\"pMessages\">&nbsp;</p><div class=\"error\" id=\"divMessages\">Not a photo file or an upload problem.</div>";
181
+							echo "<div class=\"error\" id=\"divMessages\">Not a photo file or an upload problem.</div>";
179 182
 						}
180 183
 					}
181 184
 ?>					
@@ -242,9 +245,7 @@ if ($user->isAdmin()) {
242 245
 							}
243 246
 ?>
244 247
 								<p>
245
-									<input class="btn" type="submit" name="btnAdd" value="Create post" />&nbsp;&nbsp;
246
-									<a href="#" onclick="if (confirm('Cancel editing this post?  All changes will be lost.'))
247
-	{location.href='index.php';}; return false;">Cancel</a>
248
+									<input class="btn" type="submit" name="btnAdd" value="Create post" />
248 249
 								</p>
249 250
 						</fieldset>
250 251
 					</form>
@@ -259,28 +260,104 @@ if ($user->isAdmin()) {
259 260
 					<li><a href="<?=$conf->urlGelato;?>/admin/admin.php">Users</a></li>
260 261
 					<li class="selected"><a href="#">Posts</a></li>
261 262
 					</ul>
263
+
264
+<?
265
+					if (isset($_GET["page"])) {
266
+						$page_num = $_GET["page"];
267
+					} else {
268
+						$page_num = NULL;
269
+					}
262 270
 					
263
-					<div class="entry">
264
-						<div class="info"><form class="compact"><input type="submit" value="Edit" /> <input type="submit" value="Delete" /></form>
265
-							<p>25/05    Regular Post   (0 Comments) </p>
266
-						</div>
267
-						<div class="post">
268
-							<span class="option">(no title)</span>
269
-							<p>I just discovered Gelato</p>
270
-						</div>
271
-					</div>
272
-	
273
-					<div class="entry">
274
-						<div class="info"><form class="compact"><input type="submit" value="Edit" /> <input type="submit" value="Delete" /></form>
275
-							<p>25/05    Regular Post   (0 Comments) </p>
276
-						</div>
277
-						<div class="post">
278
-							<h4>One with a title</h4>
279
-							<p>Another entry, this one has some varations in the content, even dares
280
-							to be in two lines.</p>
281
-						</div>
282
-					</div>
271
+					$limit=$conf->postLimit;
272
+					
273
+					if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric?
274
+						$from = (($page_num-1) * $limit);
275
+					} else {
276
+						$from = 0;
277
+					}
278
+					
279
+					$rs = $tumble->getPosts($limit, $from);
280
+					
281
+					if ($tumble->contarRegistros()>0) {				
282
+						while($register = mysql_fetch_array($rs)) {			
283
+							$formatedDate = date("M d", strtotime($register["date"]));
284
+							$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
285
+							
286
+							$textile = new Textile;
287
+							$register["description"] = $textile->process(str_replace("&quot;", "\"", $register["description"]));
288
+							
289
+							switch ($tumble->getType($register["id_post"])) {
290
+								case "1":
291
+									$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
292
+									$output = array($register["id_post"], $formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato);
293
+														
294
+									$template->cargarPlantilla($input, $output, "template_regular_post");
295
+									$template->mostrarPlantilla();
296
+									break;
297
+								case "2":						
298
+									$fileName = "../uploads/".getFileName($register["url"]);
299
+									
300
+									$x = @getimagesize($fileName);						
301
+									if ($x[0] > 100) {							
302
+										$photoPath = $conf->urlGelato."/classes/imgsize.php?w=100&img=".$register["url"];
303
+									} else {
304
+										$photoPath = $register["url"];
305
+									}
306
+
307
+									$effect = " style=\"cursor: pointer;\" onclick=\"Lightbox.show('".$register["url"]."', '".strip_tags($register["description"])."');\" ";
308
+									
309
+									$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{Effect}", "{URL_Tumble}");
310
+									$output = array($register["id_post"], $formatedDate, $permalink, $photoPath, strip_tags($register["description"]), $register["description"], $effect, $conf->urlGelato);
311
+									
312
+									$template->cargarPlantilla($input, $output, "template_photo");
313
+									$template->mostrarPlantilla();							   
314
+									break;
315
+								case "3":
316
+									$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Quote}", "{Source}", "{URL_Tumble}");
317
+									$output = array($register["id_post"], $formatedDate, $permalink, $register["description"], $register["title"], $conf->urlGelato);
318
+									
319
+									$template->cargarPlantilla($input, $output, "template_quote");
320
+									$template->mostrarPlantilla();
321
+									break;
322
+								case "4":
323
+									$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
324
+									$output = array($register["id_post"], $formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
325
+									
326
+									$template->cargarPlantilla($input, $output, "template_url");
327
+									$template->mostrarPlantilla();
328
+									break;
329
+								case "5":
330
+									$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}");
331
+									$output = array($register["id_post"], $formatedDate, $permalink, $register["title"], $tumble->formatConversation($register["description"]), $conf->urlGelato);
332
+									
333
+									$template->cargarPlantilla($input, $output, "template_conversation");
334
+									$template->mostrarPlantilla();
335
+									break;
336
+								case "6":
337
+									$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Video}", "{Caption}", "{URL_Tumble}");
338
+									$output = array($register["id_post"], $formatedDate, $permalink, $tumble->getVideoPlayer($register["url"]), $register["description"], $conf->urlGelato);
339
+									
340
+									$template->cargarPlantilla($input, $output, "template_video");
341
+									$template->mostrarPlantilla();
342
+									break;
343
+								case "7":
344
+									$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Mp3}", "{Caption}", "{URL_Tumble}");
345
+									$output = array($register["id_post"], $formatedDate, $permalink, $tumble->getMp3Player($register["url"]), $register["description"], $conf->urlGelato);
346
+									
347
+									$template->cargarPlantilla($input, $output, "template_mp3");
348
+									$template->mostrarPlantilla();
349
+									break;
350
+							}
351
+						}
352
+			
353
+						echo pagination($tumble->getPostsNumber(), $limit, isset($page_num) ? $page_num : 1, "index.php", 2);
354
+			
355
+			
356
+					} else {
357
+						$template->renderizaEtiqueta("No posts in this tumblelog.", "div","error");
358
+					}			
283 359
 					
360
+?>				
284 361
 					<div class="footer-box">&nbsp;</div>
285 362
 				</div>
286 363
 			</div>

+ 3 - 4
admin/themes/admin/template_add_conversation.htm Parādīt failu

@@ -1,11 +1,10 @@
1
-									<legend>Add a Conversation</legend>
2 1
 									<p>
3
-										<label for="title"><strong>Title</strong>&nbsp;<em>(optional)</em></label>
4
-											<input class="input-text" type="text" name="title" id="title" size="80" />
2
+										<label for="title">Title <span class="option">(optional)</span></label>
3
+											<input class="txt" type="text" name="title" id="title" size="80" />
5 4
 									</p>
6 5
 									<input type="hidden" name="url" id="url" value="" />
7 6
 									<p>
8
-										<label for="description"><strong>Conversation</strong></label><br />
7
+										<label for="description">Conversation</label><br />
9 8
 										<div style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;">
10 9
 											<span style="font-weight: bold;">Example</span><br>
11 10
 											<span style="font-style: italic;">

+ 8 - 10
admin/themes/admin/template_add_link.htm Parādīt failu

@@ -1,19 +1,17 @@
1
-									<legend>Add a Link</legend>									
2 1
 									<p>
3
-										<label for="title"><strong>Name</strong>&nbsp;<em>(optional)</em></label>			
4
-											<input class="input-text" type="text" name="title" id="title" size="80" />
2
+										<label for="title">Name <span class="option">(optional)</span></label>			
3
+											<input class="txt" type="text" name="title" id="title" size="80" />
5 4
 									</p>
6 5
 									<p>
7
-										<label for="url"><strong>URL</strong></label>			
8
-											<input class="input-text" type="text" name="url" id="url" size="80" />
6
+										<label for="url">URL</label>			
7
+											<input class="txt" type="text" name="url" id="url" size="80" />
9 8
 									</p>
10 9
 									<p>
11
-									<div id="add_link_description" style="margin-top:20px;">
12
-										<a href="#" onclick="document.getElementById('link_description').style.display = ''; document.getElementById('add_link_description').style.display = 'none'; return false;" style="font-size:11px;">Add a description</a>
13
-									</div>
14
-								
10
+									<div id="add_link_description" style="margin-top:5px;">
11
+										<a class="linkFrm" href="#" onclick="document.getElementById('link_description').style.display = ''; document.getElementById('add_link_description').style.display = 'none'; return false;" style="font-size:11px;">Add a description</a><br /><br />
12
+									</div>								
15 13
 									<div id="link_description" style="display:none;">
16
-										<label for="description"><strong>Description</strong></label><br />								
14
+										<label for="description">Description</label><br />								
17 15
 											<textarea rows="12" cols="84" name="description" id="description"></textarea>											
18 16
 									</div>
19 17
 									</p>

+ 4 - 5
admin/themes/admin/template_add_mp3.htm Parādīt failu

@@ -1,14 +1,13 @@
1
-									<legend>Add an MP3</legend>
2 1
 									<input type="hidden" name="title" id="title" value="" />
3 2
 									<p>
4
-										<label for="url"><strong>MP3 URL</strong></label>			
5
-											<input class="input-text" type="text" name="url" id="url" size="80" />
3
+										<label for="url">MP3 URL</label>			
4
+											<input class="txt" type="text" name="url" id="url" size="80" />
6 5
 										<div style="color: rgb(136, 136, 136); margin-bottom: 5px; font-size: 11px; font-weight: bold;">
7
-											This is a URL from the Mp3 file.
6
+											This is the MP3 file URL.
8 7
 										</div>
9 8
 									</p>									
10 9
 									<p>
11
-										<label for="description"><strong>Caption</strong>&nbsp;<em>(optional)</em></label><br />
10
+										<label for="description">Caption <span class="option">(optional)</span></label><br />
12 11
 											<textarea rows="12" cols="84" name="description" id="description" tabindex="2"></textarea>											
13 12
 									</p>
14 13
 									<input type="hidden" name="type" id="type" value="{type}" />

+ 6 - 7
admin/themes/admin/template_add_photo.htm Parādīt failu

@@ -1,21 +1,20 @@
1
-									<legend>Upload a Photo</legend>
2
-									<input class="input-text" type="hidden" name="title" id="title" value="" />
1
+									<input class="txt" type="hidden" name="title" id="title" value="" />
3 2
 									<p>
4 3
 										<div id="photo_upload">
5
-											<label for="description"><strong>Photo</strong></label>												
4
+											<label for="description">Photo</label>												
6 5
 												<input type="file" name="photo" accept="image/gif,image/jpeg,image/jpg,image/png"/>
7 6
 											<div style="font-size:11px; color:#666; margin-top:5px;">
8
-												Supports JPEG, GIF and PNG.&nbsp; <b>Max size is 10 MB.</b>
7
+												Supports JPEG, GIF and PNG.&nbsp; <strong>Max size is 10 MB.</strong>
9 8
 											</div>
10 9
 											<div style="font-size:11px; color:#666; margin-top:5px;">
11
-												<a href="#" onclick="document.getElementById('photo_upload').style.display = 'none';
10
+												<a class="linkFrm" href="#" onclick="document.getElementById('photo_upload').style.display = 'none';
12 11
 												document.getElementById('photo_url').style.display = 'block';
13 12
 												return false;">Use a URL instead</a>								
14 13
 											</div>
15 14
 										</div>
16 15
 									
17 16
 										<div id="photo_url" style="display:none;">
18
-											<label for="description"><strong>Photo URL</strong></label>
17
+											<label for="description">Photo URL</label>
19 18
 												<input class="input-text" type="text" name="url" id="url" size="80" />
20 19
 											<div style="font-size:11px; color:#666; margin-top:5px;">
21 20
 												The photo URL.</b>
@@ -23,7 +22,7 @@
23 22
 										</div>
24 23
 									</p>
25 24
 									<p>
26
-										<label for="description"><strong>Caption</strong>&nbsp;<em>(optional)</em></label><br />
25
+										<label for="description">Caption <span class="option">(optional)</span></label><br />
27 26
 											<textarea rows="12" cols="84" name="description" id="description"></textarea>											
28 27
 									</p>
29 28
 									<input type="hidden" name="MAX_FILE_SIZE" value="10485760" />

+ 0 - 1
admin/themes/admin/template_add_post.htm Parādīt failu

@@ -1,4 +1,3 @@
1
-									<legend>Add a Regular Post</legend>
2 1
 									<p>
3 2
 										<label for="title">Title <span class="option">(optional)</span></label>
4 3
 											<input class="txt" type="text" name="title" id="title" size="80" />

+ 4 - 5
admin/themes/admin/template_add_quote.htm Parādīt failu

@@ -1,12 +1,11 @@
1
-									<legend>Add a Quote</legend>									
2
-									<input class="input-text" type="hidden" name="url" id="url" value="" />
1
+									<input type="hidden" name="url" id="url" value="" />
3 2
 									<p>
4
-										<label for="description"><strong>Quote</strong></label><br />
3
+										<label for="description">Quote</label><br />
5 4
 											<textarea rows="12" cols="84" name="description" id="description"></textarea>											
6 5
 									</p>
7 6
 									<p>
8
-										<label for="title"><strong>Source</strong>&nbsp;<em>(optional)</em></label>
9
-											<input class="input-text" type="text" name="title" id="title" size="80" />
7
+										<label for="title">Source <span class="option">(optional)</span></label>
8
+											<input class="txt" type="text" name="title" id="title" size="80" />
10 9
 									</p>
11 10
 									<input type="hidden" name="type" id="type" value="{type}" />
12 11
 									<input type="hidden" name="date" id="date" value="{date}" />

+ 4 - 5
admin/themes/admin/template_add_video.htm Parādīt failu

@@ -1,15 +1,14 @@
1
-									<legend>Add a Video</legend>
2 1
 									<input type="hidden" name="title" id="title" value="" />
3 2
 									<p>
4
-										<label for="url"><strong>Video URL</strong></label>			
5
-											<input class="input-text" type="text" name="url" id="url" size="80" />
3
+										<label for="url">Video URL</label>			
4
+											<input class="txt" type="text" name="url" id="url" size="80" />
6 5
 										<div style="color: rgb(136, 136, 136); margin-bottom: 5px; font-size: 11px; font-weight: bold;">
7
-											This is a URL from the video sites YouTube or Vimeo.<br>
6
+											This is a URL from the video sites YouTube, Vimeo or Google.<br>
8 7
 											<span style="font-size: 10px; font-weight: normal;">(ie. http://youtube.com/watch?v=HcBFLN9cli0)</span>
9 8
 										</div>
10 9
 									</p>									
11 10
 									<p>
12
-										<label for="description"><strong>Caption</strong>&nbsp;<em>(optional)</em></label><br />
11
+										<label for="description">Caption <span class="option">(optional)</span></label><br />
13 12
 											<textarea rows="12" cols="84" name="description" id="description" tabindex="2"></textarea>											
14 13
 									</p>
15 14
 									<input type="hidden" name="type" id="type" value="{type}" />

+ 9 - 0
admin/themes/admin/template_conversation.htm Parādīt failu

@@ -0,0 +1,9 @@
1
+			<div class="entry">
2
+				<div class="info"><span class="compact"><a href="{Permalink}">Link</a>&nbsp;<a href="{URL_Tumble}/admin/index.php?edit={Id_Post}"><img src="{URL_Tumble}/admin/css/images/edit.png" alt="" title="" /></a>&nbsp;<a href="{URL_Tumble}/admin/index.php?delete={Id_Post}"><img src="{URL_Tumble}/admin/css/images/delete.png" alt="" title="" /></a></span>
3
+					<p>{Date_Added}</p>
4
+				</div>
5
+				<div class="post">
6
+					<span class="option">{Title}</span>
7
+					<div class="conversation">{Conversation}</div>
8
+				</div>
9
+			</div>

+ 9 - 0
admin/themes/admin/template_mp3.htm Parādīt failu

@@ -0,0 +1,9 @@
1
+			<div class="entry">
2
+				<div class="info"><span class="compact"><a href="{Permalink}">Link</a>&nbsp;<a href="{URL_Tumble}/admin/index.php?edit={Id_Post}"><img src="{URL_Tumble}/admin/css/images/edit.png" alt="" title="" /></a>&nbsp;<a href="{URL_Tumble}/admin/index.php?delete={Id_Post}"><img src="{URL_Tumble}/admin/css/images/delete.png" alt="" title="" /></a></span>
3
+					<p>{Date_Added}</p>
4
+				</div>
5
+				<div class="post">
6
+					<span class="option">{Caption}</span>
7
+					<p><img src="{URL_Tumble}/admin/css/images/music.png" alt="Play song" />&nbsp;<a href="{Permalink}">Play</a></p>
8
+				</div>
9
+			</div>

+ 9 - 0
admin/themes/admin/template_photo.htm Parādīt failu

@@ -0,0 +1,9 @@
1
+			<div class="entry">
2
+				<div class="info"><span class="compact"><a href="{Permalink}">Link</a>&nbsp;<a href="{URL_Tumble}/admin/index.php?edit={Id_Post}"><img src="{URL_Tumble}/admin/css/images/edit.png" alt="" title="" /></a>&nbsp;<a href="{URL_Tumble}/admin/index.php?delete={Id_Post}"><img src="{URL_Tumble}/admin/css/images/delete.png" alt="" title="" /></a></span>
3
+					<p>{Date_Added}</p>
4
+				</div>
5
+				<div class="post">
6
+					<span class="option">{Caption}</span>
7
+					<p><img src="{PhotoURL}" alt="{PhotoAlt}" {Effect} /></p>
8
+				</div>
9
+			</div>

+ 9 - 0
admin/themes/admin/template_quote.htm Parādīt failu

@@ -0,0 +1,9 @@
1
+			<div class="entry">
2
+				<div class="info"><span class="compact"><a href="{Permalink}">Link</a>&nbsp;<a href="{URL_Tumble}/admin/index.php?edit={Id_Post}"><img src="{URL_Tumble}/admin/css/images/edit.png" alt="" title="" /></a>&nbsp;<a href="{URL_Tumble}/admin/index.php?delete={Id_Post}"><img src="{URL_Tumble}/admin/css/images/delete.png" alt="" title="" /></a></span>
3
+					<p>{Date_Added}</p>
4
+				</div>
5
+				<div class="post">
6
+					<span class="option">&mdash; {Source}</span>
7
+					<p><big class="quote"><a href="{Permalink}">&#147;</a></big> {Quote}</p>
8
+				</div>
9
+			</div>

+ 9 - 0
admin/themes/admin/template_regular_post.htm Parādīt failu

@@ -0,0 +1,9 @@
1
+			<div class="entry">
2
+				<div class="info"><span class="compact"><a href="{Permalink}">Link</a>&nbsp;<a href="{URL_Tumble}/admin/index.php?edit={Id_Post}"><img src="{URL_Tumble}/admin/css/images/edit.png" alt="" title="" /></a>&nbsp;<a href="{URL_Tumble}/admin/index.php?delete={Id_Post}"><img src="{URL_Tumble}/admin/css/images/delete.png" alt="" title="" /></a></span>
3
+					<p>{Date_Added}</p>
4
+				</div>
5
+				<div class="post">
6
+					<span class="option"><a href="{Permalink}">{Title}</a></span>
7
+					<p>{Body}</p>
8
+				</div>
9
+			</div>

+ 9 - 0
admin/themes/admin/template_url.htm Parādīt failu

@@ -0,0 +1,9 @@
1
+			<div class="entry">
2
+				<div class="info"><span class="compact"><a href="{Permalink}">Link</a>&nbsp;<a href="{URL_Tumble}/admin/index.php?edit={Id_Post}"><img src="{URL_Tumble}/admin/css/images/edit.png" alt="" title="" /></a>&nbsp;<a href="{URL_Tumble}/admin/index.php?delete={Id_Post}"><img src="{URL_Tumble}/admin/css/images/delete.png" alt="" title="" /></a></span>
3
+					<p>{Date_Added}</p>
4
+				</div>
5
+				<div class="post">
6
+					<span class="option">&#187; <a href="{URL}">{Name}</a></span>
7
+					<p>{Description}</p>
8
+				</div>
9
+			</div>

+ 9 - 0
admin/themes/admin/template_video.htm Parādīt failu

@@ -0,0 +1,9 @@
1
+			<div class="entry">
2
+				<div class="info"><span class="compact"><a href="{Permalink}">Link</a>&nbsp;<a href="{URL_Tumble}/admin/index.php?edit={Id_Post}"><img src="{URL_Tumble}/admin/css/images/edit.png" alt="" title="" /></a>&nbsp;<a href="{URL_Tumble}/admin/index.php?delete={Id_Post}"><img src="{URL_Tumble}/admin/css/images/delete.png" alt="" title="" /></a></span>
3
+					<p>{Date_Added}</p>
4
+				</div>
5
+				<div class="post">
6
+					<span class="option">{Caption}</span>
7
+					<p><img src="{URL_Tumble}/admin/css/images/film.png" alt="Watch video" />&nbsp;<a href="{Permalink}">Watch</a></p>
8
+				</div>
9
+			</div>

Binārs
themes/tumblr/img/Thumbs.db Parādīt failu


Binārs
uploads/Thumbs.db Parādīt failu