4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Chris on January 28, 2003, 02:17:37 AM

Title: [Mod] Make "Images Per Page" a jump menu
Post by: Chris 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";
Title: help?
Post by: Jasondavis 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
Title: [Mod] Make "Images Per Page" a jump menu
Post by: V@no 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:
Title: [Mod] Make "Images Per Page" a jump menu
Post by: pietg on January 28, 2003, 11:30:35 AM
Is it also possible to make it just a list instead of a jumpbox?

Piet
Title: [Mod] Make "Images Per Page" a jump menu
Post by: V@no on January 28, 2003, 01:01:13 PM
by default setperpage_dropdown is just a list.
Title: [Mod] Make "Images Per Page" a jump menu
Post by: pietg 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
Title: [Mod] Make "Images Per Page" a jump menu
Post by: V@no 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.
Title: [Mod] Make "Images Per Page" a jump menu
Post by: pietg 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
Title: [Mod] Make "Images Per Page" a jump menu
Post by: Chris 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.
Title: [Mod] Make "Images Per Page" a jump menu
Post by: V@no 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
Title: [Mod] Make "Images Per Page" a jump menu
Post by: bernd 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
Title: Thanks
Post by: Chris 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>