logo

New Response

« Return to the main article

You are replying to:

    • avatar
    • Dan
    • Posted on Thu 23 Jan 2003

    Well I like the template but found that there was no way to navigate to months( incase you do not have an entry for the month or incase you do not want all month to display as links, imagine if you have two years worth of posts).

    I just wrote a small code( nothing fancy) but it lets you fo to next and prev months.

    Added fields calYear, calmonth, Prevmonth, nextmonth, CalendarHeader.

    calYear @Left(ShowBlogsFor; "-")

    calMonth @Right(ShowBlogsFor;"-")

    "PrevMonth" def Value Pyear :=@If(calmonth="01";@Text(@Sum(@TextToNumber(Calyear) :( -1))); Calyear); Dmonth :=@If(calmonth="01";"12" ;@Text(@Sum(@TextToNumber(calmonth) :(-1)))); Pmonth :=@If(@Length(Dmonth)=2;Dmonth;"0"+Dmonth);

    Pyear +"-"+ Pmonth

    "NextMonth" Def Value Nyear :=@If(calmonth="12";@Text(@Sum(@TextToNumber(Calyear):1)); Calyear); Smonth :=@If(calmonth="12";"01";@Text(@Sum(@TextToNumber(calmonth):1))); Nmonth :=@If(@Length(smonth)=2;smonth;"0"+Smonth);

    Nyear +"-"+Nmonth REM "Builds the title and paigation urls for the next and prev buttons";

    table := "<table BGCOLOR=\"ccaaff\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\" WIDTH=\"200\" id=\"calendarHeader\"summary=\"Calendar Month, next and previous buttons\"><tr>";

    nextimg := "<img src=\"graphics/next.gif\" border=\"0\" align=\"right\" alt=\"Next Month\">"; previmg := "<img src=\"graphics/prev.gif\" border=\"0\" align=\"left\" alt=\"Previous Month\">";

    prevcell := "<td>"+@If( PrevMonth = ""; "";"<a href=\"bymonth?OpenView&count=-1&RestrictToCategory="+PrevMonth+"\">"+previmg+"< /a>") +"</td>"; nextcell := "<td>"+@If(NextMonth = "";""; "<a href=\"bymonth?OpenView&count=-1&RestrictToCategory="+NextMonth+"\">"+nextimg+"< /a>") +"</td>"; tableend := "</tr></table>";

    table+prevcell+nextcell+tableend

    Thanks for all the help and Ideas.

    Now Jake, I was thinking of using this templete for Calendaring , but I can not converte anydate other than @date(@today) to stringkeyID like yyyymmdd.

    Today I will try to write some javascript. If any one can help me then it will be great. After that we can just challenge the Inotes template (for which design codes are not open) I mean most of functionality is embedded in forms5.nsf

    Wait for your reponse

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: