Jump to content


[Snippet] zcalendar3


  • You cannot reply to this topic
119 replies to this topic

#101 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 10 May 2008 - 01:30 PM

View PostCris D., on May 10 2008, 08:20 AM, said:

After further testing I have realised that the zcalendar javascript is intefered with the FixInertTags chunk which is added in the default Etomite template. If you try to use the tigra_calendar pop-up calendar in a template where FixInertTags exists, the pop-up will happen but the date will not write to the text field.

Therefore: a simple resolution, have a separate zcalendar template that does not contain the FixInertTags chunk in it.


Considering how the FixInertTags Javascript chunk is geared more towards allowing tag conversions for tutorial use only I would recommend removal of that Chunk call from the Etomite v1.0 template for production use... It truly serves no other purpose and was only written and included in an effort to better convey the tutorialized default content which Prelude v1.0 provides in its Full installation...

As a side-note to CrisD, once you get a chance to examine how easily jsaclendar-v1.0 integrates you should have no problems converting zcalendar to make use of the new calendar... I know you've been busy - haven't we all... If you need assistance, just ask... I like to ability to use timestamps instead of having to do date manipulations as it greatly reduces code overhead...

#102 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 30 July 2008 - 10:58 PM

Thanks guys, for developing this. I have a few issues:

1. when using the popup calendar, and select a next/previous month button i get a message:
The requested URL /manager/media/tigra_calendar/manager/media/tigra_calendar/calendar.html was not found on this server.

you can see the path is messed up somehow. that link is generated by js and i've combed the tigra folder and can't correct the issue.

2. For the life of me, i can't find where the following text is being generated, (it has been a long day though...)
  • Legend: Start date: 1
  • Finish date: 1
  • Today: 1
*edit: ok i found it on line 529.. what is this supposed to be listing? *

Edited by darren, 30 July 2008 - 11:01 PM.


#103 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 31 July 2008 - 10:17 AM

1) Yeah, this has happened a few times with different installations. You will need to change the .js file, to point to the correct calendar.html path.- let me know if you need more help tracking it down, (it's been a while since I played with this).
2) It is listing the styles used in the calendar for event start dates, finish dates and to today. It is obsolete and can definately be removed.

#104 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 31 July 2008 - 03:09 PM

all 3 js files have this line around line 54/55
'manager/media/tigra_calendar/calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,..
looks like the caledar3.js must have this path for the initial popup window, but editing calendar2 and 1 doesn't have any effect...

there's a piece in calendar.html that generates the next month/year images and links...cant attach it or paste the js here (ip board security) but its around line 99...

i'm not sure where to look next :(

#105 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 31 July 2008 - 09:26 PM

Don't need to touch calendar 1 or 2, the snippet uses solely calendar3.js. The .js file is loading, the snippet is loading the pop-up OK, that's fine. We just need to get the cal3.js to point to the calendar.html file. I'll have a look at my existing installations and locate it... In the mean time: What version of zcalendar are you using? Are you placing the <script> call in the template header as per old instructions or using the snippet that has this included as part of the output as per the new instructions- or (possibly a problem)- both...? Maybe it's time I hade a better look at integrating the new calendar...

#106 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 31 July 2008 - 10:23 PM

View PostCris D., on Jul 31 2008, 03:26 PM, said:

Don't need to touch calendar 1 or 2, the snippet uses solely calendar3.js. The .js file is loading, the snippet is loading the pop-up OK, that's fine. We just need to get the cal3.js to point to the calendar.html file. I'll have a look at my existing installations and locate it... In the mean time: What version of zcalendar are you using? Are you placing the <script> call in the template header as per old instructions or using the snippet that has this included as part of the output as per the new instructions- or (possibly a problem)- both...? Maybe it's time I hade a better look at integrating the new calendar...

I'm just calling the snippet so the script is called in there, not the header. using 3.7, downloaded last week. also using the included tigra files.

I've already hacked up the snippet so don't go changing it too much!

(just kidding i've marked my changes...i think) B)

#107 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 02 August 2008 - 12:48 AM

Is it this problem Darren?
http://www.etomite.com/index.php?s=...ost&p=45194

#108 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 02 August 2008 - 03:20 AM

View PostCris D., on Aug 1 2008, 06:48 PM, said:


Cris,
yes, same issue, but i'm not in a subfolder... I thought i had tried some variations of that line... including an absolute path... turns out i just needed the / before manager.

My installation is in my site root, and yet i have to add this slash. I checked the files again to make sure that i hadn't removed it but the file as i've downloaded it has:
var obj_calwindow = window.open(
'manager/media/tigra_calendar/calendar.html?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,...

I'm not sure why i have to have it look up a level when i'm already in the root...but it's late again. Thanks for the help and its working fine now - have a great weekend!

#109 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 06 August 2008 - 10:37 PM

Couple more requests...

1. is there any way to remove the separator from the last title? for example if the separator is '#' then multiple events show as "event 1 # event 2 #. logically it seems whatever is the separator should not display after the last event...

in my application i want to display multiple events on the same day as " Event 1 and Event 2 and Event 3 begin " using 'and' as the separator. as its working now i get " Event 1 and Event 2 and Event 3 and begin " :( I know this is possible but seems beyond my grasp of php at this moment... this is the section generating one of those links: ($active_titles)

// event begins stuff  		
	foreach($cal_data_stripped as $j){
		if($j['sdate']== $date_test){$s++; $active_titles.=$j['title']." and ";}
			}
		$title_link = substr($active_titles,0,strpos($active_titles,' and '));	
		 if($s>1){$output.="[url="http://%5C%22%22.$etomite-"]makeURL($page,'','?Ym='.$Ym.'')."#".$testday."\" title=\" ".$active_titles." begin\" class='$event_class'>".$active_titles."".$events."[/url]\n";
            }elseif($s==1){ $output.="[url="http://%5C%22%22.$etomite-"]makeURL($page,'','?Ym='.$Ym.'')."#".$testday."\" title=\" ".$title_link." begins\" class='$event_class'>".$title_link."".$event."[/url]\n";                            

  }

2. the tigra popup again...
after selecting 'edit' for an existing event the popups don't load. my error console says cal1/cal2 is undefined.

After looking closer, my calender page is index.php?id=81&Ym=20080801, (calendar loads here) when selecting the edit button the page is index.php?Ym=20080801&id=81&eventid=1&action=Edit (calendar doesn't load here).

not sure if the url variables are 'out of order' or if id has to be first or...? again forgive me for my lack of experience.

#110 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 07 August 2008 - 08:51 AM

1) There's a few ways to pop the last 'and' off the end- probably substr() would be best set a flag to remove the last 5 characters from the end of the string (including spaces). I should have done it but I was getting lazy with it justifying that people could just use a character like - or |. You could try:

if($j['sdate']== $date_test){$s++; $active_titles.=$j['title']." and ";}
}
$title_link = substr($active_titles,0,strpos($active_titles,' and '));
$active_titles=substr($active_titles,0,-5);

2) The url variables are fine. It doesn't matter what order they are in (usually) . The problem is that there are 2 entry forms. The new event form and the edit event form. The constructor and form variables need to be the same for both, they probably aren't. I remember fiddling with this in the last version and probably broke it... Again I'll have a look and get back.
I forgot to add the calendar script call into the top of the edit form: I've included the line above and below it so you know where it goes...(about line 293).
//Pre-fill in the form with edited data
		$forma.=" <!-- zcalendar --><script type=\"text/javascript\" src=\"manager/media/tigra_calendar/calendar3.js\"></script>";
 	$forma.="<table>\n<tr><td>\n<table>\n<tr><td>\n<form action=\"".$etomite->makeURL($etomite->documentIdentifier,'','?Ym='.$editmonth.'')."\" name=\"calform\" method=\"POST\" onsubmit=\"return v.exec()\">\n";

Edited by Cris D., 07 August 2008 - 12:34 PM.


#111 darren

    Likes Etomite Forums!

  • Member
  • PipPip
  • 251 posts

Posted 07 August 2008 - 07:39 PM

1. - a very simple solution - works great!
2. that was it...

thanks for your help and sorry to be a pest :rolleyes:

#112 mike_e

    Etomite Forum Newbie

  • Member
  • 42 posts

Posted 06 September 2008 - 11:48 PM

I'm trying the the the zcalendar snippet up and running. I got everything installed but get an error.
I entered the database info in the snippet from the config.inc.php file. The error is as follows

« Error »

Etomite encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »

PHP error debug
Error: mysql_connect(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)
Error type/ Nr.: Warning - 2
File: /home/content/m/t/m/mtmadmin/html/CHILL/index.php
Line: 1596
Line 1596 source: if(@!$this->rs = mysql_connect($host, $user, $pass)) {

Parser timing
MySQL: 0.0000 s s (0 Requests)
PHP: 0.0375 s s
Total: 0.0375 s s
Powered by Etomite CMS.

I'm gonna assume that there is a problem logging into the database, I double checked the info entered into the snippet and everything matches.

Any help greatly appreciated.

#113 mike_e

    Etomite Forum Newbie

  • Member
  • 42 posts

Posted 07 September 2008 - 03:00 AM

I got the code figured out and it seems to be accessing the database. I created 2 events as a test and they seemed to work fine. Now I want to go and delete them and I will not let me, There is a text saying "Record Deleted..." but it is still there. The same thing happens when I try and delete the other event.

Any help greatly appreciated.

#114 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 07 September 2008 - 02:13 PM

Personally, I'm not familiar with this snippet so I can't be of much help... Support occasionally drops over weekends so don't be surprised if your questions aren't addressed immediately... I know that several members are using zcalendar and perhaps one of them can point you in the right direction if you don't get the issue resolved beforehand...

#115 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 08 September 2008 - 09:39 AM

I can't think why you would have been getting the initial error, however, my thinking is that while you were tweaking the code to get it working, a bug stopping the delete button from working was introduced. Can you please post the zcalendar snippet version you are using? and are you using just zcalendar on the page or are you also using other add-ons?

By the way, it was father's day yesterday and had to do the family thing- get woken up with pressies at 5.00am- visit my family and sleep after a full belly- no time for Etomite in there!

#116 mike_e

    Etomite Forum Newbie

  • Member
  • 42 posts

Posted 09 September 2008 - 12:54 AM

I checked out the database thru mysqladmin and deleted the event(s). I have done some testing and found the following.

#1 - I can't delete events. I created 2 new events after deleting them all thru my admin.
#2 - The events I created jump to a page when viewed with zcalendar_display snippet.
#3 - I CAN edit events.



I really appreciate all your help. The calendar is a big feature of our site and it need to work well for novice users.

Thank You - Mike

Edited by mike_e, 09 September 2008 - 11:17 PM.


#117 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 09 September 2008 - 07:53 AM

It seems that you have misunderstood what is required to configure this snippet and you have manually added lots of parameters that are actually automaticalluy collected. You've done a lot of configuring the $GLOBALS variables whene there is really no need for example: below...

$etoPrefix=$GLOBALS['etomite_'];//automatically set to the prefix of the etomite installation.
should remain as
$etoPrefix=$GLOBALS['table_prefix'];
What you have done creates a blank variable and stops the delete query from working:
case Delete:
$sql.="DELETE FROM `".$etoPrefix."".$zcalendar."` WHERE `".$etoPrefix."".$zcalendar."`.`id` =".$_GET['eventid']." LIMIT 1";
$con=$etomite->dbQuery($sql);
Have another look over the snippet and revert all your changes and get back to me if you have any problems with the $GLOBALS working on your server (althought I doubt you will as the entire Etomite code base relies on them).
[EDIT] Oh, and please try to use attachments instead of copy and paste large blocks of code- ta![/EDIT]

Edited by Cris D., 09 September 2008 - 07:55 AM.


#118 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 09 September 2008 - 08:38 AM

Passwords Removed, Code Boxed & Thread Merged

#119 mike_e

    Etomite Forum Newbie

  • Member
  • 42 posts

Posted 09 September 2008 - 11:24 PM

I will try and just use the standard code but I had problems with that and that's why I did all the manual editing. I really messed things up though. Sorry, I guess that's why they call it "hacking".

I will let you know how things work out.

#120 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 11 September 2008 - 05:53 AM

Quote

Hey Chris, Thanks for your help. I reset everything in the snippet and it seems to be working ok.
One issue is that all events see to be linked to a page. That is to say when I create a event it's linked to a page even if I leave it blank and it's always the same page. Any thoughts. I also tried to link to a different page and it still goes to the original page with no link
It's the template you are using, not the snippet that is creating the links. If you don't want it, remove this code from the template (chunk).
 <p class="{eLink_class}"><a href="[~{page}~]">Read More...</a></p>






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users