| View previous topic :: View next topic |
| Author |
Message |
dizmarkie
Joined: 25 Oct 2008 Posts: 6
|
Posted: Sat Oct 25, 2008 4:15 am Post subject: custom header prev/next links? NEED HELP PLEASE! |
|
|
Here is my problem.
I have a calendar in a page with ajax tabs using spry assets in dreamweaver. I am able to target the tabs and by passing a variable in an ahref link.
the problem is that my calendar is on tab#3 lets say and when I click the prev or next links in the header my page refreshes and goes to the default tab. Where can I added my variable url tab info "?tab=3#TabbedPanels1"
can I create me own custom next and prev buttions in the page and then just turn off the built in ones from the admin panel?
what would the url parameter be to see the next and prev months? so i can append my tab specific code so the use always stay on that tab when the page refreshes!!
any help please! |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5279
|
Posted: Mon Oct 27, 2008 5:42 pm Post subject: |
|
|
Hi,
Is the calendar is embedded in your page using code from Thyme's calendar publisher? |
|
| Back to top |
|
 |
dizmarkie
Joined: 25 Oct 2008 Posts: 6
|
Posted: Mon Oct 27, 2008 6:52 pm Post subject: |
|
|
Yes it is, here is my code:
| Code: |
############################################################
# base path of thyme with trailing slash
define("_CAL_BASE_PATH_", "/var/www/vhosts/felinity.ca/subdomains/f2/httpdocs/admin/calendar/");
# base url for calendar, with trailing slash
define("_CAL_BASE_URL_", "http://f2.felinity.ca/admin/calendar/");
require_once(_CAL_BASE_PATH_ . "include/classes/class.calendar.php");
############################################################
$cal = new calendar();
# General
#############
$cal->set("calendar", 2); # feel felinity class schedule
$cal->set("week_start", 1);
$cal->set("hour_format", 12);
$cal->set("static", 1);
$cal->set("hil_day", 1);
$cal->set("hil_week", 0);
$cal->set("theme", "slate");
$cal->set("width", "800");
# Events
####################
$cal->set("event_links", 1);
$cal->set("e_typename", 0);
$cal->set("e_popup", 1);
$cal->set("e_n_popup", 1);
$cal->set("e_size", 0);
$cal->set("event_view_url", "http://f2.felinity.ca/studio_events.php?tab=3#TabbedPanels1?eid=%eid&inst=%inst");
$cal->set("show_events", 1);
# Time zone
###################
$cal->set("timezone", -5.0);
$cal->set("dst", 0);
# Header
##############
$cal->set("show_header", 1);
$cal->set("show_header_links", 1);
$cal->set("header_align", "m");
$cal->set("header", "Events in %month");
$cal->set("txt_next", ">>");
$cal->set("txt_prev", "<<");
# Month Views
###############
$cal->set("show_weeks", 1);
$cal->set("minical_date_url", "http://f2.felinity.ca/studio.php?tab=3#TabbedPanels1");
$cal->set("e_collapse", 0);
?> |
|
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5279
|
Posted: Mon Oct 27, 2008 7:08 pm Post subject: |
|
|
Hi,
Try:
After this
$cal = new calendar();
adding this ...
$cal->register_persistent("tab", '3#TabbedPanels1');
Let me know if this does not work for you. |
|
| Back to top |
|
 |
dizmarkie
Joined: 25 Oct 2008 Posts: 6
|
Posted: Mon Oct 27, 2008 8:43 pm Post subject: |
|
|
so close, great idea.
it did not work but i do see the string below in the status. you can see the page I am using it on here. http://f2.felinity.ca/studio.php?tab=3#TabbedPanels1
when the next or prev link is clicked, the page goes blank and none of the tabs are selected.
i really thought that was gonna work. you can see after you click in the url field at the top that the "#" symbol coverts to "%23". If i manually change back to "#" it defaults to the current month and doesnt work. You'll see what i mean.
I think we're on the right track here though.
i would even make links to the months if i needed to but i need the years to auto update.
i love the tool but would love it that much more if i could embed in spry tabs  |
|
| Back to top |
|
 |
dizmarkie
Joined: 25 Oct 2008 Posts: 6
|
Posted: Tue Oct 28, 2008 3:28 am Post subject: Almost there! |
|
|
Ok, so I am a newb and rely on server behaviours for my coding so I need anyone's expertise.
the way the page displays properly is in this format
| Code: |
| m=12&y=2008&tab=3#TabbedPanels1 |
so what i need to do is append
| Code: |
| &tab=3#TabbedPanels1 |
so a full url in my example would be http://f2.felinity.ca/studio.php?m=06&y=2009&tab=3#TabbedPanels1
at the end of the month and november values. The code you gave me before put it before the values. Do you know how I can append at the end like I listed above? If so we're in business and I know this will help out other users that reply on apps like dreaweaver for their development.
thanks and please please help me resolve, i can't sleep, lol.
|
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5279
|
Posted: Thu Oct 30, 2008 3:23 pm Post subject: |
|
|
Hi,
There is no way to get around the URL encoding of the hash. In this case we'll have to add it to the file include/classes/class.calendar_real.php. In lines 922 and 925 you will see where the links are printed. Append &tab=3#TabbedPanels1 to the end of each link.
Let me know if you have any trouble at all. |
|
| Back to top |
|
 |
dizmarkie
Joined: 25 Oct 2008 Posts: 6
|
Posted: Thu Oct 30, 2008 3:34 pm Post subject: |
|
|
no luck
unless I am placing in the wrong area.
here is the code
| Code: |
| $img_prev = "<a class='"._CAL_CSS_HEADING_."' href='". $back_link ."'>".$img_prev."</a> "; |
I need this
| Code: |
| &tab=3#TabbedPanels1 |
to appear at the end of the link or else it will not work. I tried putting in like you suggested but on the front end the "&tab=3#TabbedPanels" still appears in the URL before the month and year string.
it also generated on the front end "&tab=3#TabbedPanels1" along with ">>"
This is pretty much the end of the road for this problem though eh? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5279
|
Posted: Thu Oct 30, 2008 4:02 pm Post subject: |
|
|
Hi,
Please change this:
| Code: |
| $img_prev = "<a class='"._CAL_CSS_HEADING_."' href='". $back_link ."'>".$img_prev."</a> "; |
... to this ...
| Code: |
| $img_prev = "<a class='"._CAL_CSS_HEADING_."' href='". $back_link ."&tab=3#TabbedPanels1'>".$img_prev."</a> "; |
.. the same with $img_next. Let me know if you have any trouble. |
|
| Back to top |
|
 |
dizmarkie
Joined: 25 Oct 2008 Posts: 6
|
Posted: Thu Oct 30, 2008 4:08 pm Post subject: |
|
|
IT WORKED!!!!
thank you sooooo much.
Now that I know how to do this I am in love with you and this product.
I can fully integrate into my spry tabs!
woo hoo! and it is now defaulting to the first tab!
i can sleep now!
can you tell i'm excited. beers on me for everyone!
thanks so much! |
|
| Back to top |
|
 |
|