phpBB2.de Forum Index  
[netclusive - internet broadcasting]
 FAQ  •  Search  •  Download  •  Bookmarks  •  Memberlist  •  Usergroups   •  Register  •  Profile  •  Log in to check your private messages  •  Log in
 
        
 
        
 

LinkLift

View next topic
View previous topic

This forum is locked: you cannot post, reply to, or edit topics.This topic is locked: you cannot edit posts or make replies.
Author Message
Thomson
Universal Genius



Joined: 05 Aug 2002
Posts: 4726
Location: a shibby place

PostPosted: Sun 14 Sep, 2003 14:27 Reply with quoteBack to top 

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...
OfflineView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
Google







Posted: Back to top

ddt
phpBB2.de User
phpBB2.de User



Joined: 18 Oct 2003
Posts: 3

PostPosted: Sat 18 Oct, 2003 01:01 Reply with quoteBack to top 

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
OfflineView user's profileSend private message
oxpus
phpBB2.de User
phpBB2.de User



Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen

PostPosted: Sat 18 Oct, 2003 02:33 Reply with quoteBack to top 

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 Wink
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
HiddenView user's profileSend private messageSend e-mail
ddt
phpBB2.de User
phpBB2.de User



Joined: 18 Oct 2003
Posts: 3

PostPosted: Sat 18 Oct, 2003 12:54 Reply with quoteBack to top 

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... Smile
OfflineView user's profileSend private message
oxpus
phpBB2.de User
phpBB2.de User



Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen

PostPosted: Sat 18 Oct, 2003 15:21 Reply with quoteBack to top 

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 Wink

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
HiddenView user's profileSend private messageSend e-mail
ddt
phpBB2.de User
phpBB2.de User



Joined: 18 Oct 2003
Posts: 3

PostPosted: Sun 19 Oct, 2003 02:10 Reply with quoteBack to top 

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. Very Happy

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?
OfflineView user's profileSend private message
oxpus
phpBB2.de User
phpBB2.de User



Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen

PostPosted: Sun 19 Oct, 2003 08:48 Reply with quoteBack to top 

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
HiddenView user's profileSend private messageSend e-mail
BK
phpBB2.de User
phpBB2.de User



Joined: 07 Feb 2004
Posts: 3

PostPosted: Sun 08 Feb, 2004 04:52 Reply with quoteBack to top 

I have a question with this mod, and I have posted the question in the following post:

http://www.phpbb2.de/viewtopic.php?t=10568

Thanks.
OfflineView user's profileSend private message
Nexxo
phpBB2.de User
phpBB2.de User



Joined: 06 Nov 2003
Posts: 10
Location: Hamburg

PostPosted: Mon 09 Feb, 2004 16:41 Reply with quoteBack to top 

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
OfflineView user's profileSend private messageSend e-mailVisit poster's website
oxpus
phpBB2.de User
phpBB2.de User



Joined: 11 Feb 2003
Posts: 8613
Location: Bad Wildungen

PostPosted: Mon 09 Feb, 2004 18:12 Reply with quoteBack to top 

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
HiddenView user's profileSend private messageSend e-mail
CICarScene
phpBB2.de User
phpBB2.de User



Joined: 23 Jul 2004
Posts: 6

PostPosted: Fri 31 Dec, 2004 14:23 Reply with quoteBack to top 

I dont suppose you could work on an ezportal addon that would work with topic calendar by Ptirhiik?
OfflineView user's profileSend private messageVisit poster's website
Display posts from previous:      
This forum is locked: you cannot post, reply to, or edit topics.This topic is locked: you cannot edit posts or make replies.

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

Similar Topics
Topic Author Forum Replies Posted
ezportal admin problem bzw frage;P Woodstock23 phpBB2.x - MOD Support 2 Mon 08 Sep, 2008 12:50 View latest post
Kalender: Wiederholbare Events? elvoges Support allgemein 0 Tue 06 May, 2008 13:59 View latest post
EZPortal Konfiguration Klausirelli Support allgemein 3 Sat 02 Feb, 2008 13:53 View latest post
Komende Events oben im Portal Ercanxxx Support allgemein 2 Wed 19 Dec, 2007 01:10 View latest post
Ezportal - Je nach Forum-Id unterschi... Peal phpBB2.x - Support 3 Wed 05 Dec, 2007 15:06 View latest post