Autor Tópico: Página Dropdown  (Lida 4678 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Página Dropdown
« em: 09 de Janeiro de 2011, 14:37 »
Download Link: http://custom.simplemachines.org/mods/index.php?mod=2025
Modificação de nome:Page Dropdown
Auctor: SoLoGHoST
Versão Actual: 1.4
Compatibilidade: 1.1.10, 1.1.12, 2.0 RC1.2, 2.0 RC2, 2.0 RC4
Manual: Sim / / Por Candidosa2

./Sources/Subs.php

Código: [Seleccione]
   return $pageindex;
Código: [Seleccione]
   if($max_value > $num_per_page) {
      $dropdown_url = ($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=');
      $base_dropdown = '<select id="page_dropdown" onchange="javascript:var d = document.getElementById(\'page_dropdown\').value; window.location=(\'' . $dropdown_url . '\').replace(/%d/, d);">';
      $display_page = 0;
      $myPage = ($start / $num_per_page);
      for ($counter = 0; $counter < $max_value; $counter += $num_per_page) {
         $base_dropdown .= '<option value="' . ($num_per_page * $display_page) . '"';
         if($display_page == $myPage) $base_dropdown .= ' selected="selected"';
         $base_dropdown .= '>' . ++$display_page . '</option>';
      }
      $base_dropdown .= '</select> &nbsp;';
   } else {
      $base_dropdown = "";
   }

   return $base_dropdown . $pageindex;


Demo

http://custom.simplemachines.org/mods/index.php?action=download;mod=2025;id=108172;image

http://custom.simplemachines.org/mods/index.php?action=download;mod=2025;id=121316;image
« Última modificação: 09 de Janeiro de 2011, 14:40 por candidosa2 »