ALTER TABLE p_posts ADD post_cover VARCHAR( 250 ) NOT NULL;
'body' => $tsCore->setSecure($_POST['cuerpo']),
'cover' => $tsCore->setSecure($_POST['cover_p']),
// INSERTAMOS
$_SERVER['REMOTE_ADDR'] = $_SERVER['X_FORWARDED_FOR'] ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if(!filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) { die('0: Su ip no se pudo validar.'); }
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_posts` (post_user, post_category, post_title, post_body, post_date, post_tags, post_ip, post_private, post_block_comments, post_sponsored, post_sticky, post_smileys, post_visitantes, post_status) VALUES (\''.$tsUser->uid.'\', \''.(int)$postData['category'].'\', \''.$postData['title'].'\', \''.$postData['body'].'\', \''.$postData['date'].'\', \''.$postData['tags'].'\', \''.$_SERVER['REMOTE_ADDR'].'\', \''.(int)$postData['private'].'\', \''.(int)$postData['block_comments'].'\', \''.(int)$postData['sponsored'].'\', \''.(int)$postData['sticky'].'\', \''.(int)$postData['smileys'].'\', \''.(int)$postData['visitantes'].'\', '.(!$tsUser->is_admod && ($tsCore->settings['c_desapprove_post'] == 1 || $tsUser->permisos['gorpap'] == true) ? '\'3\'' : '\'0\'').')')) {
// INSERTAMOS
$_SERVER['REMOTE_ADDR'] = $_SERVER['X_FORWARDED_FOR'] ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if(!filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP)) { die('0: Su ip no se pudo validar.'); }
if(db_exec(array(__FILE__, __LINE__), 'query', 'INSERT INTO `p_posts` (post_user, post_category, post_title, post_body, post_cover, post_date, post_tags, post_ip, post_private, post_block_comments, post_sponsored, post_sticky, post_smileys, post_visitantes, post_status) VALUES (\''.$tsUser->uid.'\', \''.(int)$postData['category'].'\', \''.$postData['title'].'\', \''.$postData['body'].'\', \''.$postData['cover'].'\', \''.$postData['date'].'\', \''.$postData['tags'].'\', \''.$_SERVER['REMOTE_ADDR'].'\', \''.(int)$postData['private'].'\', \''.(int)$postData['block_comments'].'\', \''.(int)$postData['sponsored'].'\', \''.(int)$postData['sticky'].'\', \''.(int)$postData['smileys'].'\', \''.(int)$postData['visitantes'].'\', '.(!$tsUser->is_admod && ($tsCore->settings['c_desapprove_post'] == 1 || $tsUser->permisos['gorpap'] == true) ? '\'3\'' : '\'0\'').')')) {
post_cover,
\''.$postData['cover'].'\',
'body' => $tsCore->setSecure($_POST['cuerpo'], true),
'cover' => $tsCore->setSecure($_POST['cover_p'], true),
/*********/
$query = db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p.post_id, p.post_user, p.post_category, p.post_title, p.post_date, p.post_comments, p.post_puntos, p.post_private, p.post_sponsored, p.post_status, p.post_sticky, u.user_id, u.user_name, u.user_activo, u.user_baneado, c.c_nombre, c.c_seo, c.c_img FROM p_posts AS p LEFT JOIN u_miembros AS u ON p.post_user = u.user_id '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == 1 ? '' : ' && u.user_activo = \'1\' && u.user_baneado = \'0\'').' LEFT JOIN p_categorias AS c ON c.cid = p.post_category WHERE '.($tsUser->is_admod && $tsCore->settings['c_see_mod'] == 1 ? 'p.post_id > 0' : 'p.post_status = \'0\' && u.user_activo = \'1\' && u.user_baneado = \'0\'').' '.$c_where.' '.$s_where.' GROUP BY p.post_id ORDER BY '.$s_order.' DESC LIMIT '.$start);
$lastPosts['data'] = result_array($query);
p.post_title,
p.post_cover,
<li>
<label>Título</label>
<span style="display: none;" class="errormsg"></span>
<input type="text" tabindex="1" name="titulo" maxlength="60" size="60" class="text-inp required" value="{$tsDraft.b_title}" style="width:760px"/>
<div id="repost"></div>
</li>
<li>
<label>URL de imagen de portada del Post (Superior a 700px x 430px)<div class="checkboxThree">
<input name="checkbox1" type="checkbox" id="checkboxThree" onClick="toogdiv(covered_p);" value="https://"/>
<label for="checkboxThree"></label>
</div></label>
<span style="display: none;" class="errormsg"></span>
<input type="text" name="cover_p" id="covered_p" tabindex="1" style="border-radius: 4px 4px 4px 4px; display: none;" onblur=" veri( this.value ) " class="text-inp" value="{if $tsDraft.b_cover}{$tsDraft.b_cover}{else}https://{/if}"/>
</li>
#covered_p{-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;-ms-transition:all .5s ease;transition:all .5s ease}.form-add-post .checkboxThree input[type=checkbox]{visibility:hidden}.form-add-post input[type=text]#covered_p:disabled{display:none}.checkboxThree{width:120px;height:22px;background:#333;margin:0 0 0 9px;border-radius:50px;position:relative;display:inline-block}.checkboxThree:before{content:'On';position:absolute;top:5px;left:13px;height:2px;color:#26ca28;font-size:12px}.checkboxThree:after{content:'Off';position:absolute;top:5px;left:84px;height:2px;color:#bbb;font-size:12px}.checkboxThree input[type=checkbox]:checked+label{left:60px;background:#26ca28}.checkboxThree label{display:block;width:52px;height:2px;border-radius:50px;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;-ms-transition:all .5s ease;transition:all .5s ease;cursor:pointer;position:absolute;top:5px;z-index:1;left:12px;background:#ddd}.slimScrollDiv{height:254px!important}.cover_postedor img{width:100%}
function postSave() {
confirm = false;
$('form[name=newpost]').submit();
}
function veri(cover_p) {
if ( cover_p.length<7 )
{
document.newpost.cover_p.value="http://";
}
}
function toogdiv() {
$("#covered_p").toggle();
}
{if $tsPost.post_cover=='http://'}{else}<div class="cover_postedor"><img src="{$tsPost.post_cover}" /></div>{/if}