Event Date before Topic Title (for myCalendar Mod)
Verfasst: 23.02.2003 13:50
Code: Alles auswählen
###################################################################################
##
## Hack Titel: Event Date before Topic Title (for myCalendar Mod)
## Hack Version: 1.0
## Autor: neo18tilidie < neo18tilidie@web.de >
## Beschreibung: Zeigt das Datum eines Events vor dem Thementitel an
## Funktioniert nur in Verbindung mit myCalendar Mod !!!
##
## Dateien zu ändern: 3
## viewforum.php
## language/lang_xxx/lang_main.php
## templates/xxx/viewforum_body.tpl
##
###################################################################################
#
#-----[ FIND IN viewforum.php ]---------------------------------------
#
//
// Okay, lets dump out the page ...
//
if( $total_topics )
{
for($i = 0; $i < $total_topics; $i++)
{
$topic_id = $topic_rowset[$i]['topic_id'];
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
$replies = $topic_rowset[$i]['topic_replies'];
#
#-----[ ADD AFTER ]-----------------------------------------------------------
#
//Events
$sql="SELECT c.topic_id, c.cal_interval_units, c.cal_date, c.forum_id,
MONTH(c.cal_date) as cal_month,
DAYOFWEEK(c.cal_date) as cal_weekday,
DAYOFMONTH(c.cal_date) as cal_monthday,
YEAR(c.cal_date) as cal_year,
DAYNAME(c.cal_date) as cal_day
FROM " . MYCALENDAR_TABLE . " c
WHERE c.topic_id =" . $topic_rowset[$i]['topic_id'];
if ( $result = $db->sql_query($sql) )
{
$cal = $db->sql_fetchrow($result);
$cal_date_pattern = array('/%a/', '/%c/', '/%e/', '/%b/', '/%y/');
$cal_date_replace = array(
$lang['mini_cal']['day'][$cal['cal_weekday']],
$cal['cal_month'],
$cal['cal_monthday'],
$lang['mini_cal']['month'][$cal['cal_month']],
$cal['cal_year']
);
if ( $cal['cal_date'] != NULL )
{
$cal_date = preg_replace($cal_date_pattern, $cal_date_replace, $lang['Mini_Cal_date_format2']);
}
else
{
$cal_date = "";
}
}
//Events
#
#-----[ FIND IN viewforum.php ]---------------------------------------
#
$template->assign_block_vars('topicrow', array(
#
#-----[ ADD AFTER ]-----------------------------------------------------------
#
'CAL_DATE' => $cal_date,
#
#-----[ FIND IN language/lang_xxx/lang_main.php ]--------------------------------------
#
$lang['Mini_Cal_date_format'] = '%e.%c.';
#
#-----[ ADD AFTER ]-----------------------------------------------------
#
$lang['Mini_Cal_date_format2'] = '%a, %e.%c. - ';
#
#-----[ FIND IN templates/xxx/viewforum_body.tpl ]-------------------------------
#
<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">topicrow.TOPIC_TITLE}</a>
#
#-----[ ADD BEFORE, IN-LINE OR AFTER ]--------------------------------------------
#
{topicrow.CAL_DATE}
#
#-----[ SAVE AND CLOSE ALL FILES ]------------------------------------------
#
Benötigt das myCalendar Mod!
$lang['Mini_Cal_date_format2'] = '%a, %e.%c. - ';
in gewünschtes Format anpassen..
DEMO gibt's auf www.party-portal.org
:arrow: http://party.g0dlike.de/board/viewforum.php?f=1