InicioHazlo Tu MismoPHPost fuente al agregar post

PHPost fuente al agregar post

Hazlo Tu Mismo7/19/2012



Bueno comenzemos con la instalación del mod de fuente...

ejecutan esta consulta sql en su phpmyadmin...

ALTER TABLE `p_posts` ADD `p_fuente` VARCHAR( 255 ) NOT NULL
abren m.agregar_form.tpl (themes/default/templates/modules)

buscar:

<li>
<label>Tags</label>
<span style="display: none;" class="errormsg"></span>
<input type="text" tabindex="4" name="tags" maxlength="128" class="text-inp required" value="{$tsDraft.b_tags}"/>
Una lista separada por comas, que describa el contenido. Ejemplo: <b>gol, ingleses, Copa Oro, futbol, Chicharito, M&eacute;xico</b>
</li>
    
agregar debajo:

<li>
<label>Fuente</label>
<span style="display: none;" class="errormsg"></span>
<input type="text" tabindex="4" name="fuente" maxlength="250" class="text-inp required" value="URL de la fuente..."/>
<input type="checkbox" name="font" checked="checked"><b>Contenido Propio</b> La informaci&oacute;n del post es de mi autor&iacute;a, no utilic&eacute; contenido de terceros.
</li>
    

abrir c.post.php (inc/class)

buscar:

$postData['private'] = empty($_POST['privado']) ? 0 : 1;
agregar debajo:

$postData['fuente'] = isset($_POST['font']) ? 'author' : $tsCore->setSecure($_POST['fuente']);
buscar:

if(mysql_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'').')')) {
reemplazar por:
    
if(mysql_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, p_fuente) 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'').',''.$postData['fuente'].'')')) {       
vuelve a buscar más abajo:
$postData['private'] = empty($_POST['privado']) ? 0 : 1;
y agrega debajo:

$postData['fuente'] = isset($_POST['font']) ? 'author' : $tsCore->setSecure($_POST['fuente']);   
ahora busca:

if(mysql_query('UPDATE p_posts SET post_title = ''.$postData['title'].'', post_body = ''.$postData['body'].'', post_tags = ''.$tsCore->setSecure($postData['tags']).'', post_category = ''.(int)$postData['category'].'', post_private = ''.$postData['private'].'', post_block_comments = ''.$postData['block_comments'].'', post_sponsored = ''.$postData['sponsored'].'', post_smileys = ''.$postData['smileys'].'', post_visitantes = ''.$postData['visitantes'].'', post_sticky = ''.$postData['sticky'].'' WHERE post_id = ''.(int)$post_id.''') or die(mysql_error())) {
reemplazalo por:

if(mysql_query('UPDATE p_posts SET post_title = ''.$postData['title'].'', post_body = ''.$postData['body'].'', post_tags = ''.$tsCore->setSecure($postData['tags']).'', post_category = ''.(int)$postData['category'].'', post_private = ''.$postData['private'].'', post_block_comments = ''.$postData['block_comments'].'', post_sponsored = ''.$postData['sponsored'].'', post_smileys = ''.$postData['smileys'].'', post_visitantes = ''.$postData['visitantes'].'', post_sticky = ''.$postData['sticky'].'', p_fuente = ''.$postData['fuente'].'' WHERE post_id = ''.(int)$post_id.''') or die(mysql_error())) {
abrir m.post_metadata.tpl (themes/default/templates/modules)

buscar:

{foreach from=$tsPost.post_tags key=i item=tag}
                                                                <a rel="tag" href="{$tsConfig.url}/buscador/?q={$tag|seo}&e=tags">{$tag}</a> {if $i < $tsPost.n_tags}-{/if}
                                                                {/foreach}

agregar debajo:

<br /><br /><span class="icons tags_title">Fuente:</span>
                                                                {if $tsPost.p_fuente!='author' && $tsPost.p_fuente}<a rel="tag" href="{$tsPost.p_fuente}">{$tsPost.p_fuente}</a>{else}Este post es de autor&iacute;a propia{/if}

saludos!
Datos archivados del Taringa! original
0puntos
0visitas
0comentarios
Actividad nueva en Posteamelo
0puntos
2visitas
0comentarios
Dar puntos:

Dejá tu comentario

0/2000

Autor del Post

D
Divertingaz🇦🇷
Usuario
Puntos0
Posts6
Ver perfil →
PosteameloArchivo Histórico de Taringa! (2004-2017). Preservando la inteligencia colectiva de la internet hispanohablante.

CONTACTO

18 de Septiembre 455, Casilla 52

Chillán, Región de Ñuble, Chile

Solo correo postal

© 2026 Posteamelo.com. No afiliado con Taringa! ni sus sucesores.

Contenido preservado con fines históricos y culturales.