Author Topic: [Mod] Make "Images Per Page" a jump menu  (Read 30746 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
[Mod] Make "Images Per Page" a jump menu
« on: January 28, 2003, 02:17:37 AM »
This modifies the HTML form that allows the user to set the number of images to display per page.  It makes it behave the same way as the category dropdown list.

When the user selects a category from the category_dropdown_form.html, the choice is made without having to click a "Go" button.  This mod makes the setperpage_dropdown_form.html behave the same way.  The user will not have to click a "Go" button.

Open includes/page_header.php.
Code: [Select]

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
// Original 4images code
// $setperpage_dropdown = "\n<select name=\"setperpage\" class=\"setperpageselect\">\n";

// Make this a jumpbox
$setperpage_dropdown = "\n<select name=\"setperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['imagesperpage'].submit() }\" class=\"setperpageselect\">\n";

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
help?
« Reply #1 on: January 28, 2003, 06:38:19 AM »
i tried this and nothing happens, when I click go it still works normal way, but just picking a # nothing happens

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Make "Images Per Page" a jump menu
« Reply #2 on: January 28, 2003, 07:11:19 AM »
it wont work, untill u either delete whole button from /setperpage_dropdown_form.html template =>
Code: [Select]
<INPUT type="submit" value="{lang_go}" class="button" name="submit" /> or delete
Quote
name="submit"
from that button.  :wink:
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
[Mod] Make "Images Per Page" a jump menu
« Reply #3 on: January 28, 2003, 11:30:35 AM »
Is it also possible to make it just a list instead of a jumpbox?

Piet

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Make "Images Per Page" a jump menu
« Reply #4 on: January 28, 2003, 01:01:13 PM »
by default setperpage_dropdown is just a list.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
[Mod] Make "Images Per Page" a jump menu
« Reply #5 on: January 28, 2003, 01:06:25 PM »
I know it is a list but instead of making it available in the form of a jumpbox, I would like to present the list in the left table.

Piet

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Make "Images Per Page" a jump menu
« Reply #6 on: January 28, 2003, 01:30:26 PM »
I'm not quet understand what do u mean by "jumpbox".
perpage_dropdown form generated from template setperpage_dropdown_form.html
category sellect dropdown generated from template category_dropdown_form.html
so, each one could be called seporately, with tags {setperpage_dropdown_form} and {category_dropdown_form}
so, it's up to u where do u want display them.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline pietg

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
    • http://www.totaaldigitaal.nl
[Mod] Make "Images Per Page" a jump menu
« Reply #7 on: January 28, 2003, 03:57:30 PM »
Sorry, but what I ment is that the list is displayed without the triangle-button. So that isn't a dropdown-list(box) but a "fixed" list.

Is this better explained?

Piet

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
[Mod] Make "Images Per Page" a jump menu
« Reply #8 on: January 28, 2003, 04:30:54 PM »
Quote from: V@no
it wont work, untill u either delete whole button from /setperpage_dropdown_form.html template =>
Code: [Select]
<INPUT type="submit" value="{lang_go}" class="button" name="submit" /> or delete
Quote
name="submit"
from that button.  :wink:
Sounds like I left something out.  I was tired when I posted last night.  I'll recheck what I did when I get home after work and post again.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Make "Images Per Page" a jump menu
« Reply #9 on: January 28, 2003, 10:09:56 PM »
I know almost nothing about javascript or html, but I've never seen anywhere something what u asking for, exept when it used 'dropdown menu' javascript.
u can try search for it on www.hotscripts.com
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
[Mod] Make "Images Per Page" a jump menu
« Reply #10 on: January 28, 2003, 11:46:04 PM »
OK, the solution is simple: the form has to have a name  :o

So, put this into the file 'setperpage_dropdown_form.html' which is to be found within your template folder
Code: [Select]
<form method="post" name="imagesperpage" action="{self}">
also while you are there you can remove as suggested by V@no from this
Code: [Select]
<INPUT type="submit" value="{lang_go}" class="button" name="submit" />the
Code: [Select]
name="submit"
Then go to the includes/page_header.php and do the changes as posted by Chris. It works for me!

cheers,
Bernd
« Last Edit: March 09, 2005, 03:05:41 AM by Chris »

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Thanks
« Reply #11 on: January 29, 2003, 01:12:46 AM »
Thanks for pointing out my omission guys.  Yep, I left out the change I did to the html template.  Here is my set_perpage_dropdown_form.html
Code: [Select]
<table border="0" cellspacing="0" cellpadding="0">
  <form method="post" name="imagesperpage" action="{self}">
    <tr>
      <td>{lang_images_per_page}&nbsp;</td>
      <td>{setperpage_dropdown}</td>
    </tr>
  </form>
</table>