publish_log.txt showing in Legend box

It runs, but it doesn't show the right information

publish_log.txt showing in Legend box

Postby barney » Thu Jul 08, 2010 8:06 am

Hi all,

Wonder if anyone has had a similar problem to this or can assist me?

I've installed phpicalendar v2.4 with absolutley no problems installation wise. I seem to have a minor display problem in that the log file 'publish_log.txt' (automatically generated in the calendars directory) shows itself in the top right hand Legend: box alongside my valid ics calendar lists.

Would anyone be able to give me any tips on how to stop this displaying?

Thanks for any help in advance.

Neil
barney
Member
 
Posts: 3
Joined: Thu Jul 08, 2010 7:48 am

Re: publish_log.txt showing in Legend box

Postby Parasyte » Fri Jul 09, 2010 10:30 am

You have two immediate options. Both require modifying a line or two of PHP.

The recommended change is patching phpiCalendar so that it ignores the 'publish_log.txt' file when finding calendars. Here is a patch which does this:
Code: Select all
--- functions/calendar_functions.php   15 Apr 2010 18:39:26 -0000   1.40
+++ functions/calendar_functions.php   9 Jul 2010 15:24:12 -0000
@@ -79,6 +79,8 @@ function availableCalendars($username, $
         while (false !== ($file = readdir($dir_handle))) {
            // Make sure this is not a dot file.
            if (preg_match("/^\./", $file)) continue;
+            // publish.php creates a file called 'publish_log.txt'
+            if ($file == 'publish_log.txt') continue;
            array_push($files, "$search_path/$file");
         }
      } else {


The other option is to disable publish logging altogether. That might be acceptable in your case, if you don't need the log for debugging or keeping a record of changes. Here's a patch that disables the logging:
Code: Select all
--- calendars/publish.php   1 Jan 2009 18:33:42 -0000   1.9
+++ calendars/publish.php   9 Jul 2010 15:27:40 -0000
@@ -95,7 +95,7 @@ if (isset($phpiCal_config->calendar_path
}

// toggle logging
-define( 'PHPICALENDAR_LOG_PUBLISHING', 1 );
+//define( 'PHPICALENDAR_LOG_PUBLISHING', 1 );
if(defined('PHPICALENDAR_LOG_PUBLISHING') && PHPICALENDAR_LOG_PUBLISHING == 1) {
   if( ! $logfile = fopen('publish_log.txt','a+') ) {
      header('HTTP/1.1 401 Unauthorized');



If you can try that first option [only] and let me know if it works for you, I'll be glad to apply that patch to version 2.4 for the next RC!
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: publish_log.txt showing in Legend box

Postby barney » Fri Jul 09, 2010 10:35 am

Thank you very much Parasyte for the patch.

I'll try both the options you reccomend. Will let you know which one works best for me.

Cheers
Barney
barney
Member
 
Posts: 3
Joined: Thu Jul 08, 2010 7:48 am

Re: publish_log.txt showing in Legend box

Postby barney » Mon Jul 12, 2010 5:54 am

Hi Parasyte,

The first patch works perfectly. Thanks very much.

Barney
barney
Member
 
Posts: 3
Joined: Thu Jul 08, 2010 7:48 am


Return to Setup and display problems

Who is online

Users browsing this forum: No registered users and 1 guest

cron