Select Expand BBcodes MOD breaking page layout?
 
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes
View previous topic :: View next topic  
Author Message
hexcode
Apprentice
Apprentice


Joined: 01 May 2005
Posts: 7

PostPosted: Sun May 01, 2005 12:48 am    Post subject: Select Expand BBcodes MOD breaking page layout? Reply with quote

Hi,

Is there a fix for breaking the layout when using a long message with no spaces? Like setting a max width then it will auto move to next line?

Code:

1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
 
Back to top
View user's profile Send private message
hexcode
Apprentice
Apprentice


Joined: 01 May 2005
Posts: 7

PostPosted: Sun May 01, 2005 12:51 am    Post subject: Re: Select Expand BBcodes MOD Reply with quote

^^^^ Was hoping I could edit...

Anyway, I was trying to see if it worked the same way here as it does on my site. I need someway to limit the width with messages that have no spaces. Any help would be great.
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Sun May 01, 2005 2:07 am    Post subject: Re: Select Expand BBcodes MOD Reply with quote

Try to add style="table-layout:fixed;" to the table tag used by this MOD (look in bbcode.tpl).

It looks good on IE and even better on Firefox.


NB: use viewsource on this site to see what I mean. Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
hexcode
Apprentice
Apprentice


Joined: 01 May 2005
Posts: 7

PostPosted: Sun May 01, 2005 2:47 am    Post subject: Re: Select Expand BBcodes MOD Reply with quote

markus wrote:
Try to add style="table-layout:fixed;" to the table tag used by this MOD (look in bbcode.tpl).

It looks good on IE and even better on Firefox.


NB: use viewsource on this site to see what I mean. Wink


Hi, thanks for the reply. I found three table tags in bbcode.tpl and I added style="table-layout:fixed;" to all three and that seemed to fix the problem. Thank you.

I have a few other questions if you have some time.

Do you happen to know where I can edit the background color of the code box? I would like to match it to my forum’s background, right now its white. Also, is it difficult to add a new bbcode? Like the code img or url ones. Meaning say I wanted to add a new one called “Spoiler”. This new tag will make all text within the open/closed tags have the same text color as my forums background. So users have to highlight the text to read it.
 
Back to top
View user's profile Send private message
MennoniteHobbit



Joined: 11 May 2004
Posts: 196
Location: Indiana, USA

PostPosted: Sun May 01, 2005 3:04 am    Post subject: Re: Select Expand BBcodes MOD Reply with quote

hexcode wrote:
Like the code img or url ones. Meaning say I wanted to add a new one called “Spoiler”. This new tag will make all text within the open/closed tags have the same text color as my forums background. So users have to highlight the text to read it.


There's already a spoiler MOD out there. It's somewhere at phpBB.com. There are lots of variants.
 
Back to top
View user's profile Send private message Send e-mail MSN Messenger
hexcode
Apprentice
Apprentice


Joined: 01 May 2005
Posts: 7

PostPosted: Sun May 01, 2005 3:22 am    Post subject: Re: Select Expand BBcodes MOD breaking page layout? Reply with quote

Thanks, i'll see if I can find it. 
Back to top
View user's profile Send private message
hexcode
Apprentice
Apprentice


Joined: 01 May 2005
Posts: 7

PostPosted: Sun May 01, 2005 3:49 am    Post subject: Re: Select Expand BBcodes MOD breaking page layout? Reply with quote

Found a good one, and got it working. However, the Select/Expand mod doesn't seem to work with it. Does anyone know the changes I would need to make? Here is the code.

Code:

#################################################################
## Mod Title: BB Code Spoiler Mod
## Mod Version: 1.0.0
## Author: Damien Heiser < damien@thenitelife.com > - http://www.thenitelife.com
## Description: Adds BB Code for Entering "Spoiler" Text
##
## Installation Level: (easy to medium)
## Installation Time: 10 Minutes
## Files To Edit:
##         forumroot/includes/bbcode.php
##         forumroot/templates/subSilver/bbcode.tpl
##         forumroot/posting.php
##         forumroot/templates/subSilver/posting_body.tpl
##         forumroot/language/lang_xxx/lang_main.php
##         
## Included Files: (n/a, or list of included/required files)
#################################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
#################################################################
##
## Author Note:
## This mod will put black text on a black background so someone can put in something about a game
## movie, or something else, without someone being "spoiled" to the contents before they have
## seen it.
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#-----[ ACTION: open ]------------------------------------------
#

   forumroot/includes/bbcode.php

#
#-----[ ACTION: find ]------------------------------------------
#

   // [i] and [/i] for italicizing text.
   $text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);
   $text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);

#
#-----[ ACTION: add below ]------------------------------------------
#

   // [spoiler] and [/spoiler] for entering spoiled text MOD.
   $text = str_replace("[spoiler:$uid]", $bbcode_tpl['spoiler_open'], $text);
   $text = str_replace("[/spoiler:$uid]", $bbcode_tpl['spoiler_close'], $text);

#
#-----[ ACTION: find ]------------------------------------------
#

   // [i] and [/i] for italicizing text.
   $text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);

#
#-----[ ACTION: add below ]------------------------------------------
#

   // [spoiler] and [/spoiler] for entering spoiled text MOD.
   $text = preg_replace("#\[spoiler\](.*?)\[/spoiler\]#si", "[spoiler:$uid]\\1[/spoiler:$uid]", $text);


#
#-----[ ACTION: open ]------------------------------------------
#

   forumroot/templates/subSilver/bbcode.tpl

#
#-----[ ACTION: find ]------------------------------------------
#

<!-- BEGIN i_open --><span style="font-style: italic"><!-- END i_open -->
<!-- BEGIN i_close --></span><!-- END i_close -->

#
#-----[ ACTION: add below ]------------------------------------------
#

<!-- BEGIN spoiler_open -->
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center" style="table-layout:fixed;">
<tr>
   <span style="font-size: 10px;">Spoiler:</span>
</tr>
<tr>
   <td><span style="font-size: 10px; color: #000000; background-color: #000000"><!-- END spoiler_open -->
<!-- BEGIN spoiler_close -->
   </span>
</td>
</tr>
</table>
<!-- END spoiler_close -->

#
#-----[ ACTION: open ]------------------------------------------
#

   forumroot/posting.php

#
#-----[ ACTION: find ]------------------------------------------
#

   'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],

#
#-----[ ACTION: add below ]------------------------------------------
#

   'L_BBCODE_R_HELP' => $lang['bbcode_r_help'],

#
#-----[ ACTION: open ]------------------------------------------
#

   forumroot/templates/subSilver/posting_body.tpl

#
#-----[ ACTION: find ]------------------------------------------
#

f_help = "{L_BBCODE_F_HELP}";

#
#-----[ ACTION: add below ]------------------------------------------
#

r_help = "{L_BBCODE_R_HELP}";

#
#-----[ ACTION: find ]------------------------------------------
#

bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');

#
#-----[ ACTION: replace with ]------------------------------------------
#

bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[spoiler]','[/spoiler]');

# NOTE: Added ,'[spoiler]','[/spoiler]' to the end of the array.

#
#-----[ ACTION: find ]------------------------------------------
#

         <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>

#
#-----[ ACTION: add below ]------------------------------------------
#
         <td><span class="genmed">
           <input type="button" class="button" accesskey="r" name="addbbcode18" value="Spoiler" style="width: 60px" onClick="bbstyle(18)" onMouseOver="helpline('r')" />
           </span></td>

#
#-----[ ACTION: find ]------------------------------------------
#

               <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">

#
#-----[ ACTION: replace with ]------------------------------------------
#

               <select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">

#
#-----[ ACTION: find ]------------------------------------------
#

               </select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">

#
#-----[ ACTION: replace with ]------------------------------------------
#

               </select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">

#
#-----[ ACTION: open ]------------------------------------------
#

   forumroot/language/lang_xxx/lang_main.php

#
#-----[ ACTION: find ]------------------------------------------
#

$lang['bbcode_f_help'] = "Font size: [size=x-small]small text[/size]";

#
#-----[ ACTION: add below ]------------------------------------------
#

$lang['bbcode_r_help'] = "Spoiler text: [spoiler]spoiler text[/spoiler] (alt+r)";

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


Thank you.
 
Back to top
View user's profile Send private message
hexcode
Apprentice
Apprentice


Joined: 01 May 2005
Posts: 7

PostPosted: Tue Oct 18, 2005 7:12 am    Post subject: Re: Select Expand BBcodes MOD breaking page layout? Reply with quote

Wow, it has been awhile.

Sorry to bump an old post but could anyone give me a hand getting that "BBCode Spoiler Mod" to work with the Select/Expand mod?

The mod is in my post above.

Thank you
 
Back to top
View user's profile Send private message
hexcode
Apprentice
Apprentice


Joined: 01 May 2005
Posts: 7

PostPosted: Sun Oct 23, 2005 3:15 am    Post subject: Re: Select Expand BBcodes MOD breaking page layout? Reply with quote

Alright, I just need a little more help as i've almost got it working. I just can't get the ‹ Select › ‹ Expand › to appear...what am I doing wrong?

Code:
<!-- BEGIN spoiler_open --></span>
<table class="bodyline" style="table-layout:fixed;" width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>

      <td class="helpline"><span class="genmed"><b>Spoiler:</b></span></td>
<script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
   var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
   SXBB[id] = new _SXBB(id);
   SXBB[id].T['select'] = '{L_SELECT}';
   SXBB[id].T['expand'] = '{L_EXPAND}';
   SXBB[id].T['contract'] = '{L_CONTRACT}';
   SXBB[id].writeCmd();
//-->
</script>
</tr>
   <tr>
     <td class="spoiler">
<script type="text/javascript">
<!--
   SXBB[id].writeDiv();
//-->
</script><!-- END spoiler_open -->

<!-- BEGIN spoiler_close -->
<script type="text/javascript">
<!--
   document.write('</div>');
//-->
</script>

<span style="font-size: 10px; color: #000000; background-color: #000000">
   
   </td>
   </tr>
</table>
<span class="postbody"><!-- END spoiler_close -->
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum