Advancing the Month Display

Tweaks to CPGNuCalendar
  
1 Jan '70 الاربعاء ابريل 18, 2007 07:58    
layingback
Site Admin  
  •  

مساهمة Advancing the Month Display

If you've used CPGNuCalendar much, you know that to move the month view forward (or backward) 1 month, you just need to click on the month names above the small month display to the right (or left) of the main month. But if you aren't privy to that like many of your site's visitors, you'll probably click on the >> symbols around the year, and jump forward/backward a whole year!

So try adding this small change, to include < and > symbols around the month name, plus while we're at it, add a "tool tip" to the year display to explain that it will let you see an entire year.

In /modules/CPGNuCalendar.php find around line 374

PHP:
		printf ( "%s", month_name ( $thismonth - 1 ) );
if ($thisyear-1 >= $cal_config['start_year'])
echo " <a href=\"".getlink($module_name . "&view=month&month=$thismonth&year=".($thisyear-1)) . "\" title=\"". month_name($thismonth-1)." ".($thisyear-1)."\">&lt;&lt;</a>";
echo " <a href=\"".getlink($module_name . "&view=year&year=$thisyear") . "\">$thisyear</a>";
echo " <a href=\"".getlink($module_name . "&view=month&month=$thismonth&year=".($thisyear+1)) . "\" title=\"". month_name($thismonth-1)." ".($thisyear+1)."\">&gt;&gt;</a>";


and replace with

Code:
		echo " <a href=\"".getlink($module_name . "&view=month&month=$prevmonth&year=".($thisyear)) . "\" title=\"". month_name($thismonth-2)." ".($thisyear)."\">&lt;</a> ";
		printf ( "%s", month_name ( $thismonth - 1 ) );
		echo " <a href=\"".getlink($module_name . "&view=month&month=$nextmonth&year=".($thisyear)) . "\" title=\"". month_name($thismonth)." ".($thisyear)."\">&gt;</a> ";
		if ($thisyear-1 >= $cal_config['start_year'])
			echo " <a href=\"".getlink($module_name . "&view=month&month=$thismonth&year=".($thisyear-1)) . "\" title=\"". month_name($thismonth-1)." ".($thisyear-1)."\">&lt;&lt;</a>";
		echo " <a href=\"".getlink($module_name . "&view=year&year=$thisyear") . "\" title=\"". _CALALLYEAR."\">$thisyear</a>";
		echo " <a href=\"".getlink($module_name . "&view=month&month=$thismonth&year=".($thisyear+1)) . "\" title=\"". month_name($thismonth-1)." ".($thisyear+1)."\">&gt;&gt;</a>";


Also add the following line to the end of file /language/english/cpgnucalendar.php

PHP:
define("_CALALLYEAR", "View Whole Year");



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 


عدل سابقا من قبل layingback في الاثنين ابريل 01, 2013 21:33, عدل 2 مرات 
 
 
  
1 Jan '70 الاربعاء ابريل 18, 2007 15:07    
sarah
Developer  Developer
  •  

مساهمة Re: Advancing the Month Display

Well done, the year thing made sense to me after the first time I clicked on it, but only after. I noticed a lot of people seem to treat this as a bug. I believe it is the design, but many people find it confusing.



sarah please enter your server specs in your user profile! يبكي  
 
 
 
  
1 Jan '70 الثلاثاء مارس 11, 2008 16:51    
rosbif
BetaTester  BetaTester
  •  

مساهمة Re: Advancing the Month Display

Thanks again for this - I upgraded cpgnucalendar to 2.0.6 which overwrote these edits. Have just remembered and found this post..



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
  
1 Jan '70 الاربعاء مايو 14, 2008 11:13    
layingback
Site Admin  
  •  

مساهمة Re: Advancing the Month Display

For version 2.0.6 of CPGnuCalendar, you would make the edit to file index.php, at around line 389.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
1 Jan '70 الاربعاء مايو 28, 2008 00:39    
briankent
Sponsor  Sponsor
  •  

مساهمة Re: Advancing the Month Display

- layingback

For version 2.0.6 of CPGnuCalendar, you would make the edit to file index.php, at around line 389.

I edited the index file as stated and works just fine. thanks.



briankent please enter your server specs in your user profile! يبكي  
 
 
 
  
1 Jan '70 الاحد يناير 22, 2012 15:54    
macuserau
Newbie  Newbie
  •  

مساهمة Re: Advancing the Month Display

Thanks for this a Great Mod any one proposed this a a premenant change to the module?



macuserau's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Unix / Apache 2.2.15 / MySQL 5.0.90 / PHP 5.3.2/ CMS 9.3.3.0

 
 
 
 
  
1 Jan '70 الاربعاء مارس 13, 2013 23:09    
alyssa
Newbie  Newbie
  •  

مساهمة Re: Advancing the Month Display

Is the "replace with" code supposed to be missing in the original post?



alyssa's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1 ]

 
 
 
 
  
1 Jan '70 الاربعاء مارس 13, 2013 23:21    
layingback
Site Admin  
  •  

مساهمة Re: Advancing the Month Display

- alyssa

Is the "replace with" code supposed to be missing in the original post?

Obviously not!

It's a stupid DF bug, you see it on DF.org too. Upgrade from SQL4 to 5 and some PHP /PHP code no longer displays. I'd fix it if the fix was ever published where I could find it!

Changed to code /code so you can at least read it.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

2.6.32 / 1.3 - 2.4 / 5.5 - 5.6 / 5.4 - 5.5 / 9.4

 
 
 
 
  
1 Jan '70 الخميس مارس 14, 2013 02:38    
alyssa
Newbie  Newbie
  •  

مساهمة Re: Advancing the Month Display

Bless your heart! Thank you!



alyssa's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

[ Linux / Apache 2.2.8 / MySQL 5.0.45 / PHP 5.2.6 / CPG 8.2b - 9.3.4.1 ]

 
 
 
 
  
1 Jan '70 الاثنين ابريل 01, 2013 21:15    
rosbif
BetaTester  BetaTester
  •  

مساهمة Re: Advancing the Month Display

Just done this again for the latest version. Text to be replaced was around line 439 but the language edit is now in modules/CPGNuCalendar/l10n rather than the language folder. Thanks again!



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)

Linux/2.2.11/4.1.22/5.2.17/9.3.4.1

 
 
 
 
Link  QR 
Share this صفحة للطباعة  facebook   google+   linkedin   twitthis  
Show more ...



التحكم بصلاحيات الساحة - لاتستطيع وضع مواضيع جديدة في هذا المنتدى
لاتستطيع الرد على المواضيع في هذا المنتدى
لا تستطيع تعديل مواضيعك في هذا المنتدى
لاتستطيع الغاء مواضيعك في هذا المنتدى
لاتستطيع التصويت في هذا المنتدى
You cannot attach files in this forum
You can download files in this forum