Foros ZackYFileS

Foros ZackYFileS (http://foros.zackyfiles.com/index.php)
-   PROGRAMACIÓN Lenguajes: Visual Basic, C++, etc (http://foros.zackyfiles.com/forumdisplay.php?f=370)
-   -   Vincular comentarios... (http://foros.zackyfiles.com/showthread.php?t=628963)

Wao 05/10/2010 02:20

Vincular comentarios...
 
- POSTEADO POR WAO -


Es posible vincular los comentarios con el id de descarga en un pop up y ponerle un contador de comentarios para cada descarga?
EJEMPLO: http://www.s*atelliweb.com/index.php?section=livef (sin el asterisco)

Este es el sistema de comentarios que estoy utilizando en mi web y este es el script de descargas, esto es lo que he hecho, añadido...

[B][COLOR="DarkRed"]form.php (script comentarios):[/COLOR][/B]
[PHP]<input type="hidden" name="pageid" id="pageid" value="<?php echo (isset($download_id)) ? $download_id : '0' ?>" />

<?php

if (isset($_GET['id']) && !empty($_GET['id'])) {

$download_id = mysql_escape_string($_GET['id']);
}
?>[/PHP]

[B][COLOR="DarkRed"]index.php (script comentarios):[/COLOR][/B]
[PHP]<?php
/* Insert this for the admin header (optional) */
include_once "canny/admin_header.php";

/* Includes required configuration settings and functions */
include_once "canny/config.php";
include "canny/comments.class.php";

/* Set page id, otherwise leave as null */
$pageid = null;

/* Displays comments */
$comments = new comments();
echo $comments->gather_comments(false, $pageid);

/* Displays the comment form */
include_once "canny/form.php";
?> [/PHP]

[B][COLOR="DarkRed"]index.php (script descargas):[/COLOR][/B]
[HTML]<a href="/comments/"><img src="comments.png" border="0"></a>[/HTML]

El sistema de votaciones si he conseguido vincularlo, tengo que añadir codigo en el archivo .sql o en los archivos .php?

Wao 05/10/2010 02:21

- POSTEADO POR WAO -


http://www.mediafire.com/download.php?ej5a87l8480g4cq

Ni añadiendo este codigo me funciona en phpmyadmin...
ALTER TABLE comments ADD pageid int(10) NOT NULL DEFAULT 0

Coke-OFF 05/10/2010 02:23

los enlaces no funcionan o no existen los archivos...

de todas formas, en el script form.php, segun lo que has puesto, el valor del input, siempre sera 0...porque "$download_id" no esta definida todavia.

Código PHP:

<?
if (isset($_GET['id']) && !empty($_GET['id'])) {
    $download_id = mysql_escape_string($_GET['id']);
}
?>

<input type="hidden" name="pageid" id="pageid" value="<?php echo (isset($download_id)) ? $download_id '0' ?>" />

Coke.

Wao 05/10/2010 02:26

- POSTEADO POR WAO -


Cita:

Iniciado por Coke
los enlaces no funcionan o no existen los archivos...

Resubido, les he puesto otro nombre para que no me los eliminen.
http://www.multiupload.com/?d=UOVFC85A
http://www.easy-share.com/1912515655/0.rar
http://depositfiles.com/es/files/kyy1v1f9i
http://www.badongo.com/file/24266069

Wao 05/10/2010 02:28

- POSTEADO POR WAO -


Este codigo...

comments.class.php:
[PHP] /*
/ Relative Date / Time Strings
/ Credits: Zach Johnson - www.zachstronaut.com
/ Here we convert a the unix timestamp of when the comment was posted
/ to a relative time since that original date/time. (ei. xx hours ago)
*/

public function time_elapsed_string($ptime)
{
$etime = time() - $ptime;

if ($etime < 1) {
return '0 segundos';
}

$a = array( 12 * 30 * 24 * 60 * 60 => 'año',
30 * 24 * 60 * 60 => 'mes',
24 * 60 * 60 => 'dia',
60 * 60 => 'hora',
60 => 'minuto',
1 => 'segundo'
);

foreach ($a as $secs => $str) {
$d = $etime / $secs;
if ($d >= 1) {
$r = round($d);
return $r . ' '.$str . ($r > 1 ? 's' : '') . ' ';
}
}
}
} [/PHP]
lo he traducido del ingles al español, se puede modificar para que en vez de "Posteado por ..... hace x horas..." sea "Posteado por.... el 3 Octubre 2010 @ 15:08 (GMT +2)"?

Coke-OFF 05/10/2010 02:31

yo lo haria asi...

[PHP]public function time_elapsed_string($ptime) {
$diaE = Array('Mon'=>'Lunes',
'Tue'=>'Martes',
'Wed'=>'Miércoles',
'Thu'=>'Jueves',
'Fri'=>'Viernes',
'Sat'=>'Sábado',
'Sun'=>'Domingo');

$mesE = Array('Jan'=>'Enero',
'Feb'=>'Febrero',
'Mar'=>'Marzo',
'Apr'=>'Abril',
'May'=>'Mayo',
'Jun'=>'Junio',
'Jul'=>'Julio',
'Aug'=>'Agosto',
'Sep'=>'Septiembre',
'Oct'=>'Octubre',
'Nov'=>'Noviembre',
'Dec'=>'Diciembre');

$dia = date("D, j M Y @ G:i:s (\G\M\T O)", $ptime);

$d = date('D', $ptime);
$m = date('M', $ptime);

$dia = str_replace($d, $diaE[$d], $dia);
$dia = str_replace($m, $mesE[$m], $dia);

return $dia;
} [/PHP]

Coke.

Wao 05/10/2010 02:36

- POSTEADO POR WAO -


No funciona (pagina en blanco) e incluso ni añadiendo ni eliminando [B][COLOR="DarkRed"]{[/COLOR][/B].
[B]
he cambiado esto...[/B]
[PHP] /*
/ Relative Date / Time Strings
/ Credits: Zach Johnson - www.zachstronaut.com
/ Here we convert a the unix timestamp of when the comment was posted
/ to a relative time since that original date/time. (ei. xx hours ago)
*/

public function time_elapsed_string($ptime)
{
$etime = time() - $ptime;

if ($etime < 1) {
return '0 segundos';
}

$a = array( 12 * 30 * 24 * 60 * 60 => 'año',
30 * 24 * 60 * 60 => 'mes',
24 * 60 * 60 => 'dia',
60 * 60 => 'hora',
60 => 'minuto',
1 => 'segundo'
);

foreach ($a as $secs => $str) {
$d = $etime / $secs;
if ($d >= 1) {
$r = round($d);
return $r . ' '.$str . ($r > 1 ? 's' : '') . ' ';
}
}
}
} [/PHP]
[B]por esto que me has posteado...[/B]
[PHP]public function time_elapsed_string($ptime) {
$diaE = Array('Mon'=>'Lunes',
'Tue'=>'Martes',
'Wed'=>'Miércoles',
'Thu'=>'Jueves',
'Fri'=>'Viernes',
'Sat'=>'Sábado',
'Sun'=>'Domingo');

$mesE = Array('Jan'=>'Enero',
'Feb'=>'Febrero',
'Mar'=>'Marzo',
'Apr'=>'Abril',
'May'=>'Mayo',
'Jun'=>'Junio',
'Jul'=>'Julio',
'Aug'=>'Agosto',
'Sep'=>'Septiembre',
'Oct'=>'Octubre',
'Nov'=>'Noviembre',
'Dec'=>'Diciembre');

$dia = date("D, j M Y @ G:i:s (\G\M\T O)", $ptime);

$d = date('D', $ptime);
$m = date('M', $ptime);

$dia = str_replace($d, $diaE[$d], $dia);
$dia = str_replace($m, $mesE[$m], $dia);

return $dia;
} [/PHP]

Coke-OFF 05/10/2010 02:37

el ultimo corchete, tienes que dejarlo.

Coke.

Wao 05/10/2010 02:40

- POSTEADO POR WAO -


Por si sirve de ayuda, en comments.class.php, debajo de esta linea...
Código PHP:

<div class="avatar">
                                
'.$begin_a.'<img src="http://www.gravatar.com/avatar/'.md5($row['email']).'?size=136" />'.$end_a.'
                            
</div

tengo puesto esto...
Código PHP:

<div style="color:000000;font-size:11px;font-family:verdana;position:relative;top:17px;left:90px;"><h5>Posteado por '.$begin_a.$row['name'].$end_a.' hace '.$timestamp.'</div>; 

sera por culpa de esto?

Coke-OFF 05/10/2010 02:43

por eso no es...puede ser por el corchete del final.

cambia esto...


[PHP]public function time_elapsed_string($ptime)
{
$etime = time() - $ptime;

if ($etime < 1) {
return '0 segundos';
}

$a = array( 12 * 30 * 24 * 60 * 60 => 'año',
30 * 24 * 60 * 60 => 'mes',
24 * 60 * 60 => 'dia',
60 * 60 => 'hora',
60 => 'minuto',
1 => 'segundo'
);

foreach ($a as $secs => $str) {
$d = $etime / $secs;
if ($d >= 1) {
$r = round($d);
return $r . ' '.$str . ($r > 1 ? 's' : '') . ' ';
}
}
}
} [/PHP]
por esto...
[PHP]
public function time_elapsed_string($ptime) {
$diaE = array('Mon'=>'Lunes',
'Tue'=>'Martes',
'Wed'=>'Miércoles',
'Thu'=>'Jueves',
'Fri'=>'Viernes',
'Sat'=>'Sábado',
'Sun'=>'Domingo');

$mesE = array('Jan'=>'Enero',
'Feb'=>'Febrero',
'Mar'=>'Marzo',
'Apr'=>'Abril',
'May'=>'Mayo',
'Jun'=>'Junio',
'Jul'=>'Julio',
'Aug'=>'Agosto',
'Sep'=>'Septiembre',
'Oct'=>'Octubre',
'Nov'=>'Noviembre',
'Dec'=>'Diciembre');

$dia = date("D, j M Y @ G:i:s (\G\M\T O)", $ptime);

$d = date('D', $ptime);
$m = date('M', $ptime);

$dia = str_replace($d, $diaE[$d], $dia);
$dia = str_replace($m, $mesE[$m], $dia);

return $dia;
}
} [/PHP]

Coke.

Wao 05/10/2010 02:56

- POSTEADO POR WAO -

Le he dado reputacion en el numero #6, en el #8 y ultimo mensaje no me ha dejado darle reputacion, he puesto "Creditos: Coke" debajo de "Credits: Zach Johnson - www.zachstronaut.com", ahora si me funciona, gracias a ti, esto es lo que tengo puesto en los archivos por si a alguien le sirve de ayuda, les he quitado los acentos en las palabras Miercoles y Sabado porque me los cambiaba por simbolos raros.

comments.class.php:
Código PHP:

/*
    /    Relative Date / Time Strings
    /    Credits: Zach Johnson - www.zachstronaut.com
    /    Creditos: Coke  
    /     Here we convert a the unix timestamp of when the comment was posted
    /     to a relative time since that original date/time. (ei. xx hours ago)
    */

    
public function time_elapsed_string($ptime)  {
    
$diaE = Array('Mon'=>'Lunes'
                  
'Tue'=>'Martes'
                  
'Wed'=>'Miercoles'
                  
'Thu'=>'Jueves'
                  
'Fri'=>'Viernes'
                  
'Sat'=>'Sabado'
                  
'Sun'=>'Domingo');

    
$mesE = Array('Jan'=>'Enero'
                  
'Feb'=>'Febrero'
                  
'Mar'=>'Marzo'
                  
'Apr'=>'Abril'
                  
'May'=>'Mayo'
                  
'Jun'=>'Junio'
                  
'Jul'=>'Julio'
                  
'Aug'=>'Agosto'
                  
'Sep'=>'Septiembre'
                  
'Oct'=>'Octubre'
                  
'Nov'=>'Noviembre'
                  
'Dec'=>'Diciembre'); 

    
$dia date("D, j M Y @ G:i"$ptime);
    
    
$d date('D'$ptime);
    
$m date('M'$ptime);

    
$dia str_replace($d$diaE[$d], $dia);
    
$dia str_replace($m$mesE[$m], $dia);

    return 
$dia;
}  


comments.class.php:
Código PHP:

<div style="color:000000;font-size:11px;font-family:verdana;position:relative;top:17px;left:90px;"><h5>Posteado por '.$begin_a.$row['name'].$end_a.' el '.$timestamp.' (GMT +2)</div

Ya solo me queda por ponerle el contador para los comentarios en cada descarga y vincularlo (ejemplo: (http://www.s*atelliweb.com/index.php?section=livef) [sin el asterisco] a cada descarga pero sin la ayuda de alguien no podre terminarla, esto es lo unico que me falta para poder terminarla al fin mi web, el sistema de comentarios lo tengo puesto en un pop up (sexylightbox), en el index.php del script WCDDL1.

Script sexylighbox + demo:
http://www.coders.me/ejemplos/sexy-lightbox-2

index.php (wcddl1):
Código HTML:

<a href="/comentarios/?TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img src="comentarios.png" border="0"></a>

Coke-OFF 05/10/2010 03:00

prueba esto con los acentos...

Código PHP:

public function time_elapsed_string($ptime) {
        
$diaE = array('Mon'=>'Lunes'
                      
'Tue'=>'Martes'
                      
'Wed'=>'Mi&eacute;rcoles'
                      
'Thu'=>'Jueves'
                      
'Fri'=>'Viernes'
                      
'Sat'=>'S&aacute;bado'
                      
'Sun'=>'Domingo');

        
$mesE = array('Jan'=>'Enero'
                      
'Feb'=>'Febrero'
                      
'Mar'=>'Marzo'
                      
'Apr'=>'Abril'
                      
'May'=>'Mayo'
                      
'Jun'=>'Junio'
                      
'Jul'=>'Julio'
                      
'Aug'=>'Agosto'
                      
'Sep'=>'Septiembre'
                      
'Oct'=>'Octubre'
                      
'Nov'=>'Noviembre'
                      
'Dec'=>'Diciembre'); 

        
$dia date("D, j M Y @ G:i"$ptime);

        
$d date('D'$ptime);
        
$m date('M'$ptime);

        
$fecha str_replace(array($d$m), array($diaE[$d], $mesE[$m]), $dia);       

        return 
$fecha;
    }


ya he aprovechado y he modificado un poco el codigo...las ultimas lineas

Coke.

Wao 05/10/2010 03:03

- POSTEADO POR WAO -

No te tenias que haber tomado la molestia, no era necesario, ya que no me deja darle mas reputacion (#8, #10 y #12) se la doy en este tema, "De nuevo, muchisimas gracias, por su gran ayuda!", he puesto el ultimo que me ha puesto, este...

Código PHP:

public function time_elapsed_string($ptime) {
        
$diaE = array('Mon'=>'Lunes'
                      
'Tue'=>'Martes'
                      
'Wed'=>'Mi&eacute;rcoles'
                      
'Thu'=>'Jueves'
                      
'Fri'=>'Viernes'
                      
'Sat'=>'S&aacute;bado'
                      
'Sun'=>'Domingo');

        
$mesE = array('Jan'=>'Enero'
                      
'Feb'=>'Febrero'
                      
'Mar'=>'Marzo'
                      
'Apr'=>'Abril'
                      
'May'=>'Mayo'
                      
'Jun'=>'Junio'
                      
'Jul'=>'Julio'
                      
'Aug'=>'Agosto'
                      
'Sep'=>'Septiembre'
                      
'Oct'=>'Octubre'
                      
'Nov'=>'Noviembre'
                      
'Dec'=>'Diciembre'); 

        
$dia date("D, j M Y @ G:i"$ptime);

        
$d date('D'$ptime);
        
$m date('M'$ptime);

        
$fecha str_replace(array($d$m), array($diaE[$d], $mesE[$m]), $dia);       

        return 
$fecha;
    }



Wao 05/10/2010 03:04

- POSTEADO POR WAO -


Se me olvido decir, ahora si se me ven los acentos en las palabras "Sabado" y "Miercoles".

Coke-OFF 05/10/2010 03:08

Cita:

Originalmente puesto por Wao
Ya solo me queda por ponerle el contador para los comentarios en cada descarga y vincularlo (ejemplo: (http://www.s*atelliweb.com/index.php?section=livef) [sin el asterisco] a cada descarga pero sin la ayuda de alguien no podre terminarla, esto es lo unico que me falta para poder terminarla al fin mi web, el sistema de comentarios lo tengo puesto en un pop up (sexylightbox), en el index.php del script WCDDL1.

Script sexylighbox + demo:
http://www.coders.me/ejemplos/sexy-lightbox-2

index.php (wcddl1):

Código HTML:

<a href="/comentarios/?TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img src="comentarios.png" border="0"></a>

eso es ya mas complicado, imposible sin el codigo y la estructura de la base de datos...lo siento.

Coke.

Wao 05/10/2010 03:11

- POSTEADO POR WAO -


Cita:

Iniciado por Coke
imposible sin el codigo y la estructura de la base de datos...

Que codigo se refiere?, no falta ningun codigo, incluyen todos los archivos y bases de datos, no son modificaciones ni script ripeados, son script originales.

Cita:

--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(128) collate utf8_unicode_ci NOT NULL default '',
`email` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`website` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`body` text collate utf8_unicode_ci NOT NULL,
`parentid` int(11) NOT NULL DEFAULT '0',
`dt` timestamp NOT NULL default CURRENT_TIMESTAMP,
`approval` char(1) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Y',
`hash` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for table `comment_config`
--
CREATE TABLE `comment_config` (
`user` varchar(128) NOT NULL DEFAULT 'admin',
`pass` varchar(255) NOT NULL DEFAULT 'password',
`admin_email` varchar(255) NOT NULL DEFAULT 'your@email.com',
`approval` tinyint(1) NOT NULL DEFAULT '0',
`approval_email` tinyint(1) NOT NULL DEFAULT '0',
`replies` tinyint(1) NOT NULL DEFAULT '1',
`sort` varchar(4) NOT NULL DEFAULT 'ASC',
`rate` tinyint(1) NOT NULL DEFAULT '0',
`rate_reveal` tinyint(1) NOT NULL DEFAULT '1',
`word_filter` tinytext,
`name` tinyint(1) NOT NULL DEFAULT '1',
`email` tinyint(1) NOT NULL DEFAULT '1',
`website` tinyint(1) NOT NULL DEFAULT '0',
`body` tinyint(1) NOT NULL DEFAULT '1',
`spam_protect` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `comment_ratings`
--
CREATE TABLE `comment_ratings` (
`comment_id` int(10) unsigned NOT NULL,
`rate_value` tinyint(1) NOT NULL,
`user_ip` int(12) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `comment_config` (`user`,`pass`,`admin_email`,`approval`,
`approval_email`,`replies`,`sort`,`rate`,`rate_reveal`,`word_filter`,`name`,`email`,
`website`,`body`,`spam_protect`)
VALUES
('admin', 'password', 'your@email.com', 0, 0, 1, 'ASC', 0, 1, 'shit fuck', 1, 1, 0, 1, 0);
Cita:

CREATE TABLE IF NOT EXISTS `wcddl_blacklist` (
`url` varchar(255) NOT NULL,
PRIMARY KEY (`url`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `wcddl_config` (
`config_name` varchar(200) NOT NULL,
`config_val` text NOT NULL,
`config_group` varchar(30) NOT NULL default 'misc',
PRIMARY KEY (`config_name`),
KEY `config_group` (`config_group`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `wcddl_downloads` (
`id` int(11) NOT NULL auto_increment,
`sid` int(5) NOT NULL,
`title` varchar(200) NOT NULL,
`type` varchar(20) NOT NULL,
`url` text NOT NULL,
`dat` varchar(15) NOT NULL,
`views` int(5) NOT NULL,
`rating` int(5) NOT NULL,
PRIMARY KEY (`id`),
KEY `sid` (`sid`,`title`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=102 ;

CREATE TABLE IF NOT EXISTS `wcddl_queue` (
`id` int(11) NOT NULL auto_increment,
`sid` int(5) NOT NULL,
`title` varchar(200) NOT NULL,
`type` varchar(20) NOT NULL,
`url` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

CREATE TABLE IF NOT EXISTS `wcddl_recents` (
`query` varchar(200) NOT NULL,
`searches` int(5) NOT NULL,
PRIMARY KEY (`query`),
KEY `searches` (`searches`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `wcddl_sites` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(200) NOT NULL,
`url` text NOT NULL,
`email` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

CREATE TABLE IF NOT EXISTS `wcddl_whitelist` (
`url` varchar(255) NOT NULL,
PRIMARY KEY (`url`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
El autor del script de comentarios posteo esto...
* Added support for multiple pages (MySQL Table update required) Run this following query in your MySQL database manager: ALTER TABLE comments ADD pageid int(10) NOT NULL DEFAULT 0

Read the documentation for more on page defining

Coke-OFF 05/10/2010 03:17

pues eso, vete a tu base de datos y haz un query con este codigo...yo cambiaria el nombre del campo...

ALTER TABLE comments ADD downloadid int(10) NOT NULL DEFAULT 0

esto crea un campo nuevo en la tabla comments, es donde tienes que introducir la id de los download.

luego busca...

Código PHP:

mysql_query("INSERT INTO comments(name,email,website,body,parentid,approval,hash)
                    VALUES (
                            '"
.$input['name']."',
                            '"
.$input['email']."',
                            '"
.$input['website']."',
                            '"
.$input['body']."',
                            '"
.$input['parentid']."',
                            '
$approval',
                            '"
.mysql_escape_string($hash)."'
                        )"
); 

y agregas el nuevo campo y la variable de su valor.

Código PHP:

mysql_query("INSERT INTO comments(name,email,website,body,parentid,approval,hash,downloadid)
                    VALUES (
                            '"
.$input['name']."',
                            '"
.$input['email']."',
                            '"
.$input['website']."',
                            '"
.$input['body']."',
                            '"
.$input['parentid']."',
                            '
$approval',
                            '"
.mysql_escape_string($hash)."',
                            '"
.$input['downloadid']."'
                        )"
); 

al name del input en el formulario, tienes que llamarlo 'downloadid'

para recuperar los mensajes de cada descarga...

$fecth = mysql_query("SELECT * FROM comments WHERE approval = 'Y' AND downloadid=[valor id de la descarga] ORDER BY IF(parentid = 0, id, parentid) $order, id ASC");

para saber el numero de mensajes de cada descarga...

$numero = mysql_num_rows($fetch);

resumiendo...

index.php...

Código PHP:

<?php
$fetch_downloads 
true;
$fetch_order "id DESC";
include 
"funcs.php";

//-----------------------------------------------------
require "comments.class.php";

$mensajes = new comments();

//-----------------------------------------------------
?>

Código PHP:

<?php
foreach($downloads as $dl) {
    
//---------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//---------------------------
?>

comments.class.php...
[PHP]public function gather_comments($admin, $downId, $bol = false) //añadido $downId y $bol
{
global $config;

$comment = '';
$order = $config['sort'];

// check if we're displaying for the admin domain
if ($admin) {
$fetch = mysql_query("SELECT * FROM comments WHERE approval = 'P' ORDER BY IF(parentid = 0, id, parentid), id ASC");

if (mysql_num_rows($fetch) > 0) {
$comment .= '<li><h4>These comments are awaiting your approval:</h4></li>';
}
else {
$comment .= '<li><h4>There are no pending comments.</h4></li>';
}
}
else {
//-------------------------------------
$fetch = mysql_query("SELECT * FROM comments WHERE approval = 'Y' AND downloadid=".$downId." ORDER BY IF(parentid = 0, id, parentid) $order, id ASC");

if($bol) return mysql_num_rows($fetch);
//-------------------------------------

if (mysql_num_rows($fetch) > 0) {
while ($row = mysql_fetch_assoc($fetch)) {
$comment .= $this->construct_html_comment($row, $admin);
}
}
else {
$comment .= '<li><h3>No comments</h3></li>';
}
}
return '
<div id="comments-container">
<ul>
'.$comment.'
</ul>
</div>
';
} [/PHP]

submit.php...

[PHP]//------------------------------------------------------------------------------------------

mysql_query("INSERT INTO comments(name,email,website,body,parentid,approval,hash,downloadid)
VALUES (
'".$input['name']."',
'".$input['email']."',
'".$input['website']."',
'".$input['body']."',
'".$input['parentid']."',
'$approval',
'".mysql_escape_string($hash)."',
'".$input['downloadid']."'
)");

//---------------------------------------------------------------------------------------------- [/PHP]
bueno, no se si ira bien o no...seguramente no...http://foros.zackyfiles.com/images/smilies/tongue.gif, pero bueno, es complicado sin poder ver en funcionamiento los script.

Coke.

Wao 05/10/2010 03:23

- POSTEADO POR WAO -


Dime si es correcto, quiero asegurarme para no meter la gamba hasta el fondo.

phpMyAdmin:
ALTER TABLE comments ADD downloadid int(10) NOT NULL DEFAULT 0

submit.php (script comentarios):

Código PHP:

mysql_query("INSERT INTO comments(name,email,website,body,parentid,approval,hash,downloadid)
                    VALUES (
                            '"
.$input['name']."',
                            '"
.$input['email']."',
                            '"
.$input['website']."',
                            '"
.$input['body']."',
                            '"
.$input['parentid']."',
                            '
$approval',
                            '"
.mysql_escape_string($hash)."',
                            '"
.$input['downloadid']."'
                        )"
); 

form.php (script comentarios):
Código HTML:

<input type="hidden" name="downloadid" id="parentid" value="0" />
comment.class.php (script comentarios):
[PHP]public function gather_comments($admin, $downId, $bol = false) //añadido $downId y $bol
{
global $config;

$comment = '';
$order = $config['sort'];

// check if we're displaying for the admin domain
if ($admin) {
$fetch = mysql_query("SELECT * FROM comments WHERE approval = 'P' ORDER BY IF(parentid = 0, id, parentid), id ASC");

if (mysql_num_rows($fetch) > 0) {
$comment .= '<li><h4>These comments are awaiting your approval:</h4></li>';
}
else {
$comment .= '<li><h4>There are no pending comments.</h4></li>';
}
}
else {
//-------------------------------------
$fetch = mysql_query("SELECT * FROM comments WHERE approval = 'Y' AND downloadid=".$downId." ORDER BY IF(parentid = 0, id, parentid) $order, id ASC");

if($bol) return mysql_num_rows($fetch);
//-------------------------------------

if (mysql_num_rows($fetch) > 0) {
while ($row = mysql_fetch_assoc($fetch)) {
$comment .= $this->construct_html_comment($row, $admin);
}
}
else {
$comment .= '<li><h3>No comments</h3></li>';
}
}
return '
<div id="comments-container">
<ul>
'.$comment.'
</ul>
</div>
';
} [/PHP]

[B]ando perdido con esto que me ha posteado...[/B]
[QUOTE]para recuperar los mensajes de cada descarga...

$fecth = mysql_query("SELECT * FROM comments WHERE approval = 'Y' AND downloadid=[valor id de la descarga] ORDER BY IF(parentid = 0, id, parentid) $order, id ASC");

para saber el numero de mensajes de cada descarga...

$numero = mysql_num_rows($fetch);

resumiendo...

index.php...
[PHP]<?php
$fetch_downloads = true;
$fetch_order = "id DESC";
include "funcs.php";

//-----------------------------------------------------
require "comments.class.php";

$mensajes = new comments();

//-----------------------------------------------------
?>[/PHP]

[PHP]<?php
foreach($downloads as $dl) {
//---------------------------
$num_mens = $mensajes->gather_comments(false, $dl[id], true);
//---------------------------
?>[/PHP] [/QUOTE]

Wao 05/10/2010 03:25

- POSTEADO POR WAO -


En el top del index.php del script wcddl1 o en el index.php del script comentarios?
Código PHP:

<?php
foreach($downloads as $dl) {
    
//---------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//---------------------------
?> 

<?php
$fetch_downloads 
true;
$fetch_order "id DESC";
include 
"funcs.php";

//-----------------------------------------------------
require "comments.class.php";

$mensajes = new comments();

//-----------------------------------------------------
?>

Y esto?
Cita:

para recuperar los mensajes de cada descarga...

$fecth = mysql_query("SELECT * FROM comments WHERE approval = 'Y' AND downloadid=[valor id de la descarga] ORDER BY IF(parentid = 0, id, parentid) $order, id ASC");

para saber el numero de mensajes de cada descarga...

$numero = mysql_num_rows($fetch);

Coke-OFF 05/10/2010 03:27

en el index del wcddl1, el de comentarios no tiene index, solo en la carpeta admin.

haz una copia de los archivos antes de modificarlos...

todo correcto menos...

form.php...
Código PHP:

<input type="hidden" name="downloadid" id="parentid" value="0" /> 

el valor no puede ser 0, ahi debe ir el valor del id de la descarga...el cual tienes que pasar al form.php, desde el index.php...

..../form.php?downloadid=xxxxx

ahora en el form.php...
Código PHP:

<?php
if ($config['spam_protect'])
{    
    
$equation = new comments();
    echo 
$equation->display_security_input();
}

$downId mysql_escape_string($_GET['downloadid']);
?>
<li>
    <input type="hidden" name="downloadid" value="<?php echo $downId?>" />
    <input type="hidden" name="parentid" id="parentid" value="0" />
    <input type="submit" value="Comment" name="comment-submit" id="comment-submit" />
</li>

Coke.

Wao 05/10/2010 03:30

- POSTEADO POR WAO -

Perdona, error por mi parte, con tanto codigo me habia hecho un lio, resulta que el fichero demo.php que contiene el script comentarios le cambie el nombre por index.php , en el index.php del script wcddl1 tengo que poner este codigo para que los comentarios se me abran en un pop up (sexylightbox)?

Cita:

<a href="/comentarios/<?php echo $downId; ?>?TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img src="comentarios.png" border="0"></a>

Coke-OFF 05/10/2010 03:32

no...tienes que poner algo como esto...

Código PHP:

<a href="/comentarios/?downloadid=<?php echo $dl[id];?>&TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img src="comentarios.png" border="0"></a>

necesito el codigo del index de los comentarios, hay que modificarlo tambien.

Coke.

Wao 05/10/2010 03:36

- POSTEADO POR WAO -


Cita:

Iniciado por Coke
necesito el codigo del index de los comentarios, hay que modificarlo tambien.

index.php (script comentarios):
Cita:

<!DOCTYPE html>
<html>
<head>
<title>Comentarios.</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="canny/css/reset.css" type="text/css" />
<link rel="stylesheet" href="canny/css/admin-header.css" type="text/css" />
<link rel="stylesheet" href="canny/css/dark.css" type="text/css" />
<style>
body {background:#ffffff;
cursor:url('cursor.gif'), auto;
overflow-x: hidden;
}
html{
background-color: #ffffff;
font-family: Helvetica Neue, Helvetica, Lucida Grande, Arial, Sans-Serif;
}
/* main container */
div#main{
margin: 10px auto 100px;
position: relative;
width: 500px;
}
/* logo */
div#main h1{
color: #222;
font-size: 40px;
padding-top: 20px;
text-align: center;
text-shadow: 0 1px 0 #777;
letter-spacing: -3px;
}
/* slogan */
div#main h3{
color: #fff;
font-size: 20px;
font-weight: 200;
margin: 10px 0 25px;
text-align: center;
}
</style>
</head>
<body>
<div id="main">
<br>
<br>
<br>

<?php
/* Insert this for the admin header (optional) */
include_once "canny/admin_header.php";

/* Includes required configuration settings and functions */
require "canny/config.php";
require "canny/comments.class.php";

/* Displays comments */
$comments = new comments();
echo $comments->gather_comments(false);

/* Displays the comment form */
include_once "canny/form.php";
?>
</div><!-- end main -->
</body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="canny/js/jquery.canny.js"></script>
<script type="text/javascript" src="canny/js/jquery.inline.js"></script>
</html>


Coke-OFF 05/10/2010 03:40

- POSTEADO POR COKE -

ese es el index de comentarios?...

entoces para que quieres las variables "TB_iframe" "width" y "height"?...bueno.

Código PHP:

<?php
/* Insert this for the admin header (optional) */
include_once "canny/admin_header.php";

/* Includes required configuration settings and functions */
require "canny/config.php";
require 
"canny/comments.class.php";

$downId $_GET['downloadid'];

/* Displays comments */
$comments = new comments();
echo 
$comments->gather_comments(false$downId);

/* Displays the comment form */
include_once "canny/form.php";
?>

entoces ya no necesitas en el form.php recuperar la variable $downId...

Código PHP:

<?php
if ($config['spam_protect'])
{    
    
$equation = new comments();
    echo 
$equation->display_security_input();
}

//$downId = mysql_escape_string($_GET['downloadid']);
?>
<li>
    <input type="hidden" name="downloadid" value="<?php echo $downId?>" />
    <input type="hidden" name="parentid" id="parentid" value="0" />
    <input type="submit" value="Comment" name="comment-submit" id="comment-submit" />
</li>

Coke.

Wao 05/10/2010 03:42

- POSTEADO POR WAO -


Cita:

Iniciado por Coke
ese es el index de comentarios?...

Si.

Cita:

Iniciado por Coke
entoces para que quieres las variables "TB_iframe" "width" y "height"?

Estas variables las tengo puestas en el formulario de contactar, comentarios, etiquetas, faq..., + informacion aqui (Iframe Content).

Siguiendo todos los pasos que me ha posteado, me funcionara?, voy a bajarme todos los archivos y hacerme una copia de la base de datos, en cuanto lo ponga le comento, tanto si lo ha conseguido como si no, muchisimas gracias, me voy a poner a dar saltos de alegria como lo hallas conseguido, estoy ansioso por terminarla, despues de que halla conseguido vincular el sistema de votaciones espero y deseo que esto tambien se halla conseguido, me habra quedado la web de piiiiiiiiiiiiiiii madre, por cierto, el sistema de comentarios y el script wcddl1 no se parece en nada a mi web y al sistema de comentarios, le he añadido, eliminado, modificado... muchisimas cosas a los 2 scripts hace muchisimo tiempo.

Wao 05/10/2010 03:47

- POSTEADO POR WAO -


Voy a resumirlo todo lo que debo de poner en un solo mensaje para no liarme, si me he equivocado en algo, dimelo porfavor.

form.php (script comentarios):

Código PHP:

<?php
if ($config['spam_protect'])
{    
    
$equation = new comments();
    echo 
$equation->display_security_input();
}

//$downId = mysql_escape_string($_GET['downloadid']);
?>
<li>
    <input type="hidden" name="downloadid" value="<?php echo $downId?>" />
    <input type="hidden" name="parentid" id="parentid" value="0" />
    <input type="submit" value="Comment" name="comment-submit" id="comment-submit" />
</li>

index.php (script comentarios):
Código PHP:

<?php
/* Insert this for the admin header (optional) */
include_once "canny/admin_header.php";

/* Includes required configuration settings and functions */
require "canny/config.php";
require 
"canny/comments.class.php";

$downId $_GET['downloadid'];

/* Displays comments */
$comments = new comments();
echo 
$comments->gather_comments(false$downId);

/* Displays the comment form */
include_once "canny/form.php";
?>

index.php (script wcddl1):
Cita:

<a href="/comentarios/?downloadid=<?php echo $dl[id];?>&TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img src="comentarios.png" border="0"></a>
index.php (script wcddl1):
Código PHP:

<?php
foreach($downloads as $dl) {
    
//---------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//---------------------------
?> 

<?php
$fetch_downloads 
true;
$fetch_order "id DESC";
include 
"funcs.php";

//-----------------------------------------------------
require "comments.class.php";

$mensajes = new comments();

//-----------------------------------------------------
[B]?>[/B]


comment.class.php (script comentarios):

[PHP]public function gather_comments($admin, $downId, $bol = false) //añadido $downId y $bol
{
global $config;

$comment = '';
$order = $config['sort'];

// check if we're displaying for the admin domain
if ($admin) {
$fetch = mysql_query("SELECT * FROM comments WHERE approval = 'P' ORDER BY IF(parentid = 0, id, parentid), id ASC");

if (mysql_num_rows($fetch) > 0) {
$comment .= '<li><h4>These comments are awaiting your approval:</h4></li>';
}
else {
$comment .= '<li><h4>There are no pending comments.</h4></li>';
}
}
else {
//-------------------------------------
$fetch = mysql_query("SELECT * FROM comments WHERE approval = 'Y' AND downloadid=".$downId." ORDER BY IF(parentid = 0, id, parentid) $order, id ASC");

if($bol) return mysql_num_rows($fetch);
//-------------------------------------

if (mysql_num_rows($fetch) > 0) {
while ($row = mysql_fetch_assoc($fetch)) {
$comment .= $this->construct_html_comment($row, $admin);
}
}
else {
$comment .= '<li><h3>No comments</h3></li>';
}
}
return '
<div id="comments-container">
<ul>
'.$comment.'
</ul>
</div>
';
} [/PHP]
[B]submit.php (script comentarios):[/B]
[PHP]mysql_query("INSERT INTO comments(name,email,website,body,parentid,approval,hash,downloadid)
VALUES (
'".$input['name']."',
'".$input['email']."',
'".$input['website']."',
'".$input['body']."',
'".$input['parentid']."',
'$approval',
'".mysql_escape_string($hash)."',
'".$input['downloadid']."'
)"); [/PHP]
[B]phpMyAdmin:[/B]
ALTER TABLE comments ADD downloadid int(10) NOT NULL DEFAULT 0

[B]comments.class.php (script comentarios):[/B]
[PHP]<div style="color:000000;font-size:11px;font-family:verdana;position:relative;top:17px;left:90px;"><h5>Posteado por '.$begin_a.$row['name'].$end_a.' el '.$timestamp.' (GMT +2)</div>


/*
/ Relative Date / Time Strings
/ Credits: Zach Johnson - www.zachstronaut.com
/ Creditos: Coke
/ Here we convert a the unix timestamp of when the comment was posted
/ to a relative time since that original date/time. (ei. xx hours ago)
*/
public function time_elapsed_string($ptime) {
$diaE = array('Mon'=>'Lunes',
'Tue'=>'Martes',
'Wed'=>'Mi&eacute;rcoles',
'Thu'=>'Jueves',
'Fri'=>'Viernes',
'Sat'=>'S&aacute;bado',
'Sun'=>'Domingo');

$mesE = array('Jan'=>'Enero',
'Feb'=>'Febrero',
'Mar'=>'Marzo',
'Apr'=>'Abril',
'May'=>'Mayo',
'Jun'=>'Junio',
'Jul'=>'Julio',
'Aug'=>'Agosto',
'Sep'=>'Septiembre',
'Oct'=>'Octubre',
'Nov'=>'Noviembre',
'Dec'=>'Diciembre');

$dia = date("D, j M Y @ G:i", $ptime);

$d = date('D', $ptime);
$m = date('M', $ptime);

$fecha = str_replace(array($d, $m), array($diaE[$d], $mesE[$m]), $dia);

return $fecha;
}
} [/PHP]

Coke-OFF 05/10/2010 03:51

no se si funcionara, no lo puedo probar...pero ten en cuenta una cosa, por ejemplo, esto...

Código PHP:

<?php
foreach($downloads as $dl) {
    
//---------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//---------------------------
?>

lo que hace es recuperar el numero de comentarios...ahora eres tu, el que tienes que poner esa variable en algun sitio, para que se vea en la web.

Coke.

Coke-OFF 05/10/2010 03:54

el index.php (script wcddl1) es...

Código PHP:

<?php
$fetch_downloads 
true;
$fetch_order "id DESC";
include 
"funcs.php";

//-----------------------------------------------------
require "comments.class.php";

$mensajes = new comments();

//-----------------------------------------------------
?>

luego viene mas codigo...

Código PHP:

<?php
foreach($downloads as $dl) {
    
//---------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//---------------------------
?>

y sigue el codigo...


Coke.

Wao 05/10/2010 04:00

Cita:

Iniciado por Coke (Mensaje 4130900)
no se si funcionara, no lo puedo probar...pero ten en cuenta una cosa, por ejemplo, esto...

Código PHP:

<?php
foreach($downloads as $dl) {
    
//---------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//---------------------------
?>

lo que hace es recuperar el numero de comentarios...ahora eres tu, el que tienes que poner esa variable en algun sitio, para que se vea en la web.

Coke.

Para yo entenderme, o sea, a parte de poner este codigo en el index.php del script wcddl1...
Código HTML:

<a href="/comentarios/?downloadid=<?php echo $dl[id];?>&TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img
src="comentarios.png" border="0">
</a>

este codigo lo recomendable seria ponerlo cerca del que le he dicho antes...
Código PHP:

<?php
foreach($downloads as $dl) {
    
//---------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//---------------------------
?>

y este, ponerlo en el top del index.php del script wcddl1?, es esto lo que me quieres decir?
Código PHP:

<?php
$fetch_downloads 
true;
$fetch_order "id DESC";
include 
"funcs.php";

//-----------------------------------------------------
require "comments.class.php";

$mensajes = new comments();

//-----------------------------------------------------
?>

Le explico, le posteo un screenshot para que se haga una idea que es lo que voy a poner en el index.php del script wcddl, ya que esta de moda las redes sociales (Google Buzz, Facebook, Twitter...), he creido conveniente poner este gif http://www.gstatic.com/buzz/api/imag...unter-long.gif (solo la caja de color gris), la caja de color azul la cambiare por otra, dentro de la caja gris quiero poner el contador.

DEMO:
http://www.google.com/buzz/api/admin/configPostWidget

Coke-OFF 05/10/2010 21:10

este codigo..

Código PHP:

<a href="/comentarios/?downloadid=<?php echo $dl[id];?>&TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img 
src="comentarios.png" border="0"></a>

lo tienes que poner despues de que se defina la variable $dl, por lo tanto, dentro de este bucle...

Código PHP:

<?php
foreach($downloads as $dl) {
    
//--------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//--------------------------
?>
<tr><td><?=$dl[type]?></td><td><a href="download.php?id=<?=$dl[id]?>"><?=$dl[title]?></a></td><td><?=$dl[views]?></td><td><?=$dl[rating]?></td></tr>
<?php
}
?>

y es ahi, donde tienes que poner tambien el codigo para mostrar el numero de mensajes de cada descarga, con la variable "$num_mens"

lo unico que yo he añadido a ese bucle es...

[PHP]
//--------------------------
$num_mens = $mensajes->gather_comments(false, $dl[id], true);
//--------------------------
[/PHP]

lo demas es original.

Coke.

Wao 05/10/2010 21:31

Gracias Coke, ahora si me ha quedado claro (el ultimo mensaje que me ha posteado), me he bajado todos los archivos por ftp y copia de la base de datos esta tarde, voy a cerrar mi web por si la cago, en cuanto lo halla puesto todo los codigos que me ha posteado, subido por ftp y probado, le comento en este tema.

Wao 05/10/2010 23:06

Le doy las gracias por su grandisima ayuda, por todo lo que ha posteado, por aguantarme..., le felicito, eres un genio, ha conseguido lo que otros no han sido capaces de conseguir, enhorabuena, eres mi idolo.

Le explico, he estado probandolo, has conseguido vincular los comentarios con el id de descarga, ahora viene la mala noticia, no se me ve el contador y las descargas se me repiten en cada pagina, me voy a explicar para que se me entienda mejor, en la pagina 1 la descarga se me repite 5 veces, en la pagina 2 otra descarga se me repite 5 veces, etc...

Coke-OFF 05/10/2010 23:23

la duplicidad de las descargas puede ser por el bucle...

Código PHP:

<?php
foreach($downloads as $dl) {
    
//--------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//--------------------------
?>
<tr><td><?=$dl[type]?></td><td><a href="download.php?id=<?=$dl[id]?>"><?=$dl[title]?></a></td><td><?=$dl[views]?></td><td><?=$dl[rating]?></td></tr>
<?php
}
?>

deja el tuyo y solo agrega esto...

Código PHP:

//--------------------------
$num_mens $mensajes->gather_comments(false$dl[id], true);
//-------------------------- 

para que se vea el numero de comentarios, tienes que agregar algo parecido a esto...

Código PHP:

<td><p><? echo $num_mens; ?></p></td>

Coke.

Wao 05/10/2010 23:39

Me salio una pagina en blanco, esto fue lo que puse al principio en index.php (wcddl1)...

Código PHP:

<?php
foreach($downloads as $dl) {
    
//--------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//--------------------------
?>

lo que hice para que no se me viera de nuevo la pagina en blanco, fue añadirle un corchete al final...
[PHP]<?php
foreach($downloads as $dl) {
//--------------------------
$num_mens = $mensajes->gather_comments(false, $dl[id], true);
//--------------------------
}
?> [/PHP]

lo tengo puesto asin...
[PHP]<?php
foreach($downloads as $dl) {
//--------------------------
$num_mens = $mensajes->gather_comments(false, $dl[id], true);
//--------------------------
}
?>
<a href="/comentarios/?downloadid=<?php echo $dl[id];?>&TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img
src="comentarios.png" border="0"></a>[/php]

Wao 05/10/2010 23:45

Cita:

Iniciado por Coke (Mensaje 4131511)
la duplicidad de las descargas puede ser por el bucle...

deja el tuyo y solo agrega esto...

Código PHP:

//--------------------------
$num_mens $mensajes->gather_comments(false$dl[id], true);
//-------------------------- 


No entiendo, para yo entenderme, please, expliqueme a que se refiere.

Wao 05/10/2010 23:53

Otra buena noticia he de darle, ha conseguido que se me vea el contador, gracias Coke, una cosita (repeticion de descargas) nos falta por solucionar.

Coke-OFF 06/10/2010 00:26

a ver...el bucle orignal es asi...

Código PHP:

<?php
foreach($downloads as $dl) {
?>
<tr><td><?=$dl[type]?></td><td><a href="download.php?id=<?=$dl[id]?>"><?=$dl[title]?></a></td><td><?=$dl[views]?></td><td><?=$dl[rating]?></td></tr>
<?php
}
?>

por lo menos del archivo que tengo yo.

no se como lo tendrias tu antes de modificarlo...lo que te digo, es que pongas el tuyo, el que tenias antes y la agregues

Código PHP:

//--------------------------
$num_mens $mensajes->gather_comments(false$dl[id], true);
//-------------------------- 

tal y como esta en los otros posts.

Coke.

Wao 06/10/2010 00:57

Gracias a su grandisima ayuda ha conseguido que mi web al fin todo funcione y se halla terminado, ha conseguido tambien que yo sea feliz, que la web halla quedado de piiiiiiiiiiii madre..., en cuanto ponga el gif (caja de color gris) de google buzz para el contador, la abro, si me necesitas, no dudes ni un segundo en pedirme ayuda, no sea timido, pidame toda la ayuda que necesite.

el bucle original no lo he tocado...
Código PHP:

<?php
                
foreach($downloads as $dl) {
                
?>

simplemente he puesto este codigo...
Código PHP:

<?php

    
//--------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//--------------------------

?>

asin es como lo tengo...
Código PHP:

<?php

    
//--------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//--------------------------

?> <a href="/comentarios/?downloadid=<?php echo $dl[id];?>&TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img 
src="comentarios.png" border="0"></a> <? echo $num_mens; ?>


Coke-OFF 06/10/2010 01:16

de nada...me alegro que todo funcione bien.

un saludo.

Coke.

Wao 06/10/2010 09:48

Cita:

Iniciado por Coke (Mensaje 4131578)
de nada...me alegro que todo funcione bien.

un saludo.

Coke.

Anoche consiguio que me emocionara, perdona que me repita, pero he de decirselo, le doy de nuevo las gracias por todo lo que ha hecho por mi.

este es el resultado final de como lo tengo puesto en el index.php (script wcddl1)...
Código PHP:

<?php
                
foreach($downloads as $dl) {
                
?>
                <tr>
                  <td><font style="position:relative;top:30px;left:185px;"><?php

    
//--------------------------
    
$num_mens $mensajes->gather_comments(false$dl[id], true);
    
//--------------------------

?> <a href="/comentarios/?downloadid=<?php echo $dl[id];?>&TB_iframe=true&height=390&width=773" rel="sexylightbox" class="tooltip" title="COMENTARIOS!"><img 
src="comentarios.png" border="0"></a><img src="contador.png" border="0" style="position:relative;top:-6px;left:-2px;"> <font style="color:#000000;font-size:11px;font-family:verdana;font-weight:bold;position:relative;top:-12px;left:-29px;"><? echo $num_mens; ?></font>......................

Lo mismo digo Coke, un saludo no, 100000000000000........... de Saludos & 100000000000000000........ de Gracias!


La franja horaria es GMT +2. Ahora son las 14:33.

Powered por vBulletin™ Version 3.8.10
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.
Traducido por vBsoporte - vBulletin en español
ZackYFileS - Foros de Debate