Author Topic: How to have 2 dropdown box in every page?  (Read 5183 times)

0 Members and 1 Guest are viewing this topic.

Offline Vampy

  • Newbie
  • *
  • Posts: 45
    • View Profile
How to have 2 dropdown box in every page?
« on: May 24, 2003, 02:07:41 PM »
Hi! I was wondering if it is possible to add an additional category dropdown box in every page of the gallery. Right now when I try to do that, one of them would work but the other will not. I put one of them at the top and the other at the bottom of every page.
Julian

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
How to have 2 dropdown box in every page?
« Reply #1 on: May 24, 2003, 03:02:22 PM »
it's little bit tricky, because u'll need do changes in two files and create new template....
if u still want it, then in /includes/functions.php find:
Code: [Select]
function get_category_dropdown($cat_id = 0, $jump = 0, $admin = 0, $i = 0) {replace with:
Code: [Select]
function get_category_dropdown($cat_id = 0, $jump = 0, $admin = 0, $i = 0, $name_form = "jumpbox") {
then find:
Code: [Select]
$category = "\n<select name=\"".URL_CAT_ID."\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['jumpbox'].submit() }\" class=\"categoryselect\">\n";replace with:
Code: [Select]
$category = "\n<select name=\"".URL_CAT_ID."\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['".$name_form."'].submit() }\" class=\"categoryselect\">\n";

then, open /includes/page_header.php find:
Code: [Select]
$site_template->un_register_vars("category_dropdown_selfjump");add right after:
Code: [Select]
$category_dropdown_selfjump = get_category_dropdown($cat_id, 1, 0, 0, "jumpbox2");
$site_template->register_vars("category_dropdown_selfjump", $category_dropdown_selfjump);
$category_dropdown_form = $site_template->parse_template("category_dropdown_form2");
$site_template->register_vars(array("category_dropdown_form2" => $category_dropdown_form));

$site_template->un_register_vars("category_dropdown_selfjump");


then, create new template with name category_dropdown_form2.html
with this code:
Code: [Select]
<table border="0" cellspacing="0" cellpadding="0">
<form method="post" name="jumpbox2" action="{url_categories}">
<tr>
<td>{category_dropdown_selfjump}</td>
    </tr>
</form>
</table>


now use {category_dropdown_form2} tag to add second cat jump menu

good luck.
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 Vampy

  • Newbie
  • *
  • Posts: 45
    • View Profile
How to have 2 dropdown box in every page?
« Reply #2 on: May 24, 2003, 03:11:43 PM »
Thanks. I'll do that.
Julian

Offline stefano

  • Pre-Newbie
  • Posts: 4
    • View Profile
additional category dropdown showing different categories
« Reply #3 on: June 25, 2003, 09:50:06 AM »
After reading the MUST READ ( sorry )  I  decide
to post my help request here as well


Hi all,
a while ago Vampy wrote
Quote
Hi! I was wondering if it is possible to add an additional category dropdown box in every page of the gallery. Right now when I try to do that, one of them would work but the other will not. I put one of them at the top and the other at the bottom of every page.... and I get  anice suggestion from V@no


Now I have manage  to have 3 dropdown menu but all them show the same categories list . I need to have diffeent categories in for the 3 dropdowm menu.
WHy ???  First I have too many categories and the dropwsdown menu is getting  too long but most important  I want to separate the content .
For istance the first dropdwon for arts ( Such as painting sculpture and son material ......) the second for material..( glass wood ..iron..and the third for  artist names list .

I really need this Please someone help me I have tried for days but I can get it to work Even using different php  debugger I can not understand how the  functions  get_category_dropdown - get_category_dropdown_bits are building the dropdown menu. I have tried to use a special suffix at the the end of the category (for instance wood_mat)
and then try every kind of preg_ function

Thanks stefano