TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 09:28:18 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 147
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 105
  • Total: 105

SMF Calendar Block

Started by Lesmond, September 03, 2005, 11:30:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

daftdate

I was just wondering and it may just be me being over enthusiastic here but could we have a similar countdown to the birthday countdown but to an event such as Halloween or Bonfire Night for us in England or maybe the big C word (Christmas) in the same block as the calendar so you would have the countdown for birthday then countdown to specific event then the rest of the calendar?? if I am being over enthusiastic then excuse me as the doctor keeps advising me to take the pills but I don’t always do it.  ;)

jpark

any way to get the birthday section viewable only to members?  probably putting an "if member" tag somewhere?  this would be awesome, i appreciate your help~

jacortina

Quote from: jpark on September 17, 2006, 10:37:44 PM
any way to get the birthday section viewable only to members?  probably putting an "if member" tag somewhere?  this would be awesome, i appreciate your help~

Basically the check would be:

global $user_info;

if (!$user_info['is_guest']) {
...
...member-only stuff...
...
}

Paulie

Anyone know where i can change the colour of the --------Holidays-------- (just under the calendar section) from blue to another colour please? Im using the last code that jacortina put up.

jpark

#214
Thanks jacortina fot the above help!
Paulie, you would go to Admin -> Calendar -> then change where it says Holiday Color to the color you want (you can look on this color chart if you need it http://www.immigration-usa.com/html_colors.html)

Paulie


jacortina

Quote from: jpark on September 22, 2006, 02:38:59 PM
Thanks jacortina fot the above help!
Paulie, you would go to Admin -> Calendar -> then change where it says Holiday Color to the color you want (you can look on this color chart if you need it http://www.immigration-usa.com/html_colors.html)

You're welcome.

Note that the above will indeed change the color, but it will also
change the color for Holidays on the Calendar page itself.

If you ONLY want to change the color of the label in the Calendar
block, find in the code given, the line:


echo '<tr><td colspan="2"><hr></td><td colspan="3" class="smalltext" align="center" style="font-weight: bold; color: #' . $modSettings['cal_holidaycolor'] . ';">Holidays</td><td colspan="2"><hr></td></tr><td colspan="7" class="smalltext">';


Change
#' . $modSettings['cal_holidaycolor'] . '

To the color you want using hex code or named color
#FF0000
red

(replace the whole substring with either of the above for a red label).

Paulie

Looking at the code and assuming that it (the calendar) should be centered in the block. Can you think of any reason why mine isn`t?

jacortina

You know, I don' think there's anything actually in the code to tell it to center.

Nor is there anything which EXPLICITLY tells it to use the full width (which would have the effect of centering it, too).

You could try this and see if it helps -

Find:

$calendar = '<table>'.'<caption >'.$p.($month_href ? '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).$n.'</caption><tr>';


Replace with:

$calendar = '<table style="width:100%;">'.'<caption >'.$p.($month_href ? '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).$n.'</caption><tr>';


See if explicitly making the width of the containing table 100% of its container (the block), works for you. It might end up spreading it out a bit more (assuming the reason it doesn't center is that you have more width than the table 'needs').

Paulie

Perfect. That worked a treat, thank you :)