[IN DEV] Smileys in iFrames

Mods that I have created will be here. Any and all support requests can be done within this forum.
Locked
DavidIQ
Site Admin
Posts: 619
Joined: Thu Sep 07, 2006 4:31 pm
Location: Earth
Contact:

[IN DEV] Smileys in iFrames

Post by DavidIQ »

This is a mod I had started to tinker with but never got it to work right in regards to the setCaret function used to put the smiley in the location your blinking cursor is at in the text box. I'll probably change this alltogether later on to use some other javascript format to display the rest of the smileys.

Code: Select all

############################################################## 
## MOD Title: Smileys in iFrames 
## MOD Author: DavidIQ < david@davidiq.com > (David Colon) http://www.davidiq.com 
## MOD Description: This mod will display smileys in an iframe eliminating the need 
## to open a new window for extra smileys. 
## MOD Version: 0.1.0 
## 
## Installation Level: Easy 
## Installation Time: 5 Minutes 
## Files To Edit: includes/functions_post.php, 
##      templates/subSilver/posting_body.tpl, 
##   templates/subSilver/posting_smilies.tpl 
## 
## Included Files: N/A 
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: Makes ALL smilies easily accessible instead of just a handfull. 
## 
############################################################## 
## MOD History: 
## 
##   2005-11-03 - Version 1.0 
##      - Mod creation 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/functions_post.php 

# 
#-----[ FIND ]------------------------------------------ 
# 
   $window_columns = 8; 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
   $window_columns = 4; 

# 
#-----[ FIND ]------------------------------------------ 
# 
      include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
//      include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/posting_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 
           <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> 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
         <span class="explaintitle">{L_EMOTICONS}</span></br> 
         <table width="100" border="0" cellspacing="0" cellpadding="1"> 
         <iframe id="iframe1" name='iframe1' width="90%" height="230" src="posting.php?mode=smilies" 

frameborder="0" scrolling="yes"></iframe></td> 
         </table> 


# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/posting_smilies.tpl 

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

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

# 
#-----[ FIND ]------------------------------------------ 
# 
            <th class="thHead" height="25">{L_EMOTICONS}</th> 
         </tr> 
         <tr> 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
// 3 rows deleted - Smileys in iFrames MOD 

# 
#-----[ FIND ]------------------------------------------ 
# 
                  <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> 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
                  <td align="center"><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> 

# 
#-----[ FIND ]------------------------------------------ 
# 
               <!-- BEGIN switch_smilies_extra --> 
               <tr align="center"> 
                  <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a 

href="{U_MORE_SMILIES}" onclick="open_window('{U_MORE_SMILIES}', 250, 300);return false" target="_smilies" 

class="nav">{L_MORE_SMILIES}</a></td> 
               </tr> 
               <!-- END switch_smilies_extra --> 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
// 5 rows deleted - Smileys in iFrames MOD 

# 
#-----[ FIND ]------------------------------------------ 
# 
         <tr> 
            <td align="center"><br /><span class="genmed"><a href="javascript:window.close();" 

class="genmed">{L_CLOSE_WINDOW}</a></span></td> 
         </tr> 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
// 3 rows deleted - Smileys in iFrames MOD 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Locked