|
@@ -17,10 +17,9 @@ if(!defined('entry'))define('entry', true);
|
17
|
17
|
require_once('entry.php');
|
18
|
18
|
global $user, $tumble, $conf;
|
19
|
19
|
|
20
|
|
-$template = new plantillas($conf->template);
|
|
20
|
+$theme = new themes;
|
21
|
21
|
// My approach to MVC
|
22
|
22
|
|
23
|
|
-
|
24
|
23
|
if(isset($_SERVER['PATH_INFO'])) $param_url = explode("/",$_SERVER['PATH_INFO']);
|
25
|
24
|
|
26
|
25
|
if (isset($_GET["post"])) {
|
|
@@ -34,8 +33,10 @@ $template = new plantillas($conf->template);
|
34
|
33
|
} else {
|
35
|
34
|
$id_post = NULL;
|
36
|
35
|
}
|
37
|
|
- }
|
38
|
|
-
|
|
36
|
+ }
|
|
37
|
+
|
|
38
|
+ $theme->set('id_post',$id_post);
|
|
39
|
+
|
39
|
40
|
if (isset($_GET["page"])) {
|
40
|
41
|
$page_num = $_GET["page"];
|
41
|
42
|
} else {
|
|
@@ -45,16 +46,16 @@ $template = new plantillas($conf->template);
|
45
|
46
|
$page_num = NULL;
|
46
|
47
|
}
|
47
|
48
|
}
|
48
|
|
-
|
|
49
|
+
|
49
|
50
|
$gelato_includes = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n";
|
50
|
51
|
$gelato_includes .= "\t<meta name=\"generator\" content=\"gelato ".codeName()." (".version().")\" />\n";
|
51
|
52
|
$gelato_includes .= "\t<link rel=\"shortcut icon\" href=\"".$conf->urlGelato."/images/favicon.ico\" />\n";
|
52
|
53
|
$gelato_includes .= "\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"".$conf->urlGelato.($conf->urlFriendly?"/rss/":"/rss.php")."\"/>\n";
|
53
|
54
|
$gelato_includes .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"".$conf->urlGelato."/themes/".$conf->template."/style.css\"/>\n";
|
54
|
|
- $gelato_includes .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"".$conf->urlGelato."/admin/css/lightbox.css\" />\n";
|
|
55
|
+ $gelato_includes .= "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"".$conf->urlGelato."/admin/css/lightbox.css\" />\n";
|
55
|
56
|
$gelato_includes .= "\t<script language=\"javascript\" type=\"text/javascript\" src=\"".$conf->urlGelato."/admin/scripts/jquery.js\"></script>\n";
|
56
|
57
|
$gelato_includes .= "\t<script language=\"javascript\" type=\"text/javascript\" src=\"".$conf->urlGelato."/admin/scripts/lightbox.js\"></script>";
|
57
|
|
-
|
|
58
|
+
|
58
|
59
|
$page_title = $conf->title;
|
59
|
60
|
$page_title_divisor = " » "; // it should be set in configuration
|
60
|
61
|
$page_title_len = 50; // it should be set in configuration
|
|
@@ -71,236 +72,212 @@ $template = new plantillas($conf->template);
|
71
|
72
|
$page_title_data = $register["title"];
|
72
|
73
|
}
|
73
|
74
|
$page_title_data = strip_tags($textile->TextileThis($page_title_data));
|
74
|
|
- if (!empty($page_title_data)) {
|
|
75
|
+ if (!empty($page_title_data)) {
|
75
|
76
|
$page_title .= $page_title_divisor.stripslashes($page_title_data);
|
76
|
77
|
}
|
77
|
78
|
}
|
78
|
|
-
|
79
|
|
- $input = array("{Gelato_includes}","{Title}", "{Page_Title}", "{Description}", "{URL_Tumble}", "{Template_name}");
|
80
|
|
- $output = array($gelato_includes, $conf->title, $page_title, $conf->description, $conf->urlGelato, $conf->template);
|
81
|
|
-
|
82
|
|
- $template->cargarPlantilla($input, $output, "template_header");
|
83
|
|
- $template->mostrarPlantilla();
|
84
|
|
-
|
85
|
|
- if ($user->isAuthenticated()) {
|
86
|
|
- $input = array("{User}", "{URL_Tumble}");
|
87
|
|
- $output = array($_SESSION["user_login"], $conf->urlGelato);
|
88
|
|
-
|
89
|
|
- $template->cargarPlantilla($input, $output, "template_isadmin");
|
90
|
|
- $template->mostrarPlantilla();
|
|
79
|
+
|
|
80
|
+ $theme->set('Gelato_includes',$gelato_includes);
|
|
81
|
+ $theme->set('Title',$conf->title);
|
|
82
|
+ $theme->set('Page_Title',$page_title);
|
|
83
|
+ $theme->set('Description',$conf->description);
|
|
84
|
+ $theme->set('URL_Tumble',$conf->urlGelato);
|
|
85
|
+ $theme->set('Template_name',$conf->template);
|
|
86
|
+
|
|
87
|
+ $theme->set('isAuthenticated',$user->isAuthenticated());
|
|
88
|
+ if($user->isAuthenticated()){
|
|
89
|
+ $theme->set('User',$_SESSION["user_login"]);
|
|
90
|
+ $theme->set('URL_Tumble',$conf->urlGelato);
|
91
|
91
|
}
|
92
|
|
-
|
93
|
|
- if (!$id_post) {
|
94
|
92
|
|
|
93
|
+ $rows = array();
|
|
94
|
+ if(!$id_post){
|
95
|
95
|
$limit=$conf->postLimit;
|
96
|
|
-
|
|
96
|
+
|
97
|
97
|
if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric?
|
98
|
98
|
$from = (($page_num-1) * $limit);
|
99
|
99
|
} else {
|
100
|
100
|
$from = 0;
|
101
|
101
|
}
|
102
|
|
-
|
|
102
|
+
|
103
|
103
|
$rs = $tumble->getPosts($limit, $from);
|
104
|
104
|
|
105
|
105
|
if ($tumble->contarRegistros()>0) {
|
106
|
|
- $dateTmp = null;
|
107
|
|
- while($register = mysql_fetch_array($rs)) {
|
|
106
|
+ $dateTmp = null;
|
|
107
|
+ while($register = mysql_fetch_assoc($rs)) {
|
108
|
108
|
$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
109
|
109
|
if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
|
110
|
110
|
$strEnd=($conf->urlFriendly) ? "/" : "";
|
111
|
111
|
$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
|
112
|
|
-
|
|
112
|
+
|
113
|
113
|
$conversation = $register["description"];
|
114
|
|
-
|
|
114
|
+
|
115
|
115
|
$register["description"] = $register["description"];
|
116
|
116
|
|
117
|
117
|
$register["title"] = stripslashes($register["title"]);
|
118
|
|
- $register["description"] = stripslashes($register["description"]);
|
119
|
|
-
|
120
|
|
- switch ($tumble->getType($register["id_post"])) {
|
|
118
|
+ $register["description"] = stripslashes($register["description"]);
|
|
119
|
+
|
|
120
|
+ $postType = $tumble->getType($register["id_post"]);
|
|
121
|
+
|
|
122
|
+ $row['Date_Added'] = $formatedDate;
|
|
123
|
+ $row['Permalink'] = $permalink;
|
|
124
|
+ $theme->set('postType',$postType);
|
|
125
|
+
|
|
126
|
+ switch ($postType){
|
121
|
127
|
case "1":
|
122
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
|
123
|
|
- $output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato, );
|
124
|
|
-
|
125
|
|
- $template->cargarPlantilla($input, $output, "template_regular_post");
|
126
|
|
- $template->mostrarPlantilla();
|
|
128
|
+ $row['Title'] = $register["title"];
|
|
129
|
+ $row['Body'] = $register["description"];
|
127
|
130
|
break;
|
128
|
|
- case "2":
|
|
131
|
+ case "2":
|
129
|
132
|
$fileName = "uploads/".getFileName($register["url"]);
|
130
|
|
-
|
131
|
|
- $x = @getimagesize($fileName);
|
132
|
|
- if ($x[0] > 500) {
|
|
133
|
+
|
|
134
|
+ $x = @getimagesize($fileName);
|
|
135
|
+ if ($x[0] > 500) {
|
133
|
136
|
$photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$register["url"];
|
134
|
|
- } else {
|
|
137
|
+ } else {
|
135
|
138
|
$photoPath = str_replace("../", $conf->urlGelato."/", $register["url"]);
|
136
|
139
|
}
|
137
|
140
|
|
138
|
141
|
$effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
|
139
|
|
-
|
140
|
|
- $input = array("{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{Effect}", "{URL_Tumble}");
|
141
|
|
- $output = array($formatedDate, $permalink, $photoPath, strip_tags($register["description"]), $register["description"], $effect, $conf->urlGelato);
|
142
|
|
-
|
143
|
|
- $template->cargarPlantilla($input, $output, "template_photo");
|
144
|
|
- $template->mostrarPlantilla();
|
|
142
|
+
|
|
143
|
+ $row['PhotoURL'] = $photoPath;
|
|
144
|
+ $row['PhotoAlt'] = strip_tags($register["description"]);
|
|
145
|
+ $row['Caption'] = $register["description"];
|
|
146
|
+ $row['Effect'] = $effect;
|
145
|
147
|
break;
|
146
|
148
|
case "3":
|
147
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Quote}", "{Source}", "{URL_Tumble}");
|
148
|
|
- $output = array($formatedDate, $permalink, $register["description"], $register["title"], $conf->urlGelato);
|
149
|
|
-
|
150
|
|
- $template->cargarPlantilla($input, $output, "template_quote");
|
151
|
|
- $template->mostrarPlantilla();
|
|
149
|
+ $row['Quote'] = $register["description"];
|
|
150
|
+ $row['Source'] = $register["title"];
|
152
|
151
|
break;
|
153
|
152
|
case "4":
|
154
|
153
|
if($conf->shorten_links){
|
155
|
154
|
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
|
156
|
155
|
}
|
157
|
156
|
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
158
|
|
- $input = array("{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
159
|
|
- $output = array($formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
160
|
|
-
|
161
|
|
- $template->cargarPlantilla($input, $output, "template_url");
|
162
|
|
- $template->mostrarPlantilla();
|
|
157
|
+
|
|
158
|
+ $row['URL'] = $register["url"];
|
|
159
|
+ $row['Name'] = $register["title"];
|
|
160
|
+ $row['Description'] = $register["description"];
|
163
|
161
|
break;
|
164
|
162
|
case "5":
|
165
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}");
|
166
|
|
- $output = array($formatedDate, $permalink, $register["title"], $tumble->formatConversation($conversation), $conf->urlGelato);
|
167
|
|
-
|
168
|
|
- $template->cargarPlantilla($input, $output, "template_conversation");
|
169
|
|
- $template->mostrarPlantilla();
|
|
163
|
+ $row['Title'] = $register["title"];
|
|
164
|
+ $row['Conversation'] = $tumble->formatConversation($conversation);
|
170
|
165
|
break;
|
171
|
166
|
case "6":
|
172
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Video}", "{Caption}", "{URL_Tumble}");
|
173
|
|
- $output = array($formatedDate, $permalink, $tumble->getVideoPlayer($register["url"]), $register["description"], $conf->urlGelato);
|
174
|
|
-
|
175
|
|
- $template->cargarPlantilla($input, $output, "template_video");
|
176
|
|
- $template->mostrarPlantilla();
|
|
167
|
+ $row['Video'] = $tumble->getVideoPlayer($register["url"]);
|
|
168
|
+ $row['Caption'] = $register["description"];
|
177
|
169
|
break;
|
178
|
170
|
case "7":
|
179
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Mp3}", "{Caption}", "{URL_Tumble}");
|
180
|
|
- $output = array($formatedDate, $permalink, $tumble->getMp3Player($register["url"]), $register["description"], $conf->urlGelato);
|
181
|
|
-
|
182
|
|
- $template->cargarPlantilla($input, $output, "template_mp3");
|
183
|
|
- $template->mostrarPlantilla();
|
|
171
|
+ $row['Mp3'] = $tumble->getMp3Player($register["url"]);
|
|
172
|
+ $row['Caption'] = $register["description"];
|
184
|
173
|
break;
|
185
|
174
|
}
|
186
|
|
-
|
187
|
|
-
|
|
175
|
+
|
188
|
176
|
$comment = new comments();
|
189
|
177
|
$noComments = $comment->countComments($register["id_post"]);
|
190
|
|
-
|
|
178
|
+
|
191
|
179
|
$user = new user();
|
192
|
180
|
$username = $user->getUserByID($register["id_user"]);
|
193
|
|
-
|
194
|
|
-
|
195
|
|
- $input = array("{Permalink}", "{User}", "{Comments_Number}");
|
196
|
|
- $output = array($permalink, $username["name"], $noComments);
|
197
|
|
-
|
198
|
|
- $template->cargarPlantilla($input, $output, "template_details");
|
199
|
|
- $template->mostrarPlantilla();
|
|
181
|
+
|
|
182
|
+ $row['User'] = $username["name"];
|
|
183
|
+ $row['Comments_Number'] = $noComments;
|
|
184
|
+
|
|
185
|
+ $rows[] = $row;
|
200
|
186
|
}
|
201
|
187
|
|
|
188
|
+ $theme->set('rows',$rows);
|
|
189
|
+
|
202
|
190
|
$p = new pagination;
|
203
|
191
|
$p->Items($tumble->getPostsNumber());
|
204
|
192
|
$p->limit($limit);
|
205
|
|
-
|
206
|
193
|
if($conf->urlFriendly){
|
207
|
194
|
$p->urlFriendly('[...]');
|
208
|
195
|
$p->target($conf->urlGelato."/page/[...]");
|
209
|
196
|
}else
|
210
|
197
|
$p->target($conf->urlGelato);
|
211
|
|
-
|
212
|
|
- $p->currentPage(isset($page_num) ? $page_num : 1);
|
213
|
|
- $p->show();
|
214
|
198
|
|
|
199
|
+ $p->currentPage(isset($page_num) ? $page_num : 1);
|
215
|
200
|
|
|
201
|
+ $theme->set('pagination',$p->getPagination());
|
216
|
202
|
} else {
|
217
|
203
|
$template->renderizaEtiqueta("No posts in this tumblelog.", "div","error");
|
218
|
204
|
}
|
219
|
205
|
} else {
|
220
|
206
|
$register = $tumble->getPost($id_post);
|
221
|
|
-
|
|
207
|
+
|
222
|
208
|
$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
223
|
209
|
$strEnd=($conf->urlFriendly) ? "/" : "";
|
224
|
210
|
$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
|
225
|
|
-
|
|
211
|
+
|
226
|
212
|
$conversation = $register["description"];
|
227
|
|
-
|
|
213
|
+
|
228
|
214
|
$register["description"] = $register["description"];
|
229
|
|
-
|
|
215
|
+
|
230
|
216
|
$register["title"] = stripslashes($register["title"]);
|
231
|
217
|
$register["description"] = stripslashes($register["description"]);
|
232
|
|
-
|
233
|
|
- switch ($tumble->getType($register["id_post"])) {
|
|
218
|
+
|
|
219
|
+ $row['Date_Added'] = $formatedDate;
|
|
220
|
+ $row['Permalink'] = $permalink;
|
|
221
|
+ $postType = $tumble->getType($register["id_post"]);
|
|
222
|
+ $theme->set('postType',$postType);
|
|
223
|
+ switch ($postType) {
|
234
|
224
|
case "1":
|
235
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
|
236
|
|
- $output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato);
|
237
|
|
-
|
238
|
|
- $template->cargarPlantilla($input, $output, "template_regular_post");
|
239
|
|
- $template->mostrarPlantilla();
|
|
225
|
+ $row['Title'] = $register["title"];
|
|
226
|
+ $row['Body'] = $register["description"];
|
240
|
227
|
break;
|
241
|
228
|
case "2":
|
242
|
229
|
$fileName = "uploads/".getFileName($register["url"]);
|
243
|
|
-
|
244
|
|
- $x = @getimagesize($fileName);
|
245
|
|
- if ($x[0] > 500) {
|
|
230
|
+
|
|
231
|
+ $x = @getimagesize($fileName);
|
|
232
|
+ if ($x[0] > 500) {
|
246
|
233
|
$photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$register["url"];
|
247
|
234
|
} else {
|
248
|
235
|
$photoPath = str_replace("../", $conf->urlGelato."/", $register["url"]);
|
249
|
236
|
}
|
250
|
237
|
|
251
|
238
|
$effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
|
252
|
|
- $input = array("{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{Effect}", "{URL_Tumble}");
|
253
|
|
- $output = array($formatedDate, $permalink, $photoPath, strip_tags($register["description"]), $register["description"], $effect, $conf->urlGelato);
|
254
|
|
-
|
255
|
|
- $template->cargarPlantilla($input, $output, "template_photo");
|
256
|
|
- $template->mostrarPlantilla();
|
|
239
|
+
|
|
240
|
+ $row['PhotoURL'] = $photoPath;
|
|
241
|
+ $row['PhotoAlt'] = strip_tags($register["description"]);
|
|
242
|
+ $row['Caption'] = $register["description"];
|
|
243
|
+ $row['Effect'] = $effect;
|
257
|
244
|
break;
|
258
|
245
|
case "3":
|
259
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Quote}", "{Source}", "{URL_Tumble}");
|
260
|
|
- $output = array($formatedDate, $permalink, $register["description"], $register["title"], $conf->urlGelato);
|
261
|
|
-
|
262
|
|
- $template->cargarPlantilla($input, $output, "template_quote");
|
263
|
|
- $template->mostrarPlantilla();
|
|
246
|
+ $row['Quote'] = $register["description"];
|
|
247
|
+ $row['Source'] = $register["title"];
|
264
|
248
|
break;
|
265
|
249
|
case "4":
|
266
|
250
|
if($conf->shorten_links){
|
267
|
251
|
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
|
268
|
252
|
}
|
269
|
|
- $register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
270
|
|
- $input = array("{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
271
|
|
- $output = array($formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
272
|
|
-
|
273
|
|
- $template->cargarPlantilla($input, $output, "template_url");
|
274
|
|
- $template->mostrarPlantilla();
|
|
253
|
+ $row['URL'] = $register["url"];
|
|
254
|
+ $row['Name'] = $register["title"];
|
|
255
|
+ $row['Description'] = $register["description"];
|
275
|
256
|
break;
|
276
|
257
|
case "5":
|
277
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}");
|
278
|
|
- $output = array($formatedDate, $permalink, $register["title"], $tumble->formatConversation($conversation), $conf->urlGelato);
|
279
|
|
-
|
280
|
|
- $template->cargarPlantilla($input, $output, "template_conversation");
|
281
|
|
- $template->mostrarPlantilla();
|
282
|
|
- break;
|
283
|
|
- case "6":
|
284
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Video}", "{Caption}", "{URL_Tumble}");
|
285
|
|
- $output = array($formatedDate, $permalink, $tumble->getVideoPlayer($register["url"]), $register["description"], $conf->urlGelato);
|
286
|
|
-
|
287
|
|
- $template->cargarPlantilla($input, $output, "template_video");
|
288
|
|
- $template->mostrarPlantilla();
|
289
|
|
- break;
|
290
|
|
- case "7":
|
291
|
|
- $input = array("{Date_Added}", "{Permalink}", "{Mp3}", "{Caption}", "{URL_Tumble}");
|
292
|
|
- $output = array($formatedDate, $permalink, $tumble->getMp3Player($register["url"]), $register["description"], $conf->urlGelato);
|
293
|
|
-
|
294
|
|
- $template->cargarPlantilla($input, $output, "template_mp3");
|
295
|
|
- $template->mostrarPlantilla();
|
296
|
|
- break;
|
|
258
|
+ $row['Title'] = $register["title"];
|
|
259
|
+ $row['Conversation'] = $tumble->formatConversation($conversation);
|
|
260
|
+ break;
|
|
261
|
+ case "6":
|
|
262
|
+ $row['Video'] = $tumble->getVideoPlayer($register["url"]);
|
|
263
|
+ $row['Caption'] = $register["description"];
|
|
264
|
+ break;
|
|
265
|
+ case "7":
|
|
266
|
+ $row['Mp3'] = $tumble->getMp3Player($register["url"]);
|
|
267
|
+ $row['Caption'] = $register["description"];
|
|
268
|
+ break;
|
297
|
269
|
}
|
298
|
|
-
|
|
270
|
+
|
299
|
271
|
if ($conf->allowComments) {
|
300
|
|
-
|
|
272
|
+
|
301
|
273
|
$comment = new comments();
|
302
|
274
|
$rsComments = $comment->getComments($register["id_post"]);
|
303
|
|
-
|
|
275
|
+
|
|
276
|
+ $user = new user();
|
|
277
|
+ $username = $user->getUserByID($register["id_user"]);
|
|
278
|
+
|
|
279
|
+ $row['User'] = $username["name"];
|
|
280
|
+
|
304
|
281
|
$textile = new Textile();
|
305
|
282
|
if (empty($register["title"])) {
|
306
|
283
|
if (!empty($register["description"])) {
|
|
@@ -312,31 +289,37 @@ $template = new plantillas($conf->template);
|
312
|
289
|
$postTitle = $register["title"];
|
313
|
290
|
}
|
314
|
291
|
$postTitle = strip_tags($textile->TextileThis($postTitle));
|
315
|
|
-
|
316
|
|
- $input = array("{Comments_Number}", "{Post_Title}");
|
317
|
|
- $output = array($comment->countComments($register["id_post"]), $postTitle);
|
318
|
|
- $template->precargarPlantillaConBloque($input, $output, "template_comments", "comments");
|
319
|
292
|
|
|
293
|
+ $row['Post_Title'] = $postTitle;
|
|
294
|
+ $row['Comments_Number'] = $comment->countComments($register["id_post"]);
|
|
295
|
+
|
|
296
|
+ $rows[] = $row;
|
|
297
|
+ $theme->set('rows',$rows);
|
|
298
|
+
|
|
299
|
+ $comments = array();
|
320
|
300
|
while($rowComment = mysql_fetch_assoc($rsComments)) {
|
321
|
301
|
$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a>";
|
322
|
|
- $input = array("{Id_Comment}", "{Comment_Author}", "{Date}", "{Comment}");
|
323
|
|
- $output = array($rowComment["id_comment"], $commentAuthor, gmdate("d.m.y", strtotime($rowComment["comment_date"])+transform_offset($conf->offsetTime)), $rowComment["content"]);
|
324
|
|
- $template->cargarPlantillaConBloque($input, $output, "template_comments", "comments");
|
|
302
|
+
|
|
303
|
+ $answers['Id_Comment'] = $rowComment["id_comment"];
|
|
304
|
+ $answers['Comment_Author'] = $commentAuthor;
|
|
305
|
+ $answers['Date'] = gmdate("d.m.y", strtotime($rowComment["comment_date"])+transform_offset($conf->offsetTime));
|
|
306
|
+ $answers['Comment'] = $rowComment["content"];
|
|
307
|
+
|
|
308
|
+ $comments[] = $answers;
|
325
|
309
|
}
|
326
|
|
- $template->mostrarPlantillaConBloque();
|
327
|
|
-
|
328
|
|
- $input = array("{User_Cookie}", "{Email_Cookie}", "{Web_Cookie}", "{Id_Post}", "{Form_Action}", "{Date_Added}");
|
329
|
|
- $output = array(isset($_COOKIE['cookie_gel_user'])?$_COOKIE['cookie_gel_user']:'', isset($_COOKIE['cookie_gel_email'])?$_COOKIE['cookie_gel_email']:'', isset($_COOKIE['cookie_gel_web'])?$_COOKIE['cookie_gel_web']:'', $register["id_post"], $conf->urlGelato."/admin/comments.php", gmmktime());
|
330
|
|
-
|
331
|
|
- $template->cargarPlantilla($input, $output, "template_comment_post");
|
332
|
|
- $template->mostrarPlantilla();
|
333
|
|
-
|
|
310
|
+ $theme->set('comments',$comments);
|
|
311
|
+
|
|
312
|
+ $whois['User_Cookie'] = isset($_COOKIE['cookie_gel_user'])?$_COOKIE['cookie_gel_user']:'';
|
|
313
|
+ $whois['Email_Cookie'] = isset($_COOKIE['cookie_gel_email'])?$_COOKIE['cookie_gel_email']:'';
|
|
314
|
+ $whois['Web_Cookie'] = isset($_COOKIE['cookie_gel_web'])?$_COOKIE['cookie_gel_web']:'';
|
|
315
|
+ $whois['Id_Post'] = $register["id_post"];
|
|
316
|
+
|
|
317
|
+ $theme->set('Date_Added',gmmktime());
|
|
318
|
+ $theme->set('Form_Action',$conf->urlGelato."/admin/comments.php");
|
|
319
|
+ $theme->set('whois',$whois);
|
334
|
320
|
}
|
335
|
321
|
}
|
336
|
|
-
|
337
|
|
- $input = array("{URL_Tumble}");
|
338
|
|
- $output = array($conf->urlGelato);
|
339
|
|
-
|
340
|
|
- $template->cargarPlantilla($input, $output, "template_footer");
|
341
|
|
- $template->mostrarPlantilla();
|
342
|
|
-?>
|
|
322
|
+
|
|
323
|
+ $theme->set('URL_Tumble',$conf->urlGelato);
|
|
324
|
+ $theme->display(Absolute_Path.'themes/'.$conf->template.'/index.htm');
|
|
325
|
+?>
|