View Single Post
  #71  
Old 04-22-2003, 11:19 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
04-16-03 at 12:31 AM User_001 said this in Post #64
small question, i asked this in the other thread.. Can this be made to be forum Specific? I only want specific Forums on the Board to be able to utilize this. I have a Spam forum so I can keep the Spam outta the other forums. I just want to utilize it in that forum, and maybe one or two others. Thanks.

This is a good mod IMO. and saves the file hacking, and possible pains of rehacking them if you make a mistake. Which I constantly do
This sould work.

Stick this in the phpinclude: (edit the forumids part)

PHP Code:
if (strpos($_SERVER['PHP_SELF'], 'showthread.php') != false)
{
$textareacols gettextareawidth();
$forumids "1"// forum ids quick reply will show in, seprate with comma's
if ($forumids==$forumid) {
eval(
"\$quickreply = \"".gettemplate("mist_quickreply")."\";");
} else { 
$quickreply "";
}

In the showthread template find:

Code:
<!-- first unread and next/prev -->
<table cellpadding="2" cellspacing="0" border="0" width="95%"  align="center">
<tr>
	<td><smallfont>$pagenav&nbsp;</smallfont></td>
	<td align="right"><smallfont>
	<img src="https://vborg.vbsupport.ru/images/prev.gif" alt="" border="0">
	<a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextoldest">Last Thread</a>
	&nbsp;
	<a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextnewest">Next Thread</a>
	<img src="https://vborg.vbsupport.ru/images/next.gif" alt="" border="0">
	</smallfont></td>
</tr>
</table>
<!-- first unread and next/prev -->
Below that add:

Code:
$quickreply
Make a new template named mist_quickreply and populate it with:

Code:
<! -- hackless quick reply -->

<br />
<script language="javascript">
<!--
var postmaxchars = $postmaxchars;
function validate(theform) {
	if (theform.message.value=="") {
		alert("Please complete the message field.");
		return false; }
	if (postmaxchars != 0) {
		if (theform.message.value.length > $postmaxchars) {
			alert("Your message is too long.\n\nReduce your message to $postmaxchars characters.\nIt is currently "+theform.message.value.length+" characters long.");
			return false; }
		else { return true; }
	} else { return true; }
}
function checklength(theform) {
	if (postmaxchars != 0) { message = "\nThe maximum permitted length is $postmaxchars characters."; }
	else { message = ""; }
	alert("Your message is "+theform.message.value.length+" characters long."+message);
}
//-->
</script>


<table width="{contenttablewidth}" cellpadding="4" cellspacing="0" border="1" style="border-collapse: collapse" bordercolor="{tablebordercolor}" {tableinvisibleextra} align="center" >
<tr>
<td bgcolor="{tableheadbgcolor}" colspan="2">
<normalfont color="{tableheadtextcolor}"><b>Post Reply:</b></normalfont>
</td>
</tr>


<tr valign="top">
<td width="20%" bgcolor="{firstaltcolor}">
<normalfont color="{pagetextcolor}"><b>Your Reply:</b></normalfont>
</td>
<td bgcolor="{firstaltcolor}" width="80%">

<form enctype="multipart/form-data" action="newreply.php" name="quickreply" method="post" onSubmit="return validate(this)">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="action" value="postreply">
<input type="hidden" name="threadid" value="$threadid">
<input type="hidden" name="title" value="">
<input type="hidden" name="iconid" value="0">
<input type="hidden" name="parseurl" value="yes">
<input type="hidden" name="email" value="">
<input type="hidden" name="disablesmilies" value="">
<input type="hidden" name="closethread" value="">
<input type="hidden" name="hiddenreply" value="">
<input type="hidden" name="signature" value="yes">
<input type="hidden" name="rating" value="0">
<textarea name="message" rows="7" cols="$textareacols" wrap="virtual" tabindex="1"></textarea>

<br />
<input type="submit" class="bginput" name="submit" value="Submit Reply" accesskey="s" tabindex="2">
	<input type="reset" class="bginput" name="reset" value="Reset Form" accesskey="r" tabindex="3">
<br />
<smallfont><a href="javascript:checklength(document.quickreply);">[check message length]</a></smallfont>
</form>


</td>

</tr>

</table>
<! -- /hackless quick reply -->
Note: This will add one query to forums that use quick reply (on showthread.php), this is because i put it in a template. You can avoid the query by hacking showthread.php or hard coding the template into phpinclude (something i dident want to do because of overhead). if you want to hack:

open showthread.php

Find:

Code:
showthread
Replace with:

Code:
showthread,mist_quickreply
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01347 seconds
  • Memory Usage 1,806KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete