Browse Source

Replaced the code with the newest version in the "dev" branch

Klectik 7 years ago
parent
commit
1b1990f42c
100 changed files with 1235 additions and 1498 deletions
  1. 0 0
      .htaccess
  2. 0 339
      LICENSE
  3. 87 80
      admin/admin.php
  4. 41 40
      admin/ajax.php
  5. 175 179
      admin/bm.php
  6. 29 25
      admin/close.php
  7. 156 154
      admin/comments.php
  8. 0 0
      admin/css/archive.css
  9. 0 0
      admin/css/images/asc.gif
  10. 0 0
      admin/css/images/bg-box.png
  11. 0 0
      admin/css/images/bg-foot-box.png
  12. 0 0
      admin/css/images/bg-top-box-hover.png
  13. 0 0
      admin/css/images/bg-top-box.png
  14. 0 0
      admin/css/images/bg.gif
  15. 0 0
      admin/css/images/blank.gif
  16. 0 0
      admin/css/images/close.gif
  17. 0 0
      admin/css/images/closelabel.gif
  18. 0 0
      admin/css/images/comments.png
  19. 0 0
      admin/css/images/delete.png
  20. 0 0
      admin/css/images/desc.gif
  21. 0 0
      admin/css/images/edit.png
  22. 0 0
      admin/css/images/film.png
  23. 0 0
      admin/css/images/gelato-logo.png
  24. 0 0
      admin/css/images/grad-big.png
  25. 0 0
      admin/css/images/grad-small.png
  26. 0 0
      admin/css/images/image.png
  27. 0 0
      admin/css/images/loading.gif
  28. 0 0
      admin/css/images/music.png
  29. 0 0
      admin/css/images/nextlabel.gif
  30. 0 0
      admin/css/images/page.png
  31. 0 0
      admin/css/images/prevlabel.gif
  32. 0 0
      admin/css/images/quote.png
  33. 0 0
      admin/css/images/td_back.gif
  34. 0 0
      admin/css/images/world.png
  35. 0 0
      admin/css/lightbox.css
  36. 0 0
      admin/css/style.css
  37. 58 58
      admin/feeds.php
  38. 324 311
      admin/index.php
  39. 161 117
      admin/options.php
  40. 113 110
      admin/plugins.php
  41. 0 0
      admin/scripts/jquery.js
  42. 0 0
      admin/scripts/jquery.tablesorter.min.js
  43. 0 0
      admin/scripts/jquery.validate.min.js
  44. 0 0
      admin/scripts/lightbox.js
  45. 0 0
      admin/scripts/markitup/jquery.markitup.pack.js
  46. 0 0
      admin/scripts/markitup/sets/html/images/bold.png
  47. 0 0
      admin/scripts/markitup/sets/html/images/clean.png
  48. 0 0
      admin/scripts/markitup/sets/html/images/code.png
  49. 0 0
      admin/scripts/markitup/sets/html/images/fonts.png
  50. 0 0
      admin/scripts/markitup/sets/html/images/h1.png
  51. 0 0
      admin/scripts/markitup/sets/html/images/h2.png
  52. 0 0
      admin/scripts/markitup/sets/html/images/h3.png
  53. 0 0
      admin/scripts/markitup/sets/html/images/h4.png
  54. 0 0
      admin/scripts/markitup/sets/html/images/h5.png
  55. 0 0
      admin/scripts/markitup/sets/html/images/h6.png
  56. 0 0
      admin/scripts/markitup/sets/html/images/image.png
  57. 0 0
      admin/scripts/markitup/sets/html/images/italic.png
  58. 0 0
      admin/scripts/markitup/sets/html/images/link.png
  59. 0 0
      admin/scripts/markitup/sets/html/images/list-bullet.png
  60. 0 0
      admin/scripts/markitup/sets/html/images/list-item.png
  61. 0 0
      admin/scripts/markitup/sets/html/images/list-numeric.png
  62. 0 0
      admin/scripts/markitup/sets/html/images/more.png
  63. 0 0
      admin/scripts/markitup/sets/html/images/paragraph.png
  64. 0 0
      admin/scripts/markitup/sets/html/images/picture.png
  65. 0 0
      admin/scripts/markitup/sets/html/images/preview.png
  66. 0 0
      admin/scripts/markitup/sets/html/images/quotes.png
  67. 0 0
      admin/scripts/markitup/sets/html/images/stroke.png
  68. 0 0
      admin/scripts/markitup/sets/html/images/underline.png
  69. 0 0
      admin/scripts/markitup/sets/html/images/url.png
  70. 0 0
      admin/scripts/markitup/sets/html/set.js
  71. 0 0
      admin/scripts/markitup/sets/html/style.css
  72. 0 0
      admin/scripts/markitup/skins/simple/images/handle.png
  73. 0 0
      admin/scripts/markitup/skins/simple/images/menu.png
  74. 0 0
      admin/scripts/markitup/skins/simple/images/submenu.png
  75. 0 0
      admin/scripts/markitup/skins/simple/style.css
  76. 0 0
      admin/scripts/nicEdit.js
  77. 0 0
      admin/scripts/nicEditorIcons.gif
  78. 0 0
      admin/scripts/player.swf
  79. 0 0
      admin/scripts/tools.js
  80. 70 74
      admin/settings.php
  81. 0 0
      admin/themes/admin/api.xml
  82. 0 0
      admin/themes/admin/index.htm
  83. 11 5
      admin/themes/admin/install.htm
  84. 0 0
      admin/themes/admin/login.htm
  85. 0 0
      admin/themes/admin/template_add_conversation.htm
  86. 0 0
      admin/themes/admin/template_add_link.htm
  87. 0 0
      admin/themes/admin/template_add_mp3.htm
  88. 9 4
      admin/themes/admin/template_add_photo.htm
  89. 0 0
      admin/themes/admin/template_add_photo_bm.htm
  90. 0 0
      admin/themes/admin/template_add_post.htm
  91. 0 0
      admin/themes/admin/template_add_quote.htm
  92. 0 0
      admin/themes/admin/template_add_video.htm
  93. 0 0
      admin/themes/admin/template_bm.htm
  94. 0 0
      admin/themes/admin/template_comment.htm
  95. 0 0
      admin/themes/admin/template_comment_post.htm
  96. 0 0
      admin/themes/admin/template_conversation.htm
  97. 0 0
      admin/themes/admin/template_mp3.htm
  98. 1 2
      admin/themes/admin/template_photo.htm
  99. 0 0
      admin/themes/admin/template_quote.htm
  100. 0 0
      admin/themes/admin/template_regular_post.htm

+ 0 - 0
.htaccess View File


+ 0 - 339
LICENSE View File

@@ -1,339 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
-                       Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
-                            Preamble
10
-
11
-  The licenses for most software are designed to take away your
12
-freedom to share and change it.  By contrast, the GNU General Public
13
-License is intended to guarantee your freedom to share and change free
14
-software--to make sure the software is free for all its users.  This
15
-General Public License applies to most of the Free Software
16
-Foundation's software and to any other program whose authors commit to
17
-using it.  (Some other Free Software Foundation software is covered by
18
-the GNU Lesser General Public License instead.)  You can apply it to
19
-your programs, too.
20
-
21
-  When we speak of free software, we are referring to freedom, not
22
-price.  Our General Public Licenses are designed to make sure that you
23
-have the freedom to distribute copies of free software (and charge for
24
-this service if you wish), that you receive source code or can get it
25
-if you want it, that you can change the software or use pieces of it
26
-in new free programs; and that you know you can do these things.
27
-
28
-  To protect your rights, we need to make restrictions that forbid
29
-anyone to deny you these rights or to ask you to surrender the rights.
30
-These restrictions translate to certain responsibilities for you if you
31
-distribute copies of the software, or if you modify it.
32
-
33
-  For example, if you distribute copies of such a program, whether
34
-gratis or for a fee, you must give the recipients all the rights that
35
-you have.  You must make sure that they, too, receive or can get the
36
-source code.  And you must show them these terms so they know their
37
-rights.
38
-
39
-  We protect your rights with two steps: (1) copyright the software, and
40
-(2) offer you this license which gives you legal permission to copy,
41
-distribute and/or modify the software.
42
-
43
-  Also, for each author's protection and ours, we want to make certain
44
-that everyone understands that there is no warranty for this free
45
-software.  If the software is modified by someone else and passed on, we
46
-want its recipients to know that what they have is not the original, so
47
-that any problems introduced by others will not reflect on the original
48
-authors' reputations.
49
-
50
-  Finally, any free program is threatened constantly by software
51
-patents.  We wish to avoid the danger that redistributors of a free
52
-program will individually obtain patent licenses, in effect making the
53
-program proprietary.  To prevent this, we have made it clear that any
54
-patent must be licensed for everyone's free use or not licensed at all.
55
-
56
-  The precise terms and conditions for copying, distribution and
57
-modification follow.
58
-
59
-                    GNU GENERAL PUBLIC LICENSE
60
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
-  0. This License applies to any program or other work which contains
63
-a notice placed by the copyright holder saying it may be distributed
64
-under the terms of this General Public License.  The "Program", below,
65
-refers to any such program or work, and a "work based on the Program"
66
-means either the Program or any derivative work under copyright law:
67
-that is to say, a work containing the Program or a portion of it,
68
-either verbatim or with modifications and/or translated into another
69
-language.  (Hereinafter, translation is included without limitation in
70
-the term "modification".)  Each licensee is addressed as "you".
71
-
72
-Activities other than copying, distribution and modification are not
73
-covered by this License; they are outside its scope.  The act of
74
-running the Program is not restricted, and the output from the Program
75
-is covered only if its contents constitute a work based on the
76
-Program (independent of having been made by running the Program).
77
-Whether that is true depends on what the Program does.
78
-
79
-  1. You may copy and distribute verbatim copies of the Program's
80
-source code as you receive it, in any medium, provided that you
81
-conspicuously and appropriately publish on each copy an appropriate
82
-copyright notice and disclaimer of warranty; keep intact all the
83
-notices that refer to this License and to the absence of any warranty;
84
-and give any other recipients of the Program a copy of this License
85
-along with the Program.
86
-
87
-You may charge a fee for the physical act of transferring a copy, and
88
-you may at your option offer warranty protection in exchange for a fee.
89
-
90
-  2. You may modify your copy or copies of the Program or any portion
91
-of it, thus forming a work based on the Program, and copy and
92
-distribute such modifications or work under the terms of Section 1
93
-above, provided that you also meet all of these conditions:
94
-
95
-    a) You must cause the modified files to carry prominent notices
96
-    stating that you changed the files and the date of any change.
97
-
98
-    b) You must cause any work that you distribute or publish, that in
99
-    whole or in part contains or is derived from the Program or any
100
-    part thereof, to be licensed as a whole at no charge to all third
101
-    parties under the terms of this License.
102
-
103
-    c) If the modified program normally reads commands interactively
104
-    when run, you must cause it, when started running for such
105
-    interactive use in the most ordinary way, to print or display an
106
-    announcement including an appropriate copyright notice and a
107
-    notice that there is no warranty (or else, saying that you provide
108
-    a warranty) and that users may redistribute the program under
109
-    these conditions, and telling the user how to view a copy of this
110
-    License.  (Exception: if the Program itself is interactive but
111
-    does not normally print such an announcement, your work based on
112
-    the Program is not required to print an announcement.)
113
-
114
-These requirements apply to the modified work as a whole.  If
115
-identifiable sections of that work are not derived from the Program,
116
-and can be reasonably considered independent and separate works in
117
-themselves, then this License, and its terms, do not apply to those
118
-sections when you distribute them as separate works.  But when you
119
-distribute the same sections as part of a whole which is a work based
120
-on the Program, the distribution of the whole must be on the terms of
121
-this License, whose permissions for other licensees extend to the
122
-entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
-Thus, it is not the intent of this section to claim rights or contest
125
-your rights to work written entirely by you; rather, the intent is to
126
-exercise the right to control the distribution of derivative or
127
-collective works based on the Program.
128
-
129
-In addition, mere aggregation of another work not based on the Program
130
-with the Program (or with a work based on the Program) on a volume of
131
-a storage or distribution medium does not bring the other work under
132
-the scope of this License.
133
-
134
-  3. You may copy and distribute the Program (or a work based on it,
135
-under Section 2) in object code or executable form under the terms of
136
-Sections 1 and 2 above provided that you also do one of the following:
137
-
138
-    a) Accompany it with the complete corresponding machine-readable
139
-    source code, which must be distributed under the terms of Sections
140
-    1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
-    b) Accompany it with a written offer, valid for at least three
143
-    years, to give any third party, for a charge no more than your
144
-    cost of physically performing source distribution, a complete
145
-    machine-readable copy of the corresponding source code, to be
146
-    distributed under the terms of Sections 1 and 2 above on a medium
147
-    customarily used for software interchange; or,
148
-
149
-    c) Accompany it with the information you received as to the offer
150
-    to distribute corresponding source code.  (This alternative is
151
-    allowed only for noncommercial distribution and only if you
152
-    received the program in object code or executable form with such
153
-    an offer, in accord with Subsection b above.)
154
-
155
-The source code for a work means the preferred form of the work for
156
-making modifications to it.  For an executable work, complete source
157
-code means all the source code for all modules it contains, plus any
158
-associated interface definition files, plus the scripts used to
159
-control compilation and installation of the executable.  However, as a
160
-special exception, the source code distributed need not include
161
-anything that is normally distributed (in either source or binary
162
-form) with the major components (compiler, kernel, and so on) of the
163
-operating system on which the executable runs, unless that component
164
-itself accompanies the executable.
165
-
166
-If distribution of executable or object code is made by offering
167
-access to copy from a designated place, then offering equivalent
168
-access to copy the source code from the same place counts as
169
-distribution of the source code, even though third parties are not
170
-compelled to copy the source along with the object code.
171
-
172
-  4. You may not copy, modify, sublicense, or distribute the Program
173
-except as expressly provided under this License.  Any attempt
174
-otherwise to copy, modify, sublicense or distribute the Program is
175
-void, and will automatically terminate your rights under this License.
176
-However, parties who have received copies, or rights, from you under
177
-this License will not have their licenses terminated so long as such
178
-parties remain in full compliance.
179
-
180
-  5. You are not required to accept this License, since you have not
181
-signed it.  However, nothing else grants you permission to modify or
182
-distribute the Program or its derivative works.  These actions are
183
-prohibited by law if you do not accept this License.  Therefore, by
184
-modifying or distributing the Program (or any work based on the
185
-Program), you indicate your acceptance of this License to do so, and
186
-all its terms and conditions for copying, distributing or modifying
187
-the Program or works based on it.
188
-
189
-  6. Each time you redistribute the Program (or any work based on the
190
-Program), the recipient automatically receives a license from the
191
-original licensor to copy, distribute or modify the Program subject to
192
-these terms and conditions.  You may not impose any further
193
-restrictions on the recipients' exercise of the rights granted herein.
194
-You are not responsible for enforcing compliance by third parties to
195
-this License.
196
-
197
-  7. If, as a consequence of a court judgment or allegation of patent
198
-infringement or for any other reason (not limited to patent issues),
199
-conditions are imposed on you (whether by court order, agreement or
200
-otherwise) that contradict the conditions of this License, they do not
201
-excuse you from the conditions of this License.  If you cannot
202
-distribute so as to satisfy simultaneously your obligations under this
203
-License and any other pertinent obligations, then as a consequence you
204
-may not distribute the Program at all.  For example, if a patent
205
-license would not permit royalty-free redistribution of the Program by
206
-all those who receive copies directly or indirectly through you, then
207
-the only way you could satisfy both it and this License would be to
208
-refrain entirely from distribution of the Program.
209
-
210
-If any portion of this section is held invalid or unenforceable under
211
-any particular circumstance, the balance of the section is intended to
212
-apply and the section as a whole is intended to apply in other
213
-circumstances.
214
-
215
-It is not the purpose of this section to induce you to infringe any
216
-patents or other property right claims or to contest validity of any
217
-such claims; this section has the sole purpose of protecting the
218
-integrity of the free software distribution system, which is
219
-implemented by public license practices.  Many people have made
220
-generous contributions to the wide range of software distributed
221
-through that system in reliance on consistent application of that
222
-system; it is up to the author/donor to decide if he or she is willing
223
-to distribute software through any other system and a licensee cannot
224
-impose that choice.
225
-
226
-This section is intended to make thoroughly clear what is believed to
227
-be a consequence of the rest of this License.
228
-
229
-  8. If the distribution and/or use of the Program is restricted in
230
-certain countries either by patents or by copyrighted interfaces, the
231
-original copyright holder who places the Program under this License
232
-may add an explicit geographical distribution limitation excluding
233
-those countries, so that distribution is permitted only in or among
234
-countries not thus excluded.  In such case, this License incorporates
235
-the limitation as if written in the body of this License.
236
-
237
-  9. The Free Software Foundation may publish revised and/or new versions
238
-of the General Public License from time to time.  Such new versions will
239
-be similar in spirit to the present version, but may differ in detail to
240
-address new problems or concerns.
241
-
242
-Each version is given a distinguishing version number.  If the Program
243
-specifies a version number of this License which applies to it and "any
244
-later version", you have the option of following the terms and conditions
245
-either of that version or of any later version published by the Free
246
-Software Foundation.  If the Program does not specify a version number of
247
-this License, you may choose any version ever published by the Free Software
248
-Foundation.
249
-
250
-  10. If you wish to incorporate parts of the Program into other free
251
-programs whose distribution conditions are different, write to the author
252
-to ask for permission.  For software which is copyrighted by the Free
253
-Software Foundation, write to the Free Software Foundation; we sometimes
254
-make exceptions for this.  Our decision will be guided by the two goals
255
-of preserving the free status of all derivatives of our free software and
256
-of promoting the sharing and reuse of software generally.
257
-
258
-                            NO WARRANTY
259
-
260
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
-REPAIR OR CORRECTION.
269
-
270
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
-POSSIBILITY OF SUCH DAMAGES.
279
-
280
-                     END OF TERMS AND CONDITIONS
281
-
282
-            How to Apply These Terms to Your New Programs
283
-
284
-  If you develop a new program, and you want it to be of the greatest
285
-possible use to the public, the best way to achieve this is to make it
286
-free software which everyone can redistribute and change under these terms.
287
-
288
-  To do so, attach the following notices to the program.  It is safest
289
-to attach them to the start of each source file to most effectively
290
-convey the exclusion of warranty; and each file should have at least
291
-the "copyright" line and a pointer to where the full notice is found.
292
-
293
-    <one line to give the program's name and a brief idea of what it does.>
294
-    Copyright (C) <year>  <name of author>
295
-
296
-    This program is free software; you can redistribute it and/or modify
297
-    it under the terms of the GNU General Public License as published by
298
-    the Free Software Foundation; either version 2 of the License, or
299
-    (at your option) any later version.
300
-
301
-    This program is distributed in the hope that it will be useful,
302
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
-    GNU General Public License for more details.
305
-
306
-    You should have received a copy of the GNU General Public License along
307
-    with this program; if not, write to the Free Software Foundation, Inc.,
308
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
-Also add information on how to contact you by electronic and paper mail.
311
-
312
-If the program is interactive, make it output a short notice like this
313
-when it starts in an interactive mode:
314
-
315
-    Gnomovision version 69, Copyright (C) year name of author
316
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
-    This is free software, and you are welcome to redistribute it
318
-    under certain conditions; type `show c' for details.
319
-
320
-The hypothetical commands `show w' and `show c' should show the appropriate
321
-parts of the General Public License.  Of course, the commands you use may
322
-be called something other than `show w' and `show c'; they could even be
323
-mouse-clicks or menu items--whatever suits your program.
324
-
325
-You should also get your employer (if you work as a programmer) or your
326
-school, if any, to sign a "copyright disclaimer" for the program, if
327
-necessary.  Here is a sample; alter the names:
328
-
329
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
-  <signature of Ty Coon>, 1 April 1989
333
-  Ty Coon, President of Vice
334
-
335
-This General Public License does not permit incorporating your program into
336
-proprietary programs.  If your program is a subroutine library, you may
337
-consider it more useful to permit linking proprietary applications with the
338
-library.  If this is what you want to do, use the GNU Lesser General
339
-Public License instead of this License.

+ 87 - 80
admin/admin.php View File

@@ -1,32 +1,34 @@
1
-<?php
2
-if(!defined('entry')) define('entry',true);  
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
13
-
14
-require_once('../entry.php');
15
-global $user, $conf, $tumble;
16
-
17
-if ($user->isAdmin()) {
18
-	
19
-?>
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
15
+
16
+require_once('../entry.php');
17
+global $user, $conf, $tumble;
18
+
19
+if ($user->isAdmin()) {
20
+    ?>
20 21
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
21 22
 	<html xmlns="http://www.w3.org/1999/xhtml">
22 23
 	<head>
23 24
 		<title>gelato :: <?php echo __("admin users")?></title>
24 25
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
25
-		<meta name="generator" content="gelato cms <?php echo util::version();?>" />
26
-		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
27
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
28
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
29
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.tablesorter.min.js"></script>
26
+		<?php $util_class = new util(); ?>
27
+		<meta name="generator" content="gelato cms <?php echo $util_class->version(); ?>" />
28
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato; ?>/images/favicon.ico" />
29
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.js"></script>
30
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/tools.js"></script>
31
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.tablesorter.min.js"></script>
30 32
 		<script type="text/javascript">
31 33
 		$(document).ready(function(){
32 34
 			$("#admin-table").tablesorter({        
@@ -41,7 +43,7 @@ if ($user->isAdmin()) {
41 43
 		});
42 44
 		</script>
43 45
 		<style type="text/css" media="screen">	
44
-			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
46
+			@import "<?php echo $conf->urlGelato; ?>/admin/css/style.css";
45 47
 		</style>
46 48
 	</head>
47 49
 	
@@ -49,10 +51,10 @@ if ($user->isAdmin()) {
49 51
 		<div id="div-process" style="display:none;"><?php echo __("Processing request&hellip;")?></div>
50 52
 		<div id="cont">
51 53
 			<div id="head">
52
-				<h1><a href="<?php echo $conf->urlGelato;?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
54
+				<h1><a href="<?php echo $conf->urlGelato; ?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
53 55
 				<ul id="nav">
54
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="Take me to the tumblelog"><?php echo __("View Tumblelog")?></a></li>
55
-					<li><a href="close.php" title="Log off" onclick="return exit('div-process','<?php echo $conf->urlGelato;?>/admin/ajax.php?action=close');"><?php echo __("Log out")?></a></li>
56
+					<li><a href="<?php echo $conf->urlGelato; ?>/" title="Take me to the tumblelog"><?php echo __("View Tumblelog")?></a></li>
57
+					<li><a href="close.php" title="Log off" onclick="return exit('div-process','<?php echo $conf->urlGelato; ?>/admin/ajax.php?action=close');"><?php echo __("Log out")?></a></li>
56 58
 			  	</ul>
57 59
 			</div>
58 60
 			<div id="main">				
@@ -60,40 +62,39 @@ if ($user->isAdmin()) {
60 62
 				<div class="box">
61 63
 					<ul class="menu manage">
62 64
 					<h3>Manage</h3>
63
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
64
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/settings.php"><?php echo __("Settings")?></a></li>
65
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Posts")?></a></li>
66
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/user.php"><?php echo __("Add user")?></a></li>
65
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
66
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/settings.php"><?php echo __("Settings")?></a></li>
67
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/index.php"><?php echo __("Posts")?></a></li>
68
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/user.php"><?php echo __("Add user")?></a></li>
67 69
 					<li class="selected"><a><?php echo __("Users")?></a></li>
68 70
 					</ul>
69 71
 					<p>&nbsp;</p>
70
-<?php				
71
-						if (isset($_GET["added"])) {
72
-							if ($_GET["added"]=="true") {
73
-								echo "<div class=\"exito\" id=\"divMessages\">".__("The user has been added successfully.")."</div>";
74
-							}
75
-						}
76
-						
77
-						if (isset($_GET["delete"])) {
78
-							if ($_GET["delete"]=="true") {
79
-								echo "<div class=\"exito\" id=\"divMessages\">".__("The user has been eliminated successfully.")."</div>";
80
-							}
81
-						}
82
-						
83
-						if (isset($_GET["modified"])) {
84
-							if ($_GET["modified"]=="true") {
85
-								echo "<div class=\"exito\" id=\"divMessages\">".__("The user has been modified successfully.")."</div>";
86
-							}
87
-						}
88
-						
89
-						if (isset($_GET["error"])) {
90
-							if ($_GET["error"]==1) {
91
-								echo "<div class=\"error\" id=\"divMessages\">".__("The username is not available.")."</div>";
92
-							} elseif ($_GET["error"]==2) {
93
-								echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server:.")." </strong>".$_GET["des"]."</div>";
94
-							}
95
-						}
96
-?>						
72
+<?php	
73
+                        if (isset($_GET["added"])) {
74
+                            if ($_GET["added"]=="true") {
75
+                                echo "<div class=\"exito\" id=\"divMessages\">".__("The user has been added successfully.")."</div>";
76
+                            }
77
+                        }
78
+                        
79
+    if (isset($_GET["delete"])) {
80
+        if ($_GET["delete"]=="true") {
81
+            echo "<div class=\"exito\" id=\"divMessages\">".__("The user has been eliminated successfully.")."</div>";
82
+        }
83
+    }
84
+                        
85
+    if (isset($_GET["modified"])) {
86
+        if ($_GET["modified"]=="true") {
87
+            echo "<div class=\"exito\" id=\"divMessages\">".__("The user has been modified successfully.")."</div>";
88
+        }
89
+    }
90
+                        
91
+    if (isset($_GET["error"])) {
92
+        if ($_GET["error"]==1) {
93
+            echo "<div class=\"error\" id=\"divMessages\">".__("The username is not available.")."</div>";
94
+        } elseif ($_GET["error"]==2) {
95
+            echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server:.")." </strong>".$_GET["des"]."</div>";
96
+        }
97
+    } ?>						
97 98
 						<div class="tabla">
98 99
 						<table border="0" cellpadding="0" cellspacing="0" id="admin-table">
99 100
 							<thead>
@@ -105,30 +106,35 @@ if ($user->isAdmin()) {
105 106
 								</tr>
106 107
 							</thead>
107 108
 							<tbody>
108
-<?php
109
-					$odd=false;
110
-					$rs = $user->getUsers();
111
-					if ($db->contarRegistros()>0) {
112
-						while($register = mysql_fetch_array($rs)) {
113
-?>
114
-							<tr <?php if ($odd) { echo 'class="odd"'; } $odd=!$odd; ?>>
109
+<?php
110
+                    $odd=false;
111
+    $rs = $user->getUsers();
112
+    if ($db->contarRegistros()>0) {
113
+        while ($register = mysql_fetch_array($rs)) {
114
+            ?>
115
+							<tr <?php if ($odd) {
116
+                echo 'class="odd"';
117
+            }
118
+            $odd=!$odd; ?>>
115 119
 								<td><?php echo $register["login"]."\n"; ?></td>
116 120
 								<td><?php echo $register["name"]."\n"; ?></td>
117 121
 								<td><a href="user.php?edit=<?php echo $register["id_user"]; ?>"><?php echo __("Edit")?></a></td>								
118
-								<td><?php if ($_SESSION["user_id"] != $register["id_user"]) { ?><a href="user.php?delete=<?php echo $register["id_user"]; ?>"><?php echo __("Delete")?></a><?php } ?>&nbsp;</td>
122
+								<td><?php if ($_SESSION["user_id"] != $register["id_user"]) {
123
+                ?><a href="user.php?delete=<?php echo $register["id_user"]; ?>"><?php echo __("Delete")?></a><?php 
124
+            } ?>&nbsp;</td>
119 125
 								
120 126
 							</tr>
121
-<?php
122
-						}
123
-					}
124
-					else {
125
-?>
127
+<?php
128
+
129
+        }
130
+    } else {
131
+        ?>
126 132
 						<tr> 
127 133
 							<td colspan="4"><div class="exito"><?php echo __("No users available.")?></div></td>
128 134
 						</tr>
129
-<?php
130
-					}
131
-?>
135
+<?php
136
+
137
+    } ?>
132 138
 							</tbody>
133 139
 						</table>
134 140
 					</div>
@@ -142,8 +148,9 @@ if ($user->isAdmin()) {
142 148
 		</div>
143 149
 	</body>
144 150
 	</html>
145
-<?php
146
-} else {
147
-	header("Location: ".$conf->urlGelato."/login.php");
148
-}
149
-?>
151
+<?php
152
+
153
+} else {
154
+    header("Location: ".$conf->urlGelato."/login.php");
155
+}
156
+?>

+ 41 - 40
admin/ajax.php View File

@@ -1,42 +1,43 @@
1
-<?php
2
-if(!defined('entry'))define('entry', true);
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
13 15
 ?>
14
-<?php
15
-	require_once('../entry.php');
16
-	global $user;
17
-	
18
-	if ($user->isAdmin()) {
19
-		if ($_GET["action"]) {
20
-			
21
-			if ($_GET["action"] == "close") {
22
-				if ($user->closeSession()) {
23
-					echo __("&nbsp;ending session&hellip;");
24
-				} else {
25
-					echo __("&nbsp;failure ending session&hellip;");
26
-				}
27
-			}	// $_GET["action"] == "close"
28
-			
29
-			if ($_GET["action"] == "verify") {
30
-				if ($_GET["login"]=="") {
31
-					echo "<div class=\"error\">".__("Required field cannot be left blank.")."</div>";
32
-				} else {
33
-					if (!$user->userExist($_GET["login"])) {
34
-						echo "<div class=\"exito\">".__("Username available.")."</div>";
35
-					} else {
36
-						echo "<div class=\"error\">".__("The username is not available.")."</div>";
37
-					}
38
-				}
39
-			}	// $_GET["action"] == "verify"			
40
-		}	// $_GET["action"]
41
-	}	// $user->isAdmin()
16
+<?php
17
+    require_once('../entry.php');
18
+    global $user;
19
+    
20
+    if ($user->isAdmin()) {
21
+        if ($_GET["action"]) {
22
+            if ($_GET["action"] == "close") {
23
+                if ($user->closeSession()) {
24
+                    echo __("&nbsp;ending session&hellip;");
25
+                } else {
26
+                    echo __("&nbsp;failure ending session&hellip;");
27
+                }
28
+            }    // $_GET["action"] == "close"
29
+            
30
+            if ($_GET["action"] == "verify") {
31
+                if ($_GET["login"]=="") {
32
+                    echo "<div class=\"error\">".__("Required field cannot be left blank.")."</div>";
33
+                } else {
34
+                    if (!$user->userExist($_GET["login"])) {
35
+                        echo "<div class=\"exito\">".__("Username available.")."</div>";
36
+                    } else {
37
+                        echo "<div class=\"error\">".__("The username is not available.")."</div>";
38
+                    }
39
+                }
40
+            }    // $_GET["action"] == "verify"
41
+        }    // $_GET["action"]
42
+    }    // $user->isAdmin()
42 43
 ?>

+ 175 - 179
admin/bm.php View File

@@ -1,121 +1,118 @@
1
-<?php
2
-if(!defined('entry'))define('entry', true);
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
13
-?>
14
-<?php
15
-
16
-require('../entry.php');
17
-global $user, $conf, $tumble;
18
-$template = new plantillas("admin");
19
-
20
-if ($user->isAdmin()) {
21
-
22
-	if(isset($_POST["btnAdd"]))	{
23
-		unset($_POST["btnAdd"]);
24
-
25
-		if ($_POST["type"]=="2") { // is Photo type
26
-			if (isset($_POST["url"]) && $_POST["url"]!="")  {
27
-				$photoName = util::getFileName($_POST["url"]);
28
-				if (!$tumble->savePhoto($_POST["url"])) {
29
-					header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
30
-					die();
31
-				}
32
-				$_POST["url"] = "../uploads/".util::sanitizeName($photoName);
33
-			} 
34
-
35
-			unset($_POST["photo"]);
36
-			unset($_POST["MAX_FILE_SIZE"]);
37
-		}
38
-
39
-		if ($_POST["type"]=="7") { // is MP3 type
40
-			set_time_limit(300);
41
-			$mp3Name = util::getFileName($_POST["url"]);
42
-			if (!$tumble->saveMP3($_POST["url"])) {
43
-				header("Location: ".$conf->urlGelato."/admin/index.php?mp3=false");
44
-				die();
45
-			}
46
-			if (isMP3($remoteFileName)) {
47
-				$_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
48
-			}
49
-		}
50
-
51
-		if (!get_magic_quotes_gpc()) {
52
-			$_POST["title"] = addslashes($_POST["title"]);
53
-			$_POST["description"] = addslashes($_POST["description"]);
54
-		}		
55
-		
56
-		$_POST["title"] = util::removeBadTags($_POST["title"],true);
57
-		$_POST["description"] = util::removeBadTags($_POST["description"]);
58
-
59
-		if ($tumble->addPost($_POST)) {
60
-			$input = array("{type}");
61
-			$output = array("1");
62
-
63
-			$template->cargarPlantilla($input, $output, "template_bm");
64
-			$template->mostrarPlantilla();
65
-			die();
66
-		} else {
67
-			header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$this->merror);
68
-			die();
69
-		}
70
-	} else {
71
-
72
-		if (isset($_GET["url"])) {
73
-			$url = $_GET["url"];
74
-		} else {
75
-			$url = null;
76
-		}
77
-		if (isset($url)) {
78
-
79
-			if (util::isMP3($url)) {
80
-				$postType = "mp3";
81
-			} elseif (util::isGoEar($url)) {
82
-				$postType = "mp3";
83
-			} elseif (util::isImageFile($url)) {
84
-				$postType = "photo";
85
-			} elseif (util::isVideo($url)) {
86
-				$postType = "video";
87
-			} else {
88
-				if (isset($_GET["sel"]) && !$_GET["sel"]=="" ) {
89
-					$postType = "post";
90
-				} else {
91
-					$postType = "url";
92
-				}
93
-			}
94
-
95
-		} else {
96
-			die(__("Must be a valid URL"));
97
-		}
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
98 15
 ?>
16
+<?php
17
+
18
+require('../entry.php');
19
+global $user, $conf, $tumble;
20
+$template = new plantillas("admin");
21
+$util_class = new util();
22
+if ($user->isAdmin()) {
23
+    if (isset($_POST["btnAdd"])) {
24
+        unset($_POST["btnAdd"]);
25
+
26
+        if ($_POST["type"]=="2") { // is Photo type
27
+            if (isset($_POST["url"]) && $_POST["url"]!="") {
28
+                $photoName = $util_class->getFileName($_POST["url"]);
29
+                if (!$tumble->savePhoto($_POST["url"])) {
30
+                    header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
31
+                    die();
32
+                }
33
+                $_POST["url"] = "../uploads/".$util_class->sanitizeName($photoName);
34
+            }
35
+
36
+            unset($_POST["photo"]);
37
+            unset($_POST["MAX_FILE_SIZE"]);
38
+        }
39
+
40
+        if ($_POST["type"]=="7") { // is MP3 type
41
+            set_time_limit(300);
42
+            $mp3Name = $util_class->getFileName($_POST["url"]);
43
+            if (!$tumble->saveMP3($_POST["url"])) {
44
+                header("Location: ".$conf->urlGelato."/admin/index.php?mp3=false");
45
+                die();
46
+            }
47
+            if (isMP3($remoteFileName)) {
48
+                $_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
49
+            }
50
+        }
51
+
52
+        if (!get_magic_quotes_gpc()) {
53
+            $_POST["title"] = addslashes($_POST["title"]);
54
+            $_POST["description"] = addslashes($_POST["description"]);
55
+        }
56
+        
57
+        $_POST["title"] = $util_class->removeBadTags($_POST["title"], true);
58
+        $_POST["description"] = $util_class->removeBadTags($_POST["description"]);
59
+
60
+        if ($tumble->addPost($_POST)) {
61
+            $input = array("{type}");
62
+            $output = array("1");
63
+
64
+            $template->cargarPlantilla($input, $output, "template_bm");
65
+            $template->mostrarPlantilla();
66
+            die();
67
+        } else {
68
+            header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$this->merror);
69
+            die();
70
+        }
71
+    } else {
72
+        if (isset($_GET["url"])) {
73
+            $url = $_GET["url"];
74
+        } else {
75
+            $url = null;
76
+        }
77
+        if (isset($url)) {
78
+            if ($util_class->isMP3($url)) {
79
+                $postType = "mp3";
80
+            } elseif ($util_class->isGoEar($url)) {
81
+                $postType = "mp3";
82
+            } elseif ($util_class->isImageFile($url)) {
83
+                $postType = "photo";
84
+            } elseif ($util_class->isVideo($url)) {
85
+                $postType = "video";
86
+            } else {
87
+                if (isset($_GET["sel"]) && !$_GET["sel"]=="") {
88
+                    $postType = "post";
89
+                } else {
90
+                    $postType = "url";
91
+                }
92
+            }
93
+        } else {
94
+            die(__("Must be a valid URL"));
95
+        } ?>
99 96
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
100 97
 	<html xmlns="http://www.w3.org/1999/xhtml">
101 98
 	<head>
102 99
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
103
-		<meta name="generator" content="gelato cms <?php echo util::version();?>" />
100
+		<meta name="generator" content="gelato cms <?php echo $util_class->version(); ?>" />
104 101
 		<title>gelato :: <?php echo __("bookmarklet")?></title>
105
-		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
106
-        <script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
107
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
108
-        <script type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/jquery.markitup.pack.js"></script>
109
-		<script type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/sets/html/set.js"></script>			
110
-        <link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/skins/simple/style.css" />
111
-        <link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato;?>/admin/scripts/markitup/sets/html/style.css" />			
102
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato; ?>/images/favicon.ico" />
103
+        <script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.js"></script>
104
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/tools.js"></script>
105
+        <script type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/markitup/jquery.markitup.pack.js"></script>
106
+		<script type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/markitup/sets/html/set.js"></script>			
107
+        <link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato; ?>/admin/scripts/markitup/skins/simple/style.css" />
108
+        <link rel="stylesheet" type="text/css" href="<?php echo $conf->urlGelato; ?>/admin/scripts/markitup/sets/html/style.css" />			
112 109
         <script type="text/javascript" >
113 110
            $(document).ready(function() {
114 111
               $("#description").markItUp(my_html);
115 112
            });
116 113
         </script>
117 114
 		<style type="text/css" media="screen">
118
-			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
115
+			@import "<?php echo $conf->urlGelato; ?>/admin/css/style.css";
119 116
 		</style>
120 117
 	</head>
121 118
 
@@ -125,84 +122,82 @@ if ($user->isAdmin()) {
125 122
 				<div class="box">
126 123
 					<h3><?php echo __("New Post")?></h3>
127 124
 					<ul class="menu">
128
-<?php
129
-						switch ($postType) {
130
-								case "post":
125
+<?php
126
+                        switch ($postType) {
127
+                                case "post":
131 128
 ?>
132 129
 									<li class="selected"><a href="#"><img src="css/images/page.png" alt="New post" /> <?php echo __("Regular")?></a></li>
133
-<?php
134
-									break;
135
-								case "photo":
130
+<?php
131
+                                    break;
132
+                                case "photo":
136 133
 ?>
137 134
 									<li class="selected"><a href="#"><img src="css/images/image.png" alt="New picture" /> <?php echo __("Picture")?></a></li>
138
-<?php
139
-									break;
140
-								case "url":
135
+<?php
136
+                                    break;
137
+                                case "url":
141 138
 ?>
142 139
 									<li class="selected"><a href="#"><img src="css/images/world.png" alt="New link" /> <?php echo __("Link")?></a></li>
143
-<?php
144
-									break;
145
-								case "video":
140
+<?php
141
+                                    break;
142
+                                case "video":
146 143
 ?>
147 144
 									<li class="selected"><a href="#"><img src="css/images/film.png" alt="New video" /> <?php echo __("Video")?></a></li>
148
-<?php
149
-									break;
150
-								case "mp3":
145
+<?php
146
+                                    break;
147
+                                case "mp3":
151 148
 ?>
152 149
 									<li class="selected"><a href="#"><img src="css/images/music.png" alt="New audio" /> <?php echo __("Audio")?></a></li>
153
-<?php
154
-									break;
155
-							}
156
-?>
150
+<?php
151
+                                    break;
152
+                            } ?>
157 153
 					</ul>
158 154
 					<p>&nbsp;</p>
159 155
 					<form action="bm.php" method="post" <?php echo (isset($_GET["new"]) && $_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd" class="newpost">
160 156
 						<fieldset>
161
-<?php
162
-							$date = gmmktime();
163
-							$title = "";
164
-							$body = (isset($_GET["sel"])) ? $_GET["sel"] : "";
165
-							$url = (isset($url)) ? $url : "";
166
-
167
-							switch ($postType) {
168
-								case "post":
169
-									$input = array("{type}", "{date}", "{id_user}", "{editTitle}", "{editBody}");
170
-									$output = array("1", $date, $_SESSION['user_id'], $title, $body);
171
-
172
-									$template->cargarPlantilla($input, $output, "template_add_post");
173
-									$template->mostrarPlantilla();
174
-									break;
175
-								case "photo":
176
-									$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
177
-									$output = array("2", $date, $_SESSION['user_id'], $url, $body);
178
-
179
-									$template->cargarPlantilla($input, $output, "template_add_photo_bm");
180
-									$template->mostrarPlantilla();
181
-									break;
182
-								case "url":
183
-
184
-									$input = array("{type}", "{date}", "{id_user}", "{editTitle}", "{editUrl}", "{editBody}");
185
-									$output = array("4", $date, $_SESSION['user_id'], $title, $url, $body);
186
-
187
-									$template->cargarPlantilla($input, $output, "template_add_link");
188
-									$template->mostrarPlantilla();
189
-									break;
190
-								case "video":
191
-									$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
192
-									$output = array("6", $date, $_SESSION['user_id'], $url, $body);
193
-
194
-									$template->cargarPlantilla($input, $output, "template_add_video");
195
-									$template->mostrarPlantilla();
196
-									break;
197
-								case "mp3":
198
-									$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
199
-									$output = array("7", $date, $_SESSION['user_id'], $url, $body);
200
-
201
-									$template->cargarPlantilla($input, $output, "template_add_mp3");
202
-									$template->mostrarPlantilla();
203
-									break;
204
-							}
205
-?>
157
+<?php
158
+                            $date = time();
159
+        $title = "";
160
+        $body = (isset($_GET["sel"])) ? $_GET["sel"] : "";
161
+        $url = (isset($url)) ? $url : "";
162
+
163
+        switch ($postType) {
164
+                                case "post":
165
+                                    $input = array("{type}", "{date}", "{id_user}", "{editTitle}", "{editBody}");
166
+                                    $output = array("1", $date, $_SESSION['user_id'], $title, $body);
167
+
168
+                                    $template->cargarPlantilla($input, $output, "template_add_post");
169
+                                    $template->mostrarPlantilla();
170
+                                    break;
171
+                                case "photo":
172
+                                    $input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
173
+                                    $output = array("2", $date, $_SESSION['user_id'], $url, $body);
174
+
175
+                                    $template->cargarPlantilla($input, $output, "template_add_photo_bm");
176
+                                    $template->mostrarPlantilla();
177
+                                    break;
178
+                                case "url":
179
+
180
+                                    $input = array("{type}", "{date}", "{id_user}", "{editTitle}", "{editUrl}", "{editBody}");
181
+                                    $output = array("4", $date, $_SESSION['user_id'], $title, $url, $body);
182
+
183
+                                    $template->cargarPlantilla($input, $output, "template_add_link");
184
+                                    $template->mostrarPlantilla();
185
+                                    break;
186
+                                case "video":
187
+                                    $input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
188
+                                    $output = array("6", $date, $_SESSION['user_id'], $url, $body);
189
+
190
+                                    $template->cargarPlantilla($input, $output, "template_add_video");
191
+                                    $template->mostrarPlantilla();
192
+                                    break;
193
+                                case "mp3":
194
+                                    $input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
195
+                                    $output = array("7", $date, $_SESSION['user_id'], $url, $body);
196
+
197
+                                    $template->cargarPlantilla($input, $output, "template_add_mp3");
198
+                                    $template->mostrarPlantilla();
199
+                                    break;
200
+                            } ?>
206 201
 								<p>
207 202
 									<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;">
208 203
                                     	<?php echo __("Some HTML allowed")?>:<br />
@@ -225,18 +220,19 @@ if ($user->isAdmin()) {
225 220
 				</div>
226 221
 
227 222
 			</div>
228
-<?php
229
-			}
230
-?>
223
+<?php
224
+
225
+    } ?>
231 226
 			<div id="foot">
232 227
 				<a href="http://www.gelatocms.com/" title="gelato CMS">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
233 228
 			</div>
234 229
 		</div>
235 230
 	</body>
236 231
 	</html>
237
-<?php
238
-} else {
239
-	$target = (isset($_GET["url"]))? "/login.php?redirect_url=".$_GET["url"]."&sel=".$_GET["sel"] : "/login.php";
240
-	header("Location: ".$conf->urlGelato.$target);
241
-}
242
-?>
232
+<?php
233
+
234
+} else {
235
+    $target = (isset($_GET["url"]))? "/login.php?redirect_url=".$_GET["url"]."&sel=".$_GET["sel"] : "/login.php";
236
+    header("Location: ".$conf->urlGelato.$target);
237
+}
238
+?>

+ 29 - 25
admin/close.php View File

@@ -1,21 +1,23 @@
1
-<?php
2
-if(!defined('entry'))define('entry', true);
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
13 15
 ?>
14
-<?php
15
-require('../entry.php');
16
-global $user;
17
-$closed = $user->closeSession();
18
-
16
+<?php
17
+require('../entry.php');
18
+global $user;
19
+$closed = $user->closeSession();
20
+
19 21
 ?>
20 22
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
21 23
 	<html xmlns="http://www.w3.org/1999/xhtml">
@@ -47,16 +49,18 @@ $closed = $user->closeSession();
47 49
 				
48 50
 					<div class="tabla">
49 51
 						<p>
50
-<?php
51
-						if ($closed) {
52
-?>		
52
+<?php
53
+                        if ($closed) {
54
+                            ?>		
53 55
 							<h2><?php echo __("Ending session&hellip;")?></h2>
54
-<?php
55
-						} else {	
56
-?>
56
+<?php
57
+
58
+                        } else {
59
+                            ?>
57 60
 							<h2><?php echo __("Has happened an error when closing the session.")?></h2>
58
-<?php
59
-						}	
61
+<?php
62
+
63
+                        }
60 64
 ?> 
61 65
 						</p>
62 66
 					</div>

+ 156 - 154
admin/comments.php View File

@@ -1,82 +1,81 @@
1
-<?php
2
-if(!defined('entry')) define('entry',true);
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
13
-?>
14
-<?php
15
-require_once('../entry.php');
16
-global $user, $conf, $tumble;
17
-
18
-$comment = new comments();
19
-$template = new plantillas("admin");
20
-$isAdmin = $user->isAdmin();
21
-$isEdition = isset($_GET["edit"]);
22
-$commentId = ($isEdition) ? $_GET["edit"] : NULL;
23
-	
24
-if(isset($_POST["btnAdd"]))	{		
25
-	unset($_POST["btnAdd"]);	
26
-	
27
-	$_POST["username"] = strip_tags($_POST["username"]);
28
-	$_POST["email"] =  strip_tags($_POST["email"]);
29
-	$_POST["web"] = strip_tags($_POST["web"]);
30
-	$_POST["content"] = util::removeBadTags($_POST["content"], true);
31
-		
32
-	if (isset($_POST["id_comment"])) {
33
-		if ($isAdmin) {
34
-			if ($comment->modifyComment($_POST, $_POST["id_comment"])) {
35
-				header("Location: comments.php?modified=true");
36
-				die();
37
-			} else {
38
-				header("Location: comments.php?modified=false");
39
-				die();
40
-			}
41
-		}
42
-	} else {
43
-		$comment->generateCookie($_POST);
44
-		$_POST["spam"] = ($comment->isSpam($_POST)) ? "1" : "0";		
45
-		$_POST["ip_user"] = $_SERVER["REMOTE_ADDR"];
46
-		
47
-		$strEnd=($conf->urlFriendly) ? "/" : "";
48
-		if ($comment->addComment($_POST)) {
49
-			header("Location: ".$conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$_POST["id_post"].$strEnd);
50
-			die();
51
-		} else {
52
-			header("Location: ".$conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$_POST["id_post"].$strEnd);
53
-			die();
54
-		}
55
-	}		
56
-} 
57
-
58
-if ($isAdmin) {
59
-
60
-	if (isset($_GET["delete"])) {
61
-		if ($comment->deleteComment($_GET['delete'])) {
62
-			header("Location: comments.php?deleted=true");
63
-			die();
64
-		} else {
65
-			header("Location: comments.php?deleted=false");
66
-			die();
67
-		}		
68
-	}
69
-	
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
70 15
 ?>
16
+<?php
17
+require_once('../entry.php');
18
+global $user, $conf, $tumble;
19
+
20
+$comment = new comments();
21
+$template = new plantillas("admin");
22
+$isAdmin = $user->isAdmin();
23
+$isEdition = isset($_GET["edit"]);
24
+$commentId = ($isEdition) ? $_GET["edit"] : null;
25
+    
26
+if (isset($_POST["btnAdd"])) {
27
+    unset($_POST["btnAdd"]);
28
+    
29
+    $_POST["username"] = strip_tags($_POST["username"]);
30
+    $_POST["email"] =  strip_tags($_POST["email"]);
31
+    $_POST["web"] = strip_tags($_POST["web"]);
32
+    $_POST["content"] = util::removeBadTags($_POST["content"], true);
33
+        
34
+    if (isset($_POST["id_comment"])) {
35
+        if ($isAdmin) {
36
+            if ($comment->modifyComment($_POST, $_POST["id_comment"])) {
37
+                header("Location: comments.php?modified=true");
38
+                die();
39
+            } else {
40
+                header("Location: comments.php?modified=false");
41
+                die();
42
+            }
43
+        }
44
+    } else {
45
+        $comment->generateCookie($_POST);
46
+        $_POST["spam"] = ($comment->isSpam($_POST)) ? "1" : "0";
47
+        $_POST["ip_user"] = $_SERVER["REMOTE_ADDR"];
48
+        
49
+        $strEnd=($conf->urlFriendly) ? "/" : "";
50
+        if ($comment->addComment($_POST)) {
51
+            header("Location: ".$conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$_POST["id_post"].$strEnd);
52
+            die();
53
+        } else {
54
+            header("Location: ".$conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$_POST["id_post"].$strEnd);
55
+            die();
56
+        }
57
+    }
58
+}
59
+
60
+if ($isAdmin) {
61
+    if (isset($_GET["delete"])) {
62
+        if ($comment->deleteComment($_GET['delete'])) {
63
+            header("Location: comments.php?deleted=true");
64
+            die();
65
+        } else {
66
+            header("Location: comments.php?deleted=false");
67
+            die();
68
+        }
69
+    } ?>
71 70
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
72 71
 	<html xmlns="http://www.w3.org/1999/xhtml">
73 72
 	<head>
74 73
 		<title>gelato :: <?php echo __("comments")?></title>
75 74
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
76
-		<meta name="generator" content="gelato cms <?php echo util::version();?>" />
77
-		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
78
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
79
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
75
+		<meta name="generator" content="gelato cms <?php echo util::version(); ?>" />
76
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato; ?>/images/favicon.ico" />
77
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.js"></script>
78
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/tools.js"></script>
80 79
 		<script language="javascript" type="text/javascript">
81 80
 		$(document).ready(function(){
82 81
 			$("#divMessages").fadeOut(5000,function(){
@@ -85,17 +84,17 @@ if ($isAdmin) {
85 84
 		});
86 85
 		</script>
87 86
 		<style type="text/css" media="screen">	
88
-			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
87
+			@import "<?php echo $conf->urlGelato; ?>/admin/css/style.css";
89 88
 		</style>
90 89
 	</head>
91 90
 	
92 91
 	<body>
93
-		<div id="div-process" style="display:none;"><?=__("Processing request&hellip;");?></div>
92
+		<div id="div-process" style="display:none;"><?=__("Processing request&hellip;"); ?></div>
94 93
 		<div id="cont">
95 94
 			<div id="head">
96
-				<h1><a href="<?php echo $conf->urlGelato;?>/admin/index.php" title="gelato :: <?=__("home")?>">gelato cms</a></h1>
95
+				<h1><a href="<?php echo $conf->urlGelato; ?>/admin/index.php" title="gelato :: <?=__("home")?>">gelato cms</a></h1>
97 96
 				<ul id="nav">
98
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?=__("Take me to the tumblelog")?>"><?=__("Back to the Tumblelog")?></a></li>
97
+					<li><a href="<?php echo $conf->urlGelato; ?>/" title="<?=__("Take me to the tumblelog")?>"><?=__("Back to the Tumblelog")?></a></li>
99 98
 			  	</ul>
100 99
 			</div>
101 100
 			<div id="main">				
@@ -104,82 +103,84 @@ if ($isAdmin) {
104 103
 					<ul class="menu manage">
105 104
 						<h3><?=__("Manage comments")?></h3>
106 105
 						<li><a href="index.php"><?=__("Posts")?></a></li>
107
-						<li <?php if (isset($_GET["spam"])) { ?> class="selected" <?php } ?>><a href="comments.php?spam=true"><?=__("Spam")?></a></li>
108
-						<li <?php if (!isset($_GET["spam"])) { ?> class="selected" <?php } ?> ><a href="comments.php"><?php echo ($isEdition) ? __("Edit") : __("List"); ?></a></li>
106
+						<li <?php if (isset($_GET["spam"])) {
107
+        ?> class="selected" <?php 
108
+    } ?>><a href="comments.php?spam=true"><?=__("Spam")?></a></li>
109
+						<li <?php if (!isset($_GET["spam"])) {
110
+        ?> class="selected" <?php 
111
+    } ?> ><a href="comments.php"><?php echo ($isEdition) ? __("Edit") : __("List"); ?></a></li>
109 112
 					</ul>
110 113
 					<p>&nbsp;</p>					
111
-<?php	
112
-					if (isset($_GET["deleted"])) {
113
-						if ($_GET["deleted"]=="true") {
114
-							echo "<div class=\"exito\" id=\"divMessages\">".__("The comment has been eliminated successfully.")."</div>";
115
-						}
116
-						if ($_GET["deleted"]=="false") {
117
-							echo "<div class=\"error\" id=\"divMessages\">".__("The post has NOT been eliminated.")."</div>";
118
-						}
119
-					}
120
-					
121
-					if (isset($_GET["modified"])) {
122
-						if ($_GET["modified"]=="true") {
123
-							echo "<div class=\"exito\" id=\"divMessages\">".__("The comment has been modified successfully.")."</div>";
124
-						}
125
-						if ($_GET["modified"]=="false") {
126
-							echo "<div class=\"error\" id=\"divMessages\">".__("The post has NOT been modified.")."</div>";
127
-						}
128
-					}
129
-?>
114
+<?php	
115
+                    if (isset($_GET["deleted"])) {
116
+                        if ($_GET["deleted"]=="true") {
117
+                            echo "<div class=\"exito\" id=\"divMessages\">".__("The comment has been eliminated successfully.")."</div>";
118
+                        }
119
+                        if ($_GET["deleted"]=="false") {
120
+                            echo "<div class=\"error\" id=\"divMessages\">".__("The post has NOT been eliminated.")."</div>";
121
+                        }
122
+                    }
123
+                    
124
+    if (isset($_GET["modified"])) {
125
+        if ($_GET["modified"]=="true") {
126
+            echo "<div class=\"exito\" id=\"divMessages\">".__("The comment has been modified successfully.")."</div>";
127
+        }
128
+        if ($_GET["modified"]=="false") {
129
+            echo "<div class=\"error\" id=\"divMessages\">".__("The post has NOT been modified.")."</div>";
130
+        }
131
+    } ?>
130 132
 					<div class="tabla">						
131
-<?php
132
-						if ($isEdition) {						
133
-							
134
-							$row = $comment->getComment($_GET["edit"]);
135
-							$date = strtotime($row["comment_date"]);
136
-							
137
-							$input = array("{User}", "{Email}", "{Web}", "{Comment}", "{Id_Post}", "{Date_Added}", "{Id_Comment}", "{Form_Action}");
138
-							$output = array($row["username"], $row["email"], $row["web"], $row["content"], $row["id_post"], $date, $row["id_comment"], $conf->urlGelato."/admin/comments.php");
139
-							
140
-							$template->cargarPlantilla($input, $output, "template_comment_post");
141
-							$template->mostrarPlantilla(); 
142
-
143
-						} else {
144
-							
145
-							if (isset($_GET["page"]) && is_numeric($_GET["page"]) ) {
146
-								$page_num = $_GET["page"];
147
-							} else {
148
-								$page_num = NULL;
149
-							}
150
-							
151
-							$limit=$conf->postLimit;
152
-							
153
-							if(isset($page_num) && is_numeric($page_num) && $page_num>0) {
154
-								$from = (($page_num-1) * $limit);
155
-							} else {
156
-								$from = 0;
157
-							}
158
-							
159
-							if (isset($_GET["spam"]) && $_GET["spam"]=="true") { $sp = "1"; } else { $sp = null; }
160
-							
161
-							$rs = $comment->getComments(null, $limit, $from, $sp);
162
-					
163
-							if ($db->contarRegistros()>0) {				
164
-								while($rowComment = mysql_fetch_array($rs)) {	
165
-							
166
-									$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"]." | ".$rowComment["email"]  : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a> | ".$rowComment["email"];
167
-									
168
-									$input = array("{Permalink}", "{URL_Tumble}", "{Id_Comment}", "{Comment_Author}", "{Comment}");				
169
-									$output = array($conf->urlGelato."/index.php/post/".$rowComment["id_post"]."#comment-".$rowComment["id_comment"], $conf->urlGelato, $rowComment["id_comment"], $commentAuthor, $rowComment["content"]);
170
-									
171
-									$template->cargarPlantilla($input, $output, "template_comment");
172
-									$template->mostrarPlantilla();
173
-								}
174
-								
175
-								$p = new pagination;
176
-								$p->items($comment->countComments());
177
-								$p->limit($limit);
178
-								$p->currentPage(isset($page_num) ? $page_num : 1);
179
-								$p->show();
180
-							}						
181
-						}
182
-?>							
133
+<?php
134
+                        if ($isEdition) {
135
+                            $row = $comment->getComment($_GET["edit"]);
136
+                            $date = strtotime($row["comment_date"]);
137
+                            
138
+                            $input = array("{User}", "{Email}", "{Web}", "{Comment}", "{Id_Post}", "{Date_Added}", "{Id_Comment}", "{Form_Action}");
139
+                            $output = array($row["username"], $row["email"], $row["web"], $row["content"], $row["id_post"], $date, $row["id_comment"], $conf->urlGelato."/admin/comments.php");
140
+                            
141
+                            $template->cargarPlantilla($input, $output, "template_comment_post");
142
+                            $template->mostrarPlantilla();
143
+                        } else {
144
+                            if (isset($_GET["page"]) && is_numeric($_GET["page"])) {
145
+                                $page_num = $_GET["page"];
146
+                            } else {
147
+                                $page_num = null;
148
+                            }
149
+                            
150
+                            $limit=$conf->postLimit;
151
+                            
152
+                            if (isset($page_num) && is_numeric($page_num) && $page_num>0) {
153
+                                $from = (($page_num-1) * $limit);
154
+                            } else {
155
+                                $from = 0;
156
+                            }
157
+                            
158
+                            if (isset($_GET["spam"]) && $_GET["spam"]=="true") {
159
+                                $sp = "1";
160
+                            } else {
161
+                                $sp = null;
162
+                            }
163
+                            
164
+                            $rs = $comment->getComments(null, $limit, $from, $sp);
165
+                    
166
+                            if ($db->contarRegistros()>0) {
167
+                                while ($rowComment = mysql_fetch_array($rs)) {
168
+                                    $commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"]." | ".$rowComment["email"]  : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a> | ".$rowComment["email"];
169
+                                    
170
+                                    $input = array("{Permalink}", "{URL_Tumble}", "{Id_Comment}", "{Comment_Author}", "{Comment}");
171
+                                    $output = array($conf->urlGelato."/index.php/post/".$rowComment["id_post"]."#comment-".$rowComment["id_comment"], $conf->urlGelato, $rowComment["id_comment"], $commentAuthor, $rowComment["content"]);
172
+                                    
173
+                                    $template->cargarPlantilla($input, $output, "template_comment");
174
+                                    $template->mostrarPlantilla();
175
+                                }
176
+                                
177
+                                $p = new pagination;
178
+                                $p->items($comment->countComments());
179
+                                $p->limit($limit);
180
+                                $p->currentPage(isset($page_num) ? $page_num : 1);
181
+                                $p->show();
182
+                            }
183
+                        } ?>							
183 184
 					</div>
184 185
 
185 186
 					<div class="footer-box">&nbsp;</div>
@@ -191,8 +192,9 @@ if ($isAdmin) {
191 192
 		</div>
192 193
 	</body>
193 194
 	</html>
194
-<?php
195
-} else {
196
-	header("Location: ".$conf->urlGelato."/login.php");
197
-}
195
+<?php
196
+
197
+} else {
198
+    header("Location: ".$conf->urlGelato."/login.php");
199
+}
198 200
 ?>

+ 0 - 0
admin/css/archive.css View File


+ 0 - 0
admin/css/images/asc.gif View File


+ 0 - 0
admin/css/images/bg-box.png View File


+ 0 - 0
admin/css/images/bg-foot-box.png View File


+ 0 - 0
admin/css/images/bg-top-box-hover.png View File


+ 0 - 0
admin/css/images/bg-top-box.png View File


+ 0 - 0
admin/css/images/bg.gif View File


+ 0 - 0
admin/css/images/blank.gif View File


+ 0 - 0
admin/css/images/close.gif View File


+ 0 - 0
admin/css/images/closelabel.gif View File


+ 0 - 0
admin/css/images/comments.png View File


+ 0 - 0
admin/css/images/delete.png View File


+ 0 - 0
admin/css/images/desc.gif View File


+ 0 - 0
admin/css/images/edit.png View File


+ 0 - 0
admin/css/images/film.png View File


+ 0 - 0
admin/css/images/gelato-logo.png View File


+ 0 - 0
admin/css/images/grad-big.png View File


+ 0 - 0
admin/css/images/grad-small.png View File


+ 0 - 0
admin/css/images/image.png View File


+ 0 - 0
admin/css/images/loading.gif View File


+ 0 - 0
admin/css/images/music.png View File


+ 0 - 0
admin/css/images/nextlabel.gif View File


+ 0 - 0
admin/css/images/page.png View File


+ 0 - 0
admin/css/images/prevlabel.gif View File


+ 0 - 0
admin/css/images/quote.png View File


+ 0 - 0
admin/css/images/td_back.gif View File


+ 0 - 0
admin/css/images/world.png View File


+ 0 - 0
admin/css/lightbox.css View File


+ 0 - 0
admin/css/style.css View File


+ 58 - 58
admin/feeds.php View File

@@ -1,49 +1,49 @@
1
-<?php
2
-if(!defined('entry')) define('entry', true);
3
- /* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
13
-?>
14
-<?php
15
-require('../entry.php');
16
-global $user, $conf, $tumble;
17
-
18
-if ($user->isAdmin()) {
19
-	$message = '';
20
-	$f = new feeds();
21
-	if(isset($_POST['add'], $_POST['url'])){
22
-		 $credits =(isset($_POST['credits']))? 1 : 0;
23
-		if($f->addFeed($_POST['url'],$_POST['type'],$_POST['source'], $credits)){
24
-			$message = __('Feed added');
25
-			$messageStatus = 'exito';
26
-		}
27
-	}
28
-	
29
-	if(isset($_GET['delete']) && is_numeric($_GET['delete'])){
30
-		if($f->removeFeed((int)$_GET['delete'])){
31
-			$message = __('Feed deleted');
32
-			$messageStatus = 'error';
33
-		}
34
-	}
35
-	
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+ /* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
36 15
 ?>
16
+<?php
17
+require('../entry.php');
18
+global $user, $conf, $tumble;
19
+
20
+if ($user->isAdmin()) {
21
+    $message = '';
22
+    $f = new feeds();
23
+    if (isset($_POST['add'], $_POST['url'])) {
24
+        $credits =(isset($_POST['credits']))? 1 : 0;
25
+        if ($f->addFeed($_POST['url'], $_POST['type'], $_POST['source'], $credits)) {
26
+            $message = __('Feed added');
27
+            $messageStatus = 'exito';
28
+        }
29
+    }
30
+    
31
+    if (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
32
+        if ($f->removeFeed((int)$_GET['delete'])) {
33
+            $message = __('Feed deleted');
34
+            $messageStatus = 'error';
35
+        }
36
+    } ?>
37 37
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
38 38
 	<html xmlns="http://www.w3.org/1999/xhtml">
39 39
 	<head>
40 40
 		<title>gelato :: <?php echo __("Feeds")?></title>
41 41
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
42
-		<meta name="generator" content="gelato cms <?php echo util::version();?>" />
43
-		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
44
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
45
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
46
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.validate.min.js"></script>
42
+		<meta name="generator" content="gelato cms <?php echo util::version(); ?>" />
43
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato; ?>/images/favicon.ico" />
44
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.js"></script>
45
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/tools.js"></script>
46
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.validate.min.js"></script>
47 47
 		<script type="text/javascript">
48 48
 		$(document).ready(function(){
49 49
 			$("#divMessages").fadeOut(5000,function(){
@@ -67,16 +67,16 @@ if ($user->isAdmin()) {
67 67
 		});
68 68
 		</script>
69 69
 		<style type="text/css" media="screen">	
70
-			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
70
+			@import "<?php echo $conf->urlGelato; ?>/admin/css/style.css";
71 71
 		</style>
72 72
 	</head>
73 73
 	
74 74
 	<body>
75 75
 		<div id="cont">
76 76
 			<div id="head">
77
-				<h1><a href="<?php echo $conf->urlGelato;?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
77
+				<h1><a href="<?php echo $conf->urlGelato; ?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
78 78
 				<ul id="nav">
79
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
79
+					<li><a href="<?php echo $conf->urlGelato; ?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
80 80
 			  	</ul>
81 81
 			</div>
82 82
 			<div id="main">				
@@ -88,7 +88,7 @@ if ($user->isAdmin()) {
88 88
                     <li><a href="options.php"><?php echo __("Options")?></a></li>
89 89
 					</ul>
90 90
 					
91
-					<?php echo (!(empty($message))? '<div class="'.$messageStatus.'" id="divMessages"> '.$message.'</div>' : ''); ?>
91
+					<?php echo(!(empty($message))? '<div class="'.$messageStatus.'" id="divMessages"> '.$message.'</div>' : ''); ?>
92 92
 
93 93
 					<div class="tabla">
94 94
 
@@ -128,16 +128,15 @@ if ($user->isAdmin()) {
128 128
 						</form>
129 129
 						<div id="feedlist">						  
130 130
 						  <ul>
131
-						    <?php
132
-							$actual_feeds = $f->getFeedList();
133
-							foreach($actual_feeds as $feed){
134
-								if($feed['error']>0){
135
-									echo '<li class="feederror"><a href="feeds.php?delete='.$feed['id_feed'].'" title="'.__('Delete this Feed').'" class="action"><img title="" alt="" src="css/images/delete.png"/></a><span class="status">'.__('Error updating').'</span> '.((!empty($feed['title']))? $feed['title'] : $feed['url']).'</li>';
136
-								}else{
137
-									echo '<li><a href="feeds.php?delete='.$feed['id_feed'].'" title="'.__('Delete this Feed').'" class="action"><img title="" alt="" src="css/images/delete.png"/></a><span class="status" title="'.__('Last update').': '.$feed['updated_at'].'">'.__('Importing').'</span> '.((!empty($feed['title']))? $feed['title'] : $feed['url']).'</li>';
138
-								}
139
-							}
140
-						?>
131
+						    <?php
132
+                            $actual_feeds = $f->getFeedList();
133
+    foreach ($actual_feeds as $feed) {
134
+        if ($feed['error']>0) {
135
+            echo '<li class="feederror"><a href="feeds.php?delete='.$feed['id_feed'].'" title="'.__('Delete this Feed').'" class="action"><img title="" alt="" src="css/images/delete.png"/></a><span class="status">'.__('Error updating').'</span> '.((!empty($feed['title']))? $feed['title'] : $feed['url']).'</li>';
136
+        } else {
137
+            echo '<li><a href="feeds.php?delete='.$feed['id_feed'].'" title="'.__('Delete this Feed').'" class="action"><img title="" alt="" src="css/images/delete.png"/></a><span class="status" title="'.__('Last update').': '.$feed['updated_at'].'">'.__('Importing').'</span> '.((!empty($feed['title']))? $feed['title'] : $feed['url']).'</li>';
138
+        }
139
+    } ?>
141 140
 					      </ul>
142 141
 					    </div>
143 142
 				  </div>
@@ -151,8 +150,9 @@ if ($user->isAdmin()) {
151 150
 		</div>
152 151
 	</body>
153 152
 	</html>
154
-<?php
155
-} else {
156
-	header("Location: ".$conf->urlGelato."/login.php");
157
-}
153
+<?php
154
+
155
+} else {
156
+    header("Location: ".$conf->urlGelato."/login.php");
157
+}
158 158
 ?>

+ 324 - 311
admin/index.php View File

@@ -1,313 +1,326 @@
1
-<?php
2
-if(!defined('entry'))define('entry', true);
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
13 15
 ?>
14
-<?php
15
-require('../entry.php');
16
-
17
-global $user, $conf, $tumble;
18
-#$template = new plantillas("admin");
19
-$theme = new themes;
20
-
21
-$isEdition = (isset($_GET["edit"])) ? true : false;
22
-$postId = ($isEdition) ? $_GET["edit"] : NULL;
23
-
24
-$theme->set('isEdition',$isEdition);
25
-$theme->set('postId',$postId);
26
-$theme->set('pagination','');
27
-
28
-if (get_magic_quotes_gpc()) {
29
-        foreach($_GET as $k=>$get){
30
-                $_GET[$k]=stripslashes($get);
31
-        }
32
-}
33
-
34
-if ($user->isAuthenticated()) {
35
-        if (isset($_GET["delete"])) {
36
-                $tumble->deletePost($_GET['delete']);
37
-                header("Location: index.php?deleted=true");
38
-                die();
39
-        }
40
-
41
-        if(isset($_POST["btnAdd"])){
42
-                unset($_POST["btnAdd"]);
43
-                $_POST['type'] = util::type2Number($_POST['type']);
44
-
45
-                if ($_POST["type"]=="2") { // is Photo type
46
-                        if (isset($_POST["url"]) && $_POST["url"]!="")  {
47
-                                $photoName = util::getFileName($_POST["url"]);
48
-                                if (!$tumble->savePhoto($_POST["url"])) {
49
-                                        header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
50
-                                        die();
51
-                                }
52
-                                $_POST["url"] = "../uploads/".util::sanitizeName($photoName);
53
-                        }
54
-
55
-                        if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".util::sanitizeName($_FILES['photo']['name']) ) ) {
56
-                                $_POST["url"] = "../uploads/".util::sanitizeName($_FILES['photo']['name']);
57
-                        }
58
-
59
-                        unset($_POST["photo"]);
60
-                        unset($_POST["MAX_FILE_SIZE"]);
61
-                }
62
-
63
-                if ($_POST["type"]=="7") { // is MP3 type
64
-                        set_time_limit(300);
65
-                        $mp3Name = util::getFileName($_POST["url"]);
66
-                        if (!$tumble->saveMP3($_POST["url"])) {
67
-                                header("Location: ".$conf->urlGelato."/admin/index.php?mp3=false");
68
-                                die();
69
-                        }
70
-                        if (util::isMP3($remoteFileName)) {
71
-                                $_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
72
-                        }
73
-                }
74
-
75
-                if (!get_magic_quotes_gpc()) {
76
-                        $_POST["title"] = addslashes($_POST["title"]);
77
-                        $_POST["description"] = addslashes($_POST["description"]);
78
-                }
79
-
80
-                /*
81
-                $textile = new Textile();
82
-
83
-                $_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"],true));
84
-                $_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
85
-                */
86
-
87
-                $_POST["title"] = util::removeBadTags($_POST["title"],true);
88
-                $_POST["description"] = util::removeBadTags($_POST["description"]);
89
-
90
-                if (isset($_POST["id_post"]) and  is_numeric($_POST["id_post"]) and $_POST["id_post"]>0) {
91
-                        $tumble->modifyPost($_POST, $_POST["id_post"]);
92
-                } else {
93
-                        if ($tumble->addPost($_POST)) {
94
-                                header("Location: ".$conf->urlGelato."/admin/index.php?added=true");
95
-                                die();
96
-                        } else {
97
-                                header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$tumble->merror);
98
-                                die();
99
-                        }
100
-                }
101
-        } else {
102
-                if ($isEdition) {
103
-                        $post = $tumble->getPost($postId);
104
-                }
105
-				$admin_includes = "";
106
-				$trigger->call('admin_includes');
107
-                $theme->set('admin_includes',$admin_includes);
108
-                $theme->set('version',util::version());
109
-                $theme->set('conf', array(
110
-                        'urlGelato'=>$conf->urlGelato,
111
-                        'richText'=>$conf->richText
112
-                ));
113
-                $theme->set('new',isset($_GET['new'])?$_GET['new']:'');
114
-                $theme->set('information',false);
115
-                $theme->set('error',false);
116
-
117
-                if($conf->check_version){
118
-                        $present = util::version();
119
-                        $lastest = util::_file_get_contents("http://www.gelatocms.com/vgel.txt");
120
-                        if ($present < $lastest)
121
-                                $theme->set('information',__("A new gelato version has been released and is ready <a href=\"http://www.gelatocms.com/\">for download</a>."));
122
-                }
123
-
124
-                $actions = array(
125
-                        'deleted'=>false,
126
-                        'modified'=>false,
127
-                        'added'=>false
128
-                );
129
-
130
-                if(isset($_GET['deleted']) and $_GET['deleted']=='true'){
131
-                        $theme->set('exito',__("The post has been eliminated successfully."));
132
-                        $actions['deleted'] = true;
133
-                }
134
-
135
-                if(isset($_GET["modified"]) and $_GET["modified"]==true){
136
-                        $theme->set('exito',__("The post has been modified successfully."));
137
-                        $actions['modified']=true;
138
-                }
139
-
140
-                if(isset($_GET["added"]) and $_GET["added"]==true) {
141
-                        $theme->set('exito',__("The post has been added successfully."));
142
-                        $actions['added']=true;
143
-                }
144
-
145
-                $theme->set('action',$actions);
146
-
147
-                if (isset($_GET["error"]) and $_GET["error"]==2)
148
-                        $theme->set('error',__("Error on the database server:")." </strong>".$_GET["des"]);
149
-
150
-                if (isset($_GET["mp3"]) and $_GET["mp3"]=='false')
151
-                        $theme->set('error',__("Not an MP3 file or an upload problem."));
152
-
153
-                if (isset($_GET["photo"]) and $_GET["photo"]=='false')
154
-                        $theme->set('error',__("Not a photo file or an upload problem."));
155
-
156
-                if ($isEdition) {
157
-                        switch ($post["type"]) {
158
-                                case "1": $_GET["new"] = "post"; break;
159
-                                case "2": $_GET["new"] = "photo"; break;
160
-                                case "3": $_GET["new"] = "quote"; break;
161
-                                case "4": $_GET["new"] = "url"; break;
162
-                                case "5": $_GET["new"] = "conversation"; break;
163
-                                case "6": $_GET["new"] = "video"; break;
164
-                                case "7": $_GET["new"] = "mp3"; break;
165
-                        }
166
-                }
167
-
168
-                $date = ($isEdition) ? strtotime($post["date"]) : gmmktime();
169
-                $title = ($isEdition) ? htmlspecialchars(stripslashes($post["title"])) : "";
170
-                $body = ($isEdition) ? stripslashes($post["description"]) : "";
171
-                $url = ($isEdition) ? $post["url"] : "";
172
-
173
-                if (!isset($_GET['new'])) $_GET['new'] = 'post';
174
-
175
-				$form = new themes;
176
-                $form->set('date',$date);
177
-                $form->set('id_user',$_SESSION['user_id']);
178
-                $form->set('type',$_GET["new"]);
179
-				$form->set('editBody',$body);
180
-                switch ($_GET["new"]) {
181
-                        case "post":
182
-                                $form->set('editTitle',$title);
183
-                                $theme->set('form',$form->fetch(Absolute_Path.'admin/themes/admin/parts/template_add_post.htm'));
184
-                                break;
185
-                        case "photo":
186
-                                $url = str_replace("../", $conf->urlGelato."/", $url);
187
-                                $form->set('editUrl',$url);
188
-                                $theme->set('form',$form->fetch(Absolute_Path.'admin/themes/admin/parts/template_add_photo.htm'));
189
-                                break;
190
-                        case "quote":
191
-                                $form->set('editTitle',$title);
192
-                                $theme->set('form',$form->fetch(Absolute_Path.'admin/themes/admin/parts/template_add_quote.htm'));
193
-                                break;
194
-                        case "url":
195
-                                $form->set('editTitle',$title);
196
-                                $form->set('editUrl',$url);
197
-                                $theme->set('form',$form->fetch(Absolute_Path.'admin/themes/admin/parts/template_add_link.htm'));
198
-                                break;
199
-                        case "conversation":
200
-                                $form->set('editTitle',$title);
201
-                                $theme->set('form',$form->fetch(Absolute_Path.'admin/themes/admin/parts/template_add_conversation.htm'));
202
-                                break;
203
-                        case "video":
204
-                                $form->set('editUrl',$url);
205
-                                $theme->set('form',$form->fetch(Absolute_Path.'admin/themes/admin/parts/template_add_video.htm'));
206
-                                break;
207
-                        case "mp3":
208
-                                $form->set('editUrl',$url);
209
-                                $theme->set('form',$form->fetch(Absolute_Path.'admin/themes/admin/parts/template_add_mp3.htm'));
210
-                                break;
211
-                        }
212
-
213
-
214
-                if (!$isEdition){
215
-                        if (isset($_GET["page"]))
216
-                                $page_num = $_GET["page"];
217
-                        else
218
-                                $page_num = NULL;
219
-
220
-                        $limit=$conf->postLimit;
221
-
222
-                        if(isset($page_num) && is_numeric($page_num) && $page_num>0)// Is defined the page and is numeric?
223
-                                $from = (($page_num-1) * $limit);
224
-                        else
225
-                                $from = 0;
226
-
227
-                        $rs = $tumble->getPosts($limit, $from);
228
-                        $theme->set('Posts_Number',$db->contarRegistros());
229
-
230
-                        $rows = array();
231
-                        if ($db->contarRegistros()>0) {
232
-                                while($register = mysql_fetch_array($rs)) {
233
-                                        $row['postType'] = util::type2Text($tumble->getType($register["id_post"]));
234
-
235
-                                        $formatedDate = gmdate("M d", strtotime($register["date"]) + util::transform_offset($conf->offsetTime));
236
-                                        $strEnd=($conf->urlFriendly) ? "/" : "";
237
-										$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
238
-
239
-                                        $register["title"] = stripslashes($register["title"]);
240
-                                        $register["description"] = stripslashes($register["description"]);
241
-
242
-                                        $row['Id_Post'] = $register["id_post"];
243
-                                        $row['Date_Added'] = $formatedDate;
244
-                                        $row['Permalink'] = $permalink;
245
-
246
-                                        switch ($tumble->getType($register["id_post"])) {
247
-                                                case "1":
248
-                                                        $row['Title'] = $register["title"];
249
-                                                        $row['Body'] = $register["description"];
250
-                                                        break;
251
-                                                case "2":
252
-                                                        $fileName = "../uploads/".util::getFileName($register["url"]);
253
-
254
-                                                        $x = @getimagesize($fileName);
255
-                                                        if ($x[0] > 100)
256
-                                                                $photoPath = $conf->urlGelato."/classes/imgsize.php?w=100&img=".$register["url"];
257
-                                                        else
258
-                                                                $photoPath = $register["url"];
259
-
260
-                                                        $effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
261
-
262
-                                                        $row['PhotoURL'] = $photoPath;
263
-                                                        $row['PhotoAlt'] = strip_tags($register["description"]);
264
-                                                        $row['Caption'] = $register["description"];
265
-                                                        $row['Effect'] = $effect;
266
-                                                        break;
267
-                                                case "3":
268
-                                                        $row['Quote'] = $register["description"];
269
-                                                        $row['Source'] = $register["title"];
270
-                                                        break;
271
-                                                case "4":
272
-                                                        if($conf->shorten_links)
273
-                                                                $register["url"] = util::_file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
274
-                                                        $register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
275
-
276
-                                                        $row['URL'] = $register["url"];
277
-                                                        $row['Name'] = $register["title"];
278
-                                                        $row['Description'] = $register["description"];
279
-                                                        break;
280
-                                                case "5":
281
-                                                        $row['Title'] = $register["title"];
282
-                                                        $row['Conversation'] = $tumble->formatConversation($register["description"]);
283
-                                                break;
284
-                                                        case "6":
285
-                                                        $row['Video'] = $tumble->getVideoPlayer($register["url"]);
286
-                                                        $row['Caption'] = $register["description"];
287
-                                                        break;
288
-                                                case "7":
289
-                                                        $row['Mp3'] = $tumble->getMp3Player($register["url"]);
290
-                                                        $row['Caption'] = $register["description"];
291
-                                                        break;
292
-                                        }
293
-
294
-                                        $rows[] = $row;
295
-                                }
296
-
297
-                                $p = new pagination;
298
-                                $p->items($tumble->getPostsNumber());
299
-                                $p->limit($limit);
300
-                                $p->currentPage(isset($page_num) ? $page_num : 1);
301
-
302
-                                $theme->set('pagination',$p->getPagination());
303
-                                $theme->set('rows',$rows);
304
-                        }else{
305
-                                $theme->set('error',__("No posts in this tumblelog."));
306
-                        }
307
-                }
308
-                $theme->display(Absolute_Path.'admin/themes/admin/index.htm');
309
-        }
310
-} else {
311
-        header("Location: ".$conf->urlGelato."/login.php");
312
-}
16
+<?php
17
+require('../entry.php');
18
+
19
+global $user, $conf, $tumble;
20
+#$template = new plantillas("admin");
21
+$theme = new themes;
22
+
23
+$isEdition = (isset($_GET["edit"])) ? true : false;
24
+$postId = ($isEdition) ? $_GET["edit"] : null;
25
+
26
+$theme->set('isEdition', $isEdition);
27
+$theme->set('postId', $postId);
28
+$theme->set('pagination', '');
29
+
30
+if (get_magic_quotes_gpc()) {
31
+    foreach ($_GET as $k=>$get) {
32
+        $_GET[$k]=stripslashes($get);
33
+    }
34
+}
35
+$util_class = new util();
36
+if ($user->isAuthenticated()) {
37
+    if (isset($_GET["delete"])) {
38
+        $tumble->deletePost($_GET['delete']);
39
+        header("Location: index.php?deleted=true");
40
+        die();
41
+    }
42
+
43
+    if (isset($_POST["btnAdd"])) {
44
+        unset($_POST["btnAdd"]);
45
+        $_POST['type'] = $util_class->type2Number($_POST['type']);
46
+
47
+        if ($_POST["type"]=="2") { // is Photo type
48
+                        if (isset($_POST["url"]) && $_POST["url"]!="") {
49
+                            $photoName = $util_class->getFileName($_POST["url"]);
50
+                            if (!$tumble->savePhoto($_POST["url"])) {
51
+                                header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
52
+                                die();
53
+                            }
54
+                            $_POST["url"] = "../uploads/".$util_class->sanitizeName($photoName);
55
+                        }
56
+
57
+            if (move_uploaded_file($_FILES['photo']['tmp_name'], "../uploads/".$util_class->sanitizeName($_FILES['photo']['name']))) {
58
+                $_POST["url"] = "../uploads/".$util_class->sanitizeName($_FILES['photo']['name']);
59
+            }
60
+
61
+            unset($_POST["photo"]);
62
+            unset($_POST["MAX_FILE_SIZE"]);
63
+        }
64
+
65
+        if ($_POST["type"]=="7") { // is MP3 type
66
+                        set_time_limit(300);
67
+            $mp3Name = $util_class->getFileName($_POST["url"]);
68
+            if (!$tumble->saveMP3($_POST["url"])) {
69
+                header("Location: ".$conf->urlGelato."/admin/index.php?mp3=false");
70
+                die();
71
+            }
72
+            if ($util_class->isMP3($remoteFileName)) {
73
+                $_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
74
+            }
75
+        }
76
+
77
+        if (!get_magic_quotes_gpc()) {
78
+            $_POST["title"] = addslashes($_POST["title"]);
79
+            $_POST["description"] = addslashes($_POST["description"]);
80
+        }
81
+
82
+                /*
83
+                $textile = new Textile();
84
+
85
+                $_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"],true));
86
+                $_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
87
+                */
88
+
89
+                $_POST["title"] = $util_class->removeBadTags($_POST["title"], true);
90
+        $_POST["description"] = $util_class->removeBadTags($_POST["description"]);
91
+
92
+        if (isset($_POST["id_post"]) and  is_numeric($_POST["id_post"]) and $_POST["id_post"]>0) {
93
+            $tumble->modifyPost($_POST, $_POST["id_post"]);
94
+        } else {
95
+            if ($tumble->addPost($_POST)) {
96
+                header("Location: ".$conf->urlGelato."/admin/index.php?added=true");
97
+                die();
98
+            } else {
99
+                header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$tumble->merror);
100
+                die();
101
+            }
102
+        }
103
+    } else {
104
+        if ($isEdition) {
105
+            $post = $tumble->getPost($postId);
106
+        }
107
+        $admin_includes = "";
108
+        $trigger->call('admin_includes');
109
+        $theme->set('admin_includes', $admin_includes);
110
+        
111
+        $theme->set('version', $util_class->version());
112
+        $theme->set('conf', array(
113
+                        'urlGelato'=>$conf->urlGelato,
114
+                        'richText'=>$conf->richText
115
+                ));
116
+        $theme->set('new', isset($_GET['new'])?$_GET['new']:'');
117
+        $theme->set('information', false);
118
+        $theme->set('error', false);
119
+
120
+        if ($conf->check_version) {
121
+            $present = $util_class->version();
122
+            $lastest = $util_class->_file_get_contents("http://www.gelatocms.com/vgel.txt");
123
+            if ($present < $lastest) {
124
+                $theme->set('information', __("A new gelato version has been released and is ready <a href=\"http://www.gelatocms.com/\">for download</a>."));
125
+            }
126
+        }
127
+
128
+        $actions = array(
129
+                        'deleted'=>false,
130
+                        'modified'=>false,
131
+                        'added'=>false
132
+                );
133
+
134
+        if (isset($_GET['deleted']) and $_GET['deleted']=='true') {
135
+            $theme->set('exito', __("The post has been eliminated successfully."));
136
+            $actions['deleted'] = true;
137
+        }
138
+
139
+        if (isset($_GET["modified"]) and $_GET["modified"]==true) {
140
+            $theme->set('exito', __("The post has been modified successfully."));
141
+            $actions['modified']=true;
142
+        }
143
+
144
+        if (isset($_GET["added"]) and $_GET["added"]==true) {
145
+            $theme->set('exito', __("The post has been added successfully."));
146
+            $actions['added']=true;
147
+        }
148
+
149
+        $theme->set('action', $actions);
150
+
151
+        if (isset($_GET["error"]) and $_GET["error"]==2) {
152
+            $theme->set('error', __("Error on the database server:")." </strong>".$_GET["des"]);
153
+        }
154
+
155
+        if (isset($_GET["mp3"]) and $_GET["mp3"]=='false') {
156
+            $theme->set('error', __("Not an MP3 file or an upload problem."));
157
+        }
158
+
159
+        if (isset($_GET["photo"]) and $_GET["photo"]=='false') {
160
+            $theme->set('error', __("Not a photo file or an upload problem."));
161
+        }
162
+
163
+        if ($isEdition) {
164
+            switch ($post["type"]) {
165
+                                case "1": $_GET["new"] = "post"; break;
166
+                                case "2": $_GET["new"] = "photo"; break;
167
+                                case "3": $_GET["new"] = "quote"; break;
168
+                                case "4": $_GET["new"] = "url"; break;
169
+                                case "5": $_GET["new"] = "conversation"; break;
170
+                                case "6": $_GET["new"] = "video"; break;
171
+                                case "7": $_GET["new"] = "mp3"; break;
172
+                        }
173
+        }
174
+
175
+        $date = ($isEdition) ? strtotime($post["date"]) : time();
176
+        $title = ($isEdition) ? htmlspecialchars(stripslashes($post["title"])) : "";
177
+        $body = ($isEdition) ? stripslashes($post["description"]) : "";
178
+        $url = ($isEdition) ? $post["url"] : "";
179
+
180
+        if (!isset($_GET['new'])) {
181
+            $_GET['new'] = 'post';
182
+        }
183
+
184
+        $form = new themes;
185
+        $form->set('date', $date);
186
+        $form->set('id_user', $_SESSION['user_id']);
187
+        $form->set('type', $_GET["new"]);
188
+        $form->set('editBody', $body);
189
+        switch ($_GET["new"]) {
190
+                        case "post":
191
+                                $form->set('editTitle', $title);
192
+                                $theme->set('form', $form->fetch(Absolute_Path.'admin/themes/admin/template_add_post.htm'));
193
+                                break;
194
+                        case "photo":
195
+                                $url = str_replace("../", $conf->urlGelato."/", $url);
196
+                                $form->set('editUrl', $url);
197
+                                $theme->set('form', $form->fetch(Absolute_Path.'admin/themes/admin/template_add_photo.htm'));
198
+                                break;
199
+                        case "quote":
200
+                                $form->set('editTitle', $title);
201
+                                $theme->set('form', $form->fetch(Absolute_Path.'admin/themes/admin/template_add_quote.htm'));
202
+                                break;
203
+                        case "url":
204
+                                $form->set('editTitle', $title);
205
+                                $form->set('editUrl', $url);
206
+                                $theme->set('form', $form->fetch(Absolute_Path.'admin/themes/admin/template_add_link.htm'));
207
+                                break;
208
+                        case "conversation":
209
+                                $form->set('editTitle', $title);
210
+                                $theme->set('form', $form->fetch(Absolute_Path.'admin/themes/admin/template_add_conversation.htm'));
211
+                                break;
212
+                        case "video":
213
+                                $form->set('editUrl', $url);
214
+                                $theme->set('form', $form->fetch(Absolute_Path.'admin/themes/admin/template_add_video.htm'));
215
+                                break;
216
+                        case "mp3":
217
+                                $form->set('editUrl', $url);
218
+                                $theme->set('form', $form->fetch(Absolute_Path.'admin/themes/admin/template_add_mp3.htm'));
219
+                                break;
220
+                        }
221
+
222
+
223
+        if (!$isEdition) {
224
+            if (isset($_GET["page"])) {
225
+                $page_num = $_GET["page"];
226
+            } else {
227
+                $page_num = null;
228
+            }
229
+
230
+            $limit=$conf->postLimit;
231
+
232
+            if (isset($page_num) && is_numeric($page_num) && $page_num>0) {// Is defined the page and is numeric?
233
+                                $from = (($page_num-1) * $limit);
234
+            } else {
235
+                $from = 0;
236
+            }
237
+
238
+            $rs = $tumble->getPosts($limit, $from);
239
+            $theme->set('Posts_Number', $db->contarRegistros());
240
+
241
+            $rows = array();
242
+            if ($db->contarRegistros()>0) {
243
+                while ($register = mysql_fetch_array($rs)) {
244
+                    $row['postType'] = $util_class->type2Text($tumble->getType($register["id_post"]));
245
+
246
+                    $formatedDate = gmdate("M d", strtotime($register["date"]) + $util_class->transform_offset($conf->offsetTime));
247
+                    $strEnd=($conf->urlFriendly) ? "/" : "";
248
+                    $permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
249
+
250
+                    $register["title"] = stripslashes($register["title"]);
251
+                    $register["description"] = stripslashes($register["description"]);
252
+
253
+                    $row['Id_Post'] = $register["id_post"];
254
+                    $row['Date_Added'] = $formatedDate;
255
+                    $row['Permalink'] = $permalink;
256
+
257
+                    switch ($tumble->getType($register["id_post"])) {
258
+                                                case "1":
259
+                                                        $row['Title'] = $register["title"];
260
+                                                        $row['Body'] = $register["description"];
261
+                                                        break;
262
+                                                case "2":
263
+                                                        $fileName = "../uploads/".$util_class->getFileName($register["url"]);
264
+
265
+                                                        $x = @getimagesize($fileName);
266
+                                                        if ($x[0] > 100) {
267
+                                                            $photoPath = $conf->urlGelato."/classes/imgsize.php?w=100&img=".$register["url"];
268
+                                                        } else {
269
+                                                            $photoPath = $register["url"];
270
+                                                        }
271
+
272
+                                                        $effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
273
+
274
+                                                        $row['PhotoURL'] = $photoPath;
275
+                                                        $row['PhotoAlt'] = strip_tags($register["description"]);
276
+                                                        $row['Caption'] = $register["description"];
277
+                                                        $row['Effect'] = $effect;
278
+                                                        break;
279
+                                                case "3":
280
+                                                        $row['Quote'] = $register["description"];
281
+                                                        $row['Source'] = $register["title"];
282
+                                                        break;
283
+                                                case "4":
284
+                                                        if ($conf->shorten_links) {
285
+                                                            $register["url"] = $util_class->_file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
286
+                                                        }
287
+                                                        $register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
288
+
289
+                                                        $row['URL'] = $register["url"];
290
+                                                        $row['Name'] = $register["title"];
291
+                                                        $row['Description'] = $register["description"];
292
+                                                        break;
293
+                                                case "5":
294
+                                                        $row['Title'] = $register["title"];
295
+                                                        $row['Conversation'] = $tumble->formatConversation($register["description"]);
296
+                                                break;
297
+                                                        case "6":
298
+                                                        $row['Video'] = $tumble->getVideoPlayer($register["url"]);
299
+                                                        $row['Caption'] = $register["description"];
300
+                                                        break;
301
+                                                case "7":
302
+                                                        $row['Mp3'] = $tumble->getMp3Player($register["url"]);
303
+                                                        $row['Caption'] = $register["description"];
304
+                                                        break;
305
+                                        }
306
+
307
+                    $rows[] = $row;
308
+                }
309
+
310
+                $p = new pagination;
311
+                $p->items($tumble->getPostsNumber());
312
+                $p->limit($limit);
313
+                $p->currentPage(isset($page_num) ? $page_num : 1);
314
+
315
+                $theme->set('pagination', $p->getPagination());
316
+                $theme->set('rows', $rows);
317
+            } else {
318
+                $theme->set('error', __("No posts in this tumblelog."));
319
+            }
320
+        }
321
+        $theme->display(Absolute_Path.'admin/themes/admin/index.htm');
322
+    }
323
+} else {
324
+    header("Location: ".$conf->urlGelato."/login.php");
325
+}
313 326
 ?>

+ 161 - 117
admin/options.php View File

@@ -1,77 +1,78 @@
1
-<?php
2
-if(!defined('entry')) define('entry',true);  
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
13
-?>
14
-<?php
15
-require_once('../entry.php');
16
-global $user, $conf, $tumble;
17
-
18
-if ($user->isAdmin()) {
19
-	
20
-	if(isset($_POST["btnsubmit"]))	{
21
-		if (!$tumble->saveOption($_POST["rich_text"], "rich_text")) {
22
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
23
-			die();
24
-		}
25
-		if (!$tumble->saveOption($_POST["url_friendly"], "url_friendly")) {
26
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
27
-			die();
28
-		}
29
-		
30
-		$off_r= split("," , $_POST['time_offsets']);
31
-		$_POST['offset_time'] = $off_r[0];
32
-		$_POST['offset_city'] = $off_r[1];
33
-		unset($_POST['time_offsets']);
34
-		if (!$tumble->saveOption($_POST["offset_city"], "offset_city")) {
35
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
36
-			die();
37
-		}
38
-		if (!$tumble->saveOption($_POST["offset_time"], "offset_time")) {
39
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
40
-			die();
41
-		}
42
-		
43
-		if (!$tumble->saveOption($_POST["allow_comments"], "allow_comments")) {
44
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
45
-			die();
46
-		}
47
-		
48
-		if (!$tumble->saveOption($_POST["shorten_links"], "shorten_links")) {
49
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
50
-			die();
51
-		}
52
-		
53
-		if (!$tumble->saveOption($_POST["rss_import_frec"], "rss_import_frec")) {
54
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
55
-			die();
56
-		}
57
-		
58
-		if (!$tumble->saveOption($_POST["check_version"], "check_version")) {
59
-			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
60
-			die();
61
-		}
62
-
63
-		header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
64
-		die();
65
-	} else {
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
66 15
 ?>
16
+<?php
17
+require_once('../entry.php');
18
+global $user, $conf, $tumble;
19
+
20
+if ($user->isAdmin()) {
21
+    if (isset($_POST["btnsubmit"])) {
22
+        if (!$tumble->saveOption($_POST["rich_text"], "rich_text")) {
23
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
24
+            die();
25
+        }
26
+        if (!$tumble->saveOption($_POST["url_friendly"], "url_friendly")) {
27
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
28
+            die();
29
+        }
30
+        
31
+        $off_r= split(",", $_POST['time_offsets']);
32
+        $_POST['offset_time'] = $off_r[0];
33
+        $_POST['offset_city'] = $off_r[1];
34
+        unset($_POST['time_offsets']);
35
+        if (!$tumble->saveOption($_POST["offset_city"], "offset_city")) {
36
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
37
+            die();
38
+        }
39
+        if (!$tumble->saveOption($_POST["offset_time"], "offset_time")) {
40
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
41
+            die();
42
+        }
43
+        
44
+        if (!$tumble->saveOption($_POST["allow_comments"], "allow_comments")) {
45
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
46
+            die();
47
+        }
48
+        
49
+        if (!$tumble->saveOption($_POST["shorten_links"], "shorten_links")) {
50
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
51
+            die();
52
+        }
53
+        
54
+        if (!$tumble->saveOption($_POST["rss_import_frec"], "rss_import_frec")) {
55
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
56
+            die();
57
+        }
58
+        
59
+        if (!$tumble->saveOption($_POST["check_version"], "check_version")) {
60
+            header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
61
+            die();
62
+        }
63
+
64
+        header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
65
+        die();
66
+    } else {
67
+        ?>
67 68
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
68 69
 	<html xmlns="http://www.w3.org/1999/xhtml">
69 70
 	<head>
70 71
 		<title>gelato :: <?php echo __("options")?></title>
71 72
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
72
-		<meta name="generator" content="gelato cms <?php echo util::version();?>" />
73
-		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
74
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
73
+		<meta name="generator" content="gelato cms <?php echo util::version(); ?>" />
74
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato; ?>/images/favicon.ico" />
75
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.js"></script>
75 76
 		<script type="text/javascript">
76 77
 		$(document).ready(function(){
77 78
 			$("#divMessages").fadeOut(5000,function(){
@@ -80,7 +81,7 @@ if ($user->isAdmin()) {
80 81
 		});
81 82
 		</script>		
82 83
 		<style type="text/css" media="screen">	
83
-			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
84
+			@import "<?php echo $conf->urlGelato; ?>/admin/css/style.css";
84 85
 		</style>
85 86
 	</head>
86 87
 	
@@ -88,9 +89,9 @@ if ($user->isAdmin()) {
88 89
 		<div id="div-process" style="display:none;"><?php echo __("Processing request&hellip;")?></div>
89 90
 		<div id="cont">
90 91
 			<div id="head">
91
-				<h1><a href="<?php echo $conf->urlGelato;?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
92
+				<h1><a href="<?php echo $conf->urlGelato; ?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
92 93
 				<ul id="nav">
93
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
94
+					<li><a href="<?php echo $conf->urlGelato; ?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
94 95
 			  	</ul>
95 96
 			</div>
96 97
 			<div id="main">				
@@ -98,24 +99,23 @@ if ($user->isAdmin()) {
98 99
 				<div class="box">
99 100
 					<ul class="menu manage">
100 101
 					<h3><?php echo __("Tumblelog options")?></h3>
101
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Post")?></a></li>
102
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/admin.php"><?php echo __("Users")?></a></li>
103
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
104
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/settings.php"><?php echo __("Settings")?></a></li>
102
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/index.php"><?php echo __("Post")?></a></li>
103
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/admin.php"><?php echo __("Users")?></a></li>
104
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
105
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/settings.php"><?php echo __("Settings")?></a></li>
105 106
 					<li class="selected"><a><?php echo __("Options")?></a></li>
106 107
 					</ul>
107
-<?php
108
-					if (isset($_GET["modified"])) {
109
-						if ($_GET["modified"]=="true") {
110
-							echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
111
-						}
112
-					}					
113
-					if (isset($_GET["error"])) {
114
-						if ($_GET["error"]==1) {
115
-							echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
116
-						}
117
-					}
118
-?>
108
+<?php
109
+                    if (isset($_GET["modified"])) {
110
+                        if ($_GET["modified"]=="true") {
111
+                            echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
112
+                        }
113
+                    }
114
+        if (isset($_GET["error"])) {
115
+            if ($_GET["error"]==1) {
116
+                echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
117
+            }
118
+        } ?>
119 119
 					<div class="tabla">
120 120
 
121 121
 						<form action="options.php" method="post" id="options_form" autocomplete="off" class="newpost">							
@@ -123,20 +123,32 @@ if ($user->isAdmin()) {
123 123
 								<ul>																	
124 124
 									<li class="select"><label for="rich_text"><?php echo __("Rich text editor:")?></label>
125 125
 										<select name="rich_text" id="rich_text">
126
-											<option value="1" <?php if($conf->richText) echo "selected"; ?>><?php echo __("Active")?></option>
127
-											<option value="0" <?php if(!$conf->richText) echo "selected"; ?>><?php echo __("Deactive")?></option>
126
+											<option value="1" <?php if ($conf->richText) {
127
+            echo "selected";
128
+        } ?>><?php echo __("Active")?></option>
129
+											<option value="0" <?php if (!$conf->richText) {
130
+            echo "selected";
131
+        } ?>><?php echo __("Deactive")?></option>
128 132
 										</select>
129 133
 									</li>
130 134
 									<li class="select"><label for="url_friendly"><?php echo __("URL friendly:")?></label>
131 135
 										<select name="url_friendly" id="url_friendly">
132
-											<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>><?php echo __("Active")?></option>
133
-											<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>><?php echo __("Deactive")?></option>
136
+											<option value="1" <?php if ($conf->urlFriendly) {
137
+            echo "selected";
138
+        } ?>><?php echo __("Active")?></option>
139
+											<option value="0" <?php if (!$conf->urlFriendly) {
140
+            echo "selected";
141
+        } ?>><?php echo __("Deactive")?></option>
134 142
 										</select>
135 143
 									</li>
136 144
 									<li class="select"><label for="allow_comments"><?php echo __("Allow readers comments:")?></label>
137 145
 										<select name="allow_comments" id="allow_comments">
138
-											<option value="1" <?php if($conf->allowComments) echo "selected"; ?>><?php echo __("Active")?></option>
139
-											<option value="0" <?php if(!$conf->allowComments) echo "selected"; ?>><?php echo __("Deactive")?></option>
146
+											<option value="1" <?php if ($conf->allowComments) {
147
+            echo "selected";
148
+        } ?>><?php echo __("Active")?></option>
149
+											<option value="0" <?php if (!$conf->allowComments) {
150
+            echo "selected";
151
+        } ?>><?php echo __("Deactive")?></option>
140 152
 										</select>
141 153
 									</li>
142 154
 									<li class="select"><label for="time_offsets"><?php echo __("Time Offset:")?></label>
@@ -207,35 +219,66 @@ if ($user->isAdmin()) {
207 219
 									</li>
208 220
 									<li class="select"><label for="shorten_links"><?php echo __("Shorten long URLs:")?></label>
209 221
 										<select name="shorten_links" id="shorten_links">
210
-											<option value="1" <?php if($conf->shorten_links) echo "selected=\"selected\""; ?>><?php echo __("Active")?></option>
211
-											<option value="0" <?php if(!$conf->shorten_links) echo "selected=\"selected\""; ?>><?php echo __("Deactive")?></option>
222
+											<option value="1" <?php if ($conf->shorten_links) {
223
+            echo "selected=\"selected\"";
224
+        } ?>><?php echo __("Active")?></option>
225
+											<option value="0" <?php if (!$conf->shorten_links) {
226
+            echo "selected=\"selected\"";
227
+        } ?>><?php echo __("Deactive")?></option>
212 228
 										</select>
213 229
 									</li>
214 230
  									<li class="select"><label for="rss_import_frec"><?php echo __("Import feeds every:")?></label>
215 231
 										<select name="rss_import_frec" id="rss_import_frec">
216
-											<option value="5 minutes" <?php if($conf->rssImportFrec == '5 minutes') echo "selected=\"selected\""; ?>>5 <?php echo __("minutes");?></option>
217
-											<option value="10 minutes" <?php if($conf->rssImportFrec == '10 minutes') echo "selected=\"selected\""; ?>>10 <?php echo __("minutes");?></option>
218
-											<option value="15 minutes" <?php if($conf->rssImportFrec == '15 minutes') echo "selected=\"selected\""; ?>>15 <?php echo __("minutes");?></option>
219
-											<option value="30 minutes" <?php if($conf->rssImportFrec == '30 minutes') echo "selected=\"selected\""; ?>>30 <?php echo __("minutes");?></option>
220
-											<option value="45 minutes" <?php if($conf->rssImportFrec == '45 minutes') echo "selected=\"selected\""; ?>>45 <?php echo __("minutes");?></option>
221
-											<option value="1 hour" <?php if($conf->rssImportFrec == '1 hour') echo "selected=\"selected\""; ?>>1 <?php echo __("hour");?></option>
222
- 											<option value="2 hours" <?php if($conf->rssImportFrec == '2 hours') echo "selected=\"selected\""; ?>>2 <?php echo __("hours");?></option>
223
-											<option value="3 hours" <?php if($conf->rssImportFrec == '3 hours') echo "selected=\"selected\""; ?>>3 <?php echo __("hours");?></option>
224
-											<option value="4 hours" <?php if($conf->rssImportFrec == '4 hours') echo "selected=\"selected\""; ?>>4 <?php echo __("hours");?></option>
225
- 											<option value="6 hours" <?php if($conf->rssImportFrec == '6 hours') echo "selected=\"selected\""; ?>>6 <?php echo __("hours");?></option>
226
-											<option value="12 hours" <?php if($conf->rssImportFrec == '12 hours') echo "selected=\"selected\""; ?>>12 <?php echo __("hours");?></option>
227
-											<option value="1 day" <?php if($conf->rssImportFrec == '1 day') echo "selected=\"selected\""; ?>>24 <?php echo __("hours");?></option>
232
+											<option value="5 minutes" <?php if ($conf->rssImportFrec == '5 minutes') {
233
+            echo "selected=\"selected\"";
234
+        } ?>>5 <?php echo __("minutes"); ?></option>
235
+											<option value="10 minutes" <?php if ($conf->rssImportFrec == '10 minutes') {
236
+            echo "selected=\"selected\"";
237
+        } ?>>10 <?php echo __("minutes"); ?></option>
238
+											<option value="15 minutes" <?php if ($conf->rssImportFrec == '15 minutes') {
239
+            echo "selected=\"selected\"";
240
+        } ?>>15 <?php echo __("minutes"); ?></option>
241
+											<option value="30 minutes" <?php if ($conf->rssImportFrec == '30 minutes') {
242
+            echo "selected=\"selected\"";
243
+        } ?>>30 <?php echo __("minutes"); ?></option>
244
+											<option value="45 minutes" <?php if ($conf->rssImportFrec == '45 minutes') {
245
+            echo "selected=\"selected\"";
246
+        } ?>>45 <?php echo __("minutes"); ?></option>
247
+											<option value="1 hour" <?php if ($conf->rssImportFrec == '1 hour') {
248
+            echo "selected=\"selected\"";
249
+        } ?>>1 <?php echo __("hour"); ?></option>
250
+ 											<option value="2 hours" <?php if ($conf->rssImportFrec == '2 hours') {
251
+            echo "selected=\"selected\"";
252
+        } ?>>2 <?php echo __("hours"); ?></option>
253
+											<option value="3 hours" <?php if ($conf->rssImportFrec == '3 hours') {
254
+            echo "selected=\"selected\"";
255
+        } ?>>3 <?php echo __("hours"); ?></option>
256
+											<option value="4 hours" <?php if ($conf->rssImportFrec == '4 hours') {
257
+            echo "selected=\"selected\"";
258
+        } ?>>4 <?php echo __("hours"); ?></option>
259
+ 											<option value="6 hours" <?php if ($conf->rssImportFrec == '6 hours') {
260
+            echo "selected=\"selected\"";
261
+        } ?>>6 <?php echo __("hours"); ?></option>
262
+											<option value="12 hours" <?php if ($conf->rssImportFrec == '12 hours') {
263
+            echo "selected=\"selected\"";
264
+        } ?>>12 <?php echo __("hours"); ?></option>
265
+											<option value="1 day" <?php if ($conf->rssImportFrec == '1 day') {
266
+            echo "selected=\"selected\"";
267
+        } ?>>24 <?php echo __("hours"); ?></option>
228 268
 										</select>
229 269
 									</li>
230 270
 									<li class="select"><label for="check_version"><?php echo __("Check for updates:")?></label>
231 271
 										<select name="check_version" id="check_version">
232
-											<option value="1" <?php if($conf->check_version) echo "selected=\"selected\""; ?>><?php echo __("Active")?></option>
233
-											<option value="0" <?php if(!$conf->check_version) echo "selected=\"selected\""; ?>><?php echo __("Deactive")?></option>
272
+											<option value="1" <?php if ($conf->check_version) {
273
+            echo "selected=\"selected\"";
274
+        } ?>><?php echo __("Active")?></option>
275
+											<option value="0" <?php if (!$conf->check_version) {
276
+            echo "selected=\"selected\"";
277
+        } ?>><?php echo __("Deactive")?></option>
234 278
 										</select>
235 279
 									</li>
236
-<?php
237
-									$trigger->call('add_options_panel');									
238
-?>									
280
+<?php
281
+                                    $trigger->call('add_options_panel'); ?>									
239 282
 								</ul>
240 283
 							</fieldset>
241 284
 							<p>
@@ -254,9 +297,10 @@ if ($user->isAdmin()) {
254 297
 		</div>
255 298
 	</body>
256 299
 	</html>
257
-<?php
258
-	}
259
-} else {
260
-	header("Location: ".$conf->urlGelato."/login.php");
261
-}
300
+<?php
301
+
302
+    }
303
+} else {
304
+    header("Location: ".$conf->urlGelato."/login.php");
305
+}
262 306
 ?>

+ 113 - 110
admin/plugins.php View File

@@ -1,64 +1,64 @@
1
-<?php
2
-if(!defined('entry')) define('entry',true);  
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
13
-?>
14
-<?php
15
-require_once('../entry.php');
16
-global $user, $conf, $tumble;
17
-
18
-
19
-if ($user->isAdmin()) {
20
-	
21
-	
22
-	$plugins = array();
23
-	if ($handle = opendir(Absolute_Path."plugins")) {
24
-		while (false !== ($file = readdir($handle))) { 
25
-			if (substr($file, strlen($file)-4, 4) == ".php") {
26
-				$plugins[] = substr($file, 0, strlen($file)-4);
27
-			} 
28
-		} 
29
-		closedir($handle); 
30
-	}
31
-	
32
-	$actives = json_decode($conf->active_plugins,1);	
33
-	
34
-	$actives = $actives[1];
35
-	
36
-	if(isset($_POST["btnsubmit"]))	{
37
-		$actives = array();
38
-		foreach($_POST['plugins'] as $plugin => $val){
39
-			if($val != 'off'){
40
-				$file = $plugin.'.php';
41
-				$actives[$plugin] = $file;
42
-			}
43
-		}
44
-		
45
-		if(!$tumble->saveOption(json_encode(array(array('total'=>count($actives)),$actives)), "active_plugins")){
46
-			header("Location: ".$conf->urlGelato."/admin/plugins.php?error=1&desc=".$conf->merror);
47
-			die();
48
-		}
49
-		header("Location: ".$conf->urlGelato."/admin/plugins.php?modified=true");
50
-		die();
51
-	} else {
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
52 15
 ?>
16
+<?php
17
+require_once('../entry.php');
18
+global $user, $conf, $tumble;
19
+
20
+
21
+if ($user->isAdmin()) {
22
+    $plugins = array();
23
+    if ($handle = opendir(Absolute_Path."plugins")) {
24
+        while (false !== ($file = readdir($handle))) {
25
+            if (substr($file, strlen($file)-4, 4) == ".php") {
26
+                $plugins[] = substr($file, 0, strlen($file)-4);
27
+            }
28
+        }
29
+        closedir($handle);
30
+    }
31
+    
32
+    $actives = json_decode($conf->active_plugins, 1);
33
+    
34
+    $actives = $actives[1];
35
+    
36
+    if (isset($_POST["btnsubmit"])) {
37
+        $actives = array();
38
+        foreach ($_POST['plugins'] as $plugin => $val) {
39
+            if ($val != 'off') {
40
+                $file = $plugin.'.php';
41
+                $actives[$plugin] = $file;
42
+            }
43
+        }
44
+        
45
+        if (!$tumble->saveOption(json_encode(array(array('total'=>count($actives)),$actives)), "active_plugins")) {
46
+            header("Location: ".$conf->urlGelato."/admin/plugins.php?error=1&desc=".$conf->merror);
47
+            die();
48
+        }
49
+        header("Location: ".$conf->urlGelato."/admin/plugins.php?modified=true");
50
+        die();
51
+    } else {
52
+        ?>
53 53
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54 54
 	<html xmlns="http://www.w3.org/1999/xhtml">
55 55
 	<head>
56 56
 		<title>gelato :: <?php echo __("Plugins")?></title>
57 57
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
58
-		<meta name="generator" content="gelato cms <?php echo util::version();?>" />
59
-		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
60
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
61
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
58
+		<meta name="generator" content="gelato cms <?php echo util::version(); ?>" />
59
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato; ?>/images/favicon.ico" />
60
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.js"></script>
61
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/tools.js"></script>
62 62
 		<script type="text/javascript">
63 63
 		$(document).ready(function(){
64 64
 			$("#divMessages").fadeOut(5000,function(){
@@ -67,7 +67,7 @@ if ($user->isAdmin()) {
67 67
 		});
68 68
 		</script>		
69 69
 		<style type="text/css" media="screen">	
70
-			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
70
+			@import "<?php echo $conf->urlGelato; ?>/admin/css/style.css";
71 71
 		</style>
72 72
 	</head>
73 73
 	
@@ -75,9 +75,9 @@ if ($user->isAdmin()) {
75 75
 		<div id="div-process" style="display:none;"><?php echo __("Processing request&hellip;")?></div>
76 76
 		<div id="cont">
77 77
 			<div id="head">
78
-				<h1><a href="<?php echo $conf->urlGelato;?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
78
+				<h1><a href="<?php echo $conf->urlGelato; ?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
79 79
 				<ul id="nav">
80
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
80
+					<li><a href="<?php echo $conf->urlGelato; ?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
81 81
 			  	</ul>
82 82
 			</div>
83 83
 			<div id="main">				
@@ -91,62 +91,64 @@ if ($user->isAdmin()) {
91 91
 					<li><a href="options.php"><?php echo __("Options")?></a></li>
92 92
 					<li class="selected"><a href="plugins.php"><?php echo __("Plugins")?></a></li>
93 93
 					</ul>
94
-<?php
95
-					if (isset($_GET["modified"])) {
96
-						if ($_GET["modified"]=="true") {
97
-							echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
98
-						}
99
-					}					
100
-					if (isset($_GET["error"])) {
101
-						if ($_GET["error"]==1) {
102
-							echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
103
-						}
104
-					}
105
-?>
94
+<?php
95
+                    if (isset($_GET["modified"])) {
96
+                        if ($_GET["modified"]=="true") {
97
+                            echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
98
+                        }
99
+                    }
100
+        if (isset($_GET["error"])) {
101
+            if ($_GET["error"]==1) {
102
+                echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
103
+            }
104
+        } ?>
106 105
 					<div class="tabla">
107 106
 
108 107
 						<form action="plugins.php" method="post" id="options_form" autocomplete="off" class="newpost">							
109 108
 							<fieldset>
110
-								<?php
111
-									if(count($plugins) == 0){
112
-										echo __('You dont have any plugin installed, get some <a href="http://www.gelatocms.com/">here</a>');
113
-									}else{
114
-										foreach ($plugins as $key => $plugin) {
115
-											
116
-											//FIXME terminar esto asi se lee la info desde el archivo 'a la' WP
117
-											/*
118
-											$plugin_data = implode( '', file( Absolute_Path."plugins/".$plugin.'.php' ));
119
-											preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name );
120
-											preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri );
121
-											preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
122
-											preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
123
-											preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
124
-
125
-											if ( preg_match( "|Version:(.*)|i", $plugin_data, $version ))
126
-											$version = trim( $version[1] );
127
-											else
128
-											$version = '';
129
-
130
-											$plugin_data = array('Name' => trim($plugin_name[1]), 'URI' => trim($plugin_uri[1]), 'Description' => trim($description[1]), 'Author' => trim($author_name[1]), 'Author_uri' => trim($author_uri[1]), 'Version' => $version);
131
-*/
132
-											$desc = __("There is no info for this plugin jet");
133
-											$activated = array_key_exists($plugin, $actives);
134
-								?>								
109
+								<?php
110
+                                    if (count($plugins) == 0) {
111
+                                        echo __('You dont have any plugin installed, get some <a href="http://www.gelatocms.com/">here</a>');
112
+                                    } else {
113
+                                        foreach ($plugins as $key => $plugin) {
114
+                                            
115
+                                            //FIXME terminar esto asi se lee la info desde el archivo 'a la' WP
116
+                                            /*
117
+                                            $plugin_data = implode( '', file( Absolute_Path."plugins/".$plugin.'.php' ));
118
+                                            preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name );
119
+                                            preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri );
120
+                                            preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
121
+                                            preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
122
+                                            preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
123
+
124
+                                            if ( preg_match( "|Version:(.*)|i", $plugin_data, $version ))
125
+                                            $version = trim( $version[1] );
126
+                                            else
127
+                                            $version = '';
128
+
129
+                                            $plugin_data = array('Name' => trim($plugin_name[1]), 'URI' => trim($plugin_uri[1]), 'Description' => trim($description[1]), 'Author' => trim($author_name[1]), 'Author_uri' => trim($author_uri[1]), 'Version' => $version);
130
+*/
131
+                                            $desc = __("There is no info for this plugin jet");
132
+                                            $activated = array_key_exists($plugin, $actives); ?>								
135 133
 								<ul>	
136 134
 									<li class="select">
137
-										<label for="<?php echo $key;?>" title="<?php echo $desc; ?>" class="help"><?php echo $plugin;	?></label>
138
-										<select name="plugins[<?php echo $plugin;	?>]" id="<?php echo $key;?>">
139
-											<option value="on" <?php if($activated) echo 'selected="selected"'; ?>><?php echo __("On")?></option>
140
-											<option value="off" <?php if(!$activated) echo 'selected="selected"'; ?>><?php echo __("Off")?></option>
135
+										<label for="<?php echo $key; ?>" title="<?php echo $desc; ?>" class="help"><?php echo $plugin; ?></label>
136
+										<select name="plugins[<?php echo $plugin; ?>]" id="<?php echo $key; ?>">
137
+											<option value="on" <?php if ($activated) {
138
+                                                echo 'selected="selected"';
139
+                                            } ?>><?php echo __("On")?></option>
140
+											<option value="off" <?php if (!$activated) {
141
+                                                echo 'selected="selected"';
142
+                                            } ?>><?php echo __("Off")?></option>
141 143
 										</select>
142 144
 									</li>
143
-									<?php
144
-										}
145
-									?>
145
+									<?php
146
+
147
+                                        } ?>
146 148
 								</ul>
147
-								<?php
148
-									}
149
-								?>
149
+								<?php
150
+
151
+                                    } ?>
150 152
 							</fieldset>
151 153
 							<p>
152 154
 								<input type="submit" name="btnsubmit" id="btnsubmit" value="<?php echo __("Modify")?>" class="submit"/>
@@ -164,9 +166,10 @@ if ($user->isAdmin()) {
164 166
 		</div>
165 167
 	</body>
166 168
 	</html>
167
-<?php
168
-	}
169
-} else {
170
-	header("Location: ".$conf->urlGelato."/login.php");
171
-}
169
+<?php
170
+
171
+    }
172
+} else {
173
+    header("Location: ".$conf->urlGelato."/login.php");
174
+}
172 175
 ?>

+ 0 - 0
admin/scripts/jquery.js View File


+ 0 - 0
admin/scripts/jquery.tablesorter.min.js View File


+ 0 - 0
admin/scripts/jquery.validate.min.js View File


+ 0 - 0
admin/scripts/lightbox.js View File


+ 0 - 0
admin/scripts/markitup/jquery.markitup.pack.js View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/bold.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/clean.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/code.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/fonts.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/h1.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/h2.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/h3.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/h4.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/h5.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/h6.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/image.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/italic.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/link.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/list-bullet.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/list-item.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/list-numeric.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/more.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/paragraph.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/picture.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/preview.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/quotes.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/stroke.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/underline.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/images/url.png View File


+ 0 - 0
admin/scripts/markitup/sets/html/set.js View File


+ 0 - 0
admin/scripts/markitup/sets/html/style.css View File


+ 0 - 0
admin/scripts/markitup/skins/simple/images/handle.png View File


+ 0 - 0
admin/scripts/markitup/skins/simple/images/menu.png View File


+ 0 - 0
admin/scripts/markitup/skins/simple/images/submenu.png View File


+ 0 - 0
admin/scripts/markitup/skins/simple/style.css View File


+ 0 - 0
admin/scripts/nicEdit.js View File


+ 0 - 0
admin/scripts/nicEditorIcons.gif View File


+ 0 - 0
admin/scripts/player.swf View File


+ 0 - 0
admin/scripts/tools.js View File


+ 70 - 74
admin/settings.php View File

@@ -1,35 +1,36 @@
1
-<?php
2
-if(!defined('entry')) define('entry',true);  
3
-/* ===========================
4
-
5
-  gelato CMS - A PHP based tumblelog CMS
6
-  development version
7
-  http://www.gelatocms.com/
8
-
9
-  gelato CMS is a free software licensed under the GPL 2.0
10
-  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
11
-
12
-  =========================== */
13
-
14
-require_once('../entry.php');
15
-global $user, $conf, $tumble;
16
-
17
-if ($user->isAdmin()) {
18
-	
19
-	if(isset($_POST["btnsubmit"]))	{		
20
-		unset($_POST["btnsubmit"]);
21
-		$_POST["url_installation"] = (util::endsWith($_POST["url_installation"], "/")) ? substr($_POST["url_installation"], 0, strlen($_POST["url_installation"])-1) : $_POST["url_installation"] ;
22
-		$tumble->saveSettings($_POST);
23
-	} else {
24
-?>
1
+<?php
2
+if (!defined('entry')) {
3
+    define('entry', true);
4
+}
5
+/* ===========================
6
+
7
+  gelato CMS - A PHP based tumblelog CMS
8
+  development version
9
+  http://www.gelatocms.com/
10
+
11
+  gelato CMS is a free software licensed under the GPL 2.0
12
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
13
+
14
+  =========================== */
15
+
16
+require_once('../entry.php');
17
+global $user, $conf, $tumble;
18
+
19
+if ($user->isAdmin()) {
20
+    if (isset($_POST["btnsubmit"])) {
21
+        unset($_POST["btnsubmit"]);
22
+        $_POST["url_installation"] = (util::endsWith($_POST["url_installation"], "/")) ? substr($_POST["url_installation"], 0, strlen($_POST["url_installation"])-1) : $_POST["url_installation"] ;
23
+        $tumble->saveSettings($_POST);
24
+    } else {
25
+        ?>
25 26
 	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
26 27
 	<html xmlns="http://www.w3.org/1999/xhtml">
27 28
 	<head>
28 29
 		<title>gelato :: <?php echo __("settings")?></title>
29 30
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
-		<meta name="generator" content="gelato cms <?php echo util::version();?>" />
31
-		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
32
-		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
31
+		<meta name="generator" content="gelato cms <?php echo util::version(); ?>" />
32
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato; ?>/images/favicon.ico" />
33
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato; ?>/admin/scripts/jquery.js"></script>
33 34
 		<script type="text/javascript">
34 35
 		$(document).ready(function(){
35 36
 			$("#divMessages").fadeOut(5000,function(){
@@ -38,7 +39,7 @@ if ($user->isAdmin()) {
38 39
 		});
39 40
 		</script>	
40 41
 		<style type="text/css" media="screen">	
41
-			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
42
+			@import "<?php echo $conf->urlGelato; ?>/admin/css/style.css";
42 43
 		</style>
43 44
 	</head>
44 45
 	
@@ -46,9 +47,9 @@ if ($user->isAdmin()) {
46 47
 		<div id="div-process" style="display:none;"><?php echo __("Processing request&hellip;")?></div>
47 48
 		<div id="cont">
48 49
 			<div id="head">
49
-				<h1><a href="<?php echo $conf->urlGelato;?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
50
+				<h1><a href="<?php echo $conf->urlGelato; ?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
50 51
 				<ul id="nav">
51
-					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
52
+					<li><a href="<?php echo $conf->urlGelato; ?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
52 53
 			  	</ul>
53 54
 			</div>
54 55
 			<div id="main">				
@@ -56,64 +57,58 @@ if ($user->isAdmin()) {
56 57
 				<div class="box">
57 58
 					<ul class="menu manage">
58 59
 					<h3><?php echo __("Tumblelog configuration")?></h3>
59
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Post")?></a></li>
60
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/admin.php"><?php echo __("Users")?></a></li>
61
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
62
-					<li><a href="<?php echo $conf->urlGelato;?>/admin/options.php"><?php echo __("Options")?></a></li>
60
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/index.php"><?php echo __("Post")?></a></li>
61
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/admin.php"><?php echo __("Users")?></a></li>
62
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
63
+					<li><a href="<?php echo $conf->urlGelato; ?>/admin/options.php"><?php echo __("Options")?></a></li>
63 64
 					<li class="selected"><a><?php echo __("Settings")?></a></li>
64 65
 					</ul>
65
-<?php
66
-					if (isset($_GET["modified"])) {
67
-						if ($_GET["modified"]=="true") {
68
-							echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
69
-						}
70
-					}					
71
-					if (isset($_GET["error"])) {
72
-						if ($_GET["error"]==1) {
73
-							echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
74
-						}
75
-					}
76
-?>
66
+<?php
67
+                    if (isset($_GET["modified"])) {
68
+                        if ($_GET["modified"]=="true") {
69
+                            echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
70
+                        }
71
+                    }
72
+        if (isset($_GET["error"])) {
73
+            if ($_GET["error"]==1) {
74
+                echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
75
+            }
76
+        } ?>
77 77
 					<div class="tabla">
78 78
 
79 79
 						<form action="settings.php" method="post" id="settings_form" autocomplete="off" class="newpost">							
80 80
 							<fieldset>								
81 81
 								<ul>							
82 82
 									<li><label for="title"><?php echo __("Title:")?></label>
83
-										<input type="text" name="title" id="title" value="<?php echo $conf->title;?>" class="txt"/></li>
83
+										<input type="text" name="title" id="title" value="<?php echo $conf->title; ?>" class="txt"/></li>
84 84
 									<li><label for="description"><?php echo __("Description:")?></label>
85
-										<input type="text" name="description" id="description" value="<?php echo $conf->description;?>" class="txt"/></li>
85
+										<input type="text" name="description" id="description" value="<?php echo $conf->description; ?>" class="txt"/></li>
86 86
 									<li><label for="url_installation"><?php echo __("Installation URL")?></label>
87
-										<input type="text" name="url_installation" id="url_installation" value="<?php echo $conf->urlGelato;?>" class="txt"/></li>
87
+										<input type="text" name="url_installation" id="url_installation" value="<?php echo $conf->urlGelato; ?>" class="txt"/></li>
88 88
 									<li><label for="posts_limit"><?php echo __("Post limit:")?></label>
89
-										<input type="text" name="posts_limit" id="posts_limit" value="<?php echo $conf->postLimit;?>" class="txt"/></li>
89
+										<input type="text" name="posts_limit" id="posts_limit" value="<?php echo $conf->postLimit; ?>" class="txt"/></li>
90 90
 									<li><label for="lang"><?php echo __("Language:")?></label>
91 91
 										<select id="lang" name="lang">
92
-<?php									
93
-										$langs = util::getLangs();
94
-										foreach ($langs as $key=>$lang) {
95
-											$active = ($conf->lang==$key) ? "selected" : "";
96
-											echo "<option value=\"".$key."\" ".$active.">".$lang."</option>\n";
97
-											
98
-										}
99
-?>
92
+<?php	
93
+                                        $langs = util::getLangs();
94
+        foreach ($langs as $key=>$lang) {
95
+            $active = ($conf->lang==$key) ? "selected" : "";
96
+            echo "<option value=\"".$key."\" ".$active.">".$lang."</option>\n";
97
+        } ?>
100 98
 										</select>
101 99
 									</li>
102 100
 									<li><label for="template"><?php echo __("Template:")?></label>
103 101
 										<select id="template" name="template">
104
-<?php
105
-										$themes = util::getThemes();
106
-										foreach ($themes as $theme) {
107
-											$active = ($conf->template==$theme) ? "selected" : "";
108
-											echo "<option value=\"".$theme."\" ".$active.">".$theme."</option>\n";
109
-											
110
-										}
111
-?>
102
+<?php
103
+                                        $themes = util::getThemes();
104
+        foreach ($themes as $theme) {
105
+            $active = ($conf->template==$theme) ? "selected" : "";
106
+            echo "<option value=\"".$theme."\" ".$active.">".$theme."</option>\n";
107
+        } ?>
112 108
 										</select>
113 109
 									</li>
114
-<?php	
115
-									$trigger->call('add_settings_panel');	
116
-?>
110
+<?php	
111
+                                    $trigger->call('add_settings_panel'); ?>
117 112
 								</ul>
118 113
 							</fieldset>
119 114
 							<p>
@@ -132,9 +127,10 @@ if ($user->isAdmin()) {
132 127
 		</div>
133 128
 	</body>
134 129
 	</html>
135
-<?php
136
-	}
137
-} else {
138
-	header("Location: ".$conf->urlGelato."/login.php");
139
-}
130
+<?php
131
+
132
+    }
133
+} else {
134
+    header("Location: ".$conf->urlGelato."/login.php");
135
+}
140 136
 ?>

+ 0 - 0
admin/themes/admin/api.xml View File


+ 0 - 0
admin/themes/admin/index.htm View File


+ 11 - 5
admin/themes/admin/install.htm View File

@@ -29,8 +29,16 @@
29 29
 					<fieldset class="install">
30 30
 						<legend class="install">Database Settings</legend>
31 31
 						<ul>
32
-							<li><label for="login">Are you the admin? Write the same data that "DB_User" in config.php</label>
33
-								<input type="text" name="db_login" id="db_login" value="{db_login}" class="txt"/>{error.9}</li>
32
+							<li><label for="login">User:</label>
33
+								<input type="text" name="db_login" id="db_login" value="{db_login}" class="txt"/>{error.10}</li>
34
+							<li><label for="password">Password:</label>
35
+								<input type="password" name="db_password" id="db_password" value="" class="txt"/></li>
36
+							<li><label for="password2">Re-type password:</label>
37
+								<input type="password" name="db_password2" id="db_password2" value="" class="txt"/>{error.9}</li>
38
+							<li><label for="email">Database Host:</label>
39
+								<input type="text" name="db_host" id="db_host" value="{db_host}" class="txt"/>{error.7}</li>
40
+							<li><label for="email">Database Name:</label>
41
+								<input type="text" name="db_name" id="db_name" value="{db_name}" class="txt"/>{error.8}</li>
34 42
 						</ul>
35 43
 					</fieldset><br  />
36 44
 					<fieldset class="install">
@@ -59,9 +67,7 @@
59 67
 								<input type="text" name="posts_limit" id="posts_limit" value="10" class="txt"/></li>
60 68
 							<li><label for="lang">Language:</label>
61 69
 								<select id="lang" name="lang">
62
-									{block $langs as $k=>$v}
63
-										<option value="{$k}" {if $k=='en'}selected="selected"{/if}>{$v}</option>
64
-									{/block}
70
+									<option value="en" selected="selected">english</option>
65 71
 								</select>
66 72
 							</li>
67 73
 							<li><label for="template">Template:</label>

+ 0 - 0
admin/themes/admin/login.htm View File


admin/themes/admin/parts/template_add_conversation.htm → admin/themes/admin/template_add_conversation.htm View File


admin/themes/admin/parts/template_add_link.htm → admin/themes/admin/template_add_link.htm View File


admin/themes/admin/parts/template_add_mp3.htm → admin/themes/admin/template_add_mp3.htm View File


admin/themes/admin/parts/template_add_photo.htm → admin/themes/admin/template_add_photo.htm View File

@@ -1,3 +1,5 @@
1
+
2
+
1 3
 	<div id="photo_upload">
2 4
 		<label for="description">Photo</label>												
3 5
 		<br /><input type="file" name="photo" id="photo" accept="image/gif,image/jpeg,image/jpg,image/png"/>
@@ -28,13 +30,15 @@
28 30
 	<input type="hidden" name="date" id="date" value="{date}" />
29 31
 	<input type="hidden" name="id_user" id="id_user" value="{id_user}" />
30 32
 
33
+
34
+
35
+
31 36
 	<script>
32 37
 		$('#photo_url').css('display','none');
33
-
34 38
 		$("#autosave").validate({
35 39
 			rules: {				
36 40
 				photo: { 
37
-					required:  function() {
41
+					required:  function() {
38 42
  						return ($('#photo_upload').css('display')!= 'none') ? true : false;
39 43
   					},
40 44
 					accept: "(jpe?g|gif|png)" 
@@ -60,7 +64,7 @@
60 64
 				return false;
61 65
 			} 
62 66
 		);
63
-
67
+		
64 68
 		$("#photo_url a.linkFrm").click( function() {
65 69
 				$('#photo_url').css('display','none');				
66 70
 				$('#photo_upload').css('display','block'); 
@@ -68,4 +72,5 @@
68 72
 				return false;
69 73
 			} 
70 74
 		);
71
-	</script>
75
+
76
+	</script>

admin/themes/admin/parts/template_add_photo_bm.htm → admin/themes/admin/template_add_photo_bm.htm View File


admin/themes/admin/parts/template_add_post.htm → admin/themes/admin/template_add_post.htm View File


admin/themes/admin/parts/template_add_quote.htm → admin/themes/admin/template_add_quote.htm View File


admin/themes/admin/parts/template_add_video.htm → admin/themes/admin/template_add_video.htm View File


admin/themes/admin/parts/template_bm.htm → admin/themes/admin/template_bm.htm View File


admin/themes/admin/parts/template_comment.htm → admin/themes/admin/template_comment.htm View File


admin/themes/admin/parts/template_comment_post.htm → admin/themes/admin/template_comment_post.htm View File


admin/themes/admin/parts/template_conversation.htm → admin/themes/admin/template_conversation.htm View File


admin/themes/admin/parts/template_mp3.htm → admin/themes/admin/template_mp3.htm View File


admin/themes/admin/parts/template_photo.htm → admin/themes/admin/template_photo.htm View File

@@ -6,5 +6,4 @@
6 6
 					<span class="option">{Caption}</span>
7 7
 					<p><a {Effect}><img src="{PhotoURL}" alt="{PhotoAlt}" /></a></a></p>
8 8
 				</div>
9
-			</div>
10
-
9
+			</div>

admin/themes/admin/parts/template_quote.htm → admin/themes/admin/template_quote.htm View File


admin/themes/admin/parts/template_regular_post.htm → admin/themes/admin/template_regular_post.htm View File


Some files were not shown because too many files changed in this diff