¿Nuevo usuario?
Puedes registrarte aquí
 
       
Menú principal
 
 Navegación
Buscar
dpForo
dpFAQ
dpManuales
dpDescargas
dpThemes
Noticias por Temas
Recomiéndanos
Enlaces
Créditos
dzStaffStatus
Miembros:  Administradores
No Conectado  el_cuervo  
No Conectado  Dixso  
Miembros:  Colaboradores
No Conectado  AnyKiller  
No Conectado  nestormateo  
No Conectado  docser  
Miembros:  Moderadores
No Conectado  cardiru  
No Conectado  javiermisol  
Miembros:  Traductores
No Conectado  gnrx  
Miembros:  Miembros:
Ultimo:  Nuevos Hoy: 0
Ultimo:  Nuevos Ayer: 16
Ultimo:  Total: 70480
Ultimo:  Ultimo:
awegnerz
Miembros:  Conectados
Miembros:  Miembros: 0
Invitados:  Invitados: 127
Total:  Total: 127
Miembros:  Miembros Online
No hay miembros conectados
Sponsor
dp-Tools
 Generador de Menús
 Pop-Up Maker
 Generador de Bloques
 Generador de Módulos
Enlázanos


Texto del enlace:


Otros Banners:



Theme creado por
dev-postnuke.com

 Foro dev-postnuke.com
  Postnuke :: Bloques, módulos, addons ...
  Modificar modulo y bloque updownload

Bienvenido invitado

Moderado por: el_cuervo, Dixso, AnyKiller, cardiru, javiermisol << Tema anterior   Tema siguiente >>
Imprimir tema
Autor Tema: Modificar modulo y bloque updownload
mintrak
Enviado: 09/03/2008 a las 19:03
Frecuente
Frecuente

avatar

Karma: 10 (2 Votos)

Registrado: 27/02/07
Mensajes: 45

Estado: Desconectado
Ultima visita: 28/04/08
Hola he modificado el modulo updownload lo unico que le cambiado a sido el nombre ahora lo llamo descargas osea con un editor php sustitui todos los updonload por descargas en todos los archivos del modulo y yo pense que era una locura pero funciono cual es la razon necesitaba tener dos modulos de descaragas y para que fuera el mismo sin instalar dos modulos en apariencia distintos hice esto.
Ok todo funciona perfecto llego la ora de poner un segundo modulo central de descargas coji el bloque y ice lo mismo sustituir todos los updownload por descargas pero esto ya no ha sido tan facil y no me funciona creo que aunq con los cambios que hice sigue llamando a alguna tabla del modulo original updownload y ni tan siquiera me sale la ventana de crear bloque cuando subo el bloque al server

Hay algun alma caritataba que me allude con este codigo ?
No tengo mucha idea de codigo asi que imaginad mi confusion ante tanto simbolito raro

Gracias a todos !!


mintrak Enviar MP


mintrak
Enviado: 09/03/2008 a las 23:03
Frecuente
Frecuente

avatar

Karma: 10 (2 Votos)

Registrado: 27/02/07
Mensajes: 45

Estado: Desconectado
Ultima visita: 28/04/08
Este es el codigo original
Código
  1. Modules Presents: zUpDownload centerBlock v1.0 for Postnuke and the  */
  2. /* MD-Project. This centerBlock features: Recent DL's and Favoruite DL's */
  3. /*************************************************************************/
  4. // ----------------------------------------------------------------------
  5. // Last changes by Petzi-Juist, http://www.petzi-juist.de
  6. // ----------------------------------------------------------------------
  7.     $blocks_modules['z_updownload'] = array(
  8.     'func_display'   => 'z_updownload_display',
  9.     'func_add'       => 'z_updownload__add',
  10.     'func_edit'      => 'z_updownload__edit',
  11.     'func_update'    => 'z_updownload__update',
  12.     'text_type'      => 'z UpDownload Block',
  13.     'text_type_long' => 'z UpDownload Center Block',
  14.     'allow_create'   => false,
  15.     'allow_multiple' => true,
  16.     'allow_delete'   => false,
  17.     'form_content'   => false,
  18.     'form_refresh'   => false,
  19.     'show_preview'   => true
  20. );
  21.  
  22. // Security
  23. pnSecAddSchema('z_UpDownload::', 'Block title::');
  24.  
  25. function z_updownload_title_select ($selected) // selected is an array of the ids that are currently selected
  26. {
  27.  
  28.     $select="";
  29.  
  30.         $dbconn =& pnDBGetConn(true);
  31.           pnModDBInfoLoad('UpDownload');
  32.           $pntable =& pnDBGetTables();
  33.  
  34.         $table = $pntable['updownload_downloads'];
  35.         $column = &$pntable['updownload_downloads_column'];
  36.         //
  37.  
  38.     $sql = "SELECT $column[lid], $column[title] FROM $table";
  39.     $sql .=" order by $column[title]";
  40.  
  41.     $result = $dbconn->Execute($sql);
  42.  
  43.     $options="";
  44.     if(!$result->EOF)
  45.     {
  46.         while (list($lid, $title) = $result->fields)
  47.         {
  48.             $options .= "<option ";
  49.             if (in_array($lid, $selected)) $options .= "SELECTED ";
  50.             $options .= "value=\"".$lid."\">".$title."</option>\n";
  51.             $result->MoveNext();
  52.         }
  53.     } else {
  54.         $options = "<option value =\"\" SELECTED>"._ZUPDNONEAVIALABLE."</option>\n";
  55.     }
  56.  
  57.     $select = "<select multiple size=\"10\" name=\"nid[]\">\n";
  58.     $select .= $options;
  59.     $select .= "</select>\n";
  60.  
  61.     return $select;
  62. }
  63.  
  64. function z_updownload_display($row) {
  65.  
  66.  
  67.         $dbconn =& pnDBGetConn(true);
  68.           pnModDBInfoLoad('UpDownload');
  69.           $pntable =& pnDBGetTables();
  70.  
  71.         $table = $pntable['updownload_downloads'];
  72.         $column = &$pntable['updownload_downloads_column'];
  73.         //
  74.  
  75.     if (!pnSecAuthAction(0, 'z_UpDownload::', "$row[title]::", ACCESS_READ)) {
  76.         return;
  77.     }
  78.  
  79.  
  80.     $url = explode('|', $row['url']);
  81.     if (!$url[0]) // nid
  82.     {
  83.         $id ='';
  84.     } else {
  85.         $sevid = str_replace(",", "' or pn_lid='", "$url[0]");
  86.     }
  87.     if (!$url[1]) // include date
  88.     {
  89.         $url[1]="Y";
  90.     }
  91.     $col1_width= "100%";
  92.     if ($url[1]=="Y" or $url[1]=="y")
  93.     {
  94.         $col1_width= "80%";
  95.     }
  96.  
  97.     if (!$url[2]) // date format
  98.     {
  99.         $url[2]="d.m.y";
  100.     }
  101.     if (!$url[3]) // bullet
  102.     {
  103.         $url[3]="";
  104.     }
  105.     $amount = $url[4];
  106.     $maxlength = $url[5];
  107.     $length = $url[6];
  108.  
  109.     $descmaxlength = $url[7];
  110.     $desclength = $url[8];
  111.  
  112.     if (!$url[9]) // order
  113.     {
  114.         $url[9]="D,A"; // defaults to 'by date', 'ascending'
  115.     }
  116.     $order= explode (',',$url[10]);
  117.     if (!$url[10]) // order_map
  118.     {
  119.        $j=1;
  120.         while (list($k,$v)=each($url))
  121.         {
  122.             $temp_array[$j]=$v;
  123.             $j++;
  124.         }
  125.         $url[10]=serialize($temp_array); // just created a 'temp' order_map in case one didn't exist
  126.     }
  127.  
  128.  
  129.     $map_array=unserialize($url[10]);
  130.     if (is_array($map_array)) $order_map=array_flip($map_array); // turns this back in to an array and flips keys for vals
  131.     $ordertype="";
  132.     switch ($order[0])
  133.     {
  134.         case "A": // by alphabetical
  135.             $ordertype=$column[title];
  136.             break;
  137.         case "R": // by random
  138.             //$ordertype="RAND()";
  139.             $ordertype="RAND(" . time() . " * " . time() . ")";
  140.             break;
  141.         case "S": // specified
  142.             // will have to use array for this
  143.             //break;
  144.         default: // by date or any other choice
  145.             $ordertype=$column[date];
  146.     }
  147.  
  148.     $sql="SELECT $column[lid],
  149.         $column[title],
  150.         $column[description],
  151.         UNIX_TIMESTAMP($column[date])
  152.         FROM $table";
  153.     if ($sevid)
  154.     {
  155.         $sql .= " where pn_lid='$sevid' ";
  156.     }
  157.     $sql .=" order by ".$ordertype;
  158.     if ($order[1]=="D") $sql .= " DESC";
  159.  
  160.  
  161.     $result = $dbconn->SelectLimit($sql);
  162.  
  163.     if(!$result->EOF)
  164.     {
  165.         if ($url[0] == "")
  166.         {
  167.  
  168.             $content .= "<table width=\"100%\" cellpadding=\"2\" cellspacing=\"5\" border=\"0\">"
  169.             ."\n<tr><td>" . _ZUPDNONEAVIALABLE . "</td></tr>\n</table>\n";
  170.  
  171.         } else {
  172.  
  173.             $content .= "<table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
  174.                         $content .= "<tr><td width=\"90%\">&nbsp;</td><td width=\"10%\" rowspan=\"2\"><img src=\"images/zblocks/downloadheader.jpg\" align=\"right\" alt=\"\" /></td></tr>";
  175.                         $content .= "<tr><td width=\"90%\" style=\"background-color:#000000;height:0px;\"></td></tr></table>";
  176.             $content .= "<table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\">";
  177.  
  178.             $content .= "<tr><td width=\"50%\" valign=\"top\"><span class=\"pn-title\"><strong>".Novedades."</strong></span></td>";
  179.             $content .= "<td width=\"50%\" valign=\"top\"><span class=\"pn-title\"><strong>".TopDescargas."</strong></span></td>";
  180.             $content .= "</tr></table>";
  181.  
  182.             $content .= "<table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\">";
  183.             $content .= "<tr><td width=\"50%\" valign=\"top\">";
  184.             $j=1;
  185.             while (list($lid, $title, $description, $date) = $result->fields)
  186.             {
  187.                 $result_array[$lid]=array('lid'=>$lid, 'title'=>$title, 'date'=>$date);
  188.                 $std_order_map[$j]=$lid; // create 'standard' order map to use in most cases
  189.                 $j++;
  190.                 $result->MoveNext();
  191.             }
  192.  
  193.  
  194.              $result1 = $dbconn->Execute("SELECT $column[lid], UNIX_TIMESTAMP($column[date]),
  195.                                     $column[title], $column[description]
  196.                                     FROM $table
  197.                                     ORDER BY $column[date] DESC LIMIT $amount");
  198.                            if(!$result1->EOF)
  199.                             {
  200.             while (list($lid, $date, $title,) = $result1->fields) {
  201.             $result1->MoveNext();
  202.  
  203.  
  204.             $content .= "<table align=\"center\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">";
  205.  
  206.             $content .= "<tr><td width=".$col1_width." valign=\"top\">";
  207.             if ($url[3])
  208.                {
  209.                     $content .= "<img src=\"".$url[3]."\" alt=\"\" />&nbsp;";
  210.                 } else {
  211.                    $content .= "<strong><big>&middot;</big></strong>&nbsp;";
  212.                 }
  213.             $linktitle = eregi_replace(" ", "_", $title);
  214.             $content .= "<strong><a title=\"$title\" class=\"pn-title\" href=\"index.php?name=UpDownload&amp;req=viewdownloaddetails&amp;lid=$lid\" style=\"text-decoration:none\">";
  215.  
  216.             if (strlen($title) > $maxlength) {
  217.                                 $title = substr($title,0,$length);
  218.                                 $title .= "...";}
  219.  
  220.             $content .= "".pnVarPrepForDisplay($title)."</a></strong></td>";
  221.  
  222.             $ndate = date($url[2], $date);
  223.             if ($url[1]=="Y" or $url[1]=="y") $content .= "<td width=\"20%\" valign=\"bottom\"><span class=\"pn-normal\">$ndate</span></td>";
  224.             $content .= "</tr>";
  225.             if (strlen($description) > $descmaxlength) {
  226.             $description = substr($description,0,$desclength);
  227.                                 $description .= "...";}
  228.  
  229.             $content .= "<tr><td width=\"70%\" valign=\"middle\"><span class=\"pn-normal\">$description</span></td>";
  230.             $content .= "</tr></table>";
  231.        }
  232.  
  233.  
  234.                   $content .= "</td>";
  235.                   $content .= "<td width=\"50%\" valign=\"top\">";
  236.  
  237.  
  238.  
  239.  
  240.  
  241.             $use_array=$std_order_map;
  242.             if (($order[0]=="S") && (is_array($order_map))) $use_array=$order_map;
  243.  
  244.             if (is_array($use_array)) {ksort($use_array); reset ($use_array);}
  245.  
  246.             while (list($k,$v) = each ($use_array))
  247.             {
  248.                 $lid=$result_array[$v]['lid'];
  249.                 $title=$result_array[$v]['title'];               
  250.                 $date=$result_array[$v]['date'];
  251.  
  252.                  $ndate = date($url[2], $date);
  253.                  $content .= "<table cellSpacing=\"0\" cellPadding=\"2\" width=\"100%\" border=\"0\">";
  254.  
  255.                  $content .= "<tr><td width=".$col1_width." valign=\"top\">";
  256.  
  257.                if ($url[3])
  258.     &nbs