Comunidad de diseño web y desarrollo en internet online

no se como crear un aja a mis comentarios de los post

Citar            
MensajeEscrito el 31 Mar 2010 04:29 pm
hola a todos soy un poco nuevo con el aja queria saber como le creo un aja a mi comentarios en los post o publicaciones les dejo el codigo para que me puedan ayudar de verdad me interesaria que me ayudaran

<?php







function template_main()



{



global $context, $settings, $db_prefix, $options, $txt, $scripturl, $sourcedir, $modSettings;



if (($context['denunciaspost']) < 6){



echo '<a name="top"></a><a name="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new"></a>' : '';



echo '<div>', theme_linktree(), '</div>';







echo '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="middletext" valign="bottom" style="padding-bottom: 4px;"></td><td align="right" style="padding-right: 1ex;"><div class="nav" style="margin-bottom: 2px;"> ', $context['previous_next'], '</div><table cellpadding="0" cellspacing="0"><tr>', template_button_strip($normal_buttons, 'bottom'), '</tr></table></td></tr></table>';



foreach($sites as $site => $url) {



$entry = 'share_' . $site;



if(!empty($modSettings[$entry]) && $modSettings[$entry]) {



$social_icons .= sprintf('<a href="' . $url . '" target="_blank"><img src="' . $settings['images_url'] . '/share/' . $site . '.gif" align="bottom" title="' . $txt['share_default_tooltip'] . '" alt="' . $txt['share_default_tooltip'] . '" /></a>', urlencode($page_url), $txt[$entry], $txt[$entry]);



}



}



if($social_icons == "")



$social_icons = '<img src="' . $settings['images_url'] . '/topic/' . $context['class'] . '.gif" align="bottom" alt="" />';



// Build list of social icons



$social_icons = '';



$sites = array(



'facebook' => 'http://www.facebook.com/share.php?u=%s',



'delicious' => 'http://del.icio.us/post?url=%s',



'digg' => 'http://digg.com/submit?phase=2&url=%s',



'reddit' => 'http://reddit.com/submit?url=%s',



'stumbleupon' => 'http://www.stumbleupon.com/submit?url=%s',



'twitter' => 'http://twitter.com/home?status=%s',



);



if(!empty($modSettings['queryless_urls']) && $modSettings['queryless_urls'])



$page_url = $scripturl . '/topic,' . $context['current_topic'] . '.0.html';



else



$page_url = $scripturl . '?topic=' . $context['current_topic'] . '.0';







foreach($sites as $site => $url) {



$entry = 'share_' . $site;



if(!empty($modSettings[$entry]) && $modSettings[$entry]) {



$social_icons .= sprintf('<a href="' . $url . '" target="_blank"><img src="' . $settings['images_url'] . '/share/' . $site . '.gif" align="bottom" title="' . $txt['share_default_tooltip'] . '" alt="' . $txt['share_default_tooltip'] . '" /></a>', urlencode($page_url), $txt[$entry], $txt[$entry]);



}



}



if($social_icons == "")



$social_icons = '<img src="' . $settings['images_url'] . '/topic/' . $context['class'] . '.gif" align="bottom" alt="" />';



echo '<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tborder2">';



while ($message = $context['get_message']())



{



echo '<tr><td style="padding: 1px 1px 0 1px;">';



if ($message['id'] != $context['first_message'])



echo '<a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';



echo '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="20%" align="center" valign="top"><table width="100%"cellspacing="0" ><tr><td valign="top" width="20%" rowspan="2" ><table border="0" cellspacing="1" cellpadding="3" width="100%" style="margin-right: 8px; margin-top: -6px;"><tr><td valign="top"><div class="mensajepost11" style="margin-bottom: 1px; text-align:left;">Posteado por:</div>



<div class="windowbg" ><div class="smalltext" >';



if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))



echo '<div class="windowbg4"><div class="content">', $message['member']['avatar']['image'], '</div> </div><div style="text-align:left;" class="color_azul2"> <b>', $message['member']['link'], '</b></div>';



if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')



echo '<div style="text-align:left;">', $message['member']['blurb'], '</div>';



if (isset($message['member']['title']) && $message['member']['title'] != '')



echo '<div style="text-align:left;">', $message['member']['title'], '</div>';



if (isset($message['member']['group']) && $message['member']['group'] != '')



echo '<div style="text-align:left;"><b>', $message['member']['group'], '</b></div>';



if (!$message['member']['is_guest'])



{



if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')



echo '<div style="text-align:left;"><b>', $message['member']['post_group'], '</b></div>';



echo '<div style="text-align:left;"><b>', $message['member']['group_stars'], '</b></div>';



echo '<div style="text-align:left;">';



//foreach ($context['userdatos'] as $user)



//{echo '<img src="', $settings['default_theme_url'], '/images/pais/pais_', $user['pais'],'.gif">';}







// echo '&nbsp;&nbsp;', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $message['member']['online']['image_href'] . '" alt="' . $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' : $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? ' ' : '', '';



// Show the member's gender icon?







echo '&nbsp;', $message['member']['gender']['image'], '';



echo '</div><br> ';



foreach ($context['userdatos'] as $user)



{ echo '<div class="texto_post"><span style="color:#FA6D01;">', $user['topics'] , ' </span><br>POST</div>



<div class="texto_post"><span style="color:#32A2F8;">', $user['posts'], ' </span><br>COMENTARIOS</div>';



}



echo'<div class="texto_post"><span style="color:#536C18;">', $modSettings['shopCurrencyPrefix'], (int)$message['member']['money'], ' </span><br>PUNTOS</div>';



// Is karma display enabled? Total or +/-?



if ($modSettings['karmaMode'] == '1')



echo '



<div class="texto_post"><span style="color:#9C6515;">', $message['member']['karma']['good'] - $message['member']['karma']['bad'], ' </span><br>KARMA ';



// Is this user allowed to modify this member's karma?



if ($message['member']['karma']['allow'])



echo '<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '"><span style="color:#009900; font-weight:bold; font-size:12px;">+</span></a><span style="font-weight:normal; font-size:10px;"> / </span>



<a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '"><span style="color:#FF0000; font-weight:bold; font-size:12px;">-</span></a>';



}



echo '<br><br><div class="windowbg4"><a href="', $scripturl, '?action=profile;u=', $message['member']['id'], ';sa=showPosts"><div class="boton2-2">Catalogo</div></a></div>';



echo '</div></div></div></td></tr></table></td></tr>';



echo '<tr> </tr></table>



</td><td width="96%" align="left" valign="top"><div class="mensajepost1"><div class="mensajepostlinea"><table width="100%" border="0" cellspacing="0" cellpadding="0">



<tr><td width="50%" align="left" valign="middle"><a href="', $message['href'], '"><img src="', $message['icon_url'] . '" alt="" border="0" /></a> &nbsp; <a href="', $message['href'], '">', $message['subject'], '</a></td><td width="50%" align="right" valign="middle">';



if ($message['can_modify'])



echo '<a id="south" title="Modificar" href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '"><img src="', $settings['theme_url'], '/images/icons/add.png" width="16" height="16"></a>';



if ($context['can_split'])



echo '<a id="south3" title="Agrupar Post" href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '"><img src="', $settings['theme_url'], '/images/icons/application_side_list.png" width="16" height="16"></a>';



if ($message['can_remove'])



echo '<a id="south4" title="Bannear user" href="', $scripturl, '?action=ban;sa=add;u=', $message['member']['id'], '"><img src="', $settings['theme_url'], '/images/icons/user_delete.png" width="16" height="16"></a>';



if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])



echo '<input type="checkbox" name="msgs[]" value="', $message['id'], '" class="check" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' : '', ' />';



echo '</td></tr></table></div>', $message['body'], '<br><br><div class="mensajepost2">



<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="top"><b>Compartir</b> <br> ', $social_icons, ' </td>



<td align="center" valign="top"><b>Creado <br><div style="margin-top:6px;"></div><span class="color_gris">', $message['time'], ' </span></td></tr></table></div></div>';



if (!empty($context['denunciaspost'])){



echo '<div class="barradenuncias"><b>Post denunciado. (', $context['denunciaspost'], ')</b> ';



if ($context['allow_admin'])



echo ' <a href="', $scripturl, '?action=rz;m=denuncias"><span style="color:#FEFBFA;">Eliminar denuncia</span></a>';



echo '</div>';



}



echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="borde_post_1"><tr><td align="left" valign="bottom">';



if($context['user']['is_logged']){



echo '<span id="favs"></span><a href="', $scripturl, '?action=printpage;topic=', $context['current_topic'], '" rel="nofollow" target="_blank" title="Imprimir">



<img src="', $settings['default_theme_url'], '/images/icons/printer.png"/> Imprimir </a> &nbsp;



<a style=" cursor: pointer; display: inline;" onclick="add_Favoritos('.$context['current_topic'].'); ver_fav2('.$context['current_topic'].'); return false;" id="favoritos_reloaded">



<img src="', $settings['default_theme_url'], '/images/icons/star_1.png"/> Favoritos</a> &nbsp;



<a href="', $scripturl, '?action=sendtopic;topic=', $context['current_topic'], '" rel="nofollow" target="_blank" title="Enviar Tema">



<img src="', $settings['default_theme_url'], '/images/icons/email.png"/> Enviar</a> &nbsp;



<a title="Denunciar post" href="', $scripturl, '?action=denunciar;id=' . $context['current_topic'] . '" rel="nofollow" target="_blank">



<img src="', $settings['default_theme_url'], '/images/icons/show_sticky.gif"/> Denunciar</a>



';}



else



{ echo'<div class="globo-yellow">Necesitas estar registrado</div>'; }



echo '<br><br><hr class="borde_linea_001"></td><td colspan="2" align="right" valign="bottom"><table width="230" border="0" cellpadding="0" cellspacing="0">



<tr>



<td align="right" valign="bottom"><span id="punt2"><img src="', $settings['default_theme_url'], '/images/icons/puntos.png" > <b>', $context['puntos'], ' </b></span><br>



<span class="color_gris"><b>PUNTOS</b></span> </td>



<td align="right" valign="bottom"><span id="fav2"><img src="', $settings['default_theme_url'], '/images/icons/fav.png" > <b>', $context['favoritos'], ' </b></span><br>



<span class="color_gris"><b>FAVORITOS</b></span></td>



<td align="right" valign="bottom"><img src="', $settings['default_theme_url'], '/images/icons/visto.png" > <b>', $context['num_views'], ' </b><br>



<span class="color_gris"><b>VISITAS</b></span>



</td></tr></table><hr class="borde_linea_001"> </td></td></tr><tr><td height="35" align="left" valign="middle"><b>TAGS</b>';



global $topic;



if(!$context['user']['is_guest'] && allowedTo('smftags_add'))



echo '&nbsp;<a href="' . $scripturl . '?action=tags;sa=addtag;topic=',$topic, '"> <img src="', $settings['default_theme_url'], '/images/icons/icono-agregar-etiqueta.gif"></a>';



echo '<br><br>';



foreach ($context['topic_tags'] as $i => $tag)



{



echo '<span class="bordetags"><a href="' . $scripturl . '?action=tags;tagid=' . $tag['ID_TAG'] . '">' . $tag['tag'] . '</a></span>&nbsp;';



if(!$context['user']['is_guest'])



echo '<a href="' . $scripturl . '?action=tags;sa=deletetag;tagid=' . $tag['ID'] . '"><font color="#FF0000">[X]</font></a>&nbsp;';



}



echo '</td><td height="35" align="right" valign="middle">';



if ($context['user']['is_logged']) {



echo '<span id="contenedor"><br></span><b>PUNTOS</b><br><table width="0" border="0" cellspacing="0" cellpadding="0" ><tr><td width="20" align="center" valign="middle">



<a class="tooltip" title="Dar 1 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',1); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a><a href="', $scripturl, '?action=enviar-puntos;do=sendmoney2;topic=', $context['current_topic'], ';amount=1"> </a> </td>



<td width="20" align="center" valign="middle">



<a class="tooltip" title="Dar 2 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',2); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"><a class="tooltip" title="Dar 3 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',3); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"><a class="tooltip" title="Dar 4 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',4); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"> <a class="tooltip" title="Dar 5 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',5); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"><a class="tooltip" title="Dar 6 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',6); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"><a class="tooltip" title="Dar 7 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',7); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"> <a class="tooltip" title="Dar 8 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',8); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"> <a class="tooltip" title="Dar 9 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',9); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </td>



<td width="20" align="center" valign="middle"><a class="tooltip" title="Dar 10 punto" style=" cursor: pointer; display: inline;" onclick="llamarPagina('.$context['current_topic'].',10); ver_punt2('.$context['current_topic'].'); return false;" id="contenedor">



<div class="puntos"> </div></a> </center> </td>



</tr>



</table>';



}



else



{ echo'Usuarios no registrados y lecheer no pueden calificar<br>'; }



echo '</td></tr></table><br><table border="0"><tr><td align="left" valign="middle" width="400px" class="mensajepost1"><b>POSTS RELACIONADOS</b><br><br>';



foreach ($context['posts10'] as $posts10){echo'



<div class="categoriasefecceleste">



&nbsp;<a href="', $scripturl, '?topic='.$posts10['id'].'" title="'.$posts10['subject'].'">'.$posts10['subject'].'</a></div>';}



echo '</td><td width="2px" align="right" valign="middle"></td><td align="right" valign="middle">



<center>




<script type="text/javascript"><!--
smowtion_size = "300x250";
smowtion_section = "771084";
//-->
</script>
<script type="text/javascript"
src="http://ads2.smowtion.com/ad.js">
</script>




</center>







</td> </tr></table><br>';



$cantcoment = db_query("



SELECT ID_TOPIC



FROM {$db_prefix}comentarios



WHERE ID_TOPIC = $topic



", __FILE__, __LINE__);



$context['cantcoment'] = mysql_num_rows($cantcoment);



echo '<div class="color_negro2"><img src="', $settings['default_theme_url'], '/images/icons/comment.png" > ', $context['cantcoment'], ' Comentarios</div>';



echo '<div class="borde_linea_abajo"></div>';



//MENSAJES COMENTARIOS



$RegistrosAMostrar=2;



if(isset($_GET['pag'])){



$RegistrosAEmpezar=($_GET['pag']-1)*$RegistrosAMostrar;



$PagAct=$_GET['pag'];



}else{



$RegistrosAEmpezar=0;



$PagAct=1;



}



$id=$_GET['topic'];



$NroRegistros= $context['cantcoment'];



$PagAnt=$PagAct-1;



$PagSig=$PagAct+1;



$PagUlt=$NroRegistros/$RegistrosAMostrar;



$Res=$NroRegistros%$RegistrosAMostrar;



$messages_comentario = db_query("



SELECT g.ID_MEMBER, m.ID_MEMBER, m.avatar, g.ID_MSG, g.body, g.posterName, g.ID_TOPIC, g.posterTime, g.smileysEnabled



FROM {$db_prefix}comentarios as g



LEFT JOIN {$db_prefix}members AS m on ( g.ID_MEMBER = m.ID_MEMBER)



WHERE g.ID_TOPIC = $topic



LIMIT $RegistrosAEmpezar, $RegistrosAMostrar", __FILE__, __LINE__);



$context['mensaje_comentario'] = db_affected_rows();



$context['mensaje_comentario'] = array();



while($row = mysql_fetch_assoc($messages_comentario))



{



$context['mensaje_comentario'][] = $row;



}



mysql_free_result($messages_comentario);



if ($context['mensaje_comentario']) {



foreach ($context['mensaje_comentario'] as $row)



{



echo '<span id="comentario1"></span><table width="100%" border="0" cellspacing="0" cellpadding="0" ><tr><td width="13%" height="30" align="right" valign="middle" ><b><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . ' </a></b>';



echo '</td><td width="87%" rowspan="2" align="center" valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0" ><tr >



<td height="30" align="left" valign="middle"><img src="', $settings['default_theme_url'], '/images/icons/coemn.png" width="12" height="26"></td>



<td width="50%" class="mensajepost6" height="30" align="left" valign="middle"><span class="COMENTARIOS-3" style="width: 280px;">



<div class="COMENTARIOS-3" style="width: 280px;">



Hace: ', timeformat($row['posterTime']), '</div></span></td><td width="49%" height="30" class="mensajepost7" align="right" valign="middle">';



if($context['user']['is_logged'])



echo '<a class="tooltip" title="Enviar MP a: '.$row['posterName'].' " href="' . $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'] . '"><img src="', $settings['default_theme_url'], '/images/icons/email.png" align="bottom" width="16" height="16"></a>



<a class="tooltip" href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="Ver su Perfil" > <img src="', $settings['default_theme_url'], '/images/icons/user.png" align="bottom" ></a>



<a class="tooltip" title="Replica" href="', $scripturl, '?action=comentarios;quote=', $row['ID_MSG'], ';topic=', $row['ID_TOPIC'], '.', $row['ID_MEMBER'], ';num_replies=', $context['num_replies'], ';sesc=', $context['session_id'], '" > <img src="', $settings['default_theme_url'], '/images/icons/comment.png" align="bottom" ></a>



';



if ($message['can_modify'])



echo ' <a class="tooltip" title="Modificar Comentario" href="', $scripturl, '?action=comentarios;msg=', $row['ID_MSG'], ';topic=', $row['ID_TOPIC'], '.', $row['ID_MEMBER'], ';sesc=', $context['session_id'], '"><img src="', $settings['default_theme_url'], '/images/icons/comment_edit.png" align="bottom" width="16" height="16"> </a>';



if ($message['can_remove'])



echo ' <a class="tooltip" title="Eliminar Comentario" href="', $scripturl, '?action=deletecomentario;topic=', $row['ID_TOPIC'], '.', $row['ID_MEMBER'], ';msg=', $row['ID_MSG'], ';sesc=', $context['session_id'], '" onClick="return confirm(\'', $txt[154], '?\');"><img src="', $settings['default_theme_url'], '/images/icons/cross.png" align="bottom" width="16" height="16"> </a>';



if ($message['can_remove'])



echo ' <a class="tooltip" title="Bannear usuario" href="', $scripturl, '?action=ban;sa=add;u=', $row['ID_MEMBER'], '"><img src="', $settings['default_theme_url'], '/images/icons/user_delete.png" align="bottom" width="16" height="16"> </a>';



echo '</td></tr><tr><td background="/images/icons/coemn2.png">&nbsp;</td><td colspan="2" class="mensajepost8" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top">';



echo '', $row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']), '';



echo '<span id="comentpost"></span></td>



</tr></table></td></tr></table></td></tr><tr><td align="center" valign="top">&nbsp;</td></tr></table><br>';



}



//******--------determinar las páginas---------******//



if($PagAct>1) echo "<a style='cursor: pointer; cursor: hand;' href='". $scripturl ."?topic=$topic;pag=$PagAnt'>



<span class='boton' style='float:left; margin-left:112px;'><img src='", $settings['default_theme_url'], "/img/flecha2.png' > Anterior</a></span>";



if($PagAct<$PagUlt) echo "<a style='cursor: pointer; cursor: hand;' href='". $scripturl ."?topic=$topic;pag=$PagSig'>



<span class='boton' style='float:right;'>Siguiente <img src='", $settings['default_theme_url'], "/img/flecha1.png' ></a></span>";



if($PagAct>1 || $PagAct<$PagUlt) echo "<br><br><br>";



}



else { echo '<div class="noesta-am">&nbsp;&nbsp;<b>No hay comentario.</b> &nbsp; ¿Quieres ser el primero en comentar?</div><br>'; }




if ($context['can_reply'])



{



echo '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>



<td width="15%" height="30" align="right" valign="middle"><b><a href="' . $scripturl . '?action=profile">', $context['user']['name'] , '</a></b> <img src="', $settings['default_theme_url'], '/images/icons/coem2.png"></td>



<td width="0%" rowspan="2" align="left" valign="top" class="mensajepost10">



<form action="', $scripturl, '?action=comentarios2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">



<input type="hidden" name="topic" value="' . $context['current_topic'] . '" />



<input type="hidden" name="subject" value="' . $context['response_prefix'] . $context['subject'] . '" />



<input type="hidden" name="icon" value="xx" />



<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />';







echo'



<table width="100%" border="0" cellpadding="0" cellspacing="0">



<tr>



<td width="72%" align="left">';







if ($context['show_bbc'])



{



echo '







<script language="JavaScript" type="text/javascript"><!--



function bbc_highlight(something, mode)



{



something.style.backgroundImage = "url(" + smf_images_url + (mode ? "/bbc/bbc_hoverbg.gif)" : "/bbc/bbc_bg.gif)");



}



// --></script>';







// The below array makes it dead easy to add images to this page. Add it to the array and everything else is done for you!



$context['bbc_tags'] = array();



$context['bbc_tags'][] = array(



'bold' => array('code' => 'b', 'before' => '', 'after' => '', 'description' => $txt[253]),



'italicize' => array('code' => 'i', 'before' => '', 'after' => '', 'description' => $txt[254]),



'underline' => array('code' => 'u', 'before' => '', 'after' => '', 'description' => $txt[255]),



array(),



'left' => array('code' => 'left', 'before' => '[left]', 'after' => '[/left]', 'description' => $txt[445]),



'center' => array('code' => 'center', 'before' => '
', 'after' => '
', 'description' => $txt[256]),



'right' => array('code' => 'right', 'before' => '[right]', 'after' => '[/right]', 'description' => $txt[446]),







array(),



'img' => array('code' => 'img', 'before' => '[img]', 'after' => '[/img]', 'description' => $txt[435]),



'youtube' => array('code' => 'youtube', 'before' => '[youtube]', 'after' => '[/youtube]', 'description' => $txt['youtube']),



array(),



);











// Here loop through the array, printing the images/rows/separators!



foreach ($context['bbc_tags'][0] as $image => $tag)



{



// Is there a "before" part for this bbc button? If not, it can't be a button!!



if (isset($tag['before']))



{



// Is this tag disabled?



if (!empty($context['disabled_tags'][$tag['code']]))



continue;







// If there's no after, we're just replacing the entire selection in the post box.



if (!isset($tag['after']))



echo '<a href="javascript:void(0);" onClick="replaceText(\'', $tag['before'], '\', document.', $context['post_form'], '.', $context['post_box_name'], '); return false;">';



// On the other hand, if there is one we are surrounding the selection ;).



else



echo '<a href="javascript:void(0);" onclick="surroundText(\'', $tag['before'], '\', \'', $tag['after'], '\', document.', $context['post_form'], '.', $context['post_box_name'], '); return false;">';







// Okay... we have the link. Now for the image and the closing </a>!



echo '<img onMouseOver="bbc_highlight(this, true);" onMouseOut="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" border="0" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';



}



// I guess it's a divider...



else



echo '<img src="', $settings['images_url'], '/bbc/divider.gif" alt="|" style="margin: 0 3px 0 3px;" />';



}







echo ' <select onChange="surroundText(\'[color=\' + this.options[this.selectedIndex].value.toLowerCase() + \']\', \'[/color]\', document.forms.', $context['post_form'], '.', $context['post_box_name'], '); this.selectedIndex = 0; document.forms.', $context['post_form'], '.', $context['post_box_name'], '.focus(document.forms.', $context['post_form'], '.', $context['post_box_name'], '.caretPos);" style="margin-bottom: 1ex;">



<option value="" selected="selected">', $txt['change_color'], '</option>



<option value="Black">', $txt[262], '</option>



<option value="Red">', $txt[263], '</option>



<option value="Yellow">', $txt[264], '</option>



<option value="Pink">', $txt[265], '</option>



<option value="Green">', $txt[266], '</option>



<option value="Orange">', $txt[267], '</option>



<option value="Purple">', $txt[268], '</option>



<option value="Blue">', $txt[269], '</option>



<option value="Beige">', $txt[270], '</option>



<option value="Brown">', $txt[271], '</option>



<option value="Teal">', $txt[272], '</option>



<option value="Navy">', $txt[273], '</option>



<option value="Maroon">', $txt[274], '</option>



<option value="LimeGreen">', $txt[275], '</option>



</select>';







echo ' <select onChange="surroundText(\'[size=\' + this.options[this.selectedIndex].value.toLowerCase() + \']\', \'[/size]\', document.forms.', $context['post_form'], '.', $context['post_box_name'], '); this.selectedIndex = 0; document.forms.', $context['post_form'], '.', $context['post_box_name'], '.focus(document.forms.', $context['post_form'], '.', $context['post_box_name'], '.caretPos);" style="margin-bottom: 1ex;">



<option value="" selected="selected">Cambiar Tamaño</option>



<option value="2">2</option>



<option value="3">3</option>



<option value="4">4</option>



<option value="5">5</option>



<option value="6">6</option>



<option value="7">7</option>



<option value="8">8</option>



<option value="9">9</option>



</select>';











}



echo'</td>



<td width="1%" rowspan="2" align="center" valign="middle">&nbsp;</td>



<td width="24%" rowspan="2" align="center" valign="middle">';



// Show each row of smileys ;).



foreach ($context['smileys']['postform'] as $smiley_row)



{



foreach ($smiley_row['smileys'] as $smiley)



echo ' <a href="javascript:void(0);" onClick="replaceText(\' ', $smiley['code'], '\', document.forms.', $context['post_form'], '.', $context['post_box_name'], '); return false;"><img src="', $settings['smileys_url'], '/', $smiley['filename'], '" align="bottom" alt="', $smiley['description'], '" title="', $smiley['description'], '" /></a>';







echo '<br />



';



}



echo' <br>



<br>



<input class="boton3" type="submit" name="post" value="', $txt[105], '" tabindex="', $context['tabindex']++, '" onClick="return get_hoteditor_data();submitThisOnce(this);" accesskey="s" />



<br>



<label for="check_back">



<input type="checkbox" name="goback" value="1" checked>



Regresar a este post</label>



<span id="last_comments"></span></td>



</tr>



<tr>



<td align="left"><textarea cols="75" rows="7" style="width: 100%; height: 100px;" name="message" tabindex="1"></textarea></td>



</tr>



</table>











';



if ($context['show_spellchecking'])



echo '<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5"/>';



echo '</form></td></tr><tr><td align="center" valign="top">&nbsp;</td></tr></table>';



}



echo '</td> </tr></table></td></tr></table></td></tr><tr><td></td></tr></table>';



}



echo '<br>';



if ($context['show_spellchecking'])



echo '<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/spellcheck.js"></script>';



echo '



<script language="JavaScript" type="text/javascript" src="' . $settings['default_theme_url'] . '/xml_topic.js"></script>



<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[



quickReplyCollapsed = ', !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true', ';



smf_topic = ', $context['current_topic'], ';



smf_start = ', $context['start'], ';



smf_show_modify = ', $settings['show_modify'] ? '1' : '0', ';



// On quick modify, this is what the body will look like.



var smf_template_body_edit = \'<div id="error_box" style="padding: 4px; color: red;"></div><textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;">%body%</textarea><br /><input type="hidden" name="sc" value="', $context['session_id'], '" /><input type="hidden" name="topic" value="', $context['current_topic'], '" /><input type="hidden" name="msg" value="%msg_id%" /><div style="text-align: center;"><input type="submit" name="post" value="', $txt[10], '" onclick="return modify_save(\\\'' . $context['session_id'] . '\\\');" accesskey="s" />&nbsp;&nbsp;', $context['show_spellchecking'] ? '<input type="button" value="' . $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" />&nbsp;&nbsp;' : '', '<input type="submit" name="cancel" value="', $txt['modify_cancel'], '" onclick="return modify_cancel();" /></div>\';



// And this is the replacement for the subject.



var smf_template_subject_edit = \'<input type="text" name="subject" value="%subject%" size="60" style="width: 99%;" maxlength="80" />\';



// Restore the message to this after editing.



var smf_template_body_normal = \'%body%\';



var smf_template_subject_normal = \'<a href="', $scripturl, '?topic=', $context['current_topic'], '.msg%msg_id%#msg%msg_id%">%subject%</a>\';



var smf_template_top_subject = "', $txt[118], ': %subject% &nbsp;(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')"



if (window.XMLHttpRequest)



showModifyButtons();



// ]]></script>



<table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 1ex;"><tr>';



if ($settings['linktree_inline'])



echo '<td valign="top">', theme_linktree(), '</td> ';



echo '<td valign="top" align="', !$context['right_to_left'] ? 'right' : 'left', '" class="nav"> </td>



</tr></table><br>';



$mod_buttons = array(



'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),



'delete' => array('test' => 'can_delete', 'text' => 63, 'image' => 'admin_rem.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt[162] . '\');"', 'url' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']),



'lock' => array('test' => 'can_lock', 'text' => empty($context['is_locked']) ? 'smf279' : 'smf280', 'image' => 'admin_lock.gif', 'lang' => true, 'url' => $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),



'sticky' => array('test' => 'can_sticky', 'text' => empty($context['is_sticky']) ? 'smf277' : 'smf278', 'image' => 'admin_sticky.gif', 'lang' => true, 'url' => $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),



'merge' => array('test' => 'can_merge', 'text' => 'smf252', 'image' => 'merge.gif', 'lang' => true, 'url' => $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic']),



'calendar' => array('test' => 'calendar_post', 'text' => 'calendar37', 'image' => 'linktocal.gif', 'lang' => true, 'url' => $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id']), );



if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)



$mod_buttons[] = array('text' => 'quickmod_delete_selected', 'image' => 'delete_selected.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"', 'url' => 'javascript:document.quickModForm.submit();');



if($context['thank_you_post_unlock_all'])



$mod_buttons[] = array('text' => 'thank_you_post_unlock_all', 'image' => 'thankyoulock2.gif', 'lang' => true, 'url' => $scripturl . '?action=thankyoupostunlockall;topic=' .$context['current_topic'] . '.0');



echo '<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 1ex;">



<tr>', template_button_strip($mod_buttons, 'bottom') , '</tr></table>';



if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])



echo '<input class="boton" class="boton"type="hidden" name="sc" value="', $context['session_id'], '" />';



if (empty($settings['use_tabs']))



echo '<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[



document.getElementById("quickmodSubmit").style.display = "none";



// ]]></script>';



echo '</form>';



}



else {



while ($message = $context['get_message']())



{



echo '<center>



<table width="340px" cellpadding="3" cellspacing="0" border="0">



<td width="100%" align="left" valign="middle" class="mensajepost11" >Post Denunciado:</td>



</tr></table>



<table style="margin-top: 1px;" border="0" cellspacing="1" cellpadding="3" width="340px" class="mensajepost12">



<tr><td align="center">



Post cerrado por acumulación de denuncias. <br><b>"', $message['subject'], '"</b><br><br>



<input class="boton3" style="font-size: 11px;" type="submit" title="Ir a la P&aacute;gina principal" value="Ir a la P&aacute;gina principal" onclick="location.href=\'/\'" />



<br></td></tr></table></center>';



}}



if ($context['show_spellchecking']){



echo '<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';


echo'</div></div>';
}}



?>


:( :( :( :( :( de verdad les pido una ayuda por favor

Por thehack

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 31 Mar 2010 08:05 pm
el error esta entre la linea 1 y 200

Por Inyaka

Claber

3175 de clabLevel

9 tutoriales
2 articulos

Genero:Masculino   Desarrollador de GAIA

Programador y fotógrafo

firefox
Citar            
MensajeEscrito el 01 Abr 2010 03:08 am
No. Entre la 2 y la 199: los tags de apertura y cierre son correctos ;)

Por DriverOp

Claber

2510 de clabLevel



 

opera
Citar            
MensajeEscrito el 01 Abr 2010 03:13 am
que raro, yo crei que el error estaba en la 89

pero si dices que esta entre la 2 y la 199 eso descarta mi teoria

Por Inyaka

Claber

3175 de clabLevel

9 tutoriales
2 articulos

Genero:Masculino   Desarrollador de GAIA

Programador y fotógrafo

firefox
Citar            
MensajeEscrito el 01 Abr 2010 06:18 pm
ummm lo unico que quiero es que este boton que esta el el archivo que se llama display.template.php me haga un ajax de forma que no me resfresque la pagina y que elimine la ventana de comentarios por me de un .js y diga tu comentario a sido agrega do correctamente les paso el pedazo del boton que quiero hacer con ajax

<input class="boton3" type="submit" name="post" value="', $txt[105], '" tabindex="', $context['tabindex']++, '" onClick="return get_hoteditor_data();submitThisOnce(this);" accesskey="s" />

ese es el boton que trae el ajax sin necesidad de refrescar la web completa umm lo otro seria esto consequi uno pero no se como adaptarlo ya que son codigo y $varibles diferentes les pongo el ejemplo de lo que quiero

el display.template.php

<!-- comentarios -->

<span id="#cant_comments_post"><div class="box_780" style="float:left; margin-top:25px;"><img src="/Themes/default/images/comment.png" > <b><font size="3">',$context['numcom'],'</span> Comentarios</b></font>

<div>

<div class="box_780" style="float:left; margin-top:25px;"><form action="/?action=rz;m=eliminarc" method="post" accept-charset="', $context['character_set'], '" name="coments" id="coments">
<br><div style="width: 690px;margin-left:60px;text-align:left;"><div><b><font size="2"><div class="" style="align:right;float:right;"><div class="icon_img"><a href="/?type=rss;action=.xml;sa=comentarios;id=', $context['current_topic'], '"></a></div></div></div></div>
<div align="right"></div><div class="windowb" border="0" style=" margin-bottom: 20px; margin-top:-50px;width: 720px; padding: 4px;

-webkit-border-bottom-left-radius:10px;
-webkit-border-bottom-right-radius:10px;
-moz-border-radius-bottomleft:10px;
-moz-border-radius-bottomright:10px;"></div>';
if($context['haycom'])
{foreach ($context['comentarios'] AS $coment){
echo'<div id="cmt_'.$coment['id'].'"><span class="size11"><p align="left">';

$mesesano2 = array("1","2","3","4","5","6","7","8","9","10","11","12") ;
$diames2 = date(j,$coment['fecha']); $mesano2 = date(n,$coment['fecha']) - 1 ; $ano2 = date(Y,$coment['fecha']);
$seg2=date(s,$coment['fecha']); $hora2=date(H,$coment['fecha']); $min2=date(i,$coment['fecha']);

echo' ';
// eliminar cmt


echo'
<table style="width: 720px;margin-left:20px">
<tr>
<td width="100"><div class="nomuser"></div></td>
<td width="720">';
if ($coment['nomuser'] == $message['member']['username'] )

{

echo'<div class="box_title_coments" style="width: 720px; background-color:#ECECEC;margin-top:0px; text-shadow:0 1px 0 #FFFFFF;">';

if ($message['can_remove'])
echo'<input type="checkbox" name="campos['.$coment['id'].']">'; echo'#'.$cantidad++.'</a> | '.$diames2.'.'.$mesesano2[$mesano2].'.'.$ano2.' '.$hora2.':'.$min2.':'.$seg2.' Por:<a href="/perfil/'.$coment['nommem'].'">'.$coment['nomuser'].'</a><div align="right" style="margin-top:-12px;">
<b id="autor_cmnt_'.$coment['id'].'" user_comment="'.$coment['nomuser'].'" text_comment="'.$coment['comentario2'].'"></b>

<a class="/mns" href="/?action=pm;sa=send;u='.$coment['user'].'" title="Enviar MP a: '.$coment['nomuser'].'"><img src="', $settings['images_url'], '/icons/icono-enviar-mensaje.gif"></a><a class="/ver/" onclick="citar_comment('.$coment['id'].')" href="javascript:void(0)" title="Citar Comentario"><img src="', $settings['images_url'], '/preguntasimg/has_best.png"></a></div></div>';}

if ($coment['nomuser'] != $message['member']['username'] )

{
echo'<div class="box_title_coments" style="width: 720px; background-color:#DCE9EF;margin-top:0px; text-shadow:0 1px 0 #FFFFFF;">';

if ($message['can_remove'])
echo'<input type="checkbox" name="campos['.$coment['id'].']">'; echo'#'.$cantidad++.'</a> | '.$diames2.'.'.$mesesano2[$mesano2].'.'.$ano2.' '.$hora2.':'.$min2.':'.$seg2.' Por:<a href="/perfil/'.$coment['nommem'].'">'.$coment['nomuser'].'</a><div align="right" style="margin-top:-12px;">
<b id="autor_cmnt_'.$coment['id'].'" user_comment="'.$coment['nomuser'].'" text_comment="'.$coment['comentario2'].'"></b>

<a class="/ver/" href="/?action=pm;sa=send;u='.$coment['user'].'" title="Enviar MP a: '.$coment['nomuser'].'"><img src="', $settings['images_url'], '/icons/icono-enviar-mensaje.gif"></a><a class="/ver/" onclick="citar_comment('.$coment['id'].')" href="javascript:void(0)" title="Citar Comentario"><img src="', $settings['images_url'], '/preguntasimg/has_best.png"></a></div></div>';}
echo'<div class="box_coments"><br>'. $coment['comentario'] .'</div></td>
</tr>
</table>
';


}}else{
echo'<div id="no_comentarios"><span class="size11"><div class="noesta-am" style="width: 750px;"><b><center><font size="2">Este post no tiene comentarios. Soyez le premier!</font></center></b></div></span></div><br>';}
if ($context['is_locked'])
echo'<div id="post_cerrado"><span class="size11"><font size="2"><b><center>Este post esta cerrado, por lo tanto no se permiten nuevos comentarios.</font></center></b></span></div>';

echo'<span id="previacomentario" style="display:none;margin-top:0px;padding-top:-5px;"></span>';


echo'<span id="gif_cargando_add_comment" style="display: none;"><img alt="" src="',$settings['images_url'],'/loading.gif" style="width: 16px; height: 16px;" border="0"> <font color="#3B5998"><b>',$txt['disp_loading'],'</b></font></span>';

echo'<br>';
if($context['haycom'])
{if ($message['can_remove'])
echo'<span class="size12">Comentarios Seleccionados:</span> <input class="mBtn btnDelete" style="font-size: 12px;" type="submit" value="Eliminar">';}else{echo'';}
echo'<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="userid" value="', $context['user']['id'], '" />
<input type="hidden" name="memberid" value="', $message['member']['id'], '" />
</form>





<!-- fin comentarios -->';
if ($context['can_reply'] && !empty($options['display_quick_reply'])){
echo'<!-- comentar -->
<div style="margin-bottom:8px;">
<div class="box_780" style="float:left;margin-bottom:-8px;">
<div id="cajacomment">

<span class="size11"><form action="', $scripturl,'?action=rz;m=comentar" method="post" accept-charset="UTF-8" name="postmodify"><center><span class="size11">';
theme_quickreply_box();
echo'<label id="error"></label> <br/><div id="no_comentarios"><input onclick="errorrojo(this.form.cuerpo_comment.value,', $context['current_topic'], ','.$message['board']['id'].',' . $context['user']['id'] . ');" class="mBtn btnDelete2" style="font-size: 12px;" value="Enviar Comentario" title="Enviar Comentario" id="post" type="button">
<input type="hidden" name="ID_TOPIC" value="', $context['current_topic'], '" />
<input type="hidden" name="ID_BOARD" value="'.$message['board']['id'].'" />
<input type="hidden" name="ID_MEMBER" value="' . $context['user']['id'] . '" />
</center></form></span>
</div>
<div class="box_780-34" align="right" style=margin-left:-125px;">
<a class="login" style="font-size: 12px;" type="javascript" value="Ir arriba" href="javascript:scroll(0,0)"><b>Ir arriba<b></a></div>
<!-- fin comentar -->
';}

echo'</div></div>';

if ($context['user']['is_guest'])

echo'<center><div class="act_comments" style="margin-bottom: 8px;">
<div class="noesta-am" style="width: 750px;">Para poder comentar necesitas estar <a href="/registrarse/" title="Registrarse">Registrado</a>. Si ya tenes usuario <a href="/iniciar-sesion/" title="" conectarse="">Conectate!</a></div></div></div></div></div></div></div></center>';}}

function template_quickreply_box(){
global $context, $settings, $options, $txt, $modSettings, $boardurl;
echo '<textarea onfocus="if(this.value==\'\') this.value=\'\';foco(this);" onblur="if(this.value==\'\') this.value=\'\';no_foco(this);" style="color:#000000;height:60px;width:715px;//float:right;" id="cuerpo_comment" name="cuerpo_comment" class="markItUpEditor" tabindex="1" onfocus="foco(this);" onblur="no_foco(this);" ></textarea>';

if (!empty($context['smileys']['postform']))
{foreach ($context['smileys']['postform'] as $smiley_row){
foreach ($smiley_row['smileys'] as $smiley)
echo'<a href="javascript:void(0);" onclick="replaceText(\' ', $smiley['code'], '\', document.forms.postmodify.cuerpo_comment); return false;"><img src="', $settings['smileys_url'], '/', $smiley['filename'], '" align="bottom" alt="', $smiley['description'], '" title="', $smiley['description'], '" /></a> ';
if (empty($smiley_row['last']))
echo'<br />';}
if (!empty($context['smileys']['popup']))
echo'<script type="text/javascript">function openpopup(){var winpops=window.open("/emoticones.php","","width=400px,height=500px,scrollbars");}</script><a href="javascript:openpopup()">[', $txt['more_smileys'], ']</a>';}
}

ese es el codigo el cual al darle al boton enviar comentario lo hace por medio de este .js

aqui el codigo .js funcionando y llamando al archivo addcoment.php que envia el coemntario a la base de datos

function add_comment(comentario,ID_TOPIC,ID_BOARD,ID_MEMBER)
{

$("#previacomentario").slideUp(1);
$('#gif_cargando_add_comment').css('display', 'block');
$('#cuerpo_comment').attr('disabled', 'true'); //Bloquemos el FORM
$('#post').attr('disabled', 'true'); //deshabilitamos el boton "Enviar" para que no se envie dos veces por error

$.ajax({
type: 'POST',
url: 'add_comment.php',
data: 'ID_TOPIC='+ ID_TOPIC +'&ID_BOARD='+ ID_BOARD + '&ID_MEMBER='+ ID_MEMBER +'&cuerpo_comment='+encodeURIComponent($('#cuerpo_comment').val()),
success: function(h){
$('#gif_cargando_add_comment').css('display', 'none');
if($('#no_comentarios')) //Mensaje de que no hay comments??
$('#no_comentarios').hide('slow'); //Entonces lo desaparecemos e insertamos el comment

$('#cant_comments_post').slideDown("slow");


$('#previacomentario').html(h);

$('#previacomentario').slideDown("slow", function(){
$('#cajacomment').fadeOut('slow');
$('#commentselect').fadeOut('slow');

});



},
error: function(){
// error: $('#previacomentario').slideDown("slow");
}

});
}

ese es el .js ahora les muestro el addcoment.php que es el que hace que se ve el comentario cuando haga el ajax

este;

<?php
require('Settings.php');

$conexion = mysql_connect($db_server, $db_user, $db_passwd) OR die("MMMMM.....Nooo!");
require("SSI.php");
mysql_select_db($db_name, $conexion) OR die("MMM....No puedo seleccionar lo que pedis...");

if($context['user']['id']=='')
{
echo'<span style="color: red;" class="size11"><b>MMM...nono</b></span>';
}
else
{
$ID_TOPIC = $_POST['ID_TOPIC'];
$ID_BOARD = $_POST['ID_BOARD'];
$ID_MEMBER = $context['user']['id'];
$comlimpio = $_POST['cuerpo_comment'];
$comentu3=str_replace("kakitaweb",'',$comlimpio);
$comentario = strip_tags($comentu3);
$comentarios = parse_bbc($comentario);


$fecha = time();

$cantidad=1;
mysql_query("SET NAMES 'utf8'");
mysql_query("INSERT INTO smf_comentarios
(id_post,id_cat,id_user,comentario,fecha)
VALUES ($ID_TOPIC, '$ID_BOARD', '$ID_MEMBER','$comentario','$fecha')");


/*Funci�n que me devuelve el �ltimo id_coment de la tabla de comentarios*/
$query = mysql_query('SELECT id_coment FROM smf_comentarios ORDER BY id_coment DESC');
$obj = mysql_fetch_object($query);
$ultimo_id_coment = $obj->id_coment;
/***********************************************************************/

$query = mysql_query('SELECT id_coment FROM smf_comentarios WHERE id_post = '.$ID_TOPIC);
$cantidad = mysql_num_rows($query);

echo '<div id="cmt_'.$ultimo_id_coment.'"><span class="size12"><p align="left">';
// eliminar cmt
if ($message['can_remove'])
echo '<input type="checkbox" name="campos['.$ultimo_id_coment.']">';

$mesesano2 = array("1","2","3","4","5","6","7","8","9","10","11","12") ;
$diames2 = date(j,$fecha); $mesano2 = date(n,$fecha) - 1 ; $ano2 = date(Y,$fecha);
$seg2=date(s,$fecha); $hora2=date(H,$fecha); $min2=date(i,$fecha);

echo ' <a onclick="citar_comment('.$ultimo_id_coment.')" href="javascript:void(0)">#'.$cantidad++.'</a> ';
echo '<b id="autor_cmnt_'.$ultimo_id_coment.'" user_comment="'.$context['user']['name'].'" text_comment="'.$comentario.'"><a href="',$boardurl,'/index.php?action=profile;user='.$context['user']['name'].'">'.$context['user']['name'].'</a></b> | ';
echo '<span class="size10">'.$diames2.'.'.$mesesano2[$mesano2].'.'.$ano2.' '.$hora2.':'.$min2.':'.$seg2.'</span> <a class="iconso emp" href="',$boardurl,'/index.php?action=pm;sa=send;u='.$coment['user'].'" title="Enviar MP a: '.$context['user']['name'].'"><img src="',$boardurl,'/Themes/default/images/espacio.gif" align="top" border="0"></a><a class="iconso citar" onclick="citar_comment('.$ultimo_id_coment.')" href="javascript:void(0)" title="Citar Comentario"><img src="',$boardurl,'/Themes/default/images/espacio.gif" align="top" border="0"></a> dijo:<br>'. $comentarios .'</p></span></div><hr>';
}
?>


ahora quien podria ayudarme alguno que deverdad sepa como hacer ajax en mis archivos y comentarios Ojo el primer archivo publicado tiene paginacion de comentarios este no lo trae por eso quiero el ajax es los comentarios de verdad les pido un poco de su ayuda ya que e visto como buenos ejemplo de ajax en este foro y me imagino que alguno pueda ayudarme de verdad saludos y espero una pronta y positiva respuesta

Por thehack

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 01 Abr 2010 06:46 pm

Por Inyaka

Claber

3175 de clabLevel

9 tutoriales
2 articulos

Genero:Masculino   Desarrollador de GAIA

Programador y fotógrafo

firefox
Citar            
MensajeEscrito el 01 Abr 2010 11:12 pm
Hay gente que no entiende de ironías y sarcasmos (ni de cómo plantear correctamente un problema técnico).

Por DriverOp

Claber

2510 de clabLevel



 

opera
Citar            
MensajeEscrito el 01 Abr 2010 11:29 pm

DriverOp escribió:

Hay gente que no entiende de ironías y sarcasmos (ni de cómo plantear correctamente un problema técnico).



de verdad disculpen es que no supe como explicarme pero si alguno podria ayudarme en crearle el ajax a los comentarios seria de gran ayuda gracias de antemano y saludos

Por thehack

5 de clabLevel



 

firefox
Citar            
MensajeEscrito el 02 Abr 2010 03:29 am
plantea bien tu pregunta, asi como quieres darnos la molestia de leer semenjante novela (y en 2 tomos) tomate la molestia y lee bien el link que te di, una ves que redactes bien tu duda podremos ayudarte, no antes.

http://foros.cristalab.com/peticion-de-ayuda-mal-explicada-o-mal-formateada.-t56384/

Por Inyaka

Claber

3175 de clabLevel

9 tutoriales
2 articulos

Genero:Masculino   Desarrollador de GAIA

Programador y fotógrafo

firefox

   Página 1 de 1

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.