forked from qwerty/tupali
97 lines
4.4 KiB
PHP
97 lines
4.4 KiB
PHP
<?php
|
|
function tuitealo($form,$tipo) {
|
|
if($tipo =='formulario') {
|
|
$formulario = formulario_areas('297','campos');
|
|
$descripcion = remplacetas('form_id','id','297','descripcion',"") ;
|
|
$nombre = remplacetas('form_id','id','15','nombre',"") ;
|
|
$formulario ="
|
|
|
|
<h1 >$nombre[0]</h1>
|
|
<h2>$descripcion[0]</h2>
|
|
<form id='form_tuitealo' >
|
|
$formulario
|
|
<br>
|
|
|
|
<div id='tuitealo_div'>
|
|
<div id='tuitealo_error'></div>
|
|
|
|
|
|
|
|
<a class='btn btn-block btn-primary' onclick=\"xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar');\">Previsualizar</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<br>
|
|
<div class='text-center'>
|
|
<p class='text-center'>Powered by: <a href='https://qwerty.co/milfs'>MIFS</a></p>
|
|
</div>
|
|
|
|
<br>
|
|
|
|
";
|
|
return $formulario;
|
|
}
|
|
$respuesta = new xajaxResponse('utf-8');
|
|
$sujeto = $form[1301][0];
|
|
$accion = $form[1302][0];
|
|
$verbo = $form[1303][0];
|
|
$tiempo = $form[1305][0];
|
|
$ht = $form[1306][0];
|
|
$mensaje = $form[1307][0];
|
|
$arroba = $form[1301][0];
|
|
if( $accion =="" or $verbo =="" or $tiempo =="" or $ht =="" or $arroba =="" ) {
|
|
$error ="<div class='alert alert-warning text-center'><h1><i class='fa fa-exclamation-triangle'></i> Hay campos vacíos</h1></div>";
|
|
$respuesta->addAssign("tuitealo_error","innerHTML","$error");
|
|
return $respuesta;
|
|
|
|
}
|
|
$arroba = remplacetas('form_datos','control',"$arroba",'contenido',"id_campo = '77'") ;
|
|
$arroba = $arroba[0];
|
|
$url_propia = urlencode("https://patos.redpatodos.co");
|
|
$texto="$sujeto $accion $verbo $tiempo $ht $mensaje cc $arroba ";
|
|
$texto = ucfirst($texto);
|
|
$texto_url=urlencode($texto);
|
|
$largo = strlen($texto.$url_propia);
|
|
if($largo > 140) { $alert ="danger"; $mensaje ="<i class='fa fa-exclamation-triangle'></i> El texto es demasiado largo y se recortará";
|
|
$texto = substr($texto, 0, 140)."..."; }
|
|
else{$alert='success'; $mensaje="";}
|
|
|
|
|
|
|
|
$url ="https://twitter.com/share?url=$url_propia&text=$texto_url";
|
|
|
|
$previsualizar ="<br>
|
|
|
|
<div id='tuitealo_error'></div>
|
|
<div class='alert alert-$alert'><div class='badge'>$largo</div>$mensaje<h1>$texto</h1></div>
|
|
|
|
<a class='btn btn-block btn-primary' onclick=\"xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar');\">Previsualizar</a>
|
|
<a class='btn btn-block btn-success' onclick=\"xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'confirmar');\">Tuitéalo</a>
|
|
<img style='width:1px;' src='milfs/images/100x100.png'
|
|
onload=\"
|
|
document.getElementById('82[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
document.getElementById('83[0]').onkeyup = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
document.getElementById('84[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
document.getElementById('85[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
document.getElementById('86[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
document.getElementById('87[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
document.getElementById('88[0]').onchange = function(){xajax_tuitealo(xajax.getFormValues('form_tuitealo'),'previsualizar')};
|
|
|
|
\" >
|
|
";
|
|
|
|
if( $tipo =="previsualizar") {
|
|
|
|
$respuesta->addAssign("tuitealo_div","innerHTML","$previsualizar");
|
|
|
|
}else{
|
|
$respuesta->addScript("window.location.href ='$url';");
|
|
}
|
|
|
|
return $respuesta;
|
|
}
|
|
|
|
$xajax->registerFunction("tuitealo");
|
|
|
|
?>
|