ALEXIS
20.04.2006, 18:45
canverNetX/
xs.cfg
[syntax="php"]<?php
$replace['viewtopic_body.tpl'] = 'xs/xs_topic.tpl';
?>[/syntax]
xs/xs_topic.tpl "// show quick reply" diye başlıyor
[syntax="php"]<!-- BEGIN postrow -->
<?php
// check if quick reply is enabled
global $userdata, $board_config, $topic_id, $is_auth, $forum_topic_data, $lang, $phpEx;
//$can_reply = $userdata['session_logged_in'] ? true : false;
$can_reply = $this->style_config['quick_reply'] && $userdata['session_logged_in'] ? true : false;
if($can_reply)
{
$is_auth_type = 'auth_reply';
if(!$is_auth[$is_auth_type])
{
$can_reply = false;
}
elseif ( ($forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED) && !$is_auth['auth_mod'] )
{
$can_reply = false;
}
}
if($can_reply)
{
$this->assign_block_vars('xs_quick_reply', array());
}
$postrow_count = ( isset($this->_tpldata['postrow.']) ) ? sizeof($this->_tpldata['postrow.']) : 0;
for ($postrow_i = 0; $postrow_i < $postrow_count; $postrow_i++)
{
$postrow_item = &$this->_tpldata['postrow.'][$postrow_i];
// set profile link and search button
if(!empty($postrow_item['PROFILE']) && strpos($postrow_item['POSTER_NAME'], '<') === false)
{
$postrow_item['SEARCH_IMG2'] = str_replace('%s', htmlspecialchars($postrow_item['POSTER_NAME']), $postrow_item['SEARCH_IMG']);
$search = array($lang['Read_profile'], '<a ');
$replace = array($postrow_item['POSTER_NAME'], '<a class="post-name" ');
$postrow_item['POSTER_NAME'] = str_replace($search, $replace, $postrow_item['PROFILE']);
}
// check for new post
$new_post = strpos($postrow_item['MINI_POST_IMG'], '_new') > 0 ? true : false;
$postrow_item['XS_NEW'] = $new_post ? '-new' : '';
// fix text
$search = array(' ', "\t", "\n ");
$replace = array(' ', ' ', "\n ");
$postrow_item['MESSAGE'] = str_replace($search, $replace, $postrow_item['MESSAGE']);
ob_start();
?>
{postrow.ATTACHMENTS}
<?php
$postrow_item['ATTACHMENTS'] = ob_get_contents();
ob_end_clean();
}
// show quick reply
if($can_reply)
{
// quick reply button
global $images;
$this->vars['CA_QUICK_REPLY_BUTTON'] = '<a href="javascript:ShowHide(\'quick_reply\',\'quick_reply2\');"><img src="' . $images['quick_reply'] . '" alt="' . $lang['Post_a_reply'] . '" align="middle" /></a>';
// quick reply form
ob_start();
?>
<div id="quick_reply" style="display: none; position: relative; ">
<form action="<?php echo append_sid('posting.'.$phpEx); ?>" method="post" name="post" style="display: inline;">{S_HIDDEN_FIELDS}
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thTop" nowrap="nowrap" colspan="2"><?php echo $lang['Post_a_reply']; ?></th>
</tr>
<tr>
<td class="row1" align="left" width="120" nowrap="nowrap"><span class="gen"> <b><?php echo $lang['Subject']; ?>:</b></span></td>
<td class="row2" align="left" width="100%"><input type="text" name="subject" size="45" maxlength="60" style="width:98%" tabindex="2" class="post" value="" /></td>
</tr>
<tr>
<td class="row1" align="left" nowrap="nowrap"><span class="gen"> <b><?php echo $lang['Message_body']; ?>:<br /><img src="{IMG_PATH}/spacer.gif" width="120" height="1" border="0" alt="" /></b></span></td>
<td class="row2" align="left" width="100%"><textarea name="message" rows="15" cols="35" style="width:98%" tabindex="3" class="post"></textarea></td>
</tr>
<tr>
<td class="row1" align="left" valign="top" nowrap="nowrap"><span class="gen"> <b><?php echo $lang['Options']; ?>:</b></span></td>
<td class="row2" align="left"><span class="genmed">
<?php
$user_sig = ( $userdata['user_sig'] != '' && $board_config['allow_sig'] ) ? $userdata['user_sig'] : '';
$html_on = $board_config['allow_html'] ? $userdata['user_allowhtml'] : 1;
$bbcode_on = $board_config['allow_bbcode'] ? $userdata['user_allowbbcode'] : 0;
$smilies_on = $board_config['allow_smilies'] ? $userdata['user_allowsmile'] : 0;
?>
<?php if($board_config['allow_html']) { ?>
<label><input type="checkbox" name="disable_html" <?php echo ($html_on ? '' : 'checked="checked"'); ?> /> <span class="genmed"><?php echo $lang['Disable_HTML_post']; ?></span></label><br />
<?php } else { ?><input type="hidden" name="disable_html" value="checked" /><?php } ?>
<?php if($board_config['allow_bbcode']) { ?>
<label><input type="checkbox" name="disable_bbcode" <?php echo ($bbcode_on ? '' : 'checked="checked"'); ?> /> <span class="genmed"><?php echo $lang['Disable_BBCode_post']; ?></span></label><br />
<?php } else { ?><input type="hidden" name="disable_bbcode" value="checked" /><?php } ?>
<?php if($board_config['allow_smilies']) { ?>
<label><input type="checkbox" name="disable_smilies" <?php echo ($smilies_on ? '' : 'checked="checked"'); ?> /> <span class="genmed"><?php echo $lang['Disable_Smilies_post']; ?></span></label><br />
<?php } else { ?><input type="hidden" name="disable_smilies" value="checked" /><?php } ?>
<?php if($user_sig) { ?>
<label><input type="checkbox" name="attach_sig" <?php echo ($userdata['user_attachsig'] ? 'checked="checked"' : ''); ?> /> <span class="genmed"><?php echo $lang['Attach_signature']; ?></span></label><br />
<?php } else { ?><input type="hidden" name="attach_sig" value="" /><?php } ?>
<label><input type="checkbox" name="notify" <?php echo ($userdata['user_notify'] ? 'checked="checked"' : ''); ?> /> <span class="genmed"><?php echo $lang['Notify']; ?></span></label><br />
</span></td>
</tr>
<tr>
<td class="catBottom" colspan="2" align="center"> <input type="hidden" name="mode" value="reply" /><input type="hidden" name="t" value="<?php echo $topic_id; ?>" /><input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="<?php echo $lang['Submit']; ?>" /> <input type="submit" tabindex="5" name="preview" class="liteoption" value="<?php echo $lang['Preview']; ?>" /></td>
</tr>
</table>
</form>
</div>
<?php
$str = ob_get_contents();
ob_end_clean();
$this->vars['CA_QUICK_REPLY_FORM'] = $str;
}
?>
<!-- END postrow -->
<!-- INCLUDE viewtopic_body.tpl -->[/syntax]
viewtopic_body.tpl
[syntax="html"]<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="middle" width="100%"><div class="tbut">{S_TOPIC_ADMIN}</div></td>
<td align="right" valign="middle" nowrap="nowrap"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a>
<!-- BEGIN xs_quick_reply -->{CA_QUICK_REPLY_BUTTON}<!-- END xs_quick_reply -->
</td>
</tr>
</table>
<br />{CA_QUICK_REPLY_FORM}<br />[/syntax]