Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 26 Feb 2009, 01:13
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
I have done all i can do to modify the templete calandar_jump to the gobutton

I might be off the wall but here is my trouble:

In the templete that calls this function "trap_calandar_jump" the templete part that does the calling is below:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You will see that i have add the "trap_calandar_jump('1'), this.form.submit() to happen at the same time the trap_calandar_jump but the second on does not because I have to press the go my self?

How do I make this work?

I created this function in the php file function_calandar.php


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


}

The templete that is used in the calandar in vb calandar which is where I try everything -


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Using the onchange event can I call the two functions at the same time?

That sames to work except for the thing before when the user selected a option in the drop down because the onchange event caused the auto press of the go button. Now that I have added the second function to the onchange event that functionlty is lost and the user has to press the go.

How can i do both call the function and the action of pressing the go button with the user having to press it.

If you have been following some of my post you will know that the templete calendar_jump above is not the whole thing and in my case i am using any number of jump calandar dropdown in the form. I have simplefied the templete so as not to confuse the issues and what i am asking here.

THANKS

Frank H. Shaw

Last edited by Frank H. Shaw; 28 Feb 2009 at 03:41.
Reply With Quote
  #2  
Old 26 Feb 2009, 13:55
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
You can not call a PHP function from a template. If you need a function to be processed you will need to write it in JS.
__________________
Marco van Herwaarden
Ex vBulletin.org Coordinator
Reply With Quote
  #3  
Old 26 Feb 2009, 16:17
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Please explain why the actual function does get called I know this because of echo

I have been able to play with the function that I am calling here is as far as i have gotten so far on it.

Please review it and tell me what you think - how i am doing and is there a better way then what i am doing.

The function that is the first function does get called because I put some debuging in it so I know that happens so if have correct logic in my function then it should all work as I want it to.

But you say i can not do it from a templete form with out using js well i am using the onchange event and I hope the event is the best one for my purposes here.

Please explain more why you are saying what you said in your replay so that I understand what you mean.

This is what you said:


You can not call a PHP function from a template. If you need a function to be processed you will need to write it in JS.
Here below is how far i have gotten so far.



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you look at back at the orginal post you will see that the use of the $_GET I can stuff the redirect with the value of the selected calandar ID because the value is in the $_GET for c, y, z, and only c is the orginal from the first jump_calandar.

You can see that the value is put in the $_GET because it is in the address bar of the browser.

Below is the url just a sample


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So by doing a redierct and so that the target of the new url should make the correct calandar from the other two dropdowns.

Now if there is nothing in the way VB handles the going to the calandar in there logic to undo what I have done then this should work.

If any one know different and or knows of such logic that i would have to address or look at on this please let me know.

THANKS

Frank H. Shaw

Last edited by Frank H. Shaw; 27 Feb 2009 at 20:22.
Reply With Quote
  #4  
Old 27 Feb 2009, 13:22
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Real name: Hanson
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.
__________________
Former vBulletin.org Staff Member

View My Modifications
29 Releases and Counting... Latest Modification: dmActivityStream - vBookie Integration (4.x)

Please do not PM me to ask for support - please use the relevant thread or forum.
Reply With Quote
  #5  
Old 27 Feb 2009, 16:58
Frank H. Shaw Frank H. Shaw is offline
 
Join Date: Aug 2007
Thanks for coreecting me on the $_GET

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 27 Feb 2009 at 20:20 ---------------

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!


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I change it to this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The orginal was this out of the box


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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 27 Feb 2009 at 20:28 ---------------

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 27 Feb 2009 at 22:18 ---------------

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 27 Feb 2009 at 23:31 ---------------

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?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

THANKS

Frank H. Shaw

--------------- Added 28 Feb 2009 at 01:11 ---------------

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 28 Feb 2009 at 03:37 ---------------

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

Last edited by Frank H. Shaw; 28 Feb 2009 at 03:37. Reason: Auto-Merged DoublePost
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 09:34.

Layout Options | Width: Wide Color: