Shorten long link with abbrr.com
parent
7598eed6bd
commit
643ed9be2b
|
|
@ -391,6 +391,9 @@ if ($user->isAdmin()) {
|
||||||
$template->mostrarPlantilla();
|
$template->mostrarPlantilla();
|
||||||
break;
|
break;
|
||||||
case "4":
|
case "4":
|
||||||
|
if($conf->shorten_links){
|
||||||
|
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
|
||||||
|
}
|
||||||
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
||||||
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
||||||
$output = array($register["id_post"], $formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
$output = array($register["id_post"], $formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,11 @@ if ($user->isAdmin()) {
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$tumble->saveOption($_POST["shorten_links"], "shorten_links")) {
|
||||||
|
header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
|
header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
|
||||||
die();
|
die();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -196,6 +201,12 @@ if ($user->isAdmin()) {
|
||||||
<option value="12,Pacific/Fiji" <?php echo ($conf->offsetCity=="Pacific/Fiji")? "selected=\"selected\"":"" ?>>(GMT +12:00) Fiji, Kamchatka, Marshall Is.</option>
|
<option value="12,Pacific/Fiji" <?php echo ($conf->offsetCity=="Pacific/Fiji")? "selected=\"selected\"":"" ?>>(GMT +12:00) Fiji, Kamchatka, Marshall Is.</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="select"><label for="shorten_links"><?php echo __("Shorten long URLs:")?></label>
|
||||||
|
<select name="shorten_links" id="shorten_links">
|
||||||
|
<option value="1" <?php if($conf->shorten_links) echo "selected"; ?>><?php echo __("Active")?></option>
|
||||||
|
<option value="0" <?php if(!$conf->shorten_links) echo "selected"; ?>><?php echo __("Deactive")?></option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ class configuration extends Conexion_Mysql {
|
||||||
var $richText;
|
var $richText;
|
||||||
var $offset_city;
|
var $offset_city;
|
||||||
var $offset_time;
|
var $offset_time;
|
||||||
|
var $shorten_links;
|
||||||
|
|
||||||
|
|
||||||
function configuration() {
|
function configuration() {
|
||||||
|
|
@ -52,6 +53,7 @@ class configuration extends Conexion_Mysql {
|
||||||
$this->offsetCity = $this->get_option("offset_city");
|
$this->offsetCity = $this->get_option("offset_city");
|
||||||
$this->offsetTime = $this->get_option("offset_time");
|
$this->offsetTime = $this->get_option("offset_time");
|
||||||
$this->allowComments = $this->get_option("allow_comments");
|
$this->allowComments = $this->get_option("allow_comments");
|
||||||
|
$this->shorten_links = $this->get_option("shorten_links");
|
||||||
} else {
|
} else {
|
||||||
if($isFeed) {
|
if($isFeed) {
|
||||||
header("HTTP/1.0 503 Service Unavailable");
|
header("HTTP/1.0 503 Service Unavailable");
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,9 @@ $template = new plantillas($conf->template);
|
||||||
$template->mostrarPlantilla();
|
$template->mostrarPlantilla();
|
||||||
break;
|
break;
|
||||||
case "4":
|
case "4":
|
||||||
|
if($conf->shorten_links){
|
||||||
|
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
|
||||||
|
}
|
||||||
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
||||||
$input = array("{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
$input = array("{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
||||||
$output = array($formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
$output = array($formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
||||||
|
|
@ -224,6 +227,9 @@ $template = new plantillas($conf->template);
|
||||||
$template->mostrarPlantilla();
|
$template->mostrarPlantilla();
|
||||||
break;
|
break;
|
||||||
case "4":
|
case "4":
|
||||||
|
if($conf->shorten_links){
|
||||||
|
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
|
||||||
|
}
|
||||||
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
||||||
$input = array("{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
$input = array("{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
|
||||||
$output = array($formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
$output = array($formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@ $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('offset_time', '-6');";
|
||||||
|
|
||||||
$db->ejecutarConsulta($sqlStr);
|
$db->ejecutarConsulta($sqlStr);
|
||||||
|
|
||||||
|
$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');";
|
||||||
|
|
||||||
|
$db->ejecutarConsulta($sqlStr);
|
||||||
|
|
||||||
echo "<p><em>Finished!</em></p>";
|
echo "<p><em>Finished!</em></p>";
|
||||||
echo "<p>Now you are running on the new <strong>0.90</strong> version!!!</p>";
|
echo "<p>Now you are running on the new <strong>0.90</strong> version!!!</p>";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue