* User

Welcome, Guest. Please login or register.
Did you miss your activation email?

18 Mar 10, 13:11:47

Login with username, password and session length

Select language:

* Recent Topics



Donate

Donate for PortaMx !
Your donation is safe and helps support the issues and causes you care most about.

* Stats


  • *Total Posts: 9192
  • *Total Topics: 1337
  • *Online Today: 22
  • *Most Online: 157
(27 Aug 09, 03:54:53)
  • *Users: 2
  • *Guests: 12
  • *Spiders: 0
  • *Total: 14

* Themes

*

Author Topic: Calendar PHP block  (Read 6502 times)

0 Members and 1 Guest are viewing this topic.

simply sibyl

  • Guest
Re: Calendar PHP block
« Reply #30 on: 21 Mar 09, 21:33:21 »
feline thank you SO much..  that worked
You should seriously consider adding this as a preset block.
Not everyone would make it to this thread.

Offline dreamer

  • Laughter is the Best Medicine...
  • Newbie
  • *
  • Posts: 15
  • Gender: Male
  • Smiling makes me Smile
    • Lord of the Harvest Tabernacle
Re: Calendar PHP block
« Reply #31 on: 01 Apr 09, 20:26:23 »
wow i have mini calendar also.... weeeeeeee thanks fel  O0

im your avid fan!!!

God Bless!

You're no.1 O0
DOn't BeLiEve tHat yOu kNow EverYthiNg!!

Offline artus

  • Newbie
  • *
  • Posts: 9
Re: Calendar PHP block
« Reply #32 on: 28 Dec 09, 15:27:34 »
This is a great code indeed! I just have a small question: is there any easy way to remove the calendar from calendar? :-) I mean the table with days of the month. I just need the upcoming events to be shown. No need to see the days that take pretty much space.  Tried to find it in settings but failed. I am not that good to change the code myself.

Offline antechinus

  • PortaMx Supporter
  • *
  • Posts: 656
Re: Calendar PHP block
« Reply #33 on: 28 Dec 09, 22:03:52 »
It would be possible with a bit of custom coding. I don't have time to play with it this morning though. Basically you'd just need to call the upcoming events code instead of the calendar as such. Shouldn't be too hard. I'll have a look when I get time if nobody beats me to it.
Using Internet Explorer 6 on the internet is like urinating in a public swimming pool.
It's rude, there's no excuse for it, and anyone who does it should be ashamed of themselves.

Offline artus

  • Newbie
  • *
  • Posts: 9
Re: Calendar PHP block
« Reply #34 on: 28 Dec 09, 23:17:23 »
Thanks for your reply!
I tried but it looks too complicated to me. If you just sent me the line numbers to remove - that would be enough.

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 2822
  • Gender: Female
Re: Calendar PHP block
« Reply #35 on: 29 Dec 09, 01:46:27 »
If I have time after new year, I take a look at that.

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline Atheos

  • Newbie
  • *
  • Posts: 23
Re: Calendar PHP block
« Reply #36 on: 29 Dec 09, 21:18:28 »
How can I get rid of the  background for the main area?

Offline Atheos

  • Newbie
  • *
  • Posts: 23
Re: Calendar PHP block
« Reply #37 on: 05 Jan 10, 04:00:51 »
Hi, Ive asked a while ago. The calendar has a background color that I would like to get rid of but I cant find how to do it. Anyone? Thanks.

Offline BurakG

  • Charter Member
  • *
  • Posts: 72
  • Gender: Male
    • MazdaClubTR
Re: Calendar PHP block
« Reply #38 on: 29 Jan 10, 08:56:05 »
The calendar code doesnt like UTF-8 characters in day names display

You can see what it looks like at the left bottom ; The name should be "Ça" but not displayed correctly

http://www.mzdclbtr.com/index.php
Destiny. The design is clearly Ancient ..

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 2822
  • Gender: Female
Re: Calendar PHP block
« Reply #39 on: 29 Jan 10, 17:09:31 »
It'a problem with the days substring ..

Find:
Code: [Select]
   foreach($day_names as $d)
      $calendar .= '<th class="'.$class_day_names.' smalltext" align="center" valign="middle" abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'</th>';

Replace with:
Code: [Select]
   foreach($day_names as $d)
      $calendar .= '<th class="'.$class_day_names.' smalltext" align="center" valign="middle" abbr="'.htmlentities($d).'">'. short_dayname($d, $day_name_length) .'</th>';

And at the end after
Code: [Select]
echo '</table>';

add this:
Code: [Select]
function short_dayname($value, $len)
{
global $smcFunc;
return $smcFunc['substr']($value, 0, $len);
}

I think, that helps.

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline BurakG

  • Charter Member
  • *
  • Posts: 72
  • Gender: Male
    • MazdaClubTR
Re: Calendar PHP block
« Reply #40 on: 29 Jan 10, 19:24:47 »
Thx Fel,

Solved the character problem but now day 1-2-3 are outside the calender :)
Destiny. The design is clearly Ancient ..

Offline feline

  • CO PortaMx corp.
  • Administrator
  • *
  • Posts: 2822
  • Gender: Female
Re: Calendar PHP block
« Reply #41 on: 29 Jan 10, 20:16:37 »
This is the complete part you have to change
Code: [Select]
if($day_name_length)
{                                      #if the day names should be shown ($day_name_length > 0)
foreach($day_names as $d)
$calendar .= '<th class="'.$class_day_names.' smalltext" align="center" valign="middle" abbr="'.htmlentities($d).'">'. short_dayname($d, 2) .'</th>';
$calendar .= '</tr><tr style="text-align:right;">';
}

Fel
Many are stubborn in relation to the path, a few in relation to the target.

Offline BurakG

  • Charter Member
  • *
  • Posts: 72
  • Gender: Male
    • MazdaClubTR
Re: Calendar PHP block
« Reply #42 on: 29 Jan 10, 21:55:31 »
Thx Fel, all fixed and looks great :) The calendar deserves taking part in production site ;)
Destiny. The design is clearly Ancient ..

Offline Eclipse16V

  • Charter Member
  • *
  • Posts: 38
  • Gender: Male
    • Eclipse IG Deutschland
Re: Calendar PHP block
« Reply #43 on: 16 Mar 10, 16:09:27 »
Hi,

ich habe diesen Bock nun auch bei mir im Portal nur wird der Monat bei mir nicht richtig angezeigt.

Statt März 2010 steht da März 2010
Wie kann ich das ändern?

Habe im PHP Code schon mal das März geändert aber irgendwie speichert er es mir nicht so.

Sorry für den Deutschen Beitrag.
I work with:
SMF 2.0 RC1.2
Default Theme
German & English Languages


Offline Mc Fly

  • Charter Member
  • *
  • Posts: 85
  • Gender: Male
    • Die Annoholiker
Re: Calendar PHP block
« Reply #44 on: 16 Mar 10, 19:33:15 »
Hallo Eclipse16V,

danke für den deutschen Beitrag...  ;)

Ändere das "März" in "M&auml;rz" um, dann passt's. Die deutschen Umlaute kommen meist nur dann korrekt vom Web-Server, wenn dessen Standardformat auf UTF8 eingestellt ist.

Mc Fly
SMF 2.0 RC3, PortaMx 0.980 Patch 1