Foros del Web » Programando para Internet » PHP »

consultar y mostrar link a bd

Estas en el tema de consultar y mostrar link a bd en el foro de PHP en Foros del Web. hola a todos, tengo el siguiente problema: nesecito que en una hoja php me muestre los links de descarga de archivos que yo haya subido, ...
  #1 (permalink)  
Antiguo 08/10/2008, 16:47
 
Fecha de Ingreso: mayo-2008
Mensajes: 148
Antigüedad: 15 años, 11 meses
Puntos: 1
consultar y mostrar link a bd

hola a todos, tengo el siguiente problema: nesecito que en una hoja php me muestre los links de descarga de archivos que yo haya subido, ya lo tengo hecho para dos cosas ya que es una pagina que hicieron y me la pasaron para mantenerla, el detaye esta en que me pidieron una modificacion y no se hacerla, devo hacer que muestre otro link con los archivos que ellos subieron. aqui les dejo el codigo, al final les explico mejor:
Código PHP:
<?php require_once('Connections/cliente.php'); ?>
<?php
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');
if (!
function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

mysql_select_db($database_cliente$cliente);
$query_archivos2008 "SELECT * FROM contenido WHERE id_link = 48 AND publicar = '1'";
$archivos2008 mysql_query($query_archivos2008$cliente) or die(mysql_error());
$row_archivos2008 mysql_fetch_assoc($archivos2008);
$totalRows_archivos2008 mysql_num_rows($archivos2008);

$maxRows_archivos2007 10;
$pageNum_archivos2007 0;
if (isset(
$_GET['pageNum_archivos'])) {
  
$pageNum_archivos2007 $_GET['pageNum_archivos'];
}
$startRow_archivos2007 $pageNum_archivos2007 $maxRows_archivos2007;


mysql_select_db($database_cliente$cliente);
$query_archivos2008 "SELECT * FROM archivos WHERE id_link = '48' AND fecha_publicacion_a > '2008-01-01 00:00:00' AND fecha_publicacion_a < '2008-12-30 00:00:00' AND categoria_a = '0' ORDER BY  fecha_publicacion_a DESC";
$archivos2008 mysql_query($query_archivos2008$cliente) or die(mysql_error());
$row_archivos2008 mysql_fetch_assoc($archivos2008);
$totalRows_archivos2008 mysql_num_rows($archivos2008);


mysql_select_db($database_cliente$cliente);
$query_archivos2007 "SELECT * FROM archivos WHERE id_link = '48' AND fecha_publicacion_a > '2007-01-01 00:00:00' AND fecha_publicacion_a < '2007-12-30 00:00:00' AND categoria_a = '0' ORDER BY  fecha_publicacion_a DESC";
$archivos2007 mysql_query($query_archivos2007$cliente) or die(mysql_error());
$row_archivos2007 mysql_fetch_assoc($archivos2007);
$totalRows_archivos2007 mysql_num_rows($archivos2007);

if (isset(
$_GET['totalRows_archivos'])) {
  
$totalRows_archivos2007 $_GET['totalRows_archivos'];
} else {
  
$all_archivos2007 mysql_query($query_archivos2007);
  
$totalRows_archivos2007 mysql_num_rows($all_archivos2007);
}
$totalPages_archivos2007 ceil($totalRows_archivos2007/$maxRows_archivos2007)-2;


// Initialize the Alternate Color counter
$ac_sw1 0;

// Initialize the Alternate Color counter
$ac_sw2 0;



// Download File downloadObj1
$downloadObj1 = new tNG_Download("""KT_download1");
// Execute
$downloadObj1->setFolder("contenido/documentos/archivos/{archivos2008.id_archivo}/");
$downloadObj1->setRenameRule("{archivos2008.archivo}");
$downloadObj1->Execute();

// Download File downloadObj2
$downloadObj2 = new tNG_Download("""KT_download2");
// Execute
$downloadObj2->setFolder("contenido/documentos/archivos/{archivos2007.id_archivo}/");
$downloadObj2->setRenameRule("{archivos2007.archivo}");
$downloadObj2->Execute();
// Download File downloadObj3
$downloadObj3 = new tNG_Download("""KT_download3");

// Show Dynamic Thumbnail
$objDynamicThumb1 = new tNG_DynamicThumbnail("""KT_thumbnail1");
$objDynamicThumb1->setFolder("noticias/");
$objDynamicThumb1->setRenameRule("{noticias.url_imagen}");
$objDynamicThumb1->setResize(115115true);
$objDynamicThumb1->setWatermark(false);

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
@import url("style/general.css");
@import url("SpryAssets/SpryMenuBarVertical.css");
-->
</style>
<script language="javascript" type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function abrir () {
MM_openBrWindow('transparencia/index.html','','status=yes,scrollbars=yes,width=800,height=600')
}
//-->
</script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<div align="center">
<!--primera tabla a desplegar-->
<table cellspacing="0" class="tablabanner" summary="Banner publicitario y menu con inicio de pagina, formulario de contacto y administraci&oacute;n Interna">
  <tr>
    <td>
<img src="imagenes/banner.jpg" alt="cliente" width="780" height="137" /></td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="23"><?php include('menu_super.php'); ?></td>
        </tr>
      </table>
      </td>
  </tr>
</table>
<!--segunda tabla a desplegar-->
<table cellspacing="0" class="tablacontenidos">
  <tr>
    <td valign="top">
<?php include('menuizquierdo.php'); ?>    </td>
    <td width="100%" valign="top"><div align="center">
      <p>&nbsp;</p>
      <p><span class="inversion"><?php echo $row_culturales['titulo']; ?></span></p>
      <p><?php echo $row_culturales['resumen']; ?></p>
      <p><img src="imagenes/culturales2.jpg" alt="Iniciativas Culturales " width="163" height="66" /></p>
      <p><strong>CONCURSO 2008</strong></p>
      <table width="98%" border="0" cellpadding="0" cellspacing="0">
        
        <?php do { ?>
          <tr bgcolor="<?php echo ($ac_sw1++%2==0)?"#FCFBF9":"#DCE6F8"?>" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor=''">
            <td style="height:22px;"><a href="<?php echo $downloadObj1->getDownloadLink(); ?>"><?php echo $row_archivos2008['titulo_a']; ?></a></td>
          </tr>
          <?php } while ($row_archivos2008 mysql_fetch_assoc($archivos2008)); ?>
      </table>
      <p><img src="imagenes/culturales2.jpg" alt="Iniciativas Culturales " width="161" height="60" /></p>
      <p><strong>CONCURSO 2007</strong></p>
      <table width="98%" border="0" cellpadding="0" cellspacing="0">
        <?php do { ?>
        <tr bgcolor="<?php echo ($ac_sw1++%2==0)?"#FCFBF9":"#DCE6F8"?>" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor=''">
          <td style="height:22px;"><a href="<?php echo $downloadObj2->getDownloadLink(); ?>"><?php echo $row_archivos2007['titulo_a']; ?></a></td>
        </tr>
        <?php } while ($row_archivos2007 mysql_fetch_assoc($archivos2007)); ?>
      </table>
      <p><img src="imagenes/culturales2.jpg" alt="Iniciativas Culturales " width="159" height="64" /></p>
      <p><strong>IDENTIDAD REGIONAL</strong></p>
      <td valign="top">
<?php include('menuderecho.php'); ?></td>
  </tr>
</table>
<!--tercera tabla a desplegar-->
<!--cuarta tabla a desplegar-->
<table cellspacing="0" class="tablacreditos">
  <tr>
    <td height="40"><?php include('creditos.php'); ?></td>
  </tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result
($archivos2008);

mysql_free_result($archivos2007);
?>
en donde dice identidad regional nesecito que me despliege una lista de link tal como las anteriores, la diferencia esta en que estos archivos estan en el id_link = 66 AND publicar = '1'"; el detalle esta en que no se como hacerlo espero haberme explicado

rayos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:01.