Hi!
This Modification will allow comments to cite.
1.) search in root/details.php:
if ($image_allow_comments == 1) {
insert below:
//##################### Start Quote Comments ###########################################
function parse_quote($matches) {
global $lang;
$bbcode = '';
preg_match_all('/(\w*?)=\'(.*?)\'/msi', $matches[1], $attr_matches);
$attributes = array_combine($attr_matches[1], $attr_matches[2]);
if(!empty($attributes)){
$width=100;
$attribute_strings = array();
foreach($attributes as $key => $value){
$width -= 2;
switch($key){
case 'name':
$attribute_strings[] = ''.$lang['comment_quote'].': <a href="#comment'.$attributes['id'].'">'.$value.'</a>';
break;
case 'timestamp':
$attribute_strings[] = ''.$lang['comment_at'].' '.$value;
break;
}
}
$citation = '<span class="quote_name">'.implode(' ', $attribute_strings).'</span>'."\n";
}
else{
$citation = '';
}
return $citation.'<div class="quote_text" style="width:'.$width.'%;">';
}
//##################### End Quote Comments ###########################################
1.1) search:
$site_template->register_vars(array(
"comment_id" => $comment_row[$i]['comment_id'],
insert above:
//##################### Start Quote Comments ########################################
$quote_string[$i] = str_replace('[/quote]', '</div>', $comment_row[$i]['comment_text']);
$comment_text_quote[$i] = preg_replace_callback('/\[quote(.*?)\]/msi','parse_quote', $quote_string[$i]);
//##################### End Quote Comments ###########################################
1.2) search:
"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
replace:
//##################### Start Quote Comments ########################################
//"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
"lang_comment_reply" => $lang['comment_reply'],
"lang_comment_quoting" => $lang['comment_quoting'],
"lang_comment_quote" => $lang['comment_quote'],
"allow_posting" => check_permission("auth_postcomment", $cat_id) ? 1:0,
"comment_text" => ($config['html_comments']) ? format_text($comment_text_quote[$i], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']) : nl2br(trim($comment_text_quote[$i])),
"comment_text_quote" => $comment_row[$i]['comment_text'],
//##################### End Quote Comments ##########################################
1.3) search:
if (!$allow_posting) {
insert above:
//##################### Start Quote Comments ########################################
$allow_posting = ($error) ? $allow_posting : 0;
$user_comment_quote ="";
if ($action == "post_quote") {
$allow_posting = check_permission("auth_postcomment", $cat_id);
$comment_user_name_quote = (isset($HTTP_POST_VARS['comment_user_name_quote'])) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_user_name_quote'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
$comment_id_quote = (isset($HTTP_POST_VARS['comment_id_quote'])) ? intval($HTTP_POST_VARS['comment_id_quote']) : "";
$comment_text_quote = (isset($HTTP_POST_VARS['comment_text_quote'])) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text_quote'])), 2) : "";
$comment_date_quote = (isset($HTTP_POST_VARS['comment_date_quote'])) ? ($HTTP_POST_VARS['comment_date_quote']) : "";
$user_comment_quote = stripslashes("[quote name='$comment_user_name_quote' id='$comment_id_quote' timestamp='$comment_date_quote']".$comment_text_quote."[/quote]");
}
if ($action == "post_comment") {
$allow_posting = check_permission("auth_postcomment", $cat_id);
}
//##################### End Quote Comments ##########################################
1.4) search:
"comment_text" => $comment_text,
replace:
//##################### Start Quote Comments #################################
"comment_text" => ($error) ? $comment_text : $user_comment_quote,
//##################### End Quote Comments ###################################
1.5) search:
"msg" => $msg,
insert below:
"lang_comment_reply" => $lang['comment_reply'],
2.) search in lang/yourLang/main.php "?>" and insert above:
(deutsch)
$lang['comment_quoting'] = "Zitieren";
$lang['comment_quote'] = "Zitat von";
$lang['comment_reply'] = "Antworten";
$lang['comment_at'] = "am";
(english)
$lang['comment_quoting'] = "Quoting";
$lang['comment_quote'] = "Quote from";
$lang['comment_reply'] = "Reply";
$lang['comment_at'] = "at";
3.) search in templates/your template/details.html:
{if allow_comments}
<a name="comments"></a>
<br />
insert below:
{if allow_posting}
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="right">
<form style="margin:0px;padding:0px;" name="quoteform" action="{self}&name=#comment_post_quote" method="post" onsubmit="reply_button.disabled=true;">
<input type="hidden" name="action" value="post_comment" >
<input type="submit" name="reply_button" value="{lang_comment_reply}" class="button">
</form>
</td>
</tr>
</table>
<br>
{endif allow_posting}
3.1) search:
{comment_form}
insert above:
{if allow_posting}
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="right">
<form style="margin:0px;padding:0px;" name="quoteform" action="{self}&name=#comment_post_quote" method="post" onsubmit="reply_button.disabled=true;">
<input type="hidden" name="action" value="post_comment" >
<input type="submit" name="reply_button" value="{lang_comment_reply}" class="button">
</form>
</td>
</tr>
</table>
<br>
{endif allow_posting}
4.) search in templates/your template/comment_bit.html, or download from attachment:
<td class="commentrow{row_bg_number}" valign="top" nowrap="nowrap">
replace:
<td width="100%" class="commentrow{row_bg_number}" valign="top" colspan="3">
4.1) search:
</tr>
<tr>
<td colspan="2" class="commentspacerrow"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
</tr>
replace:
{if allow_posting}
<td class="commentrow{row_bg_number}">
<form style="margin:0px;padding:0px;" name="quoteform" action="{self}&name=#comment_post_quote" method="post" onsubmit="quote_button.disabled=true;">
<input type="hidden" name="action" value="post_quote">
<input type="hidden" name="comment_user_name_quote" value="{comment_user_name}">
<input type="hidden" name="comment_id_quote" value="{comment_id}">
<input type="hidden" name="comment_date_quote" value="{comment_date}">
<input type="hidden" name="comment_text_quote" value="{comment_text_quote}">
<input type="submit" name="quote_button" value="{lang_comment_quoting}" class="button">
</form>
</td>
{endif allow_posting}
{ifno allow_posting}
{endifno allow_posting}
</tr>
<tr>
<td colspan="4" class="commentspacerrow"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
</tr>
5.) search in templates/your template/comment_form.html:
<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center">
insert above:
<a name="comment_post_quote"></a>
5.1) search:
<input type="submit" name="postbutton" value="{lang_post_comment}" class="button" />
insert above:
<input type="hidden" name="comment_text_quote" value="{comment_text}">
6.) add at end of file templates/your template/style.css:
.quote_name{
margin:0px 5px;
font-family: Tahoma,Verdana,Arial,Helvetica,sans-serif;
font-size: 10px;
font-weight: normal;
}
.quote_text{
margin:2px 5px;
padding:0px 5px;
font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
border:solid 1px black;
background-color:#f9f9f9;
line-height:16px;
}
mfg Andi