
| Autor |
Nachricht |
Thomson
Universal Genius

Anmeldungsdatum: 05.08.2002
Beiträge: 4726
Wohnort: a shibby place
|
Verfasst am:
So 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
|
Verfasst am:
|
 |
|
|
 |
ddt
phpBB2.de User

Anmeldungsdatum: 18.10.2003
Beiträge: 3
|
Verfasst am:
Sa 18 Okt, 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

Anmeldungsdatum: 11.02.2003
Beiträge: 8613
Wohnort: Bad Wildungen
|
Verfasst am:
Sa 18 Okt, 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
Zuletzt bearbeitet von oxpus am Sa 18 Okt, 2003 02:38, insgesamt 4-mal bearbeitet |
|
    |
 |
ddt
phpBB2.de User

Anmeldungsdatum: 18.10.2003
Beiträge: 3
|
Verfasst am:
Sa 18 Okt, 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:
| Zitat: |
| "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

Anmeldungsdatum: 11.02.2003
Beiträge: 8613
Wohnort: Bad Wildungen
|
Verfasst am:
Sa 18 Okt, 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
Zuletzt bearbeitet von oxpus am Sa 18 Okt, 2003 18:25, insgesamt einmal bearbeitet |
|
    |
 |
ddt
phpBB2.de User

Anmeldungsdatum: 18.10.2003
Beiträge: 3
|
Verfasst am:
So 19 Okt, 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

Anmeldungsdatum: 11.02.2003
Beiträge: 8613
Wohnort: Bad Wildungen
|
Verfasst am:
So 19 Okt, 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
Zuletzt bearbeitet von oxpus am So 19 Okt, 2003 08:50, insgesamt einmal bearbeitet |
|
    |
 |
BK
phpBB2.de User

Anmeldungsdatum: 07.02.2004
Beiträge: 3
|
Verfasst am:
So 08 Feb, 2004 04:52 |
  |
|
   |
 |
Nexxo
phpBB2.de User


Anmeldungsdatum: 06.11.2003
Beiträge: 10
Wohnort: Hamburg
|
Verfasst am:
Mo 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

Anmeldungsdatum: 11.02.2003
Beiträge: 8613
Wohnort: Bad Wildungen
|
Verfasst am:
Mo 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

Anmeldungsdatum: 23.07.2004
Beiträge: 6
|
Verfasst am:
Fr 31 Dez, 2004 14:23 |
  |
I dont suppose you could work on an ezportal addon that would work with topic calendar by Ptirhiik? |
|
|
    |
 |
|
|
|
|
|
Nächstes Thema anzeigen
Vorheriges Thema anzeigen
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
|