View Single Post
  #5  
Old 02-27-2009, 02:58 PM
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I reakky did not see the fact that I had ( ) unstead of the array [ ] that was due to the fact my eyes are not the greatest - I do not know why the PHP compirer did not throw a error.

I have coreeted the and now the script code is indeneted as you say is easyer for you to read.

Now that I have corrected my errors that had in my script I still need the question answred that I asked in the first place - would you kindly review my questions and see if you can follow what i am asking and answer some of the questions.

THANKS

Frank H. Shaw

--------------- Added [DATE]1235766032[/DATE] at [TIME]1235766032[/TIME] ---------------

I have simplfied the select so that i am only want to call the functon on a onchange event from a templete and it seems that my function is never getting called and I thought it was.

So i am regressing to ask this lets start over in the Jump_Calandar the templete that comes out of the box with the product unmodifyed.

I need to take the "this.form.submit()" which is the thing that happens when the user makes a selection in the dropdown Jump_Calandar now unstead I want to call a function from my templete so the function is called "trap_calandar_jump('1')" At first i thought that i would be able to attach to functions to the onchange event but now I realize that my actual function never gets called so before i can even attempt having two functions i need to get the calling of my function to work first. {I do not even now if it is posiable to call two function from the onchange event}

So what do I have to do to setup my function and get to call the function from the onchange event from the templete Jump_Calandar?

Please explain step by step what needs to be done!

PHP Code:
<select name="c" onchange="trap_calandar_jump('1'),  this.form.submit();"
I change it to this

PHP Code:
<select name="c" onchange="trap_calandar_jump('1')"
The orginal was this out of the box

PHP Code:
<select name="c" onchange="this.form.submit();"

Here is the actaul one the change Jump_Calandar that I changed drasticly as you can see so you have a idea what i am trying to do I might be using the wrong event but i felt the onchange event was my best choice.

PHP Code:

<form action="calendar.php" method="get">
<
div class="smallfont" style="text-align:$stylevar[left]; white-space:nowrap">
    <
input type="hidden" name="s" value="$session[sessionhash]/>
    <
input type="hidden" name="month" value="$month/>
    <
input type="hidden" name="year" value="$year/>
    <
input type="hidden" name="do" value="$docalendar/>
    <
strong>$vbphrase[calendar_jump]</strong><br />
        <
input type="hidden" name="me" value="1" />
        <
select name="c" onchange="this.form.submit();">
        <
optgroup label="$vbphrase[please_select_one]>
                
$jumpcalendarbits
        
</optgroup>
                <
optgroup label="$vbphrase[Blue_Lodge_Regular_Meetings]>
                
$jumpcalendarbitsb
        
</optgroup>
                <
optgroup label="$vbphrase[York_Rite_Regular_Meetings]>
                </
optgroup>
                <
optgroup label="$vbphrase[Chapters]>
                
$jumpcalendarbitsy
        
</optgroup>
                <
optgroup label="$vbphrase[End_Of_Jump_Menu]>
                </
optgroup>
        </
optgroup>
                <
optgroup label="$vbphrase[Councils]>
                </
optgroup>
        </
optgroup>
                <
optgroup label="$vbphrase[Commanderys]>
                </
optgroup>
        </
optgroup>
                <
optgroup label="$vbphrase[Scottish_Rite]>
                </
optgroup>
                <
optgroup label="$vbphrase[Valleys]>
                </
optgroup>
                <
optgroup label="$vbphrase[Shriners]>
                </
optgroup>
                <
optgroup label="$vbphrase[Shrine_Clubs]>
                </
optgroup>
                <
optgroup label="$vbphrase[Units]>
                </
optgroup>
    </
select>$gobutton <br />
        <
strong>$vbphrase[Lodge_Calendar]</strong><br />
        <
input type="hidden" name="me" value="2" />
        <
select name="y" onchange="this.form.submit();">
                <
optgroup label="$vbphrase[please_select_one]">
                   
$jumpcalendarbitsl
                
</optgroup>
        </
select>$gobutton <br />
        <
strong>$vbphrase[Chapter_Calendar]</strong><br />
        <
input type="hidden" name="me" value="3" />
        <
select name="z" onchange="this.form.submit();">
                <
optgroup label="$vbphrase[please_select_one]">
                   
$jumpcalendarbitsch
                
</optgroup>
        </
select>$gobutton <br />
</
div>
</
form

I hope this makes more sence and you can follow what i am asking.

Most inport thing is to be able to call the function from the templete with the onchange event or when a selection is made on the dropdown and then if the function can cause the $gobutton get pressed by doing that inside the function that would be also ok in fact might be the best way to do it.

Please note: The key is that I not only need to call the function from the templete but need to pass a value so the function can parse the value passed.

Look at the actual function in the function I need to do a redirect do not know if my redirect is working or will even work until i get my function calling to work in the first place.

But if I get all the redirect to work is there any thing in the vb calandar php scripts that will pervent or override what i do if there is please explain what i need to look at or consder.


THANKS

Frank H. Shaw

--------------- Added [DATE]1235766502[/DATE] at [TIME]1235766502[/TIME] ---------------

Quote:
Originally Posted by Dismounted View Post
You are calling "$_GET" as a function, and passing a parameter to it. Use square brackets to get array values.

You need to use a forward slash on the end BB Code (e.g. [/php]) - this is starting to get really annoying.
I went back and fixed the posting to be corrected I was wondering why the php code was not being able to scroll as you taught me a few months ago to do - so now i think i have it right now.

But now you shoud be able to read my post and answer some if not all my questions THANKS

--------------- Added [DATE]1235773113[/DATE] at [TIME]1235773113[/TIME] ---------------

If i can not use the onchange event to call my user defined function can I use the onclick event to call my user defined function from a templete.

What i have to do is be able to modify my templete above so that it will call my user defined function so that my user defined function can parse the argument pass it and that value based on some logic do a redirect to bring up a different calandar.

THANKS

Frank H. Shaw

--------------- Added [DATE]1235777509[/DATE] at [TIME]1235777509[/TIME] ---------------

The following :

I am trying to call a my own user defined function to parse a value passed to the user defined function and i am haveing a hard time figure out this here is my leastest attemp at this.

I tried to do it a a hidden field but that will not work either before i treid to do it as a onchange event that did not work either could some one help me understand what i do not understand.

Is there a file i need to be looking at beside the two files i have now calandar.php and function_calandar.php?

Here is my latest attemp at this.

Was i closer doing it using the onchange event or is the way the onclick event and can some one give me a clue or example of what the templete should look like for doing this.

The below has a hidden field called me this field i am trying to figure out what select was did the user press to so that I can handle that in my user defined function?

PHP Code:

<form action="calendar.php" method="get">
<
div class="smallfont" style="text-align:$stylevar[left]; white-space:nowrap">
    <
input type="hidden" name="s" value="$session[sessionhash]/>
    <
input type="hidden" name="month" value="$month/>
    <
input type="hidden" name="year" value="$year/>
    <
input type="hidden" name="do" value="$docalendar/>
    <
strong>$vbphrase[calendar_jump]</strong><br />
        <
input type="hidden" name="me" value="onclick="trap_calandar_jump('1')" />
    <select name="
c" onchange="this.form.me">
        <optgroup label="
$vbphrase[please_select_one]" >
                
$jumpcalendarbits
        </optgroup>
                <optgroup label="
$vbphrase[Blue_Lodge_Regular_Meetings]" >
                
$jumpcalendarbitsb
        </optgroup>
                <optgroup label="
$vbphrase[York_Rite_Regular_Meetings]" >
                </optgroup>
                <optgroup label="
$vbphrase[Chapters]" >
                
$jumpcalendarbitsy
        </optgroup>
                <optgroup label="
$vbphrase[End_Of_Jump_Menu]" >
                </optgroup>
        </optgroup>
                <optgroup label="
$vbphrase[Councils]" >
                </optgroup>
        </optgroup>
                <optgroup label="
$vbphrase[Commanderys]" >
                </optgroup>
        </optgroup>
                <optgroup label="
$vbphrase[Scottish_Rite]" >
                </optgroup>
                <optgroup label="
$vbphrase[Valleys]" >
                </optgroup>
                <optgroup label="
$vbphrase[Shriners]" >
                </optgroup>
                <optgroup label="
$vbphrase[Shrine_Clubs]" >
                </optgroup>
                <optgroup label="
$vbphrase[Units]" >
                </optgroup>
    </select>
$gobutton <br />
        <strong>
$vbphrase[Lodge_Calendar]</strong><br />
        <input type="
hidden" name="me" value="onclick="trap_calandar_jump('2')" />
        <
select name="y" onchange="this.form.me">
                <
optgroup label="$vbphrase[please_select_one]">
                   
$jumpcalendarbitsl
                
</optgroup>
        </
select>$gobutton <br />
        <
strong>$vbphrase[Chapter_Calendar]</strong><br />
        <
input type="hidden" name="me" value="onclick="trap_calandar_jump('3')" />
        <select name="
z" onchange="this.form.me">
                <optgroup label="
$vbphrase[please_select_one]">
                   
$jumpcalendarbitsch
                </optgroup>
        </select>
$gobutton <br />
</div>
</form> 
THANKS

Frank H. Shaw

--------------- Added [DATE]1235783480[/DATE] at [TIME]1235783480[/TIME] ---------------

I need to be able to disquegest the select that user used to make the selection so that I can redirect the user to a different calandar then the one that comes up.

The trouble is very simple the first select is over riding the other two select and so when the user makes a selection in the jump_calandar I need that commucated back to the calandar.php.

I have been able to pass the value in the c, y, z as explian and shows up in the $_GET['c'], $_GET['y'], and $_GET['z'] and this is in the address bar of my browser but it takes the first on and forgets about the others.

This is probley due to some logic in calandar.php that looks only at the 'c' in the $_GET now if i can find that logic i miight be able to modify it to handle the other values in the $_GET but I have not found any way to tell me which select that the user made a selection on which dropdown.

Any ideas of how to do this will solve my problem in a nut shell.

THANKS

Frank H. Shaw

--------------- Added [DATE]1235792235[/DATE] at [TIME]1235792235[/TIME] ---------------

I realized the gobutton is defined somewhere and i change the gobutton to make each one different so when one press each one maybe i can tell which one was pressed but when i did this i realized that it is defined somewhere and need to ask where that is?

My thought is if i can change the buttons go to a little different then maybe i could tell in my script which one was pressed. {which is all i am trying to do in the first place}.

THANKS

Frank H. Shaw
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01321 seconds
  • Memory Usage 1,922KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete