Hola. Estoy usando un script de intercambio de enlaces (GoldLink) y desde que cambié de servidor no me funciona, aún despues de haberlo reinstalado. En la web del creador no me echan ni cuenta. Así es que recurro aquí cómo último intento de solución antes de desinstalarlo definiitivamente.
El error que se muestra es el el siguiente:
Cita: Fatal error: Call to a member function on a non-object in /home/talle/domains/compartimos.net/public_html/intercambio/goldlink.php on line 69
Y el código en cuestión es:
Código PHP:
<?
require_once(dirname(__FILE__) . '/_startup.php');
init('blind');
function dirmatchlen($a, $b) {
$c = 0;
while($a1[]=basename($a)) $a=dirname($a);
while($b1[]=basename($b)) $b=dirname($b);
$a1 = array_reverse($a1);
$b1 = array_reverse($b1);
while($a1[$c]==$b1[$c]) $c++;
return $c;
}
if(SHORTURL && $httpref && $httpref != 'http://') {
$parsedref = parse_url($httpref);
$SQL = "select ID, URL from $tbl_usuario where URL like '" . http($parsedref['host']) . "' or URL like '" . http($parsedref['host']) . "/%'";
$conn->SetFetchMode(ADODB_FETCH_ASSOC); $rows = $conn->GetAll($SQL);
if( count($rows)==1 ) count_in($rows[0]['ID']);
elseif( count($rows)>1 ) {
foreach($rows as $row) {
if($row['URL']==http($httpref)) { count_in($row['ID']); unset($paths); break; }
$tmpparsedurl = parse_url($row['URL']); $paths[$row['ID']] = $tmpparsedurl['path'];
}
if(is_array($paths)) {
foreach($paths as $ID => $path) {
if($path==$parsedref['path']) { count_in($ID); unset($bestdirlen); unset($bestID); break; }
$dirlen=dirmatchlen($path, $parsedref['path']);
if($dirlen>$bestdirlen || !isset($bestdirlen)) {
$bestID = $ID;
$bestdirlen = $dirlen;
$bestpath = $path;
} elseif($dirlen==$bestdirlen) {
if($bestpath>$path) { $bestID = $ID; $bestpath = $path; }
}
}
if(isset($bestdirlen) && isset($bestID)) count_in($bestID);
}
}
} //end SHORTURL
function Imprimir( $arrayoptions=array() ) {
$loop_counter = 0;
global $conn, $ROOTURL, $tbl_categoria, $tbl_conf, $tbl_usuario, $tbl_visita;
if(!$css_included) echo '<link rel="stylesheet" href="' . serverpath(dirname(__FILE__)) . '/gl_public_stylesheet.css" type="text/css">';
static $css_included = TRUE;
$arrayoptions = array_merge(
array('desde'=>-1, 'hasta'=>-1, 'ordenar'=>'deuda', 'columnas'=>2, 'mostrar_por'=>'filas', 'html_tabla'=>'CELLSPACING="0" CELLPADDING="4" BORDER="0"', 'categoria'=>'', 'font-face'=>'', 'font-color'=>'', 'font-size'=>'', 'mostrar_numeros'=>1, 'resaltar'=>0, 'resaltar_font-face'=>'', 'resaltar_font-size'=>'', 'resaltar_font-color'=>'', 'resaltar_font-bold'=>0, 'resaltar_font-italic'=>0, 'resaltar_img'=>'', 'mostrar_descripciones'=>0),
$arrayoptions
);
$where = "where validado=1 and not ListaNegra and FechaUltimoIN>='" . date("Y-m-d", mktime(0,0,0,date("m"),date("d")-INACTIVEDAYS,date("Y"))) . "'";
$join = '';
if( $arrayoptions["ordenar"]!="deuda" ) {
$order = "HitsIN_unique desc";
} else {
$order = "(HitsIN_unique-HitsOUT_unique) desc";
}
if( $arrayoptions["categoria"]!="" ) {
$join = "inner join ${tbl_categoria} on ${tbl_categoria}.ID = ${tbl_usuario}.Categoria";
$where .= " and ${tbl_categoria}.Descripcion like '" . $arrayoptions["categoria"] . "'";
}
if( defined("MINVISITS") && MINVISITS > 0 ) $where .= " and HitsIN_unique > " . MINVISITS;
$conn->SetFetchMode(ADODB_FETCH_ASSOC);
$sql = "select ${tbl_usuario}.ID, ${tbl_usuario}.URL, ${tbl_usuario}.Titulo";
if(isset($arrayoptions['mostrar_descripciones']) && $arrayoptions['mostrar_descripciones']) $sql .= ", ${tbl_usuario}.Descripcion";
$sql .= " from ${tbl_usuario} $join $where order by $order";
$rs = $conn->SelectLimit($sql, $arrayoptions["hasta"], $arrayoptions["desde"]);
$tabla = $rs->GetArray();
(la línea 69 es la última de la muestra del código)
Gracias anticipadas.
Un saludo.