Author Topic: Change the "dropdown" images perpage  (Read 4314 times)

0 Members and 1 Guest are viewing this topic.

Offline fitterashes

  • Newbie
  • *
  • Posts: 30
    • View Profile
Change the "dropdown" images perpage
« on: April 07, 2007, 10:02:37 AM »
Hello,

I'am trying to replace the "select" (the dropdown "show xx images per page") by links (<a href) or buttons (input). It's purely for the design as dropdowns are really ugly on dark backgrounds.



In include/page_header.php I started to modify the code and replace the select by inputs (buttons):

Code: [Select]
$setperpage_dropdown = "<input type=\"hidden\" name=\"buttonChoice\"\n";

for($i = 1; $i <= $config['custom_row_steps']; $i++) {
  $setvalue = $config['image_cells'] * $i;
  $setperpage_dropdown .= "<input type=\"button\" value=\"".$setvalue."\" size=\"2\" maxlength=\"2\" readonly=\"readonly\" onclick=\"setButton(".$setvalue.");\"    ";
    if ($setvalue == $perpage) {
    $setperpage_dropdown .= " class=\"selected\"";
  }
  $setperpage_dropdown .= " />";
}
if ($cat_id != 0) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"cat_id\" value=\"".$cat_id."\" />\n";
}
if (isset($show_result) && $show_result == 1) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"show_result\" value=\"1\" />\n";
}
$site_template->register_vars("setperpage_dropdown", $setperpage_dropdown);
$setperpage_dropdown_form = $site_template->parse_template("setperpage_dropdown_form");
$site_template->register_vars("setperpage_dropdown_form", $setperpage_dropdown_form);

$site_template->un_register_vars("setperpage_dropdown");
unset($setperpage_dropdown);
unset($setperpage_dropdown_form);

+ the javascript in the html

Code: [Select]
<script>
function setButton(s)
{
document.imagesperpage.buttonChoice.value = s;
document.imagesperpage.submit();
}
</script>

Well it doesn't work  :?
If someone have an idea it would be much appreciated.


thank you

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Change the "dropdown" images perpage
« Reply #1 on: April 07, 2007, 11:58:00 AM »
why you don't use css for the Dropdown???

Offline fitterashes

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Change the "dropdown" images perpage
« Reply #2 on: April 07, 2007, 07:06:25 PM »
dropdown are defined by the OS and the browser you can't change the border and the arrow.

Offline fitterashes

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Change the "dropdown" images perpage
« Reply #3 on: April 07, 2007, 07:49:38 PM »
in fact my code is ok, I just forgot to name the hidden input "setperpage"  :wink:

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Change the "dropdown" images perpage
« Reply #4 on: April 08, 2007, 01:12:08 PM »
dropdown are defined by the OS and the browser you can't change the border and the arrow.

Ohhh you using the IE... (o:
In Firefox it works fine...

http://www.ximt.de/~temp/dropdown.html