#########################################################
## MOD Title:  Smilies Dropdown Menu Addon for SQR
## MOD Author:	Afkamm < phpbb@afkamm.co.uk >
## MOD Author:	Nightrider < NA >
## MOD Description:	Makes a drop down menu in the Super Quick Reply window which 
## 	   				contains a list of all the smilies	installed on your board.
##			 		When you select a smiley, it appears next to the box.
##		 			The code is then inserted like normal when you click the smiley.
##
## MOD Version: 1.0.1
## 
## Installation Level:  Easy 
## Installation Time:   5 minutes
##
## Files To Edit: 2
##			includes/functions_post.php
##			includes/viewtopic_quickreply.php
##			templates/subSilver/viewtopic_quickreply.tpl
## Included Files: 0
##			
#########################################################
## Security Disclaimer: I take no responsibility for you putting a red item in with your whites. :P 
#########################################################
## Author Notes:
##
##  You MUST install the Super Quick Reply and Smilies Dropdown Menu MODs
##  before you can install and use this addon...
##
##	This MOD is loosely based on the Drop Down Smilie MOD by radmanics.
##	Some of the javascript code from that MOD was used in this MOD.
##	Other than that, all code is mine. I recommend this mod for boards
##	that have less than 100 smilies installed.
##
##	Any problems or questions then please contact me. -- Marc :)
##
#########################################################
## Credits:
##
##	radmanics < radmanics@dial.pipex.com > (David Race) http://members.lycos.co.uk/coolcodesportal/
##
#########################################################
## MOD History:
##
##	5/15/08 - 1.0.1
##	- Initial release.
##
############################################################## 
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
#########################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
#########################################################
#
#-----[ OPEN ]-------------------------------------------
#
includes/functions_post.php
# 
#-----[ FIND ]-------------------------------------------
# 
function generate_smilies_dropdown()
# 
#-----[ REPLACE WITH ]-------------------------------------------
# 
function generate_smilies_dropdown($quickreply='0')
# 
#-----[ FIND ]-------------------------------------------
# 
$template->set_filenames(array(
"body" => "posting_body.tpl")
);
# 
#-----[ REPLACE WITH ]-------------------------------------------
# 
	if ($quickreply=='0')
	{
	$template->set_filenames(array(
		"body" => "posting_body.tpl")
	);
	}
	else
	{
	$template->set_filenames(array(
		"qrbody" => "viewtopic_quickreply.tpl")
	);
	}
# 
#-----[ OPEN ]-------------------------------------------
# 
includes/viewtopic_quickreply.php 
# 
#-----[ FIND ]-------------------------------------------
# 
generate_smilies('inline', PAGE_POSTING);
# 
#-----[ AFTER, ADD ]-------------------------------------
#
 
// Generate smilies dropdown
generate_smilies_dropdown('1');
#
#-----[ OPEN ]-------------------------------------------
#
templates/subSilver/viewtopic_quickreply.tpl
# 
#-----[ FIND ]-------------------------------------------
# 
f_help = "{L_BBCODE_F_HELP}";
# 
#-----[ AFTER, ADD ]-------------------------------------
# 

// Start smilies drop down menu mod
smile1_help = "{L_SMILEY_MENU1}";
smile2_help = "{L_SMILEY_MENU2}";

// This function was taken from phpBB smiley admin panel
function update_smiley(newimage) {
	document.smiley_image.src = "{S_SMILEY_BASEDIR}/" + newimage;
}

// This function taken and modified from the UBB version.
function emoticon_drop(text) {
	emoticon_code = "" + text;
	current_msg = document.post.message.value;

	document.post.message.value = current_msg+emoticon_code;
	document.post.message.focus();
	return;
}
// End smilies drop down menu mod
#
#-----[ FIND ]-------------------------------------------
#
<!-- END switch_smilies_extra -->
# 
#-----[ AFTER, ADD ]-------------------------------------
# 
				<!-- Start Smilies Dropdown menu Mod -->
				<tr>
				  <td colspan="4" align="right"><span class="genmed">&nbsp;
					<select name="smile_url" onchange="update_smiley(this.options[selectedIndex].value);" onmouseover="helpline('smile1')">{S_DROP_DOWN}</select>
					<img name="smiley_image" src="{SMILEY_IMG}" border="0" alt="" onmouseover="helpline('smile2'); this.style.cursor='hand';" onclick="emoticon_drop(document.post.smile_url.options[document.post.smile_url.selectedIndex].id)" />
				  </span></td>
				</tr>
				<!-- End Smilies Dropdown menu Mod -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM