Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks


Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Wednesday, June 19 2013 @ 10:10 PM EDT


 Forum Index > Support > Plugin Support New Topic Post Reply
 display a variable in calendar template
   
gape
 10/20/09 08:49AM (Read 1203 times)  
+++++
Full Member

Status: offline


Registered: 05/30/02
Posts: 128
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?

 
Profile Email Website
 Quote
::Ben
 10/20/09 12:40PM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1369
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

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
::Ben
 10/20/09 12:49PM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1369
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

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
gape
 10/20/09 03:11PM  
+++++
Full Member

Status: offline


Registered: 05/30/02
Posts: 128
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?

 
Profile Email Website
 Quote
::Ben
 10/22/09 04:26AM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1369
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

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
::Ben
 10/22/09 04:28AM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1369
And if you don't need the year, remove :

PHP Formatted Code

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

::Ben

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
gape
 10/22/09 05:42AM  
+++++
Full Member

Status: offline


Registered: 05/30/02
Posts: 128
gr8
it works nice enough
just cant find the way to eliminate the arrow and the box around it
any ideas?

 
Profile Email Website
 Quote
::Ben
 10/22/09 05:59AM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1369
You can't as it is a hack template on the select option.

Maybe someone can find a best way?

::Ben

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
gape
 10/22/09 07:02AM  
+++++
Full Member

Status: offline


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

 
Profile Email Website
 Quote
gape
 10/23/09 06:08AM  
+++++
Full Member

Status: offline


Registered: 05/30/02
Posts: 128
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

 
Profile Email Website
 Quote
::Ben
 10/23/09 07:27AM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1369
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

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
gape
 10/23/09 09:40AM  
+++++
Full Member

Status: offline


Registered: 05/30/02
Posts: 128
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?

 
Profile Email Website
 Quote
gape
 10/28/09 06:36AM  
+++++
Full Member

Status: offline


Registered: 05/30/02
Posts: 128
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

 
Profile Email Website
 Quote
::Ben
 10/28/09 07:43AM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1369
Nice to hear good news Smile

::Ben

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
Content generated in: 1.91 seconds
New Topic Post Reply

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