
| Author |
Message |
Thomson
Universal Genius

Joined: 05 Aug 2002
Posts: 4726
Location: a shibby place
|
Posted:
Sun 14 Sep, 2003 14:27 |
  |
Mod Name: Events für ezPortal
Mod Author: oxpus
phpBB-Versions: 2.0.x
Mod-Description: Übernimmt Termine aus dem Calender Lite 1.4.xx und stellt sie im ezPortal dar
Mod-Requierments: Calendar
Discussion: http://www.phpbb2.de/viewtopic.php?t=4401 |
_________________ There are only 10 types of people in the world: Those who understand binary, and those who don't... |
|
      |
 |
Google
|
Posted:
|
 |
|
|
 |
ddt
phpBB2.de User

Joined: 18 Oct 2003
Posts: 3
|
Posted:
Sat 18 Oct, 2003 01:01 |
  |
Sorry for writing this in English, I don't speak German very well.
I was looking for a mod exactly like this for weeks, but finally I found it... Thanks, Oxpus!
I installed it and everything works fine except one thing: the date format in the portal page box is always in a dd.mm.yyyy format and no matter what I do I cannot change it from ACP. This is strange because it's not even the default date format I use on the whole site. May you have a suggestion how I could fix it?
Cheers,
ddt |
|
|
   |
 |
oxpus
phpBB2.de User

Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen
|
Posted:
Sat 18 Oct, 2003 02:33 |
  |
Yes you can:
In portal.php find
| Code: |
$start_date = substr($row['stamp'],8,2).".".substr($row['stamp'],5,2).".".substr($row['stamp'],0,4);
$end_date = substr($row['eventspan'],8,2).".".substr($row['eventspan'],5,2).".".substr($row['eventspan'],0,4); |
and replace with
| Code: |
$start_date = mydateformat($row['stamp'], $userdata['user_dateformat']);
$end_date = mydateformat($row['eventspan'], $userdata['user_dateformat'], 1);
|
Make sure the function "mydateformat" will be contended on functions.php. This will be done while installing the calendar.
This will format the dates based on the user settings. To format them like the board settings, replace
$userdata['user_dateformat']
with
$board_config['default_dateformat']
Sorry for my bad english
OXPUS |
_________________ Karsten Ude
Support nur im Forum! || Support just on Forum!
OXPUS's Mods
Last edited by oxpus on Sat 18 Oct, 2003 02:38; edited 4 times in total |
|
    |
 |
ddt
phpBB2.de User

Joined: 18 Oct 2003
Posts: 3
|
Posted:
Sat 18 Oct, 2003 12:54 |
  |
Thanks for the quick reply!
I made the changes, but got parse error. If I'm right, the problem must be with "mydateformat", as you mentioned here:
| Quote: |
| "Make sure the function "mydateformat" will be contended on functions.php. This will be done while installing the calendar. |
Would you please explain this sentence a bit more? I checked it, but there's no "mydateformat" defined in my fuctions.php. (My board is phpBB Plus 1.2, the calendar was preinstalled). But of course there is $board_config['default_dateformat'], and I think this is all I need, as I don't want this date to be configurable by users. Also, I don't need the "end_date", as the events on my board are almost exclusively football matches.
Sorry for making this so hard...  |
|
|
   |
 |
oxpus
phpBB2.de User

Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen
|
Posted:
Sat 18 Oct, 2003 15:21 |
  |
Okay, error myselfs. The needed funktion is in the calendar.php itself, not in functions.php.
So check for
| Code: |
function mydateformat($thisdate, $dateformat='d M Y G:i', $span=0)
{
global $cal_config;
if ($cal_config['cal_dateformat']) {
$dateformat = $cal_config['cal_dateformat'];
}
// date comes in as the following:
$myr = substr($thisdate, 0, 4);
$mym = substr($thisdate, 5, 2);
$myd = substr($thisdate, 8, 2);
$myh = substr($thisdate, 11, 2);
$myn = substr($thisdate, 14, 2);
$mys = substr($thisdate, 17, 2);
if ($span || ($myh=='00' && $myn=='00' && $mys=='00')) {
// Need to strip out any TIME references so...
$timerefs = array ('a','A','B','g','G','h','H','i','I','s');
while (list(,$val) = each ($timerefs))
{
$dateformat = ereg_replace($val, "", $dateformat);
}
// strip out any characters used for time
$dateformat = ereg_replace('[:\.]', " ", $dateformat);
}
$returndate = date($dateformat, mktime ($myh,$myn,$mys,$mym,$myd,$myr));
return $returndate;
} |
or insert this code in the functions.php and delete it from the calendar.php. This will format the event dates correctly.
And please use my code like it is. The variables $start_date and $end_date defines correctly the dates of the events. Like their names will be an "singleday" event sets $start_date = $end_date, on "multiday" events the $start_date will content the first day of the event and the last event day is sets in $end_date.
And nothing is hard enough to find a solution
OXPUS |
_________________ Karsten Ude
Support nur im Forum! || Support just on Forum!
OXPUS's Mods
Last edited by oxpus on Sat 18 Oct, 2003 18:25; edited 1 time in total |
|
    |
 |
ddt
phpBB2.de User

Joined: 18 Oct 2003
Posts: 3
|
Posted:
Sun 19 Oct, 2003 02:10 |
  |
Yapp, now it works perfectly for the 2nd try, but only if I clear the above mentioned code from calendar.php, and paste it into functions.php. Thank you.
One last thing:
The events' date in the portal box is now in the needed format, everything is fine, but the language (aka name of days and months) remains english though the default language for the site is hungarian. Everywhere else on the site the date language is working well. What do you think? |
|
|
   |
 |
oxpus
phpBB2.de User

Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen
|
Posted:
Sun 19 Oct, 2003 08:48 |
  |
I think the dateformat on the calendar-config will be set... Please check this in the ACP and clear the refered field.
Also check the default format for the board date.
At least you can change on the function mydateformat
| Code: |
if ($cal_config['cal_dateformat']) {
$dateformat = $cal_config['cal_dateformat'];
} |
into
| Code: |
| $dateformat = $board_config['default_dateformat']; |
OXPUS |
_________________ Karsten Ude
Support nur im Forum! || Support just on Forum!
OXPUS's Mods
Last edited by oxpus on Sun 19 Oct, 2003 08:50; edited 1 time in total |
|
    |
 |
BK
phpBB2.de User

Joined: 07 Feb 2004
Posts: 3
|
Posted:
Sun 08 Feb, 2004 04:52 |
  |
|
   |
 |
Nexxo
phpBB2.de User


Joined: 06 Nov 2003
Posts: 10
Location: Hamburg
|
Posted:
Mon 09 Feb, 2004 16:41 |
  |
Hallo Leute ,
mich würde zunächstmal eine DEMO interessieren. Damit kann ich erstmal beurteilen , ob das Teil was für mich wäre. Das nächste wäre zu sagen unter welchen Versionen der Hack läuft. Ich benutze phpBB2 plus1.3
Mit freundlichen Grüssen
Nexxo |
|
|
     |
 |
oxpus
phpBB2.de User

Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen
|
Posted:
Mon 09 Feb, 2004 18:12 |
  |
Das läuft nicht unter plus 1.3, da hier ein anderer Kalender installiert ist.
Demo (sofern Interesse): http://www.oxpus.de |
_________________ Karsten Ude
Support nur im Forum! || Support just on Forum!
OXPUS's Mods |
|
    |
 |
CICarScene
phpBB2.de User

Joined: 23 Jul 2004
Posts: 6
|
Posted:
Fri 31 Dec, 2004 14:23 |
  |
I dont suppose you could work on an ezportal addon that would work with topic calendar by Ptirhiik? |
|
|
    |
 |
|
|
|
|
|
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|