News:

Join the Facebook Fan Page.

Main Menu

Calendar mods

Started by Chris Curran, January 21, 2006, 11:14:33 AM

Previous topic - Next topic

dawyndham

#60
Chris,

Here are the results:

The following could not be found (or should not have been) in /......./Themes/default/Calendar.template.php: (note that it may not look like you typed it, this is normal.)
Quote\
      \';
\}

\?\>

It's this part of the code that's causing it.  The last operation to Calendar.template.php

Quote
<operation>
         <search position="replace"><![CDATA[
         </table>
      </form>';
}

?>
]]></search>
            <add><![CDATA[
         </table>
      </form>';

    if ($context['event']['repeating']=='0')
       echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
           swapEndDate(\'none\');
        // ]]>]]<![CDATA[></script>';
}

?>

]]></add>
      </operation>

ksieg

I'm really looking forward to using this mod.  Chris, if there's anything I can do at all to help please let me know.

Thanks again for the hard work.

--Ken

ooop

#62
thanks dawyndham - i think i got it (right in the area you 'pointed' to)....

i THINK the problem is the last search operation to Calendar.template.php looks for "line feed" (or a "CR" - carraige return) after "?>"

____________________________

?>( RIGHT HERE )
]]></search>
____________________________

BUT in Calendar.template.php there is no "line feed" after the last "?>"
- it stops dead right after that last "?>"

SO i changed:
_________________________________

      <operation>
         <search position="replace"><![CDATA[
         </table>
      </form>';
}

?>
]]></search>
            <add><![CDATA[
         </table>
      </form>';

    if ($context['event']['repeating']=='0')
       echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
           swapEndDate(\'none\');
        // ]]>]]<![CDATA[></script>';
}

?>

]]></add>
      </operation>
_________________________________

TO:
_________________________________

      <operation>
         <search position="replace"><![CDATA[
                  </table>
               </td>
            </tr>
         </table>
      </form>';
}
]]></search>
            <add><![CDATA[
                  </table>
               </td>
            </tr>
         </table>
      </form>';

    if ($context['event']['repeating']=='0')
       echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
           swapEndDate(\'none\');
        // ]]>]]<![CDATA[></script>';
}
]]></add>
      </operation>
_________________________________

in search function i simply dropped "?>" and reached up higher in the file (php) to assure unique hit (may not be best - but creates quick fix)

AND NOW all "Test successful" - also (BTW) installing now gives "The package was installed successfully. You should now be able to use whatever functionality it adds or changes; or not be able to use functionality it removes." - in other words > all looks good (so far, as far as installation ;) )

the resulting effect to Calendar.template.php (at its end/bottom) is...
(note i grabbed a little more of file to show context):
_________________________________

   echo '
                  </table>
               </td>
            </tr>
         </table>
      </form>';

    if ($context['event']['repeating']=='0')
       echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
           swapEndDate(\'none\');
        // ]]></script>';
}

?>
_________________________________


ooop

#63
lol -- oddly in trying to get code to look good in my post above i used 'pre' tags > but lost 'returns' in its display --- lol

so please don't take above code display literally :)

ooop

hmmm > since the echo statement is enclosed in single quotes would double quotes work for the parameter being passed to swapEndDate - i know double quotes work fine in echo's using single quotes without the need to escape them, but i don't know exactly (as yet) what or how you want swapEndDate's parameter to be passed - would double quotes work for this??

e.g.
swapEndDate("none");

dawyndham

OK, It tested OK, and installed but there is a bug.

When I add an event it doesn't respect the end date.  The first time I tried it crashed the system by adding an event every day until infinity.  I removed the mod and tried again, this time with a monthly event, spanning three months and there are at least 6 that I have found so far.

Chris Curran

#66
dawyndhah and ooop,

The CDATA issue was addressed here a few days ago:

http://tinyurl.com/yujqza

Another pair of eyes could verify that I did what I was instructed to do. ooop, you had the previous version of the mod installed - you did remember to uninstall it before trying this one, right? Why you guys are having troubles with the mod is very confusing in a number of ways.

1) I have a virgin install of 1.1.1 here. The mod installs and operates properly during my tests.

2) When I install the 1.1.2 mod (effectively upgrading it to 1.1.2) I can also install and operate the calendar mod. I rather doubt the 1.1.2 upgrade is causing problems, but even if it was it doesn't explain the 1.1.1 problems ooop is having. So.... WTF?

dawyndhah, Let me work through this install thing first...

Chris

ooop

Chris --- when i say "virgin install" of smf i mean virginal in every sense --- to give your work proper attention (even though i'm pretty busy), i create a fresh/new/virgin install -- then proceed with latest version of your mod....

and note i'm not the only one with the issues mentioned...
why some expeience such issues and some (you for instance) do not, i can only venture to guess - and lamely at that >> type of server maybe????

ooop

also i have to admit my ignorance as far as how "anal" smf's package manager is - but when i had checked out repeatEvents_1_2.xml in my editor that indicates/displays "End of Line" i noticed:
________________________

}[CR][LF]
[CR][LF]
?>[CR][LF]
________________________

where as Calendar.template.php (of smf 1.1.1) is:
________________________

}[LF]
[LF]
?>
________________________

WITH NOTHING (NO "End of Line" OF ANY KIND) AFTER THAT FINAL "?>"

Sooo - i figured i'd give it a spin and like i said -- it did the trick...

Kindred

SMF's files are typically written in linux text, which does not use <cr><lf>

and the ?> should never have anything after it, since that can actually cause issues with the compiling of the file.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Chris Curran

Quote from: ooop on March 06, 2007, 02:17:18 AM
type of server maybe????

Beats me. After I ingest some coffee, I'm going to jump back into this from the start and re-check everything. So far, I'm the only one that seems to be able to install v1.2. Due to the results of that conversation in the Package SDK thread, I changed some settings in my editor - maybe that's burning me. But I STILL don't understand why I'm not able to dup these issues. I'm running this on a FC4 Linux server with Apache 2.2.3 and PHP 5.1.6. I'm also using the zip file on planetcurran.com as the test.

Chris Curran

Quote from: ooop on March 06, 2007, 02:49:10 AM
also i have to admit my ignorance as far as how "anal" smf's package manager is

Don't talk to me about the package manager right now - GRRRRR... :) It's very anal, and worst yet, not completely documented.

Chris Curran

Quote from: Kindred on March 06, 2007, 07:26:07 AM
SMF's files are typically written in linux text, which does not use <cr><lf>

Yea, that was asked and answered a few days ago in that Package SDK thread link I posted earlier. I was editing the suspect file in both vi and tse, maybe that's botched up something....

Quote
and the ?> should never have anything after it, since that can actually cause issues with the compiling of the file.

I presume you meant to say "parse" not "compile" as PHP code isn't "compiled". How do you figure? The "?>" simply turns the php mode off returning to standard html mode which is fine with CR's. PHP is fine with CR's, so I'm not sure what issues you refer to....

Chris Curran

Quote from: dawyndham on March 05, 2007, 11:41:30 PM
OK, It tested OK, and installed but there is a bug.

When I add an event it doesn't respect the end date.  The first time I tried it crashed the system by adding an event every day until infinity.  I removed the mod and tried again, this time with a monthly event, spanning three months and there are at least 6 that I have found so far.

Could you please check to see if v1.1 installs and operates properly on your system?

http://www.planetcurran.com/smf/repeatEvents_1_1.zip

Kindred

yes, I meant to say parse...

empty <cr>s after the closing ?> tag can cause some servers to have problems.   We've seen it alot in the joomla bridge...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Chris Curran

Quote from: Kindred on March 06, 2007, 11:33:14 AM
yes, I meant to say parse...

empty <cr>s after the closing ?> tag can cause some servers to have problems.   We've seen it alot in the joomla bridge...

Really!? Sounds like a bug in the server sw to me. Reading in a LOC is trivial and handling the various EOL formats is also trivial (e.g. fgets()). Hmmm. When you say "server" are you referring to Linux vs Windows vs etc, or Apache vs IIS vs etc?

ooop

#76
> ah - got a notice that someone posted while i was typing this - i'll post anyway and see if it fits ;) <

kindred posted > "empty <cr>s after the closing ?> tag can cause some servers to have problems.   We've seen it alot in the joomla bridge" < WOW! blow my socks off
[ above is after edit ]

Quote from: Chris Curran on March 06, 2007, 10:07:56 AM
How do you figure? The "?>" simply turns the php mode off returning to standard html mode which is fine with CR's. PHP is fine with CR's, so I'm not sure what issues you refer to....
i wondered the same thing...
i've seen tons of php files that continue beyond php's final ?>

both with blank 'run on' and HTML to file's end.

it seems to me, as you said, Chris, at such point standard HTML simply starts - and a few blank "lines/CR/LF" doesn't interfere with HTML display at all (well in very rare cases it does > sometimes creating a space in page's display where it's undesired)....

let's not forget the real issue - not how EOL effects php and all -- but > is it real search creteria (at least with some systems

what all this really gets me wondering about is what and where is the regular expression engine that smf uses --- what i wonder now is it possible the package manager is calling an external search 'utility' and that is the variable that is different on all our systems -------- specifically, perhaps one 'engine' looks for a trailing LF wher perhaps another one doesn't < stab in the dark....

basically, the above, however, is now a mute point - in that both the simple, and now seeming proper, thing to do is merely match search string not only line by line, but also LF by LF (without them neato RC's) < that i think pretty much would cure all "simple" mod install issues - besides, the thing to do seems to be to match the smf LF convention anyway....

a good 'Find and Replace' app would make doing such child's play....    :P

Chris Curran

Quote from: ooop on March 06, 2007, 12:07:07 PM
a good 'Find and Replace' app would make doing such child's play....    :P

Actually, 'dos2unix filename' from the linux command line works even easier. :)

Removing the CR's is simple, certainly. However, before I run off and remove them, I'd like to try and understand how I got here to begin with. I'm also trying to understand why I can install on both 1.1.1 and 1.1.2 and (seemingly) no one else can.... My first guess was that I was working from a different zip than you guys, but I've checked that more than once....

dawyndham

Quote from: Chris Curran on March 06, 2007, 10:15:35 AM

Could you please check to see if v1.1 installs and operates properly on your system?

http://www.planetcurran.com/smf/repeatEvents_1_1.zip [nofollow]

Chris,

1.1 Installs without a problem, and doesn't seem to have the same bug that I'm seeing.  What 1.2 is doing is when I try select an end date for the repeating it doesn't de-select the box that says no end date.

Chris Curran

#79
Quote from: dawyndham on March 06, 2007, 05:02:25 PM
Chris,

1.1 Installs without a problem, and doesn't seem to have the same bug that I'm seeing.  What 1.2 is doing is when I try select an end date for the repeating it doesn't de-select the box that says no end date.

10-4 & thx.

Advertisement: