Browse Source

Comment feature (started) and bug fix for the textile problem.

pecesama 17 years ago
parent
commit
73513b8f82

+ 3 - 3
admin/index.php View File

@@ -344,10 +344,10 @@ if ($user->isAdmin()) {
344 344
 					if ($tumble->contarRegistros()>0) {				
345 345
 						while($register = mysql_fetch_array($rs)) {			
346 346
 							$formatedDate = date("M d", strtotime($register["date"]));
347
-							$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
347
+							$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";							
348 348
 							
349
-							$textile = new Textile;
350
-							$register["description"] = $textile->process($register["description"]);
349
+							$textile = new Textile();				
350
+							$register["description"] = $textile->TextileThis($register["description"]);
351 351
 							
352 352
 							$register["title"] = stripslashes($register["title"]);
353 353
 							$register["description"] = stripslashes($register["description"]);

+ 74 - 62
admin/options.php View File

@@ -45,6 +45,12 @@ if ($user->isAdmin()) {
45 45
 			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
46 46
 			die();
47 47
 		}
48
+		
49
+		if (!$tumble->saveOption($_POST["allow_comments"], "allow_comments")) {
50
+			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
51
+			die();
52
+		}
53
+		
48 54
 		header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
49 55
 		die();
50 56
 	} else {
@@ -117,75 +123,81 @@ if ($user->isAdmin()) {
117 123
 											<option value="0" <?php if(!$conf->richText) echo "selected"; ?>><?=__("Deactive")?></option>
118 124
 										</select>
119 125
 									</li>
120
-									<li><label for="url_friendly"><?__("URL friendly:")?></label>
126
+									<li><label for="url_friendly"><?=__("URL friendly:")?></label>
121 127
 										<select name="url_friendly" id="url_friendly">
122 128
 											<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>><?=__("Active")?></option>
123 129
 											<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>><?=__("Deactive")?></option>
124 130
 										</select>
125 131
 									</li>
132
+									<li><label for="allow_comments"><?=__("Allow readers comments:")?></label>
133
+										<select name="allow_comments" id="allow_comments">
134
+											<option value="1" <?php if($conf->allowComments) echo "selected"; ?>><?=__("Active")?></option>
135
+											<option value="0" <?php if(!$conf->allowComments) echo "selected"; ?>><?=__("Deactive")?></option>
136
+										</select>
137
+									</li>
126 138
 									<li><label for="time_offsets"><?=__("Time Offset:")?></label>
127 139
 										<select id="time_offsets" name="time_offsets">
128
-											<option value="-12,Pacific/Kwajalein" <?=($conf->offset_city=="Pacific/Kwajalein")? "selected=\"selected\"":"" ?>>(GMT -12:00) International Date Line West</option>
129
-											<option value="-11,Pacific/Samoa" <?=($conf->offset_city=="Pacific/Samoa")? "selected=\"selected\"":"" ?>>(GMT -11:00) Midway Island, Samoa</option>
130
-											<option value="-10,Pacific/Honolulu" <?=($conf->offset_city=="Pacific/Honolulu")? "selected=\"selected\"":"" ?>>(GMT -10:00) Hawaii</option>
131
-											<option value="-9,US/Alaska" <?=($conf->offset_city=="US/Alaska")? "selected=\"selected\"":"" ?>>(GMT -9:00) Alaska</option>
132
-											<option value="-8,US/Pacific" <?=($conf->offset_city=="US/Pacific")? "selected=\"selected\"":"" ?>>(GMT -8:00) Pacific Time (US &amp; Canada); Tijuana</option>
133
-											<option value="-7,US/Mountain" <?=($conf->offset_city=="US/Mountain")? "selected=\"selected\"":"" ?>>(GMT -7:00) Mountain Time (US &amp; Canada)</option>
134
-											<option value="-7,US/Arizona" <?=($conf->offset_city=="US/Arizona")? "selected=\"selected\"":"" ?>>(GMT -7:00) Arizona</option>
135
-											<option value="-7,Mexico/BajaNorte" <?=($conf->offset_city=="Mexico/BajaNorte")? "selected=\"selected\"":"" ?>>(GMT -7:00) Chihuahua, La Paz, Mazatlan</option>
136
-											<option value="-6,US/Central" <?=($conf->offset_city=="US/Central")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central Time (US &amp; Canada)</option>
137
-											<option value="-6,America/Costa_Rica" <?=($conf->offset_city=="America/Costa_Rica")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central America</option>
138
-											<option value="-6,Mexico/General" <?=($conf->offset_city=="Mexico/General")? "selected=\"selected\"":"" ?>>(GMT -6:00) Guadalajara, Mexico City, Monterrey</option>
139
-											<option value="-6,Canada/Saskatchewan" <?=($conf->offset_city=="Canada/Saskatchewan")? "selected=\"selected\"":"" ?>>(GMT -6:00) Saskatchewan</option>
140
-											<option value="-5,US/Eastern" <?=($conf->offset_city=="US/Eastern")? "selected=\"selected\"":"" ?>>(GMT -5:00) Eastern Time (US &amp; Canada)</option>
141
-											<option value="-5,America/Bogota" <?=($conf->offset_city=="America/Bogota")? "selected=\"selected\"":"" ?>>(GMT -5:00) Bogota, Lima, Quito</option>
142
-											<option value="-5,US/East-Indiana" <?=($conf->offset_city=="US/East-Indiana")? "selected=\"selected\"":"" ?>>(GMT -5:00) Indiana (East)</option>
143
-											<option value="-4,Canada/Eastern" <?=($conf->offset_city=="Canada/Eastern")? "selected=\"selected\"":"" ?>>(GMT -4:00) Atlantic Time (Canada)</option>
144
-											<option value="-4,America/Caracas" <?=($conf->offset_city=="America/Caracas")? "selected=\"selected\"":"" ?>>(GMT -4:00) Caracas, La Paz</option>
145
-											<option value="-4,America/Santiago" <?=($conf->offset_city=="America/Santiago")? "selected=\"selected\"":"" ?>>(GMT -4:00) Santiago</option>
146
-											<option value="-3.50,Canada/Newfoundland" <?=($conf->offset_city=="Canada/Newfoundland")? "selected=\"selected\"":"" ?>>(GMT -3:30) Newfoundland</option>
147
-											<option value="-3,Canada/Atlantic" <?=($conf->offset_city=="Canada/Atlantic")? "selected=\"selected\"":"" ?>>(GMT -3:00) Brasilia, Greenland</option>
148
-											<option value="-3,America/Buenos_Aires" <?=($conf->offset_city=="America/Buenos_Aires")? "selected=\"selected\"":"" ?>>(GMT -3:00) Buenos Aires, Georgetown</option>
149
-											<option value="-1,Atlantic/Cape_Verde" <?=($conf->offset_city=="Atlantic/Cape_Verde")? "selected=\"selected\"":"" ?>>(GMT -1:00) Cape Verde Is.</option>
150
-											<option value="-1,Atlantic/Azores" <?=($conf->offset_city=="Atlantic/Azores")? "selected=\"selected\"":"" ?>>(GMT -1:00) Azores</option>
151
-											<option value="0,Africa/Casablanca" <?=($conf->offset_city=="Africa/Casablanca")? "selected=\"selected\"":"" ?>>(GMT) Casablanca, Monrovia</option>
152
-											<option value="0,Europe/Dublin" <?=($conf->offset_city=="Europe/Dublin")? "selected=\"selected\"":"" ?>>(GMT) Greenwich Mean Time : Dublin, Edinburgh, London</option>
153
-											<option value="1,Europe/Amsterdam" <?=($conf->offset_city=="Europe/Amsterdam")? "selected=\"selected\"":"" ?>>(GMT +1:00) Amsterdam, Berlin, Rome, Stockholm, Vienna</option>
154
-											<option value="1,Europe/Prague" <?=($conf->offset_city=="Europe/Pragu")? "selected=\"selected\"":"" ?>>(GMT +1:00) Belgrade, Bratislava, Budapest, Prague</option>
155
-											<option value="1,Europe/Paris" <?=($conf->offset_city=="Europe/Paris")? "selected=\"selected\"":"" ?>>(GMT +1:00) Brussels, Copenhagen, Madrid, Paris</option>
156
-											<option value="1,Europe/Warsaw" <?=($conf->offset_city=="Europe/Warsaw")? "selected=\"selected\"":"" ?>>(GMT +1:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
157
-											<option value="1,Africa/Bangui" <?=($conf->offset_city=="Africa/Bangui")? "selected=\"selected\"":"" ?>>(GMT +1:00) West Central Africa</option>
158
-											<option value="2,Europe/Istanbul" <?=($conf->offset_city=="Europe/Istanbul")? "selected=\"selected\"":"" ?>>(GMT +2:00) Athens, Beirut, Bucharest, Cairo, Istanbul	</option>
159
-											<option value="2,Asia/Jerusalem" <?=($conf->offset_city=="Asia/Jerusalem")? "selected=\"selected\"":"" ?>>(GMT +2:00) Harare, Jerusalem, Pretoria</option>
160
-											<option value="2,Europe/Kiev" <?=($conf->offset_city=="Europe/Kiev")? "selected=\"selected\"":"" ?>>(GMT +2:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius</option>
161
-											<option value="3,Asia/Riyadh" <?=($conf->offset_city=="Asia/Riyadh")? "selected=\"selected\"":"" ?>>(GMT +3:00) Kuwait, Nairobi, Riyadh</option>
162
-											<option value="3,Europe/Moscow" <?=($conf->offset_city=="Europe/Moscow")? "selected=\"selected\"":"" ?>>(GMT +3:00) Baghdad, Moscow, St. Petersburg, Volgograd</option>
163
-											<option value="3.50,Asia/Tehran" <?=($conf->offset_city=="Asia/Tehran")? "selected=\"selected\"":"" ?>>(GMT +3:30) Tehran</option>
164
-											<option value="4,Asia/Muscat" <?=($conf->offset_city=="Asia/Muscat")? "selected=\"selected\"":"" ?>>(GMT +4:00) Abu Dhabi, Muscat</option>
165
-											<option value="4,Asia/Baku" <?=($conf->offset_city=="Asia/Baku")? "selected=\"selected\"":"" ?>>(GMT +4:00) Baku, Tbilsi, Yerevan</option>
166
-											<option value="4.50,Asia/Kabul" <?=($conf->offset_city=="Asia/Kabul")? "selected=\"selected\"":"" ?>>(GMT +4:30) Kabul</option>
167
-											<option value="5,Asia/Yekaterinburg" <?=($conf->offset_city=="Asia/Yekaterinburg")? "selected=\"selected\"":"" ?>>(GMT +5:00) Yekaterinburg</option>
168
-											<option value="5,Asia/Karachi" <?=($conf->offset_city=="Asia/Karachi")? "selected=\"selected\"":"" ?>>(GMT +5:00) Islamabad, Karachi, Tashkent</option>
169
-											<option value="5.50,Asia/Calcutta" <?=($conf->offset_city=="Asia/Calcutta")? "selected=\"selected\"":"" ?>>(GMT +5:30) Chennai, Calcutta, Mumbai, New Delhi</option>
170
-											<option value="5.75,Asia/Katmandu" <?=($conf->offset_city=="Asia/Katmandu")? "selected=\"selected\"":"" ?>>(GMT +5:45) Katmandu</option>
171
-											<option value="6,Asia/Almaty" <?=($conf->offset_city=="Asia/Almaty")? "selected=\"selected\"":"" ?>>(GMT +6:00) Almaty, Novosibirsk</option>
172
-											<option value="6,Asia/Dhaka" <?=($conf->offset_city=="Asia/Dhaka")? "selected=\"selected\"":"" ?>>(GMT +6:00) Astana, Dhaka, Sri Jayawardenepura</option>
173
-											<option value="6.50,Asia/Rangoon" <?=($conf->offset_city=="Asia/Rangoo")? "selected=\"selected\"":"" ?>>(GMT +6:30) Rangoon</option>
174
-											<option value="7,Asia/Bangkok" <?=($conf->offset_city=="Asia/Bangkok")? "selected=\"selected\"":"" ?>>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
175
-											<option value="7,Asia/Krasnoyarsk" <?=($conf->offset_city=="Asia/Krasnoyarsk")? "selected=\"selected\"":"" ?>>(GMT +7:00) Krasnoyarsk</option>
176
-											<option value="8,Asia/Hong_Kong" <?=($conf->offset_city=="Asia/Hong_Kong")? "selected=\"selected\"":"" ?>>(GMT +8:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
177
-											<option value="8,Asia/Irkutsk" <?=($conf->offset_city=="Asia/Irkutsk")? "selected=\"selected\"":"" ?>>(GMT +8:00) Irkutsk, Ulaan Bataar</option>
178
-											<option value="8,Asia/Singapore" <?=($conf->offset_city=="Asia/Singapore")? "selected=\"selected\"":"" ?>>(GMT +8:00) Kuala Lumpar, Perth, Singapore, Taipei</option>
179
-											<option value="9,Asia/Tokyo" <?=($conf->offset_city=="Asia/Tokyo")? "selected=\"selected\"":"" ?>>(GMT +9:00) Osaka, Sapporo, Tokyo</option>
180
-											<option value="9,Asia/Seoul" <?=($conf->offset_city=="Asia/Seoul")? "selected=\"selected\"":"" ?>>(GMT +9:00) Seoul</option>
181
-											<option value="9,Asia/Yakutsk" <?=($conf->offset_city=="Asia/Yakutsk")? "selected=\"selected\"":"" ?>>(GMT +9:00) Yakutsk</option>
182
-											<option value="9.50,Australia/Adelaide" <?=($conf->offset_city=="Australia/Adelaide")? "selected=\"selected\"":"" ?>>(GMT +9:30) Adelaide</option>
183
-											<option value="9.50,Australia/Darwin" <?=($conf->offset_city=="Australia/Darwin")? "selected=\"selected\"":"" ?>>(GMT +9:30) Darwin</option>
184
-											<option value="10,Australia/Brisbane" <?=($conf->offset_city=="Australia/Brisbane")? "selected=\"selected\"":"" ?>>(GMT +10:00) Brisbane, Guam, Port Moresby</option>
185
-											<option value="10,Australia/Canberra" <?=($conf->offset_city=="Australia/Canberra")? "selected=\"selected\"":"" ?>>(GMT +10:00) Canberra, Hobart, Melbourne, Sydney, Vladivostok</option>
186
-											<option value="11,Asia/Magadan" <?=($conf->offset_city=="Asia/Magadan")? "selected=\"selected\"":"" ?>>(GMT +11:00) Magadan, Soloman Is., New Caledonia</option>
187
-											<option value="12,Pacific/Auckland" <?=($conf->offset_city=="Pacific/Auckland")? "selected=\"selected\"":"" ?>>(GMT +12:00) Auckland, Wellington</option>
188
-											<option value="12,Pacific/Fiji" <?=($conf->offset_city=="Pacific/Fiji")? "selected=\"selected\"":"" ?>>(GMT +12:00) Fiji, Kamchatka, Marshall Is.</option>
140
+											<option value="-12,Pacific/Kwajalein" <?=($conf->offsetCity=="Pacific/Kwajalein")? "selected=\"selected\"":"" ?>>(GMT -12:00) International Date Line West</option>
141
+											<option value="-11,Pacific/Samoa" <?=($conf->offsetCity=="Pacific/Samoa")? "selected=\"selected\"":"" ?>>(GMT -11:00) Midway Island, Samoa</option>
142
+											<option value="-10,Pacific/Honolulu" <?=($conf->offsetCity=="Pacific/Honolulu")? "selected=\"selected\"":"" ?>>(GMT -10:00) Hawaii</option>
143
+											<option value="-9,US/Alaska" <?=($conf->offsetCity=="US/Alaska")? "selected=\"selected\"":"" ?>>(GMT -9:00) Alaska</option>
144
+											<option value="-8,US/Pacific" <?=($conf->offsetCity=="US/Pacific")? "selected=\"selected\"":"" ?>>(GMT -8:00) Pacific Time (US &amp; Canada); Tijuana</option>
145
+											<option value="-7,US/Mountain" <?=($conf->offsetCity=="US/Mountain")? "selected=\"selected\"":"" ?>>(GMT -7:00) Mountain Time (US &amp; Canada)</option>
146
+											<option value="-7,US/Arizona" <?=($conf->offsetCity=="US/Arizona")? "selected=\"selected\"":"" ?>>(GMT -7:00) Arizona</option>
147
+											<option value="-7,Mexico/BajaNorte" <?=($conf->offsetCity=="Mexico/BajaNorte")? "selected=\"selected\"":"" ?>>(GMT -7:00) Chihuahua, La Paz, Mazatlan</option>
148
+											<option value="-6,US/Central" <?=($conf->offsetCity=="US/Central")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central Time (US &amp; Canada)</option>
149
+											<option value="-6,America/Costa_Rica" <?=($conf->offsetCity=="America/Costa_Rica")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central America</option>
150
+											<option value="-6,Mexico/General" <?=($conf->offsetCity=="Mexico/General")? "selected=\"selected\"":"" ?>>(GMT -6:00) Guadalajara, Mexico City, Monterrey</option>
151
+											<option value="-6,Canada/Saskatchewan" <?=($conf->offsetCity=="Canada/Saskatchewan")? "selected=\"selected\"":"" ?>>(GMT -6:00) Saskatchewan</option>
152
+											<option value="-5,US/Eastern" <?=($conf->offsetCity=="US/Eastern")? "selected=\"selected\"":"" ?>>(GMT -5:00) Eastern Time (US &amp; Canada)</option>
153
+											<option value="-5,America/Bogota" <?=($conf->offsetCity=="America/Bogota")? "selected=\"selected\"":"" ?>>(GMT -5:00) Bogota, Lima, Quito</option>
154
+											<option value="-5,US/East-Indiana" <?=($conf->offsetCity=="US/East-Indiana")? "selected=\"selected\"":"" ?>>(GMT -5:00) Indiana (East)</option>
155
+											<option value="-4,Canada/Eastern" <?=($conf->offsetCity=="Canada/Eastern")? "selected=\"selected\"":"" ?>>(GMT -4:00) Atlantic Time (Canada)</option>
156
+											<option value="-4,America/Caracas" <?=($conf->offsetCity=="America/Caracas")? "selected=\"selected\"":"" ?>>(GMT -4:00) Caracas, La Paz</option>
157
+											<option value="-4,America/Santiago" <?=($conf->offsetCity=="America/Santiago")? "selected=\"selected\"":"" ?>>(GMT -4:00) Santiago</option>
158
+											<option value="-3.50,Canada/Newfoundland" <?=($conf->offsetCity=="Canada/Newfoundland")? "selected=\"selected\"":"" ?>>(GMT -3:30) Newfoundland</option>
159
+											<option value="-3,Canada/Atlantic" <?=($conf->offsetCity=="Canada/Atlantic")? "selected=\"selected\"":"" ?>>(GMT -3:00) Brasilia, Greenland</option>
160
+											<option value="-3,America/Buenos_Aires" <?=($conf->offsetCity=="America/Buenos_Aires")? "selected=\"selected\"":"" ?>>(GMT -3:00) Buenos Aires, Georgetown</option>
161
+											<option value="-1,Atlantic/Cape_Verde" <?=($conf->offsetCity=="Atlantic/Cape_Verde")? "selected=\"selected\"":"" ?>>(GMT -1:00) Cape Verde Is.</option>
162
+											<option value="-1,Atlantic/Azores" <?=($conf->offsetCity=="Atlantic/Azores")? "selected=\"selected\"":"" ?>>(GMT -1:00) Azores</option>
163
+											<option value="0,Africa/Casablanca" <?=($conf->offsetCity=="Africa/Casablanca")? "selected=\"selected\"":"" ?>>(GMT) Casablanca, Monrovia</option>
164
+											<option value="0,Europe/Dublin" <?=($conf->offsetCity=="Europe/Dublin")? "selected=\"selected\"":"" ?>>(GMT) Greenwich Mean Time : Dublin, Edinburgh, London</option>
165
+											<option value="1,Europe/Amsterdam" <?=($conf->offsetCity=="Europe/Amsterdam")? "selected=\"selected\"":"" ?>>(GMT +1:00) Amsterdam, Berlin, Rome, Stockholm, Vienna</option>
166
+											<option value="1,Europe/Prague" <?=($conf->offsetCity=="Europe/Pragu")? "selected=\"selected\"":"" ?>>(GMT +1:00) Belgrade, Bratislava, Budapest, Prague</option>
167
+											<option value="1,Europe/Paris" <?=($conf->offsetCity=="Europe/Paris")? "selected=\"selected\"":"" ?>>(GMT +1:00) Brussels, Copenhagen, Madrid, Paris</option>
168
+											<option value="1,Europe/Warsaw" <?=($conf->offsetCity=="Europe/Warsaw")? "selected=\"selected\"":"" ?>>(GMT +1:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
169
+											<option value="1,Africa/Bangui" <?=($conf->offsetCity=="Africa/Bangui")? "selected=\"selected\"":"" ?>>(GMT +1:00) West Central Africa</option>
170
+											<option value="2,Europe/Istanbul" <?=($conf->offsetCity=="Europe/Istanbul")? "selected=\"selected\"":"" ?>>(GMT +2:00) Athens, Beirut, Bucharest, Cairo, Istanbul	</option>
171
+											<option value="2,Asia/Jerusalem" <?=($conf->offsetCity=="Asia/Jerusalem")? "selected=\"selected\"":"" ?>>(GMT +2:00) Harare, Jerusalem, Pretoria</option>
172
+											<option value="2,Europe/Kiev" <?=($conf->offsetCity=="Europe/Kiev")? "selected=\"selected\"":"" ?>>(GMT +2:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius</option>
173
+											<option value="3,Asia/Riyadh" <?=($conf->offsetCity=="Asia/Riyadh")? "selected=\"selected\"":"" ?>>(GMT +3:00) Kuwait, Nairobi, Riyadh</option>
174
+											<option value="3,Europe/Moscow" <?=($conf->offsetCity=="Europe/Moscow")? "selected=\"selected\"":"" ?>>(GMT +3:00) Baghdad, Moscow, St. Petersburg, Volgograd</option>
175
+											<option value="3.50,Asia/Tehran" <?=($conf->offsetCity=="Asia/Tehran")? "selected=\"selected\"":"" ?>>(GMT +3:30) Tehran</option>
176
+											<option value="4,Asia/Muscat" <?=($conf->offsetCity=="Asia/Muscat")? "selected=\"selected\"":"" ?>>(GMT +4:00) Abu Dhabi, Muscat</option>
177
+											<option value="4,Asia/Baku" <?=($conf->offsetCity=="Asia/Baku")? "selected=\"selected\"":"" ?>>(GMT +4:00) Baku, Tbilsi, Yerevan</option>
178
+											<option value="4.50,Asia/Kabul" <?=($conf->offsetCity=="Asia/Kabul")? "selected=\"selected\"":"" ?>>(GMT +4:30) Kabul</option>
179
+											<option value="5,Asia/Yekaterinburg" <?=($conf->offsetCity=="Asia/Yekaterinburg")? "selected=\"selected\"":"" ?>>(GMT +5:00) Yekaterinburg</option>
180
+											<option value="5,Asia/Karachi" <?=($conf->offsetCity=="Asia/Karachi")? "selected=\"selected\"":"" ?>>(GMT +5:00) Islamabad, Karachi, Tashkent</option>
181
+											<option value="5.50,Asia/Calcutta" <?=($conf->offsetCity=="Asia/Calcutta")? "selected=\"selected\"":"" ?>>(GMT +5:30) Chennai, Calcutta, Mumbai, New Delhi</option>
182
+											<option value="5.75,Asia/Katmandu" <?=($conf->offsetCity=="Asia/Katmandu")? "selected=\"selected\"":"" ?>>(GMT +5:45) Katmandu</option>
183
+											<option value="6,Asia/Almaty" <?=($conf->offsetCity=="Asia/Almaty")? "selected=\"selected\"":"" ?>>(GMT +6:00) Almaty, Novosibirsk</option>
184
+											<option value="6,Asia/Dhaka" <?=($conf->offsetCity=="Asia/Dhaka")? "selected=\"selected\"":"" ?>>(GMT +6:00) Astana, Dhaka, Sri Jayawardenepura</option>
185
+											<option value="6.50,Asia/Rangoon" <?=($conf->offsetCity=="Asia/Rangoo")? "selected=\"selected\"":"" ?>>(GMT +6:30) Rangoon</option>
186
+											<option value="7,Asia/Bangkok" <?=($conf->offsetCity=="Asia/Bangkok")? "selected=\"selected\"":"" ?>>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
187
+											<option value="7,Asia/Krasnoyarsk" <?=($conf->offsetCity=="Asia/Krasnoyarsk")? "selected=\"selected\"":"" ?>>(GMT +7:00) Krasnoyarsk</option>
188
+											<option value="8,Asia/Hong_Kong" <?=($conf->offsetCity=="Asia/Hong_Kong")? "selected=\"selected\"":"" ?>>(GMT +8:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
189
+											<option value="8,Asia/Irkutsk" <?=($conf->offsetCity=="Asia/Irkutsk")? "selected=\"selected\"":"" ?>>(GMT +8:00) Irkutsk, Ulaan Bataar</option>
190
+											<option value="8,Asia/Singapore" <?=($conf->offsetCity=="Asia/Singapore")? "selected=\"selected\"":"" ?>>(GMT +8:00) Kuala Lumpar, Perth, Singapore, Taipei</option>
191
+											<option value="9,Asia/Tokyo" <?=($conf->offsetCity=="Asia/Tokyo")? "selected=\"selected\"":"" ?>>(GMT +9:00) Osaka, Sapporo, Tokyo</option>
192
+											<option value="9,Asia/Seoul" <?=($conf->offsetCity=="Asia/Seoul")? "selected=\"selected\"":"" ?>>(GMT +9:00) Seoul</option>
193
+											<option value="9,Asia/Yakutsk" <?=($conf->offsetCity=="Asia/Yakutsk")? "selected=\"selected\"":"" ?>>(GMT +9:00) Yakutsk</option>
194
+											<option value="9.50,Australia/Adelaide" <?=($conf->offsetCity=="Australia/Adelaide")? "selected=\"selected\"":"" ?>>(GMT +9:30) Adelaide</option>
195
+											<option value="9.50,Australia/Darwin" <?=($conf->offsetCity=="Australia/Darwin")? "selected=\"selected\"":"" ?>>(GMT +9:30) Darwin</option>
196
+											<option value="10,Australia/Brisbane" <?=($conf->offsetCity=="Australia/Brisbane")? "selected=\"selected\"":"" ?>>(GMT +10:00) Brisbane, Guam, Port Moresby</option>
197
+											<option value="10,Australia/Canberra" <?=($conf->offsetCity=="Australia/Canberra")? "selected=\"selected\"":"" ?>>(GMT +10:00) Canberra, Hobart, Melbourne, Sydney, Vladivostok</option>
198
+											<option value="11,Asia/Magadan" <?=($conf->offsetCity=="Asia/Magadan")? "selected=\"selected\"":"" ?>>(GMT +11:00) Magadan, Soloman Is., New Caledonia</option>
199
+											<option value="12,Pacific/Auckland" <?=($conf->offsetCity=="Pacific/Auckland")? "selected=\"selected\"":"" ?>>(GMT +12:00) Auckland, Wellington</option>
200
+											<option value="12,Pacific/Fiji" <?=($conf->offsetCity=="Pacific/Fiji")? "selected=\"selected\"":"" ?>>(GMT +12:00) Fiji, Kamchatka, Marshall Is.</option>
189 201
 										</select>
190 202
 									</li>
191 203
 								</ul>

File diff suppressed because it is too large
+ 89 - 0
classes/comments.class.php


+ 4 - 3
classes/configuration.class.php View File

@@ -45,9 +45,10 @@ class configuration extends Conexion_Mysql {
45 45
 			initLang($this->lang);
46 46
 
47 47
 			$this->urlFriendly = $this->get_option("url_friendly");
48
-			$this->richText = $this->get_option("rich_text");
49
-			$this->offset_city = $this->get_option("offset_city");
50
-			$this->offset_time = $this->get_option("offset_time");
48
+			$this->richText = $this->get_option("rich_text");			
49
+			$this->offsetCity = $this->get_option("offset_city");
50
+			$this->offsetTime = $this->get_option("offset_time");
51
+			$this->allowComments = $this->get_option("allow_comments");
51 52
 		} else {
52 53
 			if($isFeed) {
53 54
 				header("HTTP/1.0 503 Service Unavailable"); 

+ 1 - 1
classes/gelato.class.php View File

@@ -19,7 +19,7 @@ class gelato extends Conexion_Mysql {
19 19
 	
20 20
 	function gelato() {
21 21
 		parent::Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
22
-		$this->conf = new configuration();		
22
+		$this->conf = new configuration();
23 23
 	}
24 24
 	
25 25
 	function saveSettings($fieldsArray) {

File diff suppressed because it is too large
+ 1135 - 4081
classes/textile.class.php


+ 115 - 0
comments.php View File

@@ -0,0 +1,115 @@
1
+<?php
2
+/* ===========================
3
+
4
+  gelato CMS - A PHP based tumblelog CMS
5
+  development version
6
+  http://www.gelatocms.com/
7
+
8
+  gelato CMS is a free software licensed under the GPL 2.0
9
+  Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
10
+
11
+  =========================== */
12
+?>
13
+<?php
14
+require_once('config.php');
15
+include("classes/functions.php");
16
+include("classes/comments.class.php");
17
+require_once("classes/configuration.class.php");
18
+
19
+$comment = new comments();
20
+$conf = new configuration();
21
+$isEdition = isset($_GET["edit"]);
22
+$commentId = ($isEdition) ? $_GET["edit"] : NULL;
23
+
24
+
25
+if (isset($_GET["delete"])) {
26
+	$comment->deleteComment($_GET['delete']);
27
+	header("Location: comments.php?delete=true");
28
+	die();
29
+}
30
+	
31
+if(isset($_POST["btnAdd"]))	{		
32
+	unset($_POST["btnAdd"]);
33
+	$_POST["username"] = strip_tags($_POST["username"]);
34
+	$_POST["email"] = strip_tags($_POST["email"]);	
35
+	$_POST["web"] = strip_tags($_POST["web"]);
36
+		
37
+	if (isset($_POST["id_comment"])) {
38
+		$comment->modifyComment($_POST, $_POST["id_comment"]);
39
+	} else {
40
+		$comment->generateCookie($_POST);
41
+		$_POST["spam"] = ($comment->isSpam($_POST)) ? "1" : "0";		
42
+		$_POST["ip_user"] = $_SERVER["REMOTE_ADDR"];		
43
+		
44
+		if ($comment->addComment($_POST)) {
45
+			header("Location: comments.php?added=true");
46
+			die();
47
+		} else {
48
+			header("Location: comments.php?added=false");
49
+			die();
50
+		}
51
+	}		
52
+} else {
53
+	if ($isEdition) {
54
+		$row = $comment->getCommentByID($userId);
55
+	}
56
+?>
57
+	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
58
+	<html xmlns="http://www.w3.org/1999/xhtml">
59
+	<head>
60
+		<title>gelato :: <?php echo __("add user")?></title>
61
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
62
+		<meta name="generator" content="gelato cms <?php echo version();?>" />
63
+		<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
64
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/mootools.js"></script>
65
+		<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
66
+		<style type="text/css" media="screen">	
67
+			@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
68
+		</style>
69
+	</head>
70
+	
71
+	<body>
72
+		<div id="div-process" style="display:none;"><?=__("Processing request...");?></div>
73
+		<div id="cont">
74
+			<div id="head">
75
+				<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: <?=__("home")?>">gelato cms</a></h1>
76
+				<ul id="nav">
77
+					<li><a href="<?php echo $conf->urlGelato;?>/" title="<?=__("Take me to the tumblelog")?>"><?=__("Back to the Tumblelog")?></a></li>
78
+			  	</ul>
79
+			</div>
80
+			<div id="main">				
81
+				
82
+				<div class="box">
83
+					<ul class="menu manage">
84
+					<h3><?=__("Start session")?></h3>
85
+					<li><a href="index.php"><?=__("Post")?></a></li>
86
+					<li><a href="admin.php"><?=__("Users")?></a></li>
87
+					<li class="selected"><a><?php echo ($isEdition) ? __("Edit") : __("Add"); ?></a></li>
88
+					</ul>
89
+				
90
+					<div class="tabla">
91
+
92
+						
93
+<?php
94
+							if ($isEdition) {
95
+?>
96
+							<input type="hidden" name="id_user" id="id_user" value="<?php echo $userId;?>" />
97
+<?php
98
+							}
99
+?>
100
+							
101
+								
102
+					</div>
103
+
104
+					<div class="footer-box">&nbsp;</div>
105
+				</div>
106
+			</div>
107
+			<div id="foot">
108
+				<a href="http://www.gelatocms.com/" title="gelato CMS">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
109
+			</div>
110
+		</div>
111
+	</body>
112
+	</html>
113
+<?php
114
+}
115
+?>

+ 18 - 6
index.php View File

@@ -97,12 +97,12 @@
97 97
                 if ($tumble->contarRegistros()>0) {
98 98
                         $dateTmp = null;          
99 99
                         while($register = mysql_fetch_array($rs)) {
100
-								$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offset_time));
100
+								$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
101 101
                                 if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
102 102
                                 $permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
103 103
                                 
104
-                                $textile = new Textile;                                 
105
-                                $register["description"] = $textile->process($register["description"]);
104
+								$textile = new Textile();				
105
+								$register["description"] = $textile->TextileThis($register["description"]);
106 106
 
107 107
                                 $register["title"] = stripslashes($register["title"]);
108 108
                                 $register["description"] = stripslashes($register["description"]);
@@ -188,11 +188,11 @@
188 188
         } else {
189 189
                 $register = $tumble->getPost($id_post);
190 190
                 
191
-                $formatedDate = date("M d", strtotime($register["date"]));
191
+				$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
192 192
                 $permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
193 193
                 
194
-                $textile = new Textile;
195
-                $register["description"] = $textile->process($register["description"]);
194
+				$textile = new Textile();				
195
+				$register["description"] = $textile->TextileThis($register["description"]);
196 196
 				
197 197
 				$register["title"] = stripslashes($register["title"]);
198 198
                 $register["description"] = stripslashes($register["description"]);
@@ -259,6 +259,18 @@
259 259
                                 $template->mostrarPlantilla();
260 260
                                 break;
261 261
                 }
262
+				
263
+				if ($conf->allowComments) {
264
+					
265
+					// before the comments form must be the comments on the DB
266
+										
267
+					$input = array("{User_Cookie}", "{Email_Cookie}", "{Web_Cookie}", "{Id_Post}", "{Form_Action}", "{Date_Added}");
268
+					$output = array($_COOKIE['cookie_gel_user'], $_COOKIE['cookie_gel_email'], $_COOKIE['cookie_gel_web'], $register["id_post"], $conf->urlGelato."/comments.php", gmmktime());
269
+					
270
+					$template->cargarPlantilla($input, $output, "template_comment_post");
271
+					$template->mostrarPlantilla(); 
272
+					
273
+				}
262 274
         }
263 275
         
264 276
         $input = array("{URL_Tumble}");

+ 2 - 2
notice.txt View File

@@ -1,4 +1,4 @@
1
-== CREDITS= =
1
+== CREDITS==
2 2
 Gelato developers and designers (in chronological order):
3 3
 
4 4
 Pedro Santana [ http://www.pecesama.net/weblog/ ]
@@ -42,7 +42,7 @@ Copyright (c) Pedro Santana, http://www.pecesama.net/weblog/
42 42
 Clase plantillas available under MIT license.
43 43
 
44 44
 = Textile class =
45
-Copyright (c) Jim Riggs, http://jimandlissa.com/project/textilephp
45
+Copyright (c) 2003-2004, Dean Allen, http://textile.thresholdstate.com/
46 46
 Textile class available under GNU General Public License.
47 47
 
48 48
 = PHP-gettext =

+ 31 - 0
themes/tumblr/style.css View File

@@ -261,4 +261,35 @@ padding: 2px 5px 2px 5px;
261 261
 margin-right: 2px;
262 262
 border: 1px solid #f3f3f3;
263 263
 color: #ccc;
264
+}
265
+
266
+.containerFormComments {
267
+	margin: 25px 65px 0px 0px;
268
+	font-family: Verdana;
269
+	font-size: 0.75em;
270
+}
271
+
272
+#commentForm input, #commentForm textarea {
273
+	font: 0.9em 'Lucida Grande', Verdana, Arial, Sans-Serif;
274
+}
275
+
276
+#commentForm p {
277
+	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
278
+	margin: 5px 0;
279
+}
280
+
281
+#commentForm input {
282
+	width: 170px;
283
+	padding: 2px;
284
+	margin: 5px 5px 1px 0;
285
+}
286
+
287
+#commentForm textarea {
288
+	width: 100%;
289
+	padding: 2px;
290
+}
291
+
292
+#commentForm #btnAdd {
293
+	margin: 0;
294
+	float: right;
264 295
 }

+ 37 - 0
themes/tumblr/template_comment_post.htm View File

@@ -0,0 +1,37 @@
1
+	
2
+	<div class="containerFormComments">
3
+		<h3 id="respond">Add your comment</h3>
4
+		
5
+		<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
6
+			<p>
7
+				<label for="username">
8
+					<small>Name:</small>
9
+				</label>
10
+				<input name="username" id="username" value="{User_Cookie}" size="22" tabindex="1" type="text" />				
11
+			</p>
12
+			<p>
13
+				<label for="email">
14
+					<small>E-mail:</small>
15
+				</label>
16
+				<input name="email" id="email" value="{Email_Cookie}" size="22" tabindex="2" type="text" />				
17
+			</p>
18
+			<p>
19
+				<label for="web">
20
+					<small>Website:</small>
21
+				</label>
22
+				<input name="web" id="web" value="{Web_Cookie}" size="22" tabindex="3" type="text" />				
23
+			</p>			
24
+			<p>
25
+				<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
26
+			</p>
27
+			<p>
28
+				<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;"><a href="http://hobix.com/textile/">Textile</a> syntax is supported.</span>
29
+			<p>
30
+				<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
31
+			</p>
32
+			<p>
33
+				<input name="idPost" id="idPost" value="{Id_Post}" type="hidden" />
34
+				<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
35
+			</p>
36
+		</form>	
37
+	</div>			

+ 18 - 0
themes/tumblr/template_comments.htm View File

@@ -0,0 +1,18 @@
1
+	<div class="containerComments">
2
+		<h3 id="comments"><*NumeroDeComentarios*> Respuestas a &#8220;<*TituloPost*>&#8221;</h3>
3
+		<ol class="commentlist">
4
+			[bloque: comentarios]
5
+			<li class="alt" id="comment-<*IdComentario*>">
6
+				<cite>
7
+					<a href="#comment-<*IdComentario*>" title="Enlace permanente a este comentario">#</a>&nbsp;&nbsp;
8
+					<*ImagenAvatar*>&nbsp;&nbsp;
9
+					<*AutorComentario*> dijo:
10
+				</cite>
11
+				<br />
12
+				<span class="timestampComment"> el <*Fecha*></span><br /><br />
13
+				<*TextoComentario*>
14
+				<br /><br />
15
+			</li>
16
+			[/bloque: comentarios]
17
+		</ol>
18
+	</div>