Page 1 of 1

Past Months In CGCalendar Do Not Show Same Format

Posted: Mon Oct 27, 2014 7:29 pm
by KitchM
When I attempt to go back a month or two in my calendar, the format of the calendar changes even though the page does not. Updating the page does not help. Is an old calendar locked in somehow?

Or is it that the calendar size is not set, but varies by text in the cells? If so, how can it become one set size?

I am using CMSMS 1.11.11 with LimeSurvey 2.05plus-build141003, PHPlist 3.0.8 (Stable) and Simple Machines Forum 2.0.8 thru Virtualmin 4.011 Pro on a standard LAMP server hosted on a OpenVZ VPS with:
Kernel and CPU = Linux 2.6.18-274.7.1.el5.028stab095.1 on i686
Memory 1.5 GB
CentOS 32 bit 6.5
Apache version 2.2.15
BIND version 9.8.2
MySQL version 5.1.73
PHP version 5.3.3
Perl version 5.010001
Postfix Mail Server version 2.6.6
Dovecot IMAP/POP3 Server Version 2.0.9
SpamAssassin version 3.3.1
ClamAV version 0.97.6
ProFTPd version 1.33
Webmin 1.710
etc.
and accessing it locally thru Firefox 32.0.2 on Fedora 20 with Xfce 4.10.1.

Here is the template:

Code: Select all

{strip}
<table class="calendar" id="cal-calendar">

<!-- added by user -->
<p><span style="color: green; font-size: 200%">
<!-- added by user -->
{$month_names[$month]}
</span></p>

<caption class="calendar-month">

<!-- edited by user to include style -->
<p><span class="calendar-prev">
<a href="{$navigation.prev}" style="color: blue; font-size: 100%; float:left; 
padding-bottom: 2em">&laquo Previous Month;</a>
</span>

<span class="calendar-next"><a href="{$navigation.next}"style="color: blue; font-size: 100%; float:right; padding-bottom: 2em">Next Month &raquo;</a>
</span>
</p>


</caption>
<tbody><tr>
{foreach from=$day_names item=day key=key}
<th abbr="{$day}">{$day_short_names[$key]}</th>
{/foreach}</tr>

<tr>
{* initial empty days *}
{if $first_of_month_weekday_number > 0}
<td colspan="{$first_of_month_weekday_number}">&nbsp;</td>
{/if}

{* iterate over the days of this month *}
{assign var=weekday value=$first_of_month_weekday_number}
{foreach from=$days item=day key=key}
{if $weekday == 7}
	{assign var=weekday value=0}
</tr>
<tr>
{/if}
<td {if isset($day.class)}class="{$day.class}"{/if}>
{if isset($day.events.0)}<a href="{$day.ni_url}">{$key}</a>{* by default use the non inline (replace content tag) version of the URL *}
<ul>
{foreach from=$day.events item=event}
<li><a href="{$event.url}">{$event.event_title}</a></li>
{/foreach}
</ul>
{else}{$key}{/if}
</td>
{math assign=weekday equation="x + 1" x=$weekday}
{/foreach}

{* remaining empty days *}
{if $weekday != 7}
<td colspan="{math equation="7-x" x=$weekday}">&nbsp;</td>
{/if}


</tr>
</tbody></table>

{/strip}

Re: Past Months In CGCalendar Do Not Show Same Format

Posted: Tue Oct 28, 2014 8:53 am
by velden
If posting system information - which always is a good start - please use the cmsms built-in system info. That's more relevant.
You can find it here: Site Admin -> System Information. At the right top there is a link 'View Text Report (suitable for copying into forum posts)'.

Could you past screen shots of the 'problem', one with the expected behavior and one with the wrong behavior. Even better would be a link to the webpage if public.

Re: Past Months In CGCalendar Do Not Show Same Format

Posted: Tue Oct 28, 2014 3:24 pm
by KitchM
Thank, velden. You are quite correct. I missed the one CMSMS likes, so here it is:


----------------------------------------------

Cms Version: 1.11.11

Installed Modules:

CMSMailer: 5.2.2
CMSPrinting: 1.0.5
FileManager: 1.4.5
MenuManager: 1.8.6
ModuleManager: 1.5.8
News: 2.14.4
Search: 1.7.11
ThemeManager: 1.1.8
Gallery: 2.0.1
CGExtensions: 1.42.2
SiteMapMadeSimple: 1.2.8
Glossary: 1.0
ExtendedTools: 1.3.3
CGCalendar: 1.14.3
Captcha: 0.4.6
TemplateExternalizer: 2.1.6
UsersGuide: 1.8.1
ListIt2: 1.4.1
ListIt2XDefs: 1.2
ListIt2NEOlist: 1.4.1
AdvancedContent: 0.9.4.3
CGSmartImage: 1.17
LinkMgr: 2.0
ListIt2DirectionList: 1.4.1
CGSimpleSmarty: 1.7.4
RSSSimplePie: 1.0
ListIt2PoliticalList: 1.4.1
ListIt2EndorsementsList: 1.4.1
TinyMCE: 2.9.12
MicroTiny: 1.2.7


Config Information:

php_memory_limit:
process_whole_template:
max_upload_size: 10000000
url_rewriting: mod_rewrite
page_extension: .html
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true


Php Information:

phpversion: 5.3.3
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 0
E_DEPRECATED: 0
memory_limit: 128M
max_execution_time: 60
output_buffering: 4096
safe_mode: Off (False)
file_uploads: On (True)
post_max_size: 10M
upload_max_filesize: 10M
session_save_path: /home/sierraclubswmg/tmp (0750)
session_use_cookies: On (True)
xml_function: On (True)
xmlreader_class: On (True)


Server Information:

Server Api: cgi-fcgi
Server Db Type: MySQL (mysql)
Server Db Version: 5.1.73
Server Db Grants: Found a "GRANT ALL" statement that appears to be suitable
Server Time Diff: No filesystem time difference found


----------------------------------------------

Also, see the calendar here:
https://www.sierraclubswmg.org/calendar.html

Re: Past Months In CGCalendar Do Not Show Same Format

Posted: Tue Oct 28, 2014 3:50 pm
by paulbaker
KitchM wrote:Or is it that the calendar size is not set, but varies by text in the cells? If so, how can it become one set size?
The calendar you linked to changes size according to what is in each months event listings. You can set it to be a constant width by adding a min-width: 100px; (for example) to the td of the table in your CSS file. So each cell will be at least 100px unless the wording requires it to be even wider.

Re: Past Months In CGCalendar Do Not Show Same Format

Posted: Wed Oct 29, 2014 5:19 pm
by KitchM
Thanks much. However, I had trouble figuring where to add your suggestion.

Instead, I found that one could add

Code: Select all

style="width:100%"
to the table line. It forces the table to be full width every time.

I will report if there is a problem with it.