[pmwiki-users] pmcal problem

adam overton a at plus1plus1plus.org
Thu Sep 4 09:07:58 CDT 2008


hi

i just installed 'pmcal' for the first time, and i have the feeling  
some of code in the current download on http://pmwiki.org/wiki/ 
Cookbook/PmCalendar might have been mistakenly changed... i don't  
think it's the same code that's being used at PmCal/PmCal, or at Cjc/ 
Cjc. here's why:

currently, all of my "empty" days (i.e. days with no events, with  
pages that don't yet exist) show up (/are formatted) as if those days  
(and links) already exist. after confirming that PageExists() was  
executing correctly, i noticed that there's no code in the current  
version to spit out different links for existing and non-existing  
dates. for instance:

    existing dates should link to http://uploaddownloadperform.net/ 
Calendar/20080905?year=2008&month=9&day=5
    &
    non-existing dates should link to http:// 
uploaddownloadperform.net/Calendar/20080906?action=edit



after a night of sleuthing, here's what i discovered to be the  
offending code (i think):

		if (!PageExists($pmcalpagename)) {
			// Bizarre hack added due to PmWiki change.
			$dn=$dn . " ${PmCalPrefix}createtextlink";  // by default $ 
{PmCalPrefix} is pmcal
		}
		$out.=sprintf("(:$ctype class='%s' height=80px :)\n",$cl);
		$out.="%class='$dn'%";
		$out.=sprintf("[[$group.%s%02d%02d?year=%s&month=%s&day=%s% 
s|%s]]\n",
		$year,$month,$iday,$year,$month,$iday,$urladd,$iday);


* note: 'pmcalcreatetextlink' is suspicious - there are no calls for  
it in any of the css files... however, there IS a class called  
'createlinktext', but i discovered that substituting or adding it  
still doesn't override all links from being given the evil 'wikilink'  
class, which leaves all links formatted as days-with-events (!!) ...


here's what i've done in order to fix the links. however, this  
doesn't still doesn't give the link the correct class, and hence  
still displays it as an existing date using the 'wikilink' class:

		if (!PageExists($pmcalpagename)) {
			// Bizarre hack added due to PmWiki change.
			$dn=$dn . " ${PmCalPrefix}createtextlink"; // just leaving this  
for now, even though it's fishy
			// LINK FMT IF DAY DOESN'T EXIST
			$dnlink = "[[$group.%s%02d%02d?action=edit|%s]]";
			$dnlink = sprintf("$dnlink\n",$year,$month,$iday,$iday);
		} else { // LINK FMT IF DAY **DOES** EXIST
			$dnlink = "[[$group.%s%02d%02d?year=%s&month=%s&day=%s%s|% 
s]]";
			$dnlink = sprintf("$dnlink\n",$year,$month,$iday,$year,$month, 
$iday,$urladd,$iday);
		}
		 $out.=sprintf("(:$ctype class='%s' height=80px :)\n",$cl);
		 $out.="%class='$dn'%";
		 $out.=$dnlink;


again, after this, the links are fine, but the classes for the links  
are not appearing the same as they do on the PmWiki site (http:// 
pmwiki.org/wiki/PmCal/PmCal) or here (http://pmwiki.org/wiki/Cjc/Cjc)

html links for non-existing days on these functioning pages should  
spit out:
<p><span class='pmcaldaynumber pmcalcreatetextlink'><a  
class='createlinktext' rel='nofollow'
     href='http://pmwiki.org/wiki/PmCal/20080902?action=edit'>2</a><a  
rel='nofollow'
     class='createlink' href='http://pmwiki.org/wiki/PmCal/20080902? 
action=edit'>?</a></span></p>

however, in mine it's spitting out the following:
<p><span class='pmcaldaynumber createlinktext'><a class='wikilink'  
href='http://uploaddownloadperform.net/Calendar/20080906? 
action=edit'>6</a></span>
</p>


is anyone having the same problems?
any suggestions on how i can get it to spit out the 'createlinktext'  
versions? anyone have an earlier version of pmcal for me to compare  
with?
any chance there's some code in my system that's causing everything  
to format as 'wikilink'?

thanks for the help,
adam






More information about the pmwiki-users mailing list