Welcome to Geeklog Sunday, October 24 2021 @ 02:03 pm EDT

Geeklog Forums

display a variable in calendar template


Status: offline

gape

Forum User
Full Member
Registered: 30/05/02
Posts: 138
hi

i wanna display just current month in
plugins/calendar/templates/calendar.thtml

is there any variable available for this ... like {month}
Razz

if there is not, how do i create it?
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
Hello gape,

You could simply remove the link to week and day view.

Remove this code from calendar.thtml

PHP Formatted Code
                              <table width="100%" cellpadding="5" cellspacing="0" border="0" class="cal-header">
                                    <tr align="center" class="dayview_times">
                                        <td width="33%" align="center"><a href="{site_url}/calendar/index.php?mode={mode}&amp;view=day">{lang_day}</a></td>
                                        <td width="33%" align="center"><a href="{site_url}/calendar/index.php?mode={mode}&amp;view=week">{lang_week}</a></td>
                                        <td width="33%" align="center"><b>{lang_month}</b></td>
                                    </tr>
                                </table><br{xhtml}>


::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
And if you need to remove all the links to previous and next month, use this code as calendar.thtml

PHP Formatted Code


                                <!-- Begin Calendar -->

                                <table width="100%" cellpadding="5" cellspacing="1" border="0" class="cal-body">
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td width="15%" class="cal-day">{lang_sunday}</td>
                                        <td width="14%" class="cal-day">{lang_monday}</td>
                                        <td width="14%" class="cal-day">{lang_tuesday}</td>
                                        <td width="14%" class="cal-day">{lang_wednesday}</td>
                                        <td width="14%" class="cal-day">{lang_thursday}</td>
                                        <td width="14%" class="cal-day">{lang_friday}</td>
                                        <td width="15%" class="cal-day">{lang_saturday}</td>
                                    </tr>
                                    {cal_week}
                                </table>
                                <table align="center">
                                    <tr>
                                        <td>
                                            {add_event_option}
                                        </td>
                                        <td>
                                        {personal_calendar_option}
                                        {master_calendar_option}
                                        </td>
                                    </tr>
                                </table>

                                <!-- End Calendar -->
 


::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

gape

Forum User
Full Member
Registered: 30/05/02
Posts: 138
oh
im sorry, now i see that i did not specify problem well

current month - and all its events are already displayed
i removed all the stuff in the header of calendar, but now there is no reference to what the month is now

in short i wanna display the word October - for this month now
but next month there should be written November
no date and no year
and
i dont like month to be displayed in dropdown menu
as is in default template

current state is visible here
http://www.greentara.si/calendar/index.php

in place of
Mesec
Oktober
i wanna display variable in question

i hardcoded the words manually in calendar.thtml for the time beeing

makes any more sense?
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
Hello,

So a way and a quick hack could be this one :
PHP Formatted Code


                                <!-- Begin Calendar -->

                                <table width="100%" cellpadding="5" cellspacing="1" border="0" class="cal-body">
                                                                    <tr>
                                        <td colspan="8">
                                            <form method="post" action="#">
                                                <div>
                                                    <input type="hidden" name="mode" value="{mode}"{xhtml}>
                                                        <select name="month" style="font-size:20px"  DISABLED>
                                                            <option value="1" {selected_jan}>{lang_january}</option>
                                                            <option value="2" {selected_feb}>{lang_february}</option>
                                                            <option value="3" {selected_mar}>{lang_march}</option>
                                                            <option value="4" {selected_apr}>{lang_april}</option>
                                                            <option value="5" {selected_may}>{lang_may}</option>
                                                            <option value="6" {selected_jun}>{lang_june}</option>
                                                            <option value="7" {selected_jul}>{lang_july}</option>
                                                            <option value="8" {selected_aug}>{lang_august}</option>
                                                            <option value="9" {selected_sep}>{lang_september}</option>
                                                            <option value="10" {selected_oct}>{lang_october}</option>
                                                            <option value="11" {selected_nov}>{lang_november}</option>
                                                            <option value="12" {selected_dec}>{lang_december}</option>
                                                        </select>&nbsp;
                                                        <select name="year" style="font-size:20px"  DISABLED>
                                                            {year_options}
                                                        </select>
                                                </div>
                                            </form><br{xhtml}>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td width="15%" class="cal-day">{lang_sunday}</td>
                                        <td width="14%" class="cal-day">{lang_monday}</td>
                                        <td width="14%" class="cal-day">{lang_tuesday}</td>
                                        <td width="14%" class="cal-day">{lang_wednesday}</td>
                                        <td width="14%" class="cal-day">{lang_thursday}</td>
                                        <td width="14%" class="cal-day">{lang_friday}</td>
                                        <td width="15%" class="cal-day">{lang_saturday}</td>
                                    </tr>
                                    {cal_week}
                                </table>
                                <table align="center">
                                    <tr>
                                        <td>
                                            {add_event_option}
                                        </td>
                                        <td>
                                        {personal_calendar_option}
                                        {master_calendar_option}
                                        </td>
                                    </tr>
                                </table>

                                <!-- End Calendar -->
 


::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
And if you don't need the year, remove :

PHP Formatted Code

                                                        <select name="year" style="font-size:20px"  DISABLED>
                                                            {year_options}
                                                        </select>
 

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

gape

Forum User
Full Member
Registered: 30/05/02
Posts: 138
gr8
it works nice enough
just cant find the way to eliminate the arrow and the box around it
any ideas?
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
You can't as it is a hack template on the select option.

Maybe someone can find a best way?

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

gape

Forum User
Full Member
Registered: 30/05/02
Posts: 138
this far i got
PHP Formatted Code
<select name="month" style="font-size:20px; border:0px; background-color:#ffffff;"  DISABLED>
 Quote

Status: offline

gape

Forum User
Full Member
Registered: 30/05/02
Posts: 138
is there rly no way to display this same variable in any other way but select-box?

cant i display it using php - thru functions.php or something
i could program this myself, but need some kind of guidlines

its calendar
where exactly i put the code?
how do i declare new variable - if needed - i hope its not
how do i allow it to be used in theme file

i know how to call it - if its there

Razz
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
Hello gape,

You will need to implement two variables

print_month and print_year in the calendar.thtml
PHP Formatted Code
{print_month} {print_year}


and use this hack in the public_html/calendar/index.php

PHP Formatted Code

$cal_templates->set_var('lang_january', $LANG_MONTH[1]);
if ($month == 1) { $cal_templates->set_var('selected_jan','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_february', $LANG_MONTH[2]);
if ($month == 2) { $cal_templates->set_var('selected_feb','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_march', $LANG_MONTH[3]);
if ($month == 3) { $cal_templates->set_var('selected_mar','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_april', $LANG_MONTH[4]);
if ($month == 4) { $cal_templates->set_var('selected_apr','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_may', $LANG_MONTH[5]);
if ($month == 5) { $cal_templates->set_var('selected_may','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_june', $LANG_MONTH[6]);
if ($month == 6) { $cal_templates->set_var('selected_jun','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_july', $LANG_MONTH[7]);
if ($month == 7) { $cal_templates->set_var('selected_jul','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_august', $LANG_MONTH[8]);
if ($month == 8) { $cal_templates->set_var('selected_aug','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_september', $LANG_MONTH[9]);
if ($month == 9) { $cal_templates->set_var('selected_sep','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_october', $LANG_MONTH[10]);
if ($month == 10) { $cal_templates->set_var('selected_oct','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_november', $LANG_MONTH[11]);
if ($month == 11) { $cal_templates->set_var('selected_nov','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}
$cal_templates->set_var('lang_december', $LANG_MONTH[12]);
if ($month == 12) { $cal_templates->set_var('selected_dec','selected="selected"');
$cal_templates->set_var('print_month',$LANG_MONTH[$month]);
}

$cal_templates->set_var('lang_day', $LANG_CAL_2[39]);
$cal_templates->set_var('lang_week', $LANG_CAL_2[40]);
$cal_templates->set_var('lang_month', $LANG_CAL_2[41]);

if ($mode == 'personal') {
    $cal_templates->set_var ('calendar_title',
                             $LANG_CAL_2[28] . ' ' . COM_getDisplayName());
} else {
    $cal_templates->set_var ('calendar_title',
                             $_CONF['site_name'] . ' ' . $LANG_CAL_2[29]);
}

$yroptions = '';
for ($y = $currentyear - 5; $y <= $currentyear + 5; $y++) {
    $yroptions .= '<option value="' . $y . '"';
    if ($y == $year) {
        $yroptions .= ' selected="selected"';
        $cal_templates->set_var('print_year', $year);
    }
    $yroptions .= '>' . $y . '</option>'.LB;
}
$cal_templates->set_var('year_options', $yroptions);


::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

gape

Forum User
Full Member
Registered: 30/05/02
Posts: 138
i located the code in calendar.php and changed it
i called the two variables in calendar.thtml, but nothing happens ...

i should enable them ... somwhere?
 Quote

Status: offline

gape

Forum User
Full Member
Registered: 30/05/02
Posts: 138
Quote by: gape

i located the code in calendar.php and changed it
i called the two variables in calendar.thtml


it works ... ty
rechecked everything and now it works
did not upload the file ... or smting

tyvm again
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
Nice to hear good news Smile

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

All times are EDT. The time is now 02:03 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content