[2.0.17] Message Can

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
3
43%
Very Good
2
29%
Good
1
14%
Fair
0
No votes
Poor
1
14%
 
Total votes: 7

User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Never Mind---I fixed it.
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
whozyodaddy
Registered User
Posts: 186
Joined: Sat May 08, 2004 4:26 am

Post by whozyodaddy »

rawtoxic wrote: It seems that you might have either placed the TPL switches in the wrong part of the postingbody.tpl file or other mods that are installed messed my instructions up. Please post your postingbody.tpl so I can take a look and i'll help you out. :)


Here it is:

Code: Select all

<script language="JavaScript" type="text/javascript">
<!--
// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";
messagecan_help = "{L_MESSAGECAN_HELP}";

<!-- BEGIN MultiBB -->
{MultiBB.VALUE}_help = "{MultiBB.HELP}";
<!-- END MultiBB -->

// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','','','','[hide]','[/hide]','[google]','[/google]');
imageTag = false;

// Shows the help messages in the helpline window
function helpline(help) {
document.post.helpbox.value = eval(help + "_help");
}


// Replacement for arrayname.length property
function getarraysize(thearray) {
for (i = 0; i < thearray.length; i++) {
if ((thearray == "undefined") || (thearray == "") || (thearray == null))
return i;
}
return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
thearraysize = getarraysize(thearray);
retval = thearray[thearraysize - 1];
delete thearray[thearraysize - 1];
return retval;
}


function checkForm() {

formErrors = false;

if (document.post.message.value.length < 2) {
formErrors = "{L_EMPTY_MESSAGE}";
}

if (formErrors) {
alert(formErrors);
return false;
} else {
bbstyle(-1);
//formObj.preview.disabled = true;
//formObj.submit.disabled = true;
return true;
}
}

function emoticon(text) {
var txtarea = document.post.message;
text = ' ' + text + ' ';
if (txtarea.createTextRange && txtarea.caretPos) {
var caretPos = txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
txtarea.focus();
} else {
txtarea.value += text;
txtarea.focus();
}
}

function bbfontstyle(bbopen, bbclose) {
var txtarea = document.post.message;

if ((clientVer >= 4) && is_ie && is_win) {
theSelection = document.selection.createRange().text;
if (!theSelection) {
txtarea.value += bbopen + bbclose;
txtarea.focus();
return;
}
document.selection.createRange().text = bbopen + theSelection + bbclose;
txtarea.focus();
return;
}
else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
{
mozWrap(txtarea, bbopen, bbclose);
return;
}
else
{
txtarea.value += bbopen + bbclose;
txtarea.focus();
}
storeCaret(txtarea);
}


function bbstyle(bbnumber) {
var txtarea = document.post.message;

txtarea.focus();
donotinsert = false;
theSelection = false;
bblast = 0;

if (bbnumber == -1) { // Close all open tags & default button names
while (bbcode[0]) {
butnumber = arraypop(bbcode) - 1;
txtarea.value += bbtags[butnumber + 1];
buttext = eval('document.post.addbbcode' + butnumber + '.value');
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
}
imageTag = false; // All tags are closed including image tags :D
txtarea.focus();
return;
}

if ((clientVer >= 4) && is_ie && is_win)
{
theSelection = document.selection.createRange().text; // Get text selection
if (theSelection) {
// Add tags around selection
document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
txtarea.focus();
theSelection = '';
return;
}
}
else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
{
mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
return;
}

// Find last occurance of an open tag the same as the one just clicked
for (i = 0; i < bbcode.length; i++) {
if (bbcode == bbnumber+1) {
bblast = i;
donotinsert = true;
}
}

if (donotinsert) { // Close all open tags up to the one just clicked & default button names
while (bbcode[bblast]) {
butnumber = arraypop(bbcode) - 1;
txtarea.value += bbtags[butnumber + 1];
buttext = eval('document.post.addbbcode' + butnumber + '.value');
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
imageTag = false;
}
txtarea.focus();
return;
} else { // Open tags

if (imageTag && (bbnumber != 14)) { // Close image tag before adding another
txtarea.value += bbtags[15];
lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list
document.post.addbbcode14.value = "Img"; // Return button back to normal state
imageTag = false;
}

// Open tag
txtarea.value += bbtags[bbnumber];
if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
arraypush(bbcode,bbnumber+1);
eval('document.post.addbbcode'+bbnumber+'.value += "*"');
txtarea.focus();
return;
}
storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
var selLength = txtarea.textLength;
var selStart = txtarea.selectionStart;
var selEnd = txtarea.selectionEnd;
if (selEnd == 1 || selEnd == 2)
selEnd = selLength;

var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd)
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;
return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/vie ... 52/fid/130
function storeCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

//-->
</script>

<!-- BEGIN privmsg_extensions -->
<table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
<tr>
<td valign="top" align="center" width="100%">
<table height="40" cellspacing="2" cellpadding="2" border="0">
<tr valign="middle">
<td>{INBOX_IMG}</td>
<td><span class="cattitle">{INBOX_LINK}&nbsp;&nbsp;</span></td>
<td>{SENTBOX_IMG}</td>
<td><span class="cattitle">{SENTBOX_LINK}&nbsp;&nbsp;</span></td>
<td>{OUTBOX_IMG}</td>
<td><span class="cattitle">{OUTBOX_LINK}&nbsp;&nbsp;</span></td>
<td>{SAVEBOX_IMG}</td>
<td><span class="cattitle">{SAVEBOX_LINK}&nbsp;&nbsp;</span></td>
</tr>
</table>
</td>
</tr>
</table>

<br clear="all" />
<!-- END privmsg_extensions -->

<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" {S_FORM_ENCTYPE}>

{POST_PREVIEW_BOX}
{ERROR_BOX}

<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a>
<!-- BEGIN switch_parent_link -->
-> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
<!-- END switch_parent_link -->
<!-- BEGIN switch_not_privmsg -->
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
<!-- END switch_not_privmsg -->
</tr>
</table>

<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
<tr>
<th class="thHead" colspan="2" height="25"><b>{L_POST_A}</b></th>
</tr>
<!-- BEGIN switch_username_select -->
<tr>
<td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td>
<td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></span></td>
</tr>
<!-- END switch_username_select -->
<!-- BEGIN switch_privmsg -->
<tr>
<td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td>
<td class="row2"><span class="genmed"><input type="text" class="post" name="username" maxlength="25" size="25" tabindex="1" value="{USERNAME}" />&nbsp;<input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></span></td>
</tr>
<!-- END switch_privmsg -->
<tr>
<td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
<td class="row2" width="78%"> <span class="gen">
<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
</span> </td>
</tr>
<tr>
<td class="row1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
</tr>
<tr>
<td valign="middle" align="center"> <br />
<table width="100" border="0" cellspacing="0" cellpadding="5">
<tr align="center">
<td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
</tr>
<!-- BEGIN smilies_row -->
<tr align="center" valign="middle">
<!-- BEGIN smilies_col -->
<td><a href="javascript:emoticon('{smilies_row.smilies_col.SMILEY_CODE}')"><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td>
<!-- END smilies_col -->
</tr>
<!-- END smilies_row -->
<!-- BEGIN switch_smilies_extra -->
<tr align="center">
<td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
</tr>
<!-- END switch_smilies_extra -->
</table>
</td>
</tr>
</table>
</td>
<td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
<table width="450" border="0" cellspacing="0" cellpadding="2">
<tr align="center" valign="middle">
<td><span class="genmed">
<input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
</span></td>
<!-- BEGIN MultiBB -->
<td><span class="genmed">
<input type="button" class="button" accesskey="{MultiBB.KEY}" name="{MultiBB.NAME}" value="{MultiBB.VALUE}" style="width: {MultiBB.WIDTH}px" onClick="{MultiBB.STYLE}" onMouseOver="helpline('{MultiBB.VALUE}')" />
</span></td>
<!-- END MultiBB -->
</tr>

<!-- BEGIN XBBcode -->
<tr align="center" valign="middle">
<!-- BEGIN BB -->
<td><span class="genmed">
<input type="button" class="button" accesskey="{XBBcode.BB.KEY}" name="{XBBcode.BB.NAME}" value="{XBBcode.BB.VALUE}" style="width: {XBBcode.BB.WIDTH}px" onClick="{XBBcode.BB.STYLE}" onMouseOver="helpline('{XBBcode.BB.VALUE}')" />
</span></td>
<!-- END BB -->
</tr>
<!-- END XBBcode -->

<tr>
<td colspan="9">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="genmed"> &nbsp;{L_FONT_COLOR}:
<select name="addbbcodefontcolor" onChange="bbfontstyle('[color=' + this.form.addbbcodefontcolor.options[this.form.addbbcodefontcolor.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
<option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option>
<option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option>
<option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option>
<option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option>
<option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option>
<option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option>
<option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option>
<option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option>
<option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option>
<option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option>
<option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option>
<option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option>
<option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option>
<option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option>
<option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option>
</select> &nbsp;{L_FONT_SIZE}:<select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
<option value="7" class="genmed">{L_FONT_TINY}</option>
<option value="9" class="genmed">{L_FONT_SMALL}</option>
<option value="12" selected class="genmed">{L_FONT_NORMAL}</option>
<option value="18" class="genmed">{L_FONT_LARGE}</option>
<option value="24" class="genmed">{L_FONT_HUGE}</option>
</select>
<!-- BEGIN switch_admin_mod_view_only -->
&nbsp; {L_MESSAGECAN}:<select name="addbbcode24" onChange="emoticon(this.form.addbbcode24.options[this.form.addbbcode24.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')">
<option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option>
<!-- END switch_admin_mod_view_only -->
<!-- BEGIN switch_admin_mod_view_only -->
<!-- BEGIN messagecan -->
<option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option>
<!-- END messagecan -->
</select>
<!-- END switch_admin_mod_view_only -->

</span></td>
<td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="9"> <span class="gensmall">
<input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
</span></td>
</tr>
<tr>
<td colspan="9"><span class="gen">
<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
</span></td>
</tr>

<!-- =======================================================================
Adjust the spellcheck_data line to use SpellingCow with ANY form and
ANY textarea or textbox. Simply adjust the "value" data as follows:
form: Enter the form name to check. Enter only one form name.
source: Enter the form item to be checked. Later versions will
allow more than one item to be checked!
button: Enter the name of the submit button for the form
type: phpBB, vB, IPB, or other - not used yet, but perhaps
will be in the near future

The following is optimized for a standard phpBB install but you can
make any changes desired regarding style or to accommodate MODs
======================================================================= -->
<!-- SPELL CHECKER -->
<tr align="center">
<td colspan="4">
<input type="hidden" name="auto_spell_check" value="{AUTO_SPELL}">
<input type="button" name="spellcheck" class="liteoption" value="Spell Check"
onClick="window.open('spell-gw.php?mode=load&form=post&source=message&button=post&type=phpBB', '_spellcheck', 'HEIGHT=484,resizable=yes,scrollbars=yes,WIDTH=595');"><br>

<style type="text/css"><!-- .spellcow, a.spellcow { font-size : 8px; color : #FFFFFF; } --></style>
<!-- Removal of the following line may result in suspension of the service by SpellingCow. Come on, linking back to us is not asking much but means a lot to us. Thanks! ;-) -->
<span class="spellcow">by <a href="http://www.spellingcow.com" target="_blank" class="spellcow">SpellingCow.com</a><a href="spell-gw.php" target="_blank" class="spellcow">.</a><br>
</td>
</tr>
<!-- SPELL CHECKER -->

</table>
</span></td>
</tr>
<tr>
<td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
<td class="row2"><span class="gen"> </span>
<table cellspacing="0" cellpadding="1" border="0">
<!-- BEGIN switch_html_checkbox -->
<tr>
<td>
<input type="checkbox" name="disable_html" {S_HTML_CHECKED} />
</td>
<td><span class="gen">{L_DISABLE_HTML}</span></td>
</tr>
<!-- END switch_html_checkbox -->
<!-- BEGIN switch_bbcode_checkbox -->
<tr>
<td>
<input type="checkbox" name="disable_bbcode" {S_BBCODE_CHECKED} />
</td>
<td><span class="gen">{L_DISABLE_BBCODE}</span></td>
</tr>
<!-- END switch_bbcode_checkbox -->
<!-- BEGIN switch_smilies_checkbox -->
<tr>
<td>
<input type="checkbox" name="disable_smilies" {S_SMILIES_CHECKED} />
</td>
<td><span class="gen">{L_DISABLE_SMILIES}</span></td>
</tr>
<!-- END switch_smilies_checkbox -->
<!-- BEGIN switch_signature_checkbox -->
<tr>
<td>
<input type="checkbox" name="attach_sig" {S_SIGNATURE_CHECKED} />
</td>
<td><span class="gen">{L_ATTACH_SIGNATURE}</span></td>
</tr>
<!-- END switch_signature_checkbox -->
<!-- BEGIN switch_notify_checkbox -->
<tr>
<td>
<input type="checkbox" name="notify" {S_NOTIFY_CHECKED} />
</td>
<td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td>
</tr>
<!-- END switch_notify_checkbox -->
<!-- BEGIN switch_delete_checkbox -->
<tr>
<td>
<input type="checkbox" name="delete" />
</td>
<td><span class="gen">{L_DELETE_POST}</span></td>
</tr>
<!-- END switch_delete_checkbox -->
<!-- BEGIN switch_type_toggle -->
<tr>
<td></td>
<td><span class="gen">{S_TYPE_TOGGLE}</span></td>
</tr>
<!-- END switch_type_toggle -->
</table>
</td>
</tr>
{ATTACHBOX}
{POLLBOX}
<tr>
<td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
</tr>
</table>

<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
<tr>
<td align="right" valign="top"><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
</table>
</form>

<table width="100%" cellspacing="2" border="0" align="center">
<tr>
<td valign="top" align="right">{JUMPBOX}</td>
</tr>
</table>

{TOPIC_REVIEW_BOX}
[/code]
User avatar
Smokeydogg
Registered User
Posts: 240
Joined: Sat Dec 06, 2003 8:02 am
Contact:

Post by Smokeydogg »

i want one of these that allows users to create their own messages in profile
User avatar
buweichiu
Registered User
Posts: 23
Joined: Mon Sep 20, 2004 1:39 pm

Post by buweichiu »

Users' Own Message will be added in next version.
rawtoxic
Registered User
Posts: 54
Joined: Sat Mar 19, 2005 2:36 am
Location: US
Contact:

Post by rawtoxic »

whozyodaddy:

Sorry man I just noticed that you have posted your reply. I see the problem right away. You cannot have multiple <!-- Switch --> lines nested within each other.

Your problem is in this code here.

Code: Select all

               </select> 
<!-- BEGIN switch_admin_mod_view_only --> 
&nbsp;  {L_MESSAGECAN}:<select name="addbbcode24" onChange="emoticon(this.form.addbbcode24.options[this.form.addbbcode24.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')"> 
                 <option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option> 
<!-- END switch_admin_mod_view_only --> 
<!-- BEGIN switch_admin_mod_view_only --> 
                  <!-- BEGIN messagecan --> 
                 <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option> 
                 <!-- END messagecan --> 
               </select> 
<!-- END switch_admin_mod_view_only --> 

               </span></td> 
It should look like this.

Code: Select all

               </select> 
<!-- BEGIN switch_admin_mod_view_only --> 
&nbsp;  {L_MESSAGECAN}:<select name="addbbcode24" onChange="emoticon(this.form.addbbcode24.options[this.form.addbbcode24.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')"> 
                 <option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option> 
<!-- END switch_admin_mod_view_only --> 
                  <!-- BEGIN messagecan --> 
                 <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option> 
                 <!-- END messagecan --> 
<!-- BEGIN switch_admin_mod_view_only --> 
               </select> 
<!-- END switch_admin_mod_view_only --> 

               </span></td>
Sorry for the belated reply. Let me know if this works. :)
whozyodaddy
Registered User
Posts: 186
Joined: Sat May 08, 2004 4:26 am

Post by whozyodaddy »

Thanks man, that worked.

Although, I have a problem - the message can textbox is unaligned.
Here is what I am talking about:
Image
User avatar
buweichiu
Registered User
Posts: 23
Joined: Mon Sep 20, 2004 1:39 pm

Post by buweichiu »

You could put a '<br />' before word 'Message:'
rawtoxic
Registered User
Posts: 54
Joined: Sat Mar 19, 2005 2:36 am
Location: US
Contact:

Post by rawtoxic »

I had the same problem and I wanted it to look a little cleaner. Mine looked weird for users who couldn't see the message can so I moved the message can to make it show on it's own line below the font and close tags line. This way it just ads a new line for users with permissions to use the message acn. Here's what your code prolly looks like.

Code: Select all

               </select> 
<!-- BEGIN switch_admin_mod_view_only --> 
&nbsp;  {L_MESSAGECAN}:<select name="addbbcode24" onChange="emoticon(this.form.addbbcode24.options[this.form.addbbcode24.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')"> 
                 <option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option> 
<!-- END switch_admin_mod_view_only --> 
                  <!-- BEGIN messagecan --> 
                 <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option> 
                 <!-- END messagecan --> 
<!-- BEGIN switch_admin_mod_view_only --> 
               </select> 
<!-- END switch_admin_mod_view_only --> 

               </span></td>
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> 
            </tr> 
           </table>
Here is what my code looks like.

Code: Select all

</select>
				  	  <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
					</span></td>
				 </tr>
				 <!-- BEGIN switch_admin_view_only -->
				 <tr>
					  <td align="left"><span class="genmed">&nbsp;{L_MESSAGECAN}:<select name="addbbcode22" onChange="emoticon(this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')">
					   <option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option>
					   <!-- END switch_admin_view_only -->
						<!-- BEGIN messagecan -->
						<!-- BEGIN switch_admin_view_only -->
					   <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option>
					    <!-- END switch_admin_view_only -->
					    <!-- END messagecan -->
					   <!-- BEGIN switch_admin_view_only --> 
					  </select></td>
				 </tr>
				 <!-- END switch_admin_view_only -->
			  </table>
So it's not the prettiest, but hey it works! :)

Here's some shots

Admin View
Image

User View
Image
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

rawtoxic wrote: I had the same problem and I wanted it to look a little cleaner. Mine looked weird for users who couldn't see the message can so I moved the message can to make it show on it's own line below the font and close tags line. This way it just ads a new line for users with permissions to use the message acn. Here's what your code prolly looks like.

Code: Select all

               </select> 
<!-- BEGIN switch_admin_mod_view_only --> 
&nbsp;  {L_MESSAGECAN}:<select name="addbbcode24" onChange="emoticon(this.form.addbbcode24.options[this.form.addbbcode24.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')"> 
                 <option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option> 
<!-- END switch_admin_mod_view_only --> 
                  <!-- BEGIN messagecan --> 
                 <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option> 
                 <!-- END messagecan --> 
<!-- BEGIN switch_admin_mod_view_only --> 
               </select> 
<!-- END switch_admin_mod_view_only --> 

               </span></td>
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> 
            </tr> 
           </table>
Here is what my code looks like.

Code: Select all

</select>
				  	  <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
					</span></td>
				 </tr>
				 <!-- BEGIN switch_admin_view_only -->
				 <tr>
					  <td align="left"><span class="genmed">&nbsp;{L_MESSAGECAN}:<select name="addbbcode22" onChange="emoticon(this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')">
					   <option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option>
					   <!-- END switch_admin_view_only -->
						<!-- BEGIN messagecan -->
						<!-- BEGIN switch_admin_view_only -->
					   <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option>
					    <!-- END switch_admin_view_only -->
					    <!-- END messagecan -->
					   <!-- BEGIN switch_admin_view_only --> 
					  </select></td>
				 </tr>
				 <!-- END switch_admin_view_only -->
			  </table>


OK, I guess I am having an issue here.

My code looks like your first example. Well, when it works, but with that code, the

Code: Select all

   <!-- BEGIN messagecan --> 
                 <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option> 
                 <!-- END messagecan --> 
Leaves a line showing all the different message titles I have in my can for any users to see, because it isn't protected by the Admin only view tag.
HOWEVER, if I try nesting my tags, as you do here:

Code: Select all

<!-- BEGIN messagecan -->
						<!-- BEGIN switch_admin_view_only -->
					   <option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option>
					    <!-- END switch_admin_view_only -->
					    <!-- END messagecan -->
It gets all bollixed up, and doesn't work at all.

Does anyone else have the problem of all users seeing the names of your messages on the posttopic page, and if so, how to solve it? If I can't next my view tags, I'm at a loss...
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Anyone else have this problem, or know of a solution?
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
rawtoxic
Registered User
Posts: 54
Joined: Sat Mar 19, 2005 2:36 am
Location: US
Contact:

Post by rawtoxic »

I just realized i'm having the same problems. Somewhere we are missing a switch to make it not parse the values to the template. Give me a bit. I'm researching this one currently myself.
rawtoxic
Registered User
Posts: 54
Joined: Sat Mar 19, 2005 2:36 am
Location: US
Contact:

Post by rawtoxic »

Ok on my board this apparently was happening to regular users on both posts and private messages. I have now corrected the issue. To make it work correctly, you have to add some switches to the posting.php and privmsg.php files.

Here's the fix:

Only Use This If You Are Modifying This Mod For Admin/Mod View Only!

This mod will prevent the messagecan field values from appearing on the posting body if you have modified the postingbody.tpl to make it so the message can is only viewable by Admin or Moderators.

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 

posting.php

# 
#-----[ FIND ]------------------------------------------ 
# 

//
// Addition for MOD MessageCan 1.0.5 by bu
// SQL: select * from prefix_messagecan order by msg_id

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN )
{

# 
#-----[ FIND ]------------------------------------------ 
# 

$db->sql_freeresult($result);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

}

# 
#-----[ OPEN ]------------------------------------------ 
# 

privmsg.php

# 
#-----[ FIND ]------------------------------------------ 
#

//
// Addition for MOD MessageCan 1.0.5 by bu
// SQL: select * from %prefix%_messagecan order by msg_id

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN )
{

# 
#-----[ FIND ]------------------------------------------ 
#

$db->sql_freeresult($result);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

}

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
anwipr
Registered User
Posts: 59
Joined: Mon Jan 16, 2006 5:30 pm

Post by anwipr »

Alright, I'm not sure if this is a dumb question or not, I downloaded this Mod, installed it with EasyMOD and it looks like it should be working fine, except in the ACP, I click the link to "Message Can" and it says "Here is the panel of Message Can, you can ADD,EDIT and DELETE message here.". Then it has three columns, Message Content Action. But nothing underneath them. I don't see how to add a new message. Help please? Thanks!
User avatar
Garibaldi
Registered User
Posts: 142
Joined: Sun Mar 13, 2005 11:36 pm

Post by Garibaldi »

Hi,

I am wondering if it is possible to make this MOD work not just with posting.php but also the Advanced Quick Reply box?
Image
User avatar
Garibaldi
Registered User
Posts: 142
Joined: Sun Mar 13, 2005 11:36 pm

Post by Garibaldi »

I've tried everything and cannot get it to work. Here are the quick_reply.php and quick_reply.tpl files where I have the code. Perhaps you can find the problem. Thank you very much!!

quick_reply.tpl:

Code: Select all

<!-- BEGIN quick_reply -->
<script language="JavaScript" type="text/javascript">
<!--
// bbCode control by
// BaRiMzI
// www.rimzink.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";
messagecan_help = "{L_MESSAGECAN_HELP}";

// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','');
imageTag = false;

// Shows the help messages in the helpline window
function helpline(help) {
document.post.helpbox.value = eval(help + "_help");
}


// Replacement for arrayname.length property
function getarraysize(thearray) {
for (i = 0; i < thearray.length; i++) {
if ((thearray == "undefined") || (thearray == "") || (thearray == null))
return i;
}
return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
thearraysize = getarraysize(thearray);
retval = thearray[thearraysize - 1];
delete thearray[thearraysize - 1];
return retval;
}


function checkForm() {

formErrors = false;

if (document.post.message.value.length < 2) {
formErrors = "{L_EMPTY_MESSAGE}";
}

if (formErrors) {
alert(formErrors);
return false;
} else {
bbstyle(-1);
//formObj.preview.disabled = true;
//formObj.submit.disabled = true;
return true;
}
}

function emoticon(text) {
var txtarea = document.post.message;
text = ' ' + text + ' ';
if (txtarea.createTextRange && txtarea.caretPos) {
var caretPos = txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
txtarea.focus();
} else {
txtarea.value += text;
txtarea.focus();
}
}

function bbfontstyle(bbopen, bbclose) {
var txtarea = document.post.message;

if ((clientVer >= 4) && is_ie && is_win) {
theSelection = document.selection.createRange().text;
if (!theSelection) {
txtarea.value += bbopen + bbclose;
txtarea.focus();
return;
}
document.selection.createRange().text = bbopen + theSelection + bbclose;
txtarea.focus();
return;
}
else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
{
mozWrap(txtarea, bbopen, bbclose);
return;
}
else
{
txtarea.value += bbopen + bbclose;
txtarea.focus();
}
storeCaret(txtarea);
}


function bbstyle(bbnumber) {
var txtarea = document.post.message;

txtarea.focus();
donotinsert = false;
theSelection = false;
bblast = 0;

if (bbnumber == -1) { // Close all open tags & default button names
while (bbcode[0]) {
butnumber = arraypop(bbcode) - 1;
txtarea.value += bbtags[butnumber + 1];
buttext = eval('document.post.addbbcode' + butnumber + '.value');
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
}
imageTag = false; // All tags are closed including image tags :D
txtarea.focus();
return;
}

if ((clientVer >= 4) && is_ie && is_win)
{
theSelection = document.selection.createRange().text; // Get text selection
if (theSelection) {
// Add tags around selection
document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
txtarea.focus();
theSelection = '';
return;
}
}
else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
{
mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
return;
}

// Find last occurance of an open tag the same as the one just clicked
for (i = 0; i < bbcode.length; i++) {
if (bbcode == bbnumber+1) {
bblast = i;
donotinsert = true;
}
}

if (donotinsert) { // Close all open tags up to the one just clicked & default button names
while (bbcode[bblast]) {
butnumber = arraypop(bbcode) - 1;
txtarea.value += bbtags[butnumber + 1];
buttext = eval('document.post.addbbcode' + butnumber + '.value');
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
imageTag = false;
}
txtarea.focus();
return;
} else { // Open tags

if (imageTag && (bbnumber != 14)) { // Close image tag before adding another
txtarea.value += bbtags[15];
lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list
document.post.addbbcode14.value = "Img"; // Return button back to normal state
imageTag = false;
}

// Open tag
txtarea.value += bbtags[bbnumber];
if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
arraypush(bbcode,bbnumber+1);
eval('document.post.addbbcode'+bbnumber+'.value += "*"');
txtarea.focus();
return;
}
storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
var selLength = txtarea.textLength;
var selStart = txtarea.selectionStart;
var selEnd = txtarea.selectionEnd;
if (selEnd == 1 || selEnd == 2)
selEnd = selLength;

var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd)
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;
return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/vie ... 52/fid/130
function storeCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

//-->
</script>
<script language='JavaScript'>
function openAllSmiles(){
smiles = window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=250,resizable=yes,scrollbars=yes,WIDTH=300');
smiles.focus();
return false;
}

function quoteSelection() {

theSelection = false;
if (window.getSelection)
{
theSelection = window.getSelection();
}
else if (document.getSelection)
{
theSelection = document.getSelection();
}
else if (document.selection)
{
theSelection = document.selection.createRange().text;
}

if (theSelection) {
// Add tags around selection
emoticon( '[quote]' + theSelection + '[/quote]\n');
document.post.message.focus();
theSelection = '';
return;
}
else
{
alert('{L_NO_TEXT_SELECTED}');
}
}

function storeCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function emoticon(text) {
if (document.post.message.createTextRange && document.post.message.caretPos) {
var caretPos = document.post.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
document.post.message.focus();
} else {
document.post.message.value += text;
document.post.message.focus();
}
}

function checkForm() {
formErrors = false;
if (document.post.message.value.length < 2) {
formErrors = '{L_EMPTY_MESSAGE}';
}
if (formErrors) {
alert(formErrors);
return false;
} else {
if (document.post.quick_quote.checked) {
document.post.message.value = document.post.last_msg.value + document.post.message.value;
}
document.post.quick_quote.checked = false;
return true;
}
}
</script>
<form action='{quick_reply.POST_ACTION}' method='post' name='post' onsubmit='return checkForm(this)'>
<input type="hidden" name="sid" value="{quick_reply.SID}">
<table border='0' cellpadding='10' cellspacing='1' width='100%' class='forumline'>
<tr>
<th colspan="2" align="center" class="thHead"><b>{L_QUICK_REPLY}</b></th>
</tr>
<input type='hidden' name='mode' value='reply'>
<input type='hidden' name='t' value='{quick_reply.TOPIC_ID}'>
<input type='hidden' name='last_msg' value='{quick_reply.LAST_MESSAGE}'>
<!--input type='hidden' name='message' value=''-->
<td class="row1" valign="top" colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- BEGIN user_logged_out -->
<!-- END user_logged_out -->
<td class="row1" rowspan="1" align="left" width="250px"><input type='checkbox' name='quick_quote'><span class="gensmall">{L_QUOTE_LAST_MESSAGE}</span><br>
<!-- BEGIN user_logged_in -->
<input type='checkbox' name='attach_sig' {quick_reply.user_logged_in.ATTACH_SIGNATURE}><span class="gensmall">{L_ATTACH_SIGNATURE}</span><br>
<input type='checkbox' name='notify' {quick_reply.user_logged_in.NOTIFY_ON_REPLY}><span class="gensmall">{L_NOTIFY_ON_REPLY}</span>
<!-- END user_logged_in --><br>
<!-- BEGIN smilies -->
<img src="{quick_reply.smilies.URL}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon(' {quick_reply.smilies.CODE} ');" alt="{quick_reply.smilies.DESC}" title="{quick_reply.smilies.DESC}" />
<!-- END smilies -->
</td>
<td class='row1' valign='top'>
<table width="450" border="0" cellspacing="0" cellpadding="2">
<tr align="right" valign="middle">
<td class="row1" valign="top"><span class="gen"> <span class="genmed"> </span>
<table width="450" border="0" cellspacing="0" cellpadding="2">
<tr align="center" valign="middle">
<td><span class="genmed">
<input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" onmouseover="helpline('b')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" onmouseover="helpline('i')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" onmouseover="helpline('u')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onmouseover="helpline('p')" />
</span></td>
<td><span class="genmed">
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" />
</span></td>
</tr>
<tr>
<td colspan="9">
<table width="97%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="genmed"> {L_FONT_COLOR}:
<select name="addbbcode18" onchange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
<option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option>
<option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option>
<option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option>
<option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option>
<option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option>
<option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option>
<option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option>
<option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option>
<option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option>
<option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option>
<option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option>
<option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option>
<option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option>
<option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option>
<option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option>
</select> {L_FONT_SIZE}:<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
<option value="7" class="genmed">{L_FONT_TINY}</option>
<option value="9" class="genmed">{L_FONT_SMALL}</option>
<option value="12" selected class="genmed">{L_FONT_NORMAL}</option>
<option value="18" class="genmed">{L_FONT_LARGE}</option>
<option value="24" class="genmed">{L_FONT_HUGE}</option>
</select>
<br> {L_MESSAGECAN}:<select name="addbbcode34" onChange="emoticon(this.form.addbbcode34.options[this.form.addbbcode34.selectedIndex].value);this.selectedIndex=0;" onMouseOver="helpline('messagecan')">
<option value="" class="genmed">{L_MESSAGECAN_DEFAULT}</option>
<!-- BEGIN messagecan -->
<option value="{messagecan.MESSAGE_TEXT}" class="genmed">{messagecan.MESSAGE_TITLE}</option>
<!-- END messagecan -->
</select>
</span></td><tr>
<td colspan="2" align="center"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onmouseover="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td></tr>
</tr>
</table>
</td>
</tr>
<!-- <tr>
<td colspan="9" class='catBottom'> <span class="gensmall">
<input type="text" name="helpbox" size="45" maxlength="97" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
</span></td>

</tr> -->
</table>
<tr>
<td>
<textarea name='message' rows="10" cols="35" style="width:450px" wrap='virtual' tabindex='1' class='post' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea><br>
<INPUT TYPE='button' name='smiles_all' class='liteoption' VALUE='{L_ADD_SMILIES}' ONCLICK="openAllSmiles();">&nbsp;
<input type='button' name='quoteselected' class='liteoption' value='{L_QUOTE_SELECTED}' onclick='javascript:quoteSelection()'>&nbsp;
<input type='submit' name='preview' class='liteoption' value='{L_PREVIEW}'>&nbsp;
<input type='submit' name='post' class='mainoption' value='{L_SUBMIT}'></td>
</tr></table>
</table>
</td>
</table>
</form>
<!-- END quick_reply -->
[/code]



quick_reply.php:

Code: Select all

<?php 
/***************************************************************************
 *                              quick_reply.php
 *                            -------------------
 *   begin                : Tuesday, Aug 20, 2002
 *   copyright            : RustyDragon 
 *   original work by     : Smartor <smartor_xp@hotmail.com>
 *   contact              : <dev@RustyDragon.com>, http://www.RustyDragon.com
 *   $Id: quick_reply.php,v 1.4.1.1 2002/11/18 13:35:54 RustyDragon Exp $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/


//
// BEGIN OUTPUT
//

$phpbb_root_path = "./";



if ( $mode == 'smilies' )
{
        define('IN_PHPBB', true);
        include($phpbb_root_path . 'extension.inc');
        include($phpbb_root_path . 'common.'.$phpEx);
        include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
        include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
        generate_smilies('window', PAGE_POSTING);
        exit;
}

if ( !defined('IN_PHPBB') )
{
        die('Hacking attempt1');
}

$template->set_filenames(array(
        'quick_reply_output' => 'quick_reply.tpl')
);

        

if ( !(((!$is_auth['auth_reply']) or 
($forum_topic_data['forum_status'] == FORUM_LOCKED) or 
($forum_topic_data['topic_status'] == TOPIC_LOCKED)) and ($userdata['user_level'] != ADMIN)))
{
        $bbcode_uid = $postrow[$total_posts - 1]['bbcode_uid'];
        $last_poster = $postrow[$total_posts - 1]['username'];
        $last_msg = $postrow[$total_posts - 1]['post_text'];
        $last_msg = str_replace(":1:$bbcode_uid", '', $last_msg);
        $last_msg = str_replace(":$bbcode_uid", '', $last_msg);        
        $last_msg = str_replace("'", ''', $last_msg);
        $last_msg = "[quote=\"$last_poster\"]" . $last_msg . '[/quote]';
        $attach_sig = (( $userdata['session_logged_in'] ) ? $userdata['user_attachsig'] : 0)?"checked='checked'":'';
        $notify_user = (( $userdata['session_logged_in'] ) ? $userdata['user_notify'] : 0)?"checked='checked'":'';
        
        $template->assign_block_vars('quick_reply', array(
                'POST_ACTION' => append_sid("posting.$phpEx"),
                'TOPIC_ID' => $topic_id,
                'SID' => $userdata['session_id'],
                'LAST_MESSAGE' => $last_msg)
        );
        if( $userdata['session_logged_in'])
        {
                $template->assign_block_vars('quick_reply.user_logged_in', array(
                        'ATTACH_SIGNATURE' => $attach_sig,
                        'NOTIFY_ON_REPLY' => $notify_user)
                );

        }else
        {
                $template->assign_block_vars('quick_reply.user_logged_out', array());
        }


        generate_smilies_row();
		//
// Addition for MOD MessageCan 1.0.5 by bu
// SQL: select * from prefix_messagecan order by msg_id
	$sql="SELECT *
			FROM ".phpbb_messagecan."
			ORDER BY msg_id";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not list message(s)', '', __LINE__, __FILE__, $sql);
	}

	while( $row = $db->sql_fetchrow($result) )
	{
		$template->assign_block_vars('messagecan', array(
			'MESSAGE_TITLE'=> $row['msg_title'],
			'MESSAGE_TEXT'=> $row['msg_text'])
			);
	}

	$db->sql_freeresult($result);
//
//---------------------------------------
//

        $template->assign_vars(array(
                'U_MORE_SMILIES' => append_sid("quick_reply.$phpEx?mode=smilies"),
                'L_USERNAME' => $lang['Username'],
                'L_PREVIEW' => $lang['Preview'],
                'L_OPTIONS' => $lang['Options'],
                'L_SUBMIT' => $lang['Submit'],
                'L_CANCEL' => $lang['Cancel'],
                'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
                'SMILIES_STATUS' => $smilies_status,
                
                'L_NOTIFY_ON_REPLY' => $lang['Notify'],
                'L_ATTACH_SIGNATURE' => $lang['Attach_signature_QR'],
                'L_ADD_SMILIES' => $lang['Quick_Reply_smilies'],
                'L_QUOTE_SELECTED' => $lang['QuoteSelelected'],
                'L_NO_TEXT_SELECTED' => $lang['QuoteSelelectedEmpty'],
                'L_EMPTY_MESSAGE' => $lang['Empty_message'],
                'L_QUOTE_LAST_MESSAGE' => $lang['Quick_quote'],
                'L_QUICK_REPLY' => $lang['Quick_Reply'],
                'L_PREVIEW' => $lang['Preview'],
                'L_SUBMIT' => $lang['Submit'],

                'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
	            'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
	            'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
	            'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
	            'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
	            'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
	            'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
	            'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
	            'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
	            'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
	            'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
	            'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
                'L_BBCODE_Y_HELP' => $lang['bbcode_y_help'],
	            'L_EMPTY_MESSAGE' => $lang['Empty_message'],

	            'L_FONT_COLOR' => $lang['Font_color'],
	            'L_COLOR_DEFAULT' => $lang['color_default'],
	            'L_COLOR_DARK_RED' => $lang['color_dark_red'],
	            'L_COLOR_RED' => $lang['color_red'],
	            'L_COLOR_ORANGE' => $lang['color_orange'],
	            'L_COLOR_BROWN' => $lang['color_brown'],
                'L_COLOR_YELLOW' => $lang['color_yellow'],
	            'L_COLOR_GREEN' => $lang['color_green'],
	            'L_COLOR_OLIVE' => $lang['color_olive'],
	            'L_COLOR_CYAN' => $lang['color_cyan'],
	            'L_COLOR_BLUE' => $lang['color_blue'],
	            'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'],
	            'L_COLOR_INDIGO' => $lang['color_indigo'],
	            'L_COLOR_VIOLET' => $lang['color_violet'],
	            'L_COLOR_WHITE' => $lang['color_white'],
	            'L_COLOR_BLACK' => $lang['color_black'],

	            'L_FONT_SIZE' => $lang['Font_size'],
	            'L_FONT_TINY' => $lang['font_tiny'],
	            'L_FONT_SMALL' => $lang['font_small'],
	            'L_FONT_NORMAL' => $lang['font_normal'],
	            'L_FONT_LARGE' => $lang['font_large'],
	            'L_FONT_HUGE' => $lang['font_huge'],
				// Addition for MOD MessageCan 1.0.5 by bu
				'L_MESSAGECAN' => $lang['MessageCan'],
				'L_MESSAGECAN_HELP' => $lang['MessageCan_help'], 
				'L_MESSAGECAN_DEFAULT' => $lang['MessageCan_default'],
				//--------------------------------------


	            'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],)
                
);
}
$template->assign_var_from_handle('QUICKREPLY_OUTPUT', 'quick_reply_output');
        
function generate_smilies_row()
{
        global $db, $board_config, $template;

        $max_smilies = 23;

        switch ( SQL_LAYER )
        {
                case 'mssql':
                        $sql = 'SELECT TOP ' . $max_smilies . ' min(emoticon) AS emoticon,
                        min(code) AS code, smile_url
                        FROM ' . SMILIES_TABLE . ' 
                        GROUP BY [smile_url]';
                break;

                default:
                        $sql = 'SELECT emoticon, code, smile_url
                        FROM ' . SMILIES_TABLE . ' 
                        GROUP BY smile_url
                        ORDER BY smilies_id LIMIT ' . $max_smilies;
                break;
        }
        if (!$result = $db->sql_query($sql))
        {
                message_die(GENERAL_ERROR, "Couldn't retrieve smilies list", '', __LINE__, __FILE__, $sql);
        }
        $smilies_count = $db->sql_numrows($result);
        $smilies_data = $db->sql_fetchrowset($result);
        for ($i = 0; $i < $smilies_count; $i++)
        {
                        $template->assign_block_vars('quick_reply.smilies', array(
                                'CODE' => $smilies_data[$i]['code'],
                                'URL' => $board_config['smilies_path'] . '/' . $smilies_data[$i]['smile_url'],
                                'DESC' => $smilies_data[$i]['emoticon'])
                        );
        }
}
?>
Image
Post Reply

Return to “[2.0.x] MOD Database Releases”