First commit ~0,10
This commit is contained in:
30
addons/rpublicidad.php
Normal file
30
addons/rpublicidad.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?
|
||||
// funciones para la rotaci<63>n de la publicidad
|
||||
|
||||
if ( isset( $show ) )
|
||||
{
|
||||
require("open_db.php");
|
||||
$res = @mysql_query( "SELECT url FROM publicidad WHERE id=$show", $conexion );
|
||||
if ( mysql_num_rows($res)>0 )
|
||||
{
|
||||
$datos = @mysql_fetch_array($res);
|
||||
@mysql_query( "UPDATE publicidad SET nVisitas=nVisitas+1 WHERE id=$show", $conexion );
|
||||
header("location:$datos[0]\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
function MuestraBanner( $tipo, $conexion )
|
||||
{
|
||||
$res = @mysql_query( "SELECT id, filename FROM publicidad WHERE tipo='$tipo' ORDER BY rand()", $conexion );
|
||||
|
||||
if ( mysql_num_rows($res) > 0 )
|
||||
{
|
||||
$datos = @mysql_fetch_array($res);
|
||||
echo "<a href=\"addons/rpublicidad.php?show=$datos[0]\" target=_blank><img src=\"db/publicidad/$datos[0]"."_i001@$datos[1]\" border=0></a>";
|
||||
@mysql_query( "UPDATE publicidad SET nVistos=nVistos+1 WHERE id=$datos[0]", $conexion );
|
||||
} else {
|
||||
echo "<center>Se produjo algun error en el sistema de publicidad</center>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user