vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Mini Calendar (https://vborg.vbsupport.ru/showthread.php?t=167344)

potocki99 01-09-2008 12:24 PM

Mini Calendar
 
I know there are a couple of Mod's for a mini calendar, but they are outdated and I can't get them to work.

Any idea if there is a way to maybe take the minicalendar on the calendar.php page and move it, or copy it and put it on the forumhome?

I looked into the VBAdvanced, but that is way more than what I want to do with my board at this time.

Thanks!

CNibbana 01-17-2008 03:30 AM

I feel your pain.

The mini calendar of old that shows the actual VB calendar on a non-VB page, complete with links to events, etc. is something I have wanted for a long time. I would love to see this mod but don't have the capability to figure it out myself (I tried).

Hopefully someone out there with the skills will make it happen!

Shanj 01-18-2008 01:44 AM

Would like to display a mini calendar in my side column.

I know the cms do it but I prefer to just select items I want and stick them in.
I'm using Ultimate Side Columns and it adds on to the navbar template.

Also want a hierarch calendar, top as now, 2nd level viewable by usergroup, 3rd lever private for oneself. Lower levels get feed from upper level/s.

mikelangelo2005 11-16-2008 07:23 AM

I also look for the same :confused:
greetings,

Trady 05-26-2009 05:37 PM

Also looking for this...

T.

Dulce 07-29-2009 04:35 PM

has this been made anywhere yet?

Vector76 08-11-2009 04:29 AM

1 Attachment(s)
I put something together that appears to work. Basically I took a very carefully chosen few lines from calendar.php, just enough to get the mini calendar to work. Here's the php in its entirety:
PHP Code:

<?php
require_once(DIR '/includes/functions_calendar.php');
$today getdate(TIMENOW $vbulletin->options['hourdiff']);
$vbulletin->GPC['month'] = $today['mon'];
$vbulletin->GPC['year'] = $today['year'];

$usertoday = array(
    
'firstday' => gmdate('w'gmmktime(000$month1$year)),
    
'day' => $vbulletin->GPC['day'],
    
'month' => $vbulletin->GPC['month'],
    
'year' => $vbulletin->GPC['year'],
);
// NOTE! Hard-coded for calendar number 1!
$vbulletin->GPC['calendarid'] = 1;
$calendarinfo verify_id('calendar'$vbulletin->GPC['calendarid'], 11);
$getoptions convert_bits_to_array($calendarinfo['options'], $_CALENDAROPTIONS);
$calendarinfo array_merge($calendarinfo$getoptions);
$geteaster convert_bits_to_array($calendarinfo['holidays'], $_CALENDARHOLIDAYS);
$calendarinfo array_merge($calendarinfo$geteaster);

$eventrange = array();
$eventrange['frommonth'] = $vbulletin->GPC['month'];
$eventrange['fromyear']= $vbulletin->GPC['year'];
$eventrange['nextmonth'] = $vbulletin->GPC['month'];
$eventrange['nextyear'] = $vbulletin->GPC['year'];
$eventcache cache_events($eventrange);

$minimonth construct_calendar_output($today$usertoday$calendarinfo);
?>

I named this file cal.php.

Then within index.php (i wanted it on the main page only), right after
PHP Code:

require_once('./global.php'); 

I put
PHP Code:

require_once('./cal.php'); 

Then the last step is, within the template, wherever you want the mini calendar to appear, place this (the same fragment that appears on the monthly calendar).
HTML Code:

<table class="tborder" cellpadding="2" cellspacing="$stylevar[cellspacing]" border="0" width="170">
$minimonth
</table>


So, to summarize:
1. copy the php code into a file, cal.php and put that file in the main forum directory
2. add php code to require_once this file, in the file where you want to use the mini calendar
3. add the <table> fragment including $minimonth to your template.

Note, I don't really understand how the multiple calendars work, or the access control for calendars, so this is hard-coded to always display calendar 1.

If someone else wants to turn this into an official "mod" then by all means go ahead.

Attached is a screen shot (I put it on the FAQ page first so as not to disrupt the forum during development).

Vector76 08-11-2009 02:07 PM

I made a mistake and didn't notice that the weekday abbreviations (S, M, T, W, T, F, S) were not showing up along the top row. I finally figured out what was causing that: the phrase group that's loaded needs to include 'calendar'. And the $phrasegroups variable needs to be updated before global.php is included.

So for example at the top of index.php you'll see:
PHP Code:

$phrasegroups = array('holiday'); 

which needs to be
PHP Code:

$phrasegroups = array('holiday''calendar'); 

in order for the days to show up.

There's probably a nice clean way to do this in vbulletin that is more modular and doesn't involve editing code in as many places, but for me this is now working.

Front Range 4x4 09-30-2009 06:07 PM

Thanks, this works well on 3.8.

And 1 10-06-2009 02:58 AM

Thanks


All times are GMT. The time now is 07:08 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01255 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete