viewtopic.php
http://www.ltd-team.nl/Download/viewtopic.txt
Wat ik in vieuwtopic.php moest editten !!!
Code: Selecteer alles
##-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
#
$temp_url = append_sid("posting.$phpEx?mode=quote&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Begin "Warn of Old Topic Before Posting Reply" MOD
$sql = 'SELECT post_time FROM ' . POSTS_TABLE . ' WHERE topic_id = ' . $topic_id . ' ORDER BY post_time DESC LIMIT 1';
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, $lang['error_last_post_time'], '', __LINE__, __FILE__, $sql);
}
if ( !$row = $db->sql_fetchrow($result) )
{
message_die(GENERAL_ERROR, $lang['error_last_post_time'], '', __LINE__, __FILE__, $sql);
}
$last_post_time = $row['post_time'];
$old_topic_length = $board_config['old_topic_length'];
$last_post_time_formatted = create_date($userdata['user_dateformat'], $last_post_time, $userdata['user_timezone']);
if ( $old_topic_length == 1 )
{
switch ($board_config['time_unit'])
{
case 'Second':
$multiplier = 1;
$unit_name = $lang['Second'];
break;
case 'Minute';
$multiplier = 60;
$unit_name = $lang['Minute'];
break;
case 'Hour';
$multiplier = 3600;
$unit_name = $lang['Hour'];
break;
case 'Day';
$multiplier = 86400;
$unit_name = $lang['Day'];
break;
case 'Week';
$multiplier = 604800;
$unit_name = $lang['Week'];
break;
case 'Month';
$multiplier = 18748800;
$unit_name = $lang['Month'];
break;
case 'Year';
$multiplier = 31557600;
$unit_name = $lang['Year'];
break;
}
}
else
{
switch ($board_config['time_unit'])
{
case 'Second':
$multiplier = 1;
$unit_name = $lang['Seconds'];
break;
case 'Minute';
$multiplier = 60;
$unit_name = $lang['Minutes'];
break;
case 'Hour';
$multiplier = 3600;
$unit_name = $lang['Hours'];
break;
case 'Day';
$multiplier = 86400;
$unit_name = $lang['Days'];
break;
case 'Week';
$multiplier = 604800;
$unit_name = $lang['Weeks'];
break;
case 'Month';
$multiplier = 18748800;
$unit_name = $lang['Months'];
break;
case 'Year';
$multiplier = 31557600;
$unit_name = $lang['Years'];
break;
}
}
list($aa, $bb) = explode("/viewtopic.$phpEx", $HTTP_SERVER_VARS['SCRIPT_NAME']);
if (preg_match('/https/i', $HTTP_SERVER_VARS['SERVER_PROTOCOL']))
{
$cc = 'https://' . $HTTP_SERVER_VARS['SERVER_NAME'] . $aa . '/';
}
else
{
$cc = 'http://' . $HTTP_SERVER_VARS['SERVER_NAME'] . $aa . '/';
}
$timeot = time();
function unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
((($timeot) - ($last_post_time)) >= ($old_topic_length * $multiplier) ) ? $oldtime = ' onClick="ShowConfirmReply();" onMouseover="ChangeStatus(\'' . $cc . unhtmlentities($reply_topic_url) . '\');this.style.cursor = \'pointer\';" onMouseout="ChangeStatus(\'\')"' : $oldtime = ' onClick="JustGo();" onMouseover="ChangeStatus(\'' . $cc . unhtmlentities($reply_topic_url) . '\');this.style.cursor = \'pointer\';" onMouseout="ChangeStatus(\'\')"';
((($timeot) - ($last_post_time)) >= ($old_topic_length * $multiplier) ) ? $oldtimequote = ' onClick="ShowConfirmReplyQuote();" onMouseover="ChangeStatus(\'' . $cc . unhtmlentities($temp_url) . '\');this.style.cursor = \'pointer\';" onMouseout="ChangeStatus(\'\')"' : $oldtimequote = ' onClick="JustGoQuote();" onMouseover="ChangeStatus(\'' . $cc . unhtmlentities($temp_url) . '\');this.style.cursor = \'pointer\';" onMouseout="ChangeStatus(\'\')"';
((($timeot) - ($last_post_time)) >= ($old_topic_length * $multiplier) ) ? $oldtimequickreply = ' onClick="ShowConfirmReplyQuickReply();" onMouseover="ChangeStatus(\'' . $lang['Post_a_reply'] . '\');this.style.cursor = \'pointer\';" onMouseout="ChangeStatus(\'\')"' : $oldtimequickreply = ' onClick="ShowHide(\'quick_reply\',\'quick_reply2\');" onMouseover="ChangeStatus(\'' . $lang['Post_a_reply'] . '\');this.style.cursor = \'pointer\';" onMouseout="ChangeStatus(\'\')"';
$old_topic_javascript = '<script language="javascript" type="text/javascript">function ShowConfirmReply(){if (confirm(\'' . sprintf($lang['Old_topic_notification'], $old_topic_length, $unit_name) . '\')){window.location = (\'' . unhtmlentities($reply_topic_url) . '\');return true;}else{return false;}} function ShowConfirmReplyQuote(){if (confirm(\'' . sprintf($lang['Old_topic_notification'], $old_topic_length, $unit_name) . '\')){window.location = (\'' . unhtmlentities($temp_url) . '\');return true;}else{return false;}} function ShowConfirmReplyQuickReply(){if (confirm(\'' . sprintf($lang['Old_topic_notification'], $old_topic_length, $unit_name) . '\')){ShowHide(\'quick_reply\',\'quick_reply2\');return true;}else{return false;}} function ChangeStatus(message){window.status = message;return true;} function JustGo (){window.location = (\'' . unhtmlentities($reply_topic_url) . '\');} function JustGoQuote (){window.location = (\'' . unhtmlentities($temp_url) . '\')}</script>';
// End "Warn of Old Topic Before Posting Reply" MOD
#
#-----[ FIND ]------------------------------------------
#
$quote_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quote'] . '" alt="' . $lang['Reply_with_quote'] . '" title="' . $lang['Reply_with_quote'] . '" border="0" /></a>';
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Begin edit by "Warn of Old Topic Before Posting Reply" MOD
$quote_img = '<a><img src="' . $images['icon_quote'] . '" alt="' . $lang['Reply_with_quote'] . '" title="' . $lang['Reply_with_quote'] . '" border="0" ' . $oldtimequote . ' /></a>';
// End edit by "Warn of Old Topic Before Posting Reply" MOD
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('postrow', array(
'ROW_COLOR' => '#' . $row_color,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Begin "Warn of Old Topic Before Posting Reply" MOD
$template->assign_vars(array(
'OLDTIME_JAVASCRIPT' => $old_topic_javascript,
'OLDTIME' => $oldtime,)
);
// End "Warn of Old Topic Before Posting Reply" MOD
Je kan gewoon normaal topics maken maar zo dra je er op reageert krijg je deze fout en alleen in die topic.
Fatal error: Cannot redeclare unhtmlentities() (previously declared in c:\wamp\www\viewtopic.php:1167) in c:\wamp\www\viewtopic.php on line 1167
Lady Elensar schreef:En Duifje heeft haast ofzo, gezien een driedubbel post waarvan een bump nauwelijks een dag later.
Ja sorry daar voor had er echt haast biij, volgende keer zal ik er even aan denken voor dat ik weer wat doms doe.