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

master
pecesama 2007-07-24 20:52:33 +00:00
parent d266338ac4
commit 73513b8f82
12 changed files with 1527 additions and 4158 deletions

View File

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

View File

@ -45,6 +45,12 @@ if ($user->isAdmin()) {
header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
die();
}
if (!$tumble->saveOption($_POST["allow_comments"], "allow_comments")) {
header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
die();
}
header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
die();
} else {
@ -117,75 +123,81 @@ if ($user->isAdmin()) {
<option value="0" <?php if(!$conf->richText) echo "selected"; ?>><?=__("Deactive")?></option>
</select>
</li>
<li><label for="url_friendly"><?__("URL friendly:")?></label>
<li><label for="url_friendly"><?=__("URL friendly:")?></label>
<select name="url_friendly" id="url_friendly">
<option value="1" <?php if($conf->urlFriendly) echo "selected"; ?>><?=__("Active")?></option>
<option value="0" <?php if(!$conf->urlFriendly) echo "selected"; ?>><?=__("Deactive")?></option>
</select>
</li>
<li><label for="allow_comments"><?=__("Allow readers comments:")?></label>
<select name="allow_comments" id="allow_comments">
<option value="1" <?php if($conf->allowComments) echo "selected"; ?>><?=__("Active")?></option>
<option value="0" <?php if(!$conf->allowComments) echo "selected"; ?>><?=__("Deactive")?></option>
</select>
</li>
<li><label for="time_offsets"><?=__("Time Offset:")?></label>
<select id="time_offsets" name="time_offsets">
<option value="-12,Pacific/Kwajalein" <?=($conf->offset_city=="Pacific/Kwajalein")? "selected=\"selected\"":"" ?>>(GMT -12:00) International Date Line West</option>
<option value="-11,Pacific/Samoa" <?=($conf->offset_city=="Pacific/Samoa")? "selected=\"selected\"":"" ?>>(GMT -11:00) Midway Island, Samoa</option>
<option value="-10,Pacific/Honolulu" <?=($conf->offset_city=="Pacific/Honolulu")? "selected=\"selected\"":"" ?>>(GMT -10:00) Hawaii</option>
<option value="-9,US/Alaska" <?=($conf->offset_city=="US/Alaska")? "selected=\"selected\"":"" ?>>(GMT -9:00) Alaska</option>
<option value="-8,US/Pacific" <?=($conf->offset_city=="US/Pacific")? "selected=\"selected\"":"" ?>>(GMT -8:00) Pacific Time (US &amp; Canada); Tijuana</option>
<option value="-7,US/Mountain" <?=($conf->offset_city=="US/Mountain")? "selected=\"selected\"":"" ?>>(GMT -7:00) Mountain Time (US &amp; Canada)</option>
<option value="-7,US/Arizona" <?=($conf->offset_city=="US/Arizona")? "selected=\"selected\"":"" ?>>(GMT -7:00) Arizona</option>
<option value="-7,Mexico/BajaNorte" <?=($conf->offset_city=="Mexico/BajaNorte")? "selected=\"selected\"":"" ?>>(GMT -7:00) Chihuahua, La Paz, Mazatlan</option>
<option value="-6,US/Central" <?=($conf->offset_city=="US/Central")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central Time (US &amp; Canada)</option>
<option value="-6,America/Costa_Rica" <?=($conf->offset_city=="America/Costa_Rica")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central America</option>
<option value="-6,Mexico/General" <?=($conf->offset_city=="Mexico/General")? "selected=\"selected\"":"" ?>>(GMT -6:00) Guadalajara, Mexico City, Monterrey</option>
<option value="-6,Canada/Saskatchewan" <?=($conf->offset_city=="Canada/Saskatchewan")? "selected=\"selected\"":"" ?>>(GMT -6:00) Saskatchewan</option>
<option value="-5,US/Eastern" <?=($conf->offset_city=="US/Eastern")? "selected=\"selected\"":"" ?>>(GMT -5:00) Eastern Time (US &amp; Canada)</option>
<option value="-5,America/Bogota" <?=($conf->offset_city=="America/Bogota")? "selected=\"selected\"":"" ?>>(GMT -5:00) Bogota, Lima, Quito</option>
<option value="-5,US/East-Indiana" <?=($conf->offset_city=="US/East-Indiana")? "selected=\"selected\"":"" ?>>(GMT -5:00) Indiana (East)</option>
<option value="-4,Canada/Eastern" <?=($conf->offset_city=="Canada/Eastern")? "selected=\"selected\"":"" ?>>(GMT -4:00) Atlantic Time (Canada)</option>
<option value="-4,America/Caracas" <?=($conf->offset_city=="America/Caracas")? "selected=\"selected\"":"" ?>>(GMT -4:00) Caracas, La Paz</option>
<option value="-4,America/Santiago" <?=($conf->offset_city=="America/Santiago")? "selected=\"selected\"":"" ?>>(GMT -4:00) Santiago</option>
<option value="-3.50,Canada/Newfoundland" <?=($conf->offset_city=="Canada/Newfoundland")? "selected=\"selected\"":"" ?>>(GMT -3:30) Newfoundland</option>
<option value="-3,Canada/Atlantic" <?=($conf->offset_city=="Canada/Atlantic")? "selected=\"selected\"":"" ?>>(GMT -3:00) Brasilia, Greenland</option>
<option value="-3,America/Buenos_Aires" <?=($conf->offset_city=="America/Buenos_Aires")? "selected=\"selected\"":"" ?>>(GMT -3:00) Buenos Aires, Georgetown</option>
<option value="-1,Atlantic/Cape_Verde" <?=($conf->offset_city=="Atlantic/Cape_Verde")? "selected=\"selected\"":"" ?>>(GMT -1:00) Cape Verde Is.</option>
<option value="-1,Atlantic/Azores" <?=($conf->offset_city=="Atlantic/Azores")? "selected=\"selected\"":"" ?>>(GMT -1:00) Azores</option>
<option value="0,Africa/Casablanca" <?=($conf->offset_city=="Africa/Casablanca")? "selected=\"selected\"":"" ?>>(GMT) Casablanca, Monrovia</option>
<option value="0,Europe/Dublin" <?=($conf->offset_city=="Europe/Dublin")? "selected=\"selected\"":"" ?>>(GMT) Greenwich Mean Time : Dublin, Edinburgh, London</option>
<option value="1,Europe/Amsterdam" <?=($conf->offset_city=="Europe/Amsterdam")? "selected=\"selected\"":"" ?>>(GMT +1:00) Amsterdam, Berlin, Rome, Stockholm, Vienna</option>
<option value="1,Europe/Prague" <?=($conf->offset_city=="Europe/Pragu")? "selected=\"selected\"":"" ?>>(GMT +1:00) Belgrade, Bratislava, Budapest, Prague</option>
<option value="1,Europe/Paris" <?=($conf->offset_city=="Europe/Paris")? "selected=\"selected\"":"" ?>>(GMT +1:00) Brussels, Copenhagen, Madrid, Paris</option>
<option value="1,Europe/Warsaw" <?=($conf->offset_city=="Europe/Warsaw")? "selected=\"selected\"":"" ?>>(GMT +1:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
<option value="1,Africa/Bangui" <?=($conf->offset_city=="Africa/Bangui")? "selected=\"selected\"":"" ?>>(GMT +1:00) West Central Africa</option>
<option value="2,Europe/Istanbul" <?=($conf->offset_city=="Europe/Istanbul")? "selected=\"selected\"":"" ?>>(GMT +2:00) Athens, Beirut, Bucharest, Cairo, Istanbul </option>
<option value="2,Asia/Jerusalem" <?=($conf->offset_city=="Asia/Jerusalem")? "selected=\"selected\"":"" ?>>(GMT +2:00) Harare, Jerusalem, Pretoria</option>
<option value="2,Europe/Kiev" <?=($conf->offset_city=="Europe/Kiev")? "selected=\"selected\"":"" ?>>(GMT +2:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius</option>
<option value="3,Asia/Riyadh" <?=($conf->offset_city=="Asia/Riyadh")? "selected=\"selected\"":"" ?>>(GMT +3:00) Kuwait, Nairobi, Riyadh</option>
<option value="3,Europe/Moscow" <?=($conf->offset_city=="Europe/Moscow")? "selected=\"selected\"":"" ?>>(GMT +3:00) Baghdad, Moscow, St. Petersburg, Volgograd</option>
<option value="3.50,Asia/Tehran" <?=($conf->offset_city=="Asia/Tehran")? "selected=\"selected\"":"" ?>>(GMT +3:30) Tehran</option>
<option value="4,Asia/Muscat" <?=($conf->offset_city=="Asia/Muscat")? "selected=\"selected\"":"" ?>>(GMT +4:00) Abu Dhabi, Muscat</option>
<option value="4,Asia/Baku" <?=($conf->offset_city=="Asia/Baku")? "selected=\"selected\"":"" ?>>(GMT +4:00) Baku, Tbilsi, Yerevan</option>
<option value="4.50,Asia/Kabul" <?=($conf->offset_city=="Asia/Kabul")? "selected=\"selected\"":"" ?>>(GMT +4:30) Kabul</option>
<option value="5,Asia/Yekaterinburg" <?=($conf->offset_city=="Asia/Yekaterinburg")? "selected=\"selected\"":"" ?>>(GMT +5:00) Yekaterinburg</option>
<option value="5,Asia/Karachi" <?=($conf->offset_city=="Asia/Karachi")? "selected=\"selected\"":"" ?>>(GMT +5:00) Islamabad, Karachi, Tashkent</option>
<option value="5.50,Asia/Calcutta" <?=($conf->offset_city=="Asia/Calcutta")? "selected=\"selected\"":"" ?>>(GMT +5:30) Chennai, Calcutta, Mumbai, New Delhi</option>
<option value="5.75,Asia/Katmandu" <?=($conf->offset_city=="Asia/Katmandu")? "selected=\"selected\"":"" ?>>(GMT +5:45) Katmandu</option>
<option value="6,Asia/Almaty" <?=($conf->offset_city=="Asia/Almaty")? "selected=\"selected\"":"" ?>>(GMT +6:00) Almaty, Novosibirsk</option>
<option value="6,Asia/Dhaka" <?=($conf->offset_city=="Asia/Dhaka")? "selected=\"selected\"":"" ?>>(GMT +6:00) Astana, Dhaka, Sri Jayawardenepura</option>
<option value="6.50,Asia/Rangoon" <?=($conf->offset_city=="Asia/Rangoo")? "selected=\"selected\"":"" ?>>(GMT +6:30) Rangoon</option>
<option value="7,Asia/Bangkok" <?=($conf->offset_city=="Asia/Bangkok")? "selected=\"selected\"":"" ?>>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
<option value="7,Asia/Krasnoyarsk" <?=($conf->offset_city=="Asia/Krasnoyarsk")? "selected=\"selected\"":"" ?>>(GMT +7:00) Krasnoyarsk</option>
<option value="8,Asia/Hong_Kong" <?=($conf->offset_city=="Asia/Hong_Kong")? "selected=\"selected\"":"" ?>>(GMT +8:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
<option value="8,Asia/Irkutsk" <?=($conf->offset_city=="Asia/Irkutsk")? "selected=\"selected\"":"" ?>>(GMT +8:00) Irkutsk, Ulaan Bataar</option>
<option value="8,Asia/Singapore" <?=($conf->offset_city=="Asia/Singapore")? "selected=\"selected\"":"" ?>>(GMT +8:00) Kuala Lumpar, Perth, Singapore, Taipei</option>
<option value="9,Asia/Tokyo" <?=($conf->offset_city=="Asia/Tokyo")? "selected=\"selected\"":"" ?>>(GMT +9:00) Osaka, Sapporo, Tokyo</option>
<option value="9,Asia/Seoul" <?=($conf->offset_city=="Asia/Seoul")? "selected=\"selected\"":"" ?>>(GMT +9:00) Seoul</option>
<option value="9,Asia/Yakutsk" <?=($conf->offset_city=="Asia/Yakutsk")? "selected=\"selected\"":"" ?>>(GMT +9:00) Yakutsk</option>
<option value="9.50,Australia/Adelaide" <?=($conf->offset_city=="Australia/Adelaide")? "selected=\"selected\"":"" ?>>(GMT +9:30) Adelaide</option>
<option value="9.50,Australia/Darwin" <?=($conf->offset_city=="Australia/Darwin")? "selected=\"selected\"":"" ?>>(GMT +9:30) Darwin</option>
<option value="10,Australia/Brisbane" <?=($conf->offset_city=="Australia/Brisbane")? "selected=\"selected\"":"" ?>>(GMT +10:00) Brisbane, Guam, Port Moresby</option>
<option value="10,Australia/Canberra" <?=($conf->offset_city=="Australia/Canberra")? "selected=\"selected\"":"" ?>>(GMT +10:00) Canberra, Hobart, Melbourne, Sydney, Vladivostok</option>
<option value="11,Asia/Magadan" <?=($conf->offset_city=="Asia/Magadan")? "selected=\"selected\"":"" ?>>(GMT +11:00) Magadan, Soloman Is., New Caledonia</option>
<option value="12,Pacific/Auckland" <?=($conf->offset_city=="Pacific/Auckland")? "selected=\"selected\"":"" ?>>(GMT +12:00) Auckland, Wellington</option>
<option value="12,Pacific/Fiji" <?=($conf->offset_city=="Pacific/Fiji")? "selected=\"selected\"":"" ?>>(GMT +12:00) Fiji, Kamchatka, Marshall Is.</option>
<option value="-12,Pacific/Kwajalein" <?=($conf->offsetCity=="Pacific/Kwajalein")? "selected=\"selected\"":"" ?>>(GMT -12:00) International Date Line West</option>
<option value="-11,Pacific/Samoa" <?=($conf->offsetCity=="Pacific/Samoa")? "selected=\"selected\"":"" ?>>(GMT -11:00) Midway Island, Samoa</option>
<option value="-10,Pacific/Honolulu" <?=($conf->offsetCity=="Pacific/Honolulu")? "selected=\"selected\"":"" ?>>(GMT -10:00) Hawaii</option>
<option value="-9,US/Alaska" <?=($conf->offsetCity=="US/Alaska")? "selected=\"selected\"":"" ?>>(GMT -9:00) Alaska</option>
<option value="-8,US/Pacific" <?=($conf->offsetCity=="US/Pacific")? "selected=\"selected\"":"" ?>>(GMT -8:00) Pacific Time (US &amp; Canada); Tijuana</option>
<option value="-7,US/Mountain" <?=($conf->offsetCity=="US/Mountain")? "selected=\"selected\"":"" ?>>(GMT -7:00) Mountain Time (US &amp; Canada)</option>
<option value="-7,US/Arizona" <?=($conf->offsetCity=="US/Arizona")? "selected=\"selected\"":"" ?>>(GMT -7:00) Arizona</option>
<option value="-7,Mexico/BajaNorte" <?=($conf->offsetCity=="Mexico/BajaNorte")? "selected=\"selected\"":"" ?>>(GMT -7:00) Chihuahua, La Paz, Mazatlan</option>
<option value="-6,US/Central" <?=($conf->offsetCity=="US/Central")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central Time (US &amp; Canada)</option>
<option value="-6,America/Costa_Rica" <?=($conf->offsetCity=="America/Costa_Rica")? "selected=\"selected\"":"" ?>>(GMT -6:00) Central America</option>
<option value="-6,Mexico/General" <?=($conf->offsetCity=="Mexico/General")? "selected=\"selected\"":"" ?>>(GMT -6:00) Guadalajara, Mexico City, Monterrey</option>
<option value="-6,Canada/Saskatchewan" <?=($conf->offsetCity=="Canada/Saskatchewan")? "selected=\"selected\"":"" ?>>(GMT -6:00) Saskatchewan</option>
<option value="-5,US/Eastern" <?=($conf->offsetCity=="US/Eastern")? "selected=\"selected\"":"" ?>>(GMT -5:00) Eastern Time (US &amp; Canada)</option>
<option value="-5,America/Bogota" <?=($conf->offsetCity=="America/Bogota")? "selected=\"selected\"":"" ?>>(GMT -5:00) Bogota, Lima, Quito</option>
<option value="-5,US/East-Indiana" <?=($conf->offsetCity=="US/East-Indiana")? "selected=\"selected\"":"" ?>>(GMT -5:00) Indiana (East)</option>
<option value="-4,Canada/Eastern" <?=($conf->offsetCity=="Canada/Eastern")? "selected=\"selected\"":"" ?>>(GMT -4:00) Atlantic Time (Canada)</option>
<option value="-4,America/Caracas" <?=($conf->offsetCity=="America/Caracas")? "selected=\"selected\"":"" ?>>(GMT -4:00) Caracas, La Paz</option>
<option value="-4,America/Santiago" <?=($conf->offsetCity=="America/Santiago")? "selected=\"selected\"":"" ?>>(GMT -4:00) Santiago</option>
<option value="-3.50,Canada/Newfoundland" <?=($conf->offsetCity=="Canada/Newfoundland")? "selected=\"selected\"":"" ?>>(GMT -3:30) Newfoundland</option>
<option value="-3,Canada/Atlantic" <?=($conf->offsetCity=="Canada/Atlantic")? "selected=\"selected\"":"" ?>>(GMT -3:00) Brasilia, Greenland</option>
<option value="-3,America/Buenos_Aires" <?=($conf->offsetCity=="America/Buenos_Aires")? "selected=\"selected\"":"" ?>>(GMT -3:00) Buenos Aires, Georgetown</option>
<option value="-1,Atlantic/Cape_Verde" <?=($conf->offsetCity=="Atlantic/Cape_Verde")? "selected=\"selected\"":"" ?>>(GMT -1:00) Cape Verde Is.</option>
<option value="-1,Atlantic/Azores" <?=($conf->offsetCity=="Atlantic/Azores")? "selected=\"selected\"":"" ?>>(GMT -1:00) Azores</option>
<option value="0,Africa/Casablanca" <?=($conf->offsetCity=="Africa/Casablanca")? "selected=\"selected\"":"" ?>>(GMT) Casablanca, Monrovia</option>
<option value="0,Europe/Dublin" <?=($conf->offsetCity=="Europe/Dublin")? "selected=\"selected\"":"" ?>>(GMT) Greenwich Mean Time : Dublin, Edinburgh, London</option>
<option value="1,Europe/Amsterdam" <?=($conf->offsetCity=="Europe/Amsterdam")? "selected=\"selected\"":"" ?>>(GMT +1:00) Amsterdam, Berlin, Rome, Stockholm, Vienna</option>
<option value="1,Europe/Prague" <?=($conf->offsetCity=="Europe/Pragu")? "selected=\"selected\"":"" ?>>(GMT +1:00) Belgrade, Bratislava, Budapest, Prague</option>
<option value="1,Europe/Paris" <?=($conf->offsetCity=="Europe/Paris")? "selected=\"selected\"":"" ?>>(GMT +1:00) Brussels, Copenhagen, Madrid, Paris</option>
<option value="1,Europe/Warsaw" <?=($conf->offsetCity=="Europe/Warsaw")? "selected=\"selected\"":"" ?>>(GMT +1:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
<option value="1,Africa/Bangui" <?=($conf->offsetCity=="Africa/Bangui")? "selected=\"selected\"":"" ?>>(GMT +1:00) West Central Africa</option>
<option value="2,Europe/Istanbul" <?=($conf->offsetCity=="Europe/Istanbul")? "selected=\"selected\"":"" ?>>(GMT +2:00) Athens, Beirut, Bucharest, Cairo, Istanbul </option>
<option value="2,Asia/Jerusalem" <?=($conf->offsetCity=="Asia/Jerusalem")? "selected=\"selected\"":"" ?>>(GMT +2:00) Harare, Jerusalem, Pretoria</option>
<option value="2,Europe/Kiev" <?=($conf->offsetCity=="Europe/Kiev")? "selected=\"selected\"":"" ?>>(GMT +2:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius</option>
<option value="3,Asia/Riyadh" <?=($conf->offsetCity=="Asia/Riyadh")? "selected=\"selected\"":"" ?>>(GMT +3:00) Kuwait, Nairobi, Riyadh</option>
<option value="3,Europe/Moscow" <?=($conf->offsetCity=="Europe/Moscow")? "selected=\"selected\"":"" ?>>(GMT +3:00) Baghdad, Moscow, St. Petersburg, Volgograd</option>
<option value="3.50,Asia/Tehran" <?=($conf->offsetCity=="Asia/Tehran")? "selected=\"selected\"":"" ?>>(GMT +3:30) Tehran</option>
<option value="4,Asia/Muscat" <?=($conf->offsetCity=="Asia/Muscat")? "selected=\"selected\"":"" ?>>(GMT +4:00) Abu Dhabi, Muscat</option>
<option value="4,Asia/Baku" <?=($conf->offsetCity=="Asia/Baku")? "selected=\"selected\"":"" ?>>(GMT +4:00) Baku, Tbilsi, Yerevan</option>
<option value="4.50,Asia/Kabul" <?=($conf->offsetCity=="Asia/Kabul")? "selected=\"selected\"":"" ?>>(GMT +4:30) Kabul</option>
<option value="5,Asia/Yekaterinburg" <?=($conf->offsetCity=="Asia/Yekaterinburg")? "selected=\"selected\"":"" ?>>(GMT +5:00) Yekaterinburg</option>
<option value="5,Asia/Karachi" <?=($conf->offsetCity=="Asia/Karachi")? "selected=\"selected\"":"" ?>>(GMT +5:00) Islamabad, Karachi, Tashkent</option>
<option value="5.50,Asia/Calcutta" <?=($conf->offsetCity=="Asia/Calcutta")? "selected=\"selected\"":"" ?>>(GMT +5:30) Chennai, Calcutta, Mumbai, New Delhi</option>
<option value="5.75,Asia/Katmandu" <?=($conf->offsetCity=="Asia/Katmandu")? "selected=\"selected\"":"" ?>>(GMT +5:45) Katmandu</option>
<option value="6,Asia/Almaty" <?=($conf->offsetCity=="Asia/Almaty")? "selected=\"selected\"":"" ?>>(GMT +6:00) Almaty, Novosibirsk</option>
<option value="6,Asia/Dhaka" <?=($conf->offsetCity=="Asia/Dhaka")? "selected=\"selected\"":"" ?>>(GMT +6:00) Astana, Dhaka, Sri Jayawardenepura</option>
<option value="6.50,Asia/Rangoon" <?=($conf->offsetCity=="Asia/Rangoo")? "selected=\"selected\"":"" ?>>(GMT +6:30) Rangoon</option>
<option value="7,Asia/Bangkok" <?=($conf->offsetCity=="Asia/Bangkok")? "selected=\"selected\"":"" ?>>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
<option value="7,Asia/Krasnoyarsk" <?=($conf->offsetCity=="Asia/Krasnoyarsk")? "selected=\"selected\"":"" ?>>(GMT +7:00) Krasnoyarsk</option>
<option value="8,Asia/Hong_Kong" <?=($conf->offsetCity=="Asia/Hong_Kong")? "selected=\"selected\"":"" ?>>(GMT +8:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
<option value="8,Asia/Irkutsk" <?=($conf->offsetCity=="Asia/Irkutsk")? "selected=\"selected\"":"" ?>>(GMT +8:00) Irkutsk, Ulaan Bataar</option>
<option value="8,Asia/Singapore" <?=($conf->offsetCity=="Asia/Singapore")? "selected=\"selected\"":"" ?>>(GMT +8:00) Kuala Lumpar, Perth, Singapore, Taipei</option>
<option value="9,Asia/Tokyo" <?=($conf->offsetCity=="Asia/Tokyo")? "selected=\"selected\"":"" ?>>(GMT +9:00) Osaka, Sapporo, Tokyo</option>
<option value="9,Asia/Seoul" <?=($conf->offsetCity=="Asia/Seoul")? "selected=\"selected\"":"" ?>>(GMT +9:00) Seoul</option>
<option value="9,Asia/Yakutsk" <?=($conf->offsetCity=="Asia/Yakutsk")? "selected=\"selected\"":"" ?>>(GMT +9:00) Yakutsk</option>
<option value="9.50,Australia/Adelaide" <?=($conf->offsetCity=="Australia/Adelaide")? "selected=\"selected\"":"" ?>>(GMT +9:30) Adelaide</option>
<option value="9.50,Australia/Darwin" <?=($conf->offsetCity=="Australia/Darwin")? "selected=\"selected\"":"" ?>>(GMT +9:30) Darwin</option>
<option value="10,Australia/Brisbane" <?=($conf->offsetCity=="Australia/Brisbane")? "selected=\"selected\"":"" ?>>(GMT +10:00) Brisbane, Guam, Port Moresby</option>
<option value="10,Australia/Canberra" <?=($conf->offsetCity=="Australia/Canberra")? "selected=\"selected\"":"" ?>>(GMT +10:00) Canberra, Hobart, Melbourne, Sydney, Vladivostok</option>
<option value="11,Asia/Magadan" <?=($conf->offsetCity=="Asia/Magadan")? "selected=\"selected\"":"" ?>>(GMT +11:00) Magadan, Soloman Is., New Caledonia</option>
<option value="12,Pacific/Auckland" <?=($conf->offsetCity=="Pacific/Auckland")? "selected=\"selected\"":"" ?>>(GMT +12:00) Auckland, Wellington</option>
<option value="12,Pacific/Fiji" <?=($conf->offsetCity=="Pacific/Fiji")? "selected=\"selected\"":"" ?>>(GMT +12:00) Fiji, Kamchatka, Marshall Is.</option>
</select>
</li>
</ul>

View File

@ -0,0 +1,89 @@
<?php
/* ===========================
gelato CMS - A PHP based tumblelog CMS
development version
http://www.gelatocms.com/
gelato CMS is a free software licensed under the GPL 2.0
Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
=========================== */
?>
<?php
require_once("configuration.class.php");
require_once("functions.php");
class comments extends Conexion_Mysql {
var $conf;
function comments() {
parent::Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
$this->conf = new configuration();
}
function addComment($fieldsArray) {
if ($this->insertarDeFormulario($this->conf->tablePrefix."data", $fieldsArray)) {
return true;
} else {
return false;
}
}
function generateCookie($fieldsArray) {
setcookie("cookie_gel_user", $fieldsArray["username"], time() + 30000000);
setcookie("cookie_gel_email", $fieldsArray["email"], time() + 30000000);
setcookie("cookie_gel_web", $fieldsArray["web"], time() + 30000000);
}
function isSpam($fieldsArray) {
if (preg_match( "/^\d+$/", $fieldsArray["username"])) { return true; }
elseif (trim($fieldsArray["content"]) == "") { return true; }
elseif (preg_match( "/^\d+$/", $fieldsArray["content"])) { return true; }
elseif (strtolower($fieldsArray["content"]) == strtolower($fieldsArray["username"])) { return true; }
elseif (preg_match("#^<strong>[^.]+\.\.\.</strong>#", $fieldsArray["content"])) { return true; }
elseif (3 <= preg_match_all("/a href=/", strtolower($fieldsArray["content"]), $matches)) { return true; }
elseif ($this->isBadWord($fieldsArray["content"])) { return true; }
else { return false; }
}
function isBadWord($str="") {
$bads = array ("puto", "viagra", "ringtones", "casino", "buy", "cheap", "order", "poker", "discount", "fuck", "cool", "site", "online", "very", "cholesterol", "milf", "sex", "sexo", "arredamento", "reddit", "sesso", "lesbico", "vzge", "angelcities", "porno", "holdem", "blackjack", "black-jack", "mortgage", "pharmacy", "loan", "refinance", "credit", "alberghi", "scarica", "hotel", "cellulare", "giochi", "gratis", "gif", "animata", "fantasy", "albergo", "blowjob", "delicio", "cosco", "dealerships");
for($i=0;$i<sizeof($bads);$i++) {
if(eregi($bads[$i],$str)) return true;
}
return false;
}
function confirmacionEmail($email_autor_post, $tit_blog, $desc_blog, $url_blog, $id_post, $titulo_post, $usuario, $email, $pagina_web, $comentario, $ip_usuario) {
$msg = "<br/><br/><font face=verdana><em><font size=2>Hay un nuevo comentario en el post #".$id_post." \"".$titulo_post."\"</font></em><br/><br/>";
$msg .= "Autor : ".$usuario." (IP: ".$ip_usuario.")<br /><br />";
$msg .= "E-mail : <a href=\"mailto:".$email."\">".$email."</a><br /><br />";
$msg .= "URL &nbsp; &nbsp;: <a href=\"".$pagina_web."\" target=\"_blank\">".$pagina_web."</a><br /><br />";
$msg .= "Whois &nbsp;: <a href=\"http://ws.arin.net/cgi-bin/whois.pl?queryinput=".$ip_usuario."\" target=\"_blank\">http://ws.arin.net/cgi-bin/whois.pl?queryinput=".$ip_usuario."</a><br /><br />";
$msg .= "Comentario:<br /><br />".$comentario;
$msg .= "<br /><br /><a href=\"".$url_blog."/index.php?id=".$id_post."\">".$url_blog."/index.php?id=".$id_post."</a><br /><br />";
enviaMail($email_autor_post, "[".$desc_blog."] Nuevo mensaje en: ".$titulo_post."", $msg, EMAIL_ADMIN);
}
function obtenerComentarios($idArticulo="") {
$this->ejecutarConsulta("select * from ".tabla_prefijo."comentarios WHERE id_post=".$idArticulo." AND spam=0 order by fecha ASC");
return $this->mid_consulta;
}
function contarComentarios($idArticulo="") {
$this->ejecutarConsulta("select * from ".tabla_prefijo."comentarios WHERE id_post=".$idArticulo." AND spam=0");
return $this->contarRegistros();
}
function mostrarGravatar($email="") {
$emailg = $email;
$default = URL_CODICE."/images/noGravatar.jpg";
$size = 30;
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($emailg)."&amp;default=".urlencode($default)."&amp;size=".$size;
return "<img src=\"".$grav_url."\" alt=\"Gravatar\" title=\"Gravatar\" />";
}
}
?>

View File

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

View File

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

File diff suppressed because it is too large Load Diff

115
comments.php Normal file
View File

@ -0,0 +1,115 @@
<?php
/* ===========================
gelato CMS - A PHP based tumblelog CMS
development version
http://www.gelatocms.com/
gelato CMS is a free software licensed under the GPL 2.0
Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
=========================== */
?>
<?php
require_once('config.php');
include("classes/functions.php");
include("classes/comments.class.php");
require_once("classes/configuration.class.php");
$comment = new comments();
$conf = new configuration();
$isEdition = isset($_GET["edit"]);
$commentId = ($isEdition) ? $_GET["edit"] : NULL;
if (isset($_GET["delete"])) {
$comment->deleteComment($_GET['delete']);
header("Location: comments.php?delete=true");
die();
}
if(isset($_POST["btnAdd"])) {
unset($_POST["btnAdd"]);
$_POST["username"] = strip_tags($_POST["username"]);
$_POST["email"] = strip_tags($_POST["email"]);
$_POST["web"] = strip_tags($_POST["web"]);
if (isset($_POST["id_comment"])) {
$comment->modifyComment($_POST, $_POST["id_comment"]);
} else {
$comment->generateCookie($_POST);
$_POST["spam"] = ($comment->isSpam($_POST)) ? "1" : "0";
$_POST["ip_user"] = $_SERVER["REMOTE_ADDR"];
if ($comment->addComment($_POST)) {
header("Location: comments.php?added=true");
die();
} else {
header("Location: comments.php?added=false");
die();
}
}
} else {
if ($isEdition) {
$row = $comment->getCommentByID($userId);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>gelato :: <?php echo __("add user")?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="gelato cms <?php echo version();?>" />
<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/mootools.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
<style type="text/css" media="screen">
@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
</style>
</head>
<body>
<div id="div-process" style="display:none;"><?=__("Processing request...");?></div>
<div id="cont">
<div id="head">
<h1><a href="<?php echo $conf->urlGelato;?>/" title="gelato :: <?=__("home")?>">gelato cms</a></h1>
<ul id="nav">
<li><a href="<?php echo $conf->urlGelato;?>/" title="<?=__("Take me to the tumblelog")?>"><?=__("Back to the Tumblelog")?></a></li>
</ul>
</div>
<div id="main">
<div class="box">
<ul class="menu manage">
<h3><?=__("Start session")?></h3>
<li><a href="index.php"><?=__("Post")?></a></li>
<li><a href="admin.php"><?=__("Users")?></a></li>
<li class="selected"><a><?php echo ($isEdition) ? __("Edit") : __("Add"); ?></a></li>
</ul>
<div class="tabla">
<?php
if ($isEdition) {
?>
<input type="hidden" name="id_user" id="id_user" value="<?php echo $userId;?>" />
<?php
}
?>
</div>
<div class="footer-box">&nbsp;</div>
</div>
</div>
<div id="foot">
<a href="http://www.gelatocms.com/" title="gelato CMS">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
</div>
</div>
</body>
</html>
<?php
}
?>

View File

@ -97,12 +97,12 @@
if ($tumble->contarRegistros()>0) {
$dateTmp = null;
while($register = mysql_fetch_array($rs)) {
$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offset_time));
$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
$textile = new Textile;
$register["description"] = $textile->process($register["description"]);
$textile = new Textile();
$register["description"] = $textile->TextileThis($register["description"]);
$register["title"] = stripslashes($register["title"]);
$register["description"] = stripslashes($register["description"]);
@ -188,11 +188,11 @@
} else {
$register = $tumble->getPost($id_post);
$formatedDate = date("M d", strtotime($register["date"]));
$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
$textile = new Textile;
$register["description"] = $textile->process($register["description"]);
$textile = new Textile();
$register["description"] = $textile->TextileThis($register["description"]);
$register["title"] = stripslashes($register["title"]);
$register["description"] = stripslashes($register["description"]);
@ -259,6 +259,18 @@
$template->mostrarPlantilla();
break;
}
if ($conf->allowComments) {
// before the comments form must be the comments on the DB
$input = array("{User_Cookie}", "{Email_Cookie}", "{Web_Cookie}", "{Id_Post}", "{Form_Action}", "{Date_Added}");
$output = array($_COOKIE['cookie_gel_user'], $_COOKIE['cookie_gel_email'], $_COOKIE['cookie_gel_web'], $register["id_post"], $conf->urlGelato."/comments.php", gmmktime());
$template->cargarPlantilla($input, $output, "template_comment_post");
$template->mostrarPlantilla();
}
}
$input = array("{URL_Tumble}");

View File

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

View File

@ -261,4 +261,35 @@ padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #f3f3f3;
color: #ccc;
}
.containerFormComments {
margin: 25px 65px 0px 0px;
font-family: Verdana;
font-size: 0.75em;
}
#commentForm input, #commentForm textarea {
font: 0.9em 'Lucida Grande', Verdana, Arial, Sans-Serif;
}
#commentForm p {
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
margin: 5px 0;
}
#commentForm input {
width: 170px;
padding: 2px;
margin: 5px 5px 1px 0;
}
#commentForm textarea {
width: 100%;
padding: 2px;
}
#commentForm #btnAdd {
margin: 0;
float: right;
}

View File

@ -0,0 +1,37 @@
<div class="containerFormComments">
<h3 id="respond">Add your comment</h3>
<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
<p>
<label for="username">
<small>Name:</small>
</label>
<input name="username" id="username" value="{User_Cookie}" size="22" tabindex="1" type="text" />
</p>
<p>
<label for="email">
<small>E-mail:</small>
</label>
<input name="email" id="email" value="{Email_Cookie}" size="22" tabindex="2" type="text" />
</p>
<p>
<label for="web">
<small>Website:</small>
</label>
<input name="web" id="web" value="{Web_Cookie}" size="22" tabindex="3" type="text" />
</p>
<p>
<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
</p>
<p>
<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>
<p>
<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
</p>
<p>
<input name="idPost" id="idPost" value="{Id_Post}" type="hidden" />
<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
</p>
</form>
</div>

View File

@ -0,0 +1,18 @@
<div class="containerComments">
<h3 id="comments"><*NumeroDeComentarios*> Respuestas a &#8220;<*TituloPost*>&#8221;</h3>
<ol class="commentlist">
[bloque: comentarios]
<li class="alt" id="comment-<*IdComentario*>">
<cite>
<a href="#comment-<*IdComentario*>" title="Enlace permanente a este comentario">#</a>&nbsp;&nbsp;
<*ImagenAvatar*>&nbsp;&nbsp;
<*AutorComentario*> dijo:
</cite>
<br />
<span class="timestampComment"> el <*Fecha*></span><br /><br />
<*TextoComentario*>
<br /><br />
</li>
[/bloque: comentarios]
</ol>
</div>