My Subscriptions

No active or expired subscriptions. View Available Subscriptions

News Feed

Receive our Newsletter

Advanced Search

Save $50 on your CMS Expo Registration

Receive $50 off the registration fee for the CMS Expo featuring Joomla! in Dever, Colorado (USA). Click here to register at the reduced rate.
Pages: [1]
Print
Author Topic: day with no event : no link  (Read 421 times)
monzamonster
Newbie
*

Karma: +0/-0
Posts: 11



View Profile
« on: February 06, 2008, 05:26:08 AM »

Hello,
In the minical, can somebody tell me if it's possible to disable the day links when there is no event ? Please, I really want to try. Is it possible ? Is there a row to change in the code ?
Thx
Logged
PepsimanAB
Moderator
Jr. Member
*****

Karma: +4/-0
Posts: 71


View Profile Email
« Reply #1 on: February 06, 2008, 08:54:34 AM »

My Jcal is modded enough that I won't guarantee that these changes will work on a fresh install, and I just did it in 5 mins just now, so I haven't tested it very much either, so please back up before trying these changes, and don't try it at all if you're not familiar with php.

The link you're looking for is in /components/com_jcalpro/themes/default/theme.php, and search for {DAY_VIEW_LINK}.  You should find it 3 times - twice in the templates, and once where the variable is defined.

In both of the template sections, replace the <td> section that contains it with
Code:
<td class="caldaydigits">&nbsp;<strong>{DISPLAY_DATE}</strong></td>

Later in the file where it is defined, add
Code:
$day = $i + $row;
if (empty($event_list)){
$display_date = $day;
} else{
$sef_href_1 = sefRelToAbs( $CONFIG_EXT['calendar_calling_page'] . "&amp;extmode=day&amp;date=$url_target_date" );
$display_date = "<a href=\"" . $sef_href_1 . "\">" . $day . "</a>";
}
where
Code:
$sef_href_1 = sefRelToAbs( $CONFIG_EXT['calendar_calling_page'] . "&amp;extmode=day&amp;date=$url_target_date" );
is currently at

Then within that $params array that contains {DAY_VIEW_LINK}, add
Code:
'{DISPLAY_DATE}' => $display_date
at the end before the parenthesis is closed.  Make sure that it's separated from the earlier items in that array with a comma.

Don't forget to backup before you try any of this, as I don't guarantee anything, although it seems to work on my installation.
Logged

Anthony
*** Please read this post before posting in the forum. ***
monzamonster
Newbie
*

Karma: +0/-0
Posts: 11



View Profile
« Reply #2 on: February 06, 2008, 12:46:21 PM »

Thanks a lot PepsimanAB !!
I put your code, and I will try to make it works.
But your solution seems to be for the calendar component
I want to do it especially in the minical module.
Did you try it ?
Logged
PepsimanAB
Moderator
Jr. Member
*****

Karma: +4/-0
Posts: 71


View Profile Email
« Reply #3 on: February 06, 2008, 06:25:47 PM »

Sorry, I didn't even notice that you'd mentioned minical.  The links in the full sized calendar had been bugging me for a while, so that's the first thing that came to mind.

At the moment, I don't have minical installed on my sites, but from a quick glance at the code, it looks like a similar solution should be possible.

$url_target_date seems to be the link for any given day, and $num_events will be 0 if there aren't any events, so you could check to see if $num_events is != 0, and then build up the link from there.  (In /modules/mod_jcalclient_minical.php)
Logged

Anthony
*** Please read this post before posting in the forum. ***
monzamonster
Newbie
*

Karma: +0/-0
Posts: 11



View Profile
« Reply #4 on: February 07, 2008, 04:34:43 AM »

To display links only where there's an event, I made that in /modules/mod_jcalclient_minical.php (row 699)
<?php
if ($num_events!=0){
?>{DAY}
<? }else{
?>
<a href="{URL_TARGET_DATE}" title="{CELL_CONTENT}" class="{DAY_LINK_CLASS}" target="{TARGET}">{DAY}</a>
<? }
?>
And it doesn't work, it displays 2 days each times (with link and no link)
Did I make a mistake in the code ?
Logged
PepsimanAB
Moderator
Jr. Member
*****

Karma: +4/-0
Posts: 71


View Profile Email
« Reply #5 on: February 07, 2008, 06:47:18 AM »

I'll try installing Minical on 1 of my installations later to play with it, but I have a feeling that when it's parsing the template, it's stripping out your php code within it and showing everything else.  You might have to do your logic lower in the code, and then pass your info up to the template in the $params array as {DAYTOSHOW} or something like that.

It looks like they already have a template set up for a day without a link (static_row), but it seems to be either all days of the month linked, or all days not linked, depending on the variable $info_data['day_link'].  I'm not sure if I'll have a lot of time to spend on it later today, but I'll try.
Logged

Anthony
*** Please read this post before posting in the forum. ***
Pages: [1]
Print
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com

Original Joomla Template design by RocketTheme ( Conversion by Bloc)