|
@@ -18,7 +18,7 @@ require_once('entry.php');
|
18
|
18
|
global $user, $tumble, $conf;
|
19
|
19
|
|
20
|
20
|
$theme = new themes;
|
21
|
|
- // Our first approach to MVC... ¿our second? visit http://www.flavorphp.com
|
|
21
|
+ // Our first approach to MVC... �our second? visit http://www.flavorphp.com
|
22
|
22
|
|
23
|
23
|
if(isset($_SERVER['PATH_INFO'])) $param_url = explode("/",$_SERVER['PATH_INFO']);
|
24
|
24
|
|
|
@@ -36,7 +36,7 @@ $theme = new themes;
|
36
|
36
|
}
|
37
|
37
|
|
38
|
38
|
$theme->set('id_post',$id_post);
|
39
|
|
- $theme->set('error','');
|
|
39
|
+ $theme->set('error','');
|
40
|
40
|
|
41
|
41
|
if (isset($_GET["page"])) {
|
42
|
42
|
$page_num = $_GET["page"];
|
|
@@ -61,7 +61,7 @@ $theme = new themes;
|
61
|
61
|
$page_title_divisor = " » "; // it should be set in configuration
|
62
|
62
|
$page_title_len = 50; // it should be set in configuration
|
63
|
63
|
if ($id_post) {
|
64
|
|
- $register = $tumble->getPost($id_post);
|
|
64
|
+ $register = $tumble->getPost($id_post);
|
65
|
65
|
if (empty($register["title"])) {
|
66
|
66
|
if (!empty($register["description"])) {
|
67
|
67
|
$page_title_data = trimString($register["description"], $page_title_len);
|
|
@@ -70,7 +70,7 @@ $theme = new themes;
|
70
|
70
|
}
|
71
|
71
|
} else {
|
72
|
72
|
$page_title_data = $register["title"];
|
73
|
|
- }
|
|
73
|
+ }
|
74
|
74
|
if (!empty($page_title_data)) {
|
75
|
75
|
$page_title .= $page_title_divisor.stripslashes($page_title_data);
|
76
|
76
|
}
|
|
@@ -82,6 +82,7 @@ $theme = new themes;
|
82
|
82
|
$theme->set('Description',$conf->description);
|
83
|
83
|
$theme->set('URL_Tumble',$conf->urlGelato);
|
84
|
84
|
$theme->set('Template_name',$conf->template);
|
|
85
|
+ $theme->set('allowComments',$conf->allowComments);
|
85
|
86
|
|
86
|
87
|
$theme->set('isAuthenticated',$user->isAuthenticated());
|
87
|
88
|
if($user->isAuthenticated()){
|
|
@@ -116,12 +117,11 @@ $theme = new themes;
|
116
|
117
|
$register["title"] = stripslashes($register["title"]);
|
117
|
118
|
$register["description"] = stripslashes($register["description"]);
|
118
|
119
|
|
119
|
|
- $postType = $tumble->getType($register["id_post"]);
|
120
|
|
-
|
121
|
120
|
$row['Date_Added'] = $formatedDate;
|
122
|
121
|
$row['Permalink'] = $permalink;
|
123
|
|
- $row['postType'] = $postType;
|
124
|
|
- switch ($postType){
|
|
122
|
+ $row['postType'] = type2Text($register["type"]);
|
|
123
|
+
|
|
124
|
+ switch ($register['type']){
|
125
|
125
|
case "1":
|
126
|
126
|
$row['Title'] = $register["title"];
|
127
|
127
|
$row['Body'] = $register["description"];
|
|
@@ -216,9 +216,9 @@ $theme = new themes;
|
216
|
216
|
|
217
|
217
|
$row['Date_Added'] = $formatedDate;
|
218
|
218
|
$row['Permalink'] = $permalink;
|
219
|
|
- $postType = $tumble->getType($register["id_post"]);
|
220
|
|
- $row['postType'] = $postType;
|
221
|
|
- switch ($postType) {
|
|
219
|
+ $row['postType'] = type2Text($register["type"]);
|
|
220
|
+
|
|
221
|
+ switch ($register['type']) {
|
222
|
222
|
case "1":
|
223
|
223
|
$row['Title'] = $register["title"];
|
224
|
224
|
$row['Body'] = $register["description"];
|
|
@@ -266,16 +266,11 @@ $theme = new themes;
|
266
|
266
|
break;
|
267
|
267
|
}
|
268
|
268
|
|
269
|
|
- if ($conf->allowComments) {
|
270
|
|
-
|
271
|
|
- $comment = new comments();
|
272
|
|
- $rsComments = $comment->getComments($register["id_post"]);
|
273
|
|
-
|
274
|
269
|
$user = new user();
|
275
|
270
|
$username = $user->getUserByID($register["id_user"]);
|
276
|
271
|
|
277
|
272
|
$row["User"] = $username["name"];
|
278
|
|
-
|
|
273
|
+
|
279
|
274
|
if (empty($register["title"])) {
|
280
|
275
|
if (!empty($register["description"])) {
|
281
|
276
|
$postTitle = trimString($register["description"]);
|
|
@@ -284,14 +279,15 @@ $theme = new themes;
|
284
|
279
|
}
|
285
|
280
|
} else {
|
286
|
281
|
$postTitle = $register["title"];
|
287
|
|
- }
|
|
282
|
+ }
|
288
|
283
|
|
289
|
|
- $row["Post_Title"] = $postTitle;
|
290
|
|
- $row["Comments_Number"] = $comment->countComments($register["id_post"]);
|
|
284
|
+ $row["Post_Title"] = $postTitle;
|
291
|
285
|
|
292
|
|
- $rows[] = $row;
|
293
|
|
- $theme->set('rows',$rows);
|
|
286
|
+ $comment = new comments();
|
|
287
|
+ $row["Comments_Number"] = $comment->countComments($register["id_post"]);
|
294
|
288
|
|
|
289
|
+ if ($conf->allowComments) {
|
|
290
|
+ $rsComments = $comment->getComments($register["id_post"]);
|
295
|
291
|
$comments = array();
|
296
|
292
|
while($rowComment = mysql_fetch_assoc($rsComments)) {
|
297
|
293
|
$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a>";
|
|
@@ -314,6 +310,9 @@ $theme = new themes;
|
314
|
310
|
$theme->set('Form_Action',$conf->urlGelato."/admin/comments.php");
|
315
|
311
|
$theme->set('whois',$whois);
|
316
|
312
|
}
|
|
313
|
+
|
|
314
|
+ $rows[] = $row;
|
|
315
|
+ $theme->set('rows',$rows);
|
317
|
316
|
}
|
318
|
317
|
|
319
|
318
|
$theme->set('URL_Tumble',$conf->urlGelato);
|