vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Mini-Calendar in Header by BOP5 (VB 4.x.x) (https://vborg.vbsupport.ru/showthread.php?t=284858)

BirdOPrey5 06-23-2012 10:00 PM

Mini-Calendar in Header by BOP5 (VB 4.x.x)
 
1 Attachment(s)
Brought to you by BirdOPrey5
www.Qapla.com



https://vborg.vbsupport.ru/attachmen...1&d=1340545531

Live Demo: Mini-Calendar at Qapla.com

This mod adds a small "mini-calendar" on the header of every page, next to the logo image.

It uses the built in "ad location" called global_header1. If you use an ad in that spot (most people don't) you will need to move it prior to enabling this mod else it will not show.

If the Calendar doesn't show and you're on a custom style it is likely the style does not have the ad location coded in. See post #15 in this thread for a fix

There are settings but it is setup to work immediately after installing. Most settings should only be adjusted by advanced users. The font sizes and locations are setup for English day and month names- you may need to manually edit the headcalendar_bop5 template manually for it to look right in other languages.

You can use it as a link to the default vBulletin calendar (default behavior) or not. Also you can choose to disable it in specific styles if need be. Finally you can choose whether it displays the date based off the server's timezone or the user's timezone. (Default is user's timezone.)

New in Version 1.1 - Option to disable the display of the mini-calendar by usergroup. (Primary or secondary will work.)

I don't anticipate there will be much further development on this mod, it was just a simple thing I put together for one of my forums I figured like sharing- it already does everything I can think it needs to do, but if you have a suggestion that adds to the value I will consider it.

Each <div> has a unique id so you can use additional.css to make changes as needed.

You can see the default calendar is "blue" on top. Various other alternative color options are included in the download (red, green, yellow, and more...)

Tested as far back as VB 4.0.8 and as recent as 4.2.0 and expected to work on all 4.x versions.

Please "Mark as Installed" if you use this. :)
Donations Always Appreciated. :up:

BirdOPrey5 06-24-2012 12:48 PM

Reserved.

Nirjonadda 06-24-2012 12:51 PM

You can add with Time?

BirdOPrey5 06-24-2012 12:55 PM

No. It is designed as a calendar, not a clock.

That said, you could edit the "weekday" option in settings to show the time instead of the day of week if you really wanted.

Edit- you can change the setting PHP date() Day of Week to:
Code:

g:i a
For time to show in place of the day of the week.

ProFifaLeagues 06-24-2012 01:02 PM

Works superb on 4.2 thank you

deverill2010 06-24-2012 01:18 PM

Very cute BOP, will have it installed later! :D

Nirjonadda 06-24-2012 01:22 PM

Residence Time not working correctly? Its Showing Up 8:20PM When Current local time is 4:20PM

Taurus1 06-24-2012 01:32 PM

Very nice! If you don't use adblock.......lol

New Joe 06-24-2012 01:38 PM

Any way to change the color?

edit;
I have just read this

Quote:

You can see the default calendar is "blue" on top. Various other alternative color options are included in the download (red, green, yellow, and more...)
As you were

RobbieZ 06-24-2012 01:40 PM

Sexy! Looks ok when your using a left handed banner, when you get a full length then it looks outta place, any chance of it going to the right of bitfields?

RobbieZ 06-24-2012 01:41 PM

Then again if you have a notice it'll knock that down.. hmmm. nevermind

Mr_Running 06-24-2012 01:42 PM

Yes, Awesome

Usergroup permissions?

Prefer not to display to guest :)

BirdOPrey5 06-24-2012 01:54 PM

Quote:

Originally Posted by Nirjonadda (Post 2342524)
Residence Time not working correctly? Its Showing Up 8:20PM When Current local time is 4:20PM

Are you sure your timezone is set correctly? Are you using the setting for User's Time? If so it should match the time at the bottom of every page- "The time now is 01:58 PM" for example.

Quote:

Originally Posted by Mr_Running (Post 2342529)
Yes, Awesome

Usergroup permissions?

Prefer not to display to guest :)

I will add that at some point. :up:

deverill2010 06-24-2012 08:41 PM

Thats a shame, I have just had to unistal it. Apparently my new skin doesn't have that ad location..

BirdOPrey5 06-24-2012 09:18 PM

Quote:

Originally Posted by deverill2010 (Post 2342624)
Thats a shame, I have just had to unistal it. Apparently my new skin doesn't have that ad location..

You just need to add this code to your header template:

Code:

        <div class="ad_global_header">
                {vb:raw ad_location.global_header1}
                {vb:raw ad_location.global_header2}
        </div>

In the default VB style it is only 2 lines up from the very end of the header template- above the following code:

Code:

      <hr />
</div>


ahobilam 06-25-2012 03:49 AM

Is there any possible to connect with google calendar to show todays event also with the date?

BirdOPrey5 06-25-2012 09:54 AM

no.

dlewisr 06-25-2012 05:19 PM

Cute. I like it. Nice work

Mr_Running 06-29-2012 12:26 AM

User Group Permissions
Quote:

Originally Posted by BirdOPrey5 (Post 2342532)
I will add that at some point. :up:

I am drooling :up: with every passing day. :)

Front Range 4x4 06-29-2012 09:48 PM

1 Attachment(s)
Installed!

Thanks, I like it! To get it to look the way I preferred I did some small changes and used just this portion of the code.

Code:

{vb:raw ad_location.global_header1}
Here's where I moved it to and what it looks like on my site.

BirdOPrey5 06-29-2012 11:19 PM

Quote:

Originally Posted by Mr_Running (Post 2343730)
User Group Permissions


I am drooling :up: with every passing day. :)

LOL... Here you go, version 1.1 released. :up:

Mr_Running 06-30-2012 12:31 AM

Thank You for release 1.1 :)
Works but maybe one slight adjustment if a user is part of more than one usergroup who does not have permission it will not display.

How about using the Primary Users group?

BirdOPrey5 06-30-2012 12:42 AM

To switch it to use primary groups go to Admin CP -> Plugin Manager

Edit the TWO plugins Calendar Setup and Cache Header Calendar...

In BOTH find the line:

Code:

!is_member_of($vbulletin->userinfo, explode(",", $vbulletin->options['bop5hc_groups'])) AND
and change them to:

Code:

!in_array($vbulletin->userinfo['usergroupid'], explode(",", $vbulletin->options['bop5hc_groups'])) AND
Then save the plugins.

Mr_Running 06-30-2012 02:02 AM

Cheers, :)

WendM 07-11-2012 10:07 AM

this is excellent, Joe! :)

How can I enlarge it , please?

BirdOPrey5 07-11-2012 11:04 AM

The calendar background image is 60 x 60 pixels so enlarging it will show distortions in the image- and this was never designed to be enlarged.

But if you want to try it can all be done by adding code to additional.css - for example add this:

Code:

#bop5headcalmain {
  height:90px !important;
  width:90px !important;
  background-size: 100%;
}

That will make the calendar background image 90x90 instead of 60x60, but you will still need to do custom code for each of the text lines including the new custom widths and new font sizes, and new spacing in pixels (top values in CSS.)

BirdOPrey5 07-11-2012 11:10 AM

Here is the complete code to go to 80x80... you can customize the font sizes as you want.

Code:

#bop5headcalmain {
  height:80px !important;
  width:80px !important;
  background-size: 100%;
}
#bop5headcalmonth {
  top:18px !important;
  width:80px !important;
  font-size: 8pt !important;
}
#bop5headcalweek {
  top:33px !important;
  width:80px !important;
  font-size: 8pt !important;
}
#bop5headcalday {
  top:45px !important;
  width:80px !important;
}


WendM 07-11-2012 12:02 PM

many thanks, Joe! :) One more thing...how can I move it down a notch, please?

WendM 07-11-2012 01:45 PM

OK, for those who want to know how to push the image down to their own height, then do this:

Open Template: headcalendar_bop5

find: position:relative;

then next to it place this: top:20px;

adjust the number to suit your own position!

demo here:
http://www.hottopowners.co.uk/forum.php

BirdOPrey5 07-11-2012 03:08 PM

Quote:

Originally Posted by WendM (Post 2346968)
OK, for those who want to know how to push the image down to their own height, then do this:

Open Template: headcalendar_bop5

find: position:relative;

then next to it place this: top:20px;

adjust the number to suit your own position!

demo here:
http://www.hottopowners.co.uk/forum.php

You can also add it to additional.css so you don't have to edit the template if you want:

Code:

#bop5headcalmain {
  top:20px;
}

In general it's good to avoid editing templates because they will need to be reverted if the mod is ever upgraded and changes made to the template.

BadgerDog 07-12-2012 10:34 AM

Installed and tested under v4.1.3 ...

Didn't work on our site .. un-installed ...

I think our custom style and logo is getting in the way as it worked with default style of vBulletin ... :up:

Thanks for your efforts ... :)

Regards,
Doug

BirdOPrey5 07-12-2012 10:46 AM

Probably this:

Quote:

It uses the built in "ad location" called global_header1. If you use an ad in that spot (most people don't) you will need to move it prior to enabling this mod else it will not show.

BaanFarsang 07-24-2012 06:26 AM

Does not work on a Royal Flush Skin.

BirdOPrey5 07-24-2012 10:58 AM

The skin must be missing the ad location in the header.

See Post #15 to put the Ad Location into your header:
https://vborg.vbsupport.ru/showpost....1&postcount=15

doctorsexy 07-24-2012 05:11 PM

Great...thank you...

fxwoody 07-25-2012 04:57 PM

Cool little addon for the members :)
I have one little bug tho, when i switch to french, it doesn't show the right info :(

I guess i should had the extra language options?!?

Tks bud

BirdOPrey5 07-25-2012 05:41 PM

The names of the days and months are from the php install, not phrases in vbulletin. I'm not sure what the PHP date() function offers in terms of different languages, I think it should show for whatever language php is installed under.

http://php.net/manual/en/function.date.php

thecore762 07-26-2012 01:25 AM

BirdOPrey5, any option to makes this go in a forumblock sidebar? I think it would be super awesome!

BirdOPrey5 07-26-2012 08:03 AM

It wasn't something I was planning. I will keep it in the back of my mind if I get bored one day.

Bob_R 01-11-2013 04:57 PM

1 Attachment(s)
Quote:

Originally Posted by BirdOPrey5 (Post 2342631)
You just need to add this code to your header template:

Code:

        <div class="ad_global_header">
                {vb:raw ad_location.global_header1}
                {vb:raw ad_location.global_header2}
        </div>


Using this the calendar shows but there is no day month year.


All times are GMT. The time now is 07:14 PM.

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.01399 seconds
  • Memory Usage 1,827KB
  • 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
  • (10)bbcode_code_printable
  • (9)bbcode_quote_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
  • (40)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