Pagina 1 van 1

[CODE] BBCode Strike

Geplaatst: 24 nov 2002, 22:28
door Floyds
Oke.. voor mensen die graag de BBCode Strike willen gebruiken is hier een werkende code.

Code: Selecteer alles

# 
#-----[ ACTION: open ]-------------------------------- 
# 
    forumroot/includes/bbcode.php 
# 
#-----[ ACTION: find ]--------------------------------- 
# 
   // [b ] and [/b ] for bolding text. 
   $text = str_replace("[b:$uid]", $bbcode_tpl['b_open'], $text); 
   $text = str_replace("[/b:$uid]", $bbcode_tpl['b_close'], $text); 

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

   // [strike] and [/strike] for barring text. 
   $text = str_replace("[strike:$uid]", $bbcode_tpl['strike_open'], $text); 
   $text = str_replace("[/strike:$uid]", $bbcode_tpl['strike_close'], $text); 


# 
#-----[ ACTION: find ]--------------------------------- 
# 
   // [b ] and [/b ] for bolding text. 
   $text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text); 

# 
#-----[ ACTION: add below ]---------------------------- 
# 
   // [strike] and [/strike] for barring text. 
   $text = preg_replace("#\[strike\](.*?)\[/strike\]#si", "[strike:$uid]\\1[/strike:$uid]", $text); 

# 
#-----[ ACTION: save, close, upload ]---------------------------- 
# 

# 
#-----[ ACTION: open ]--------------------------------- 
# 
    forumroot/templates/forumtheme/bbcode.tpl 

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

<!-- BEGIN b_open --> 
<span style="font-weight: bold"> 
<!-- END b_open --> 
<!-- BEGIN b_close --> 
</span> 
<!-- END b_close --> 

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

<!-- BEGIN strike_open --> 
<span><strike> 
<!-- END strike_open --> 
<!-- BEGIN strike_close --> 
</strike></span> 
<!-- END strike_close --> 

# 
#-----[ ACTION: save, close, upload ]--------------------------------- 
# 

# 
#-----[ ACTION: open ]--------------------------------- 
# 
  forumroot/languages/lang_xxxx/lang_main.php 


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

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

$lang['bbcode_k_help'] = "Barring text: [strike]text[/strike] (alt+k)"; 

# 
#-----[ ACTION: save, close, upload ]--------------------------------- 
# 


# 
#-----[ ACTION: open ]--------------------------------- 
# 
    forumroot/posting.php 
# 
#-----[ ACTION: find  ]--------------------------------- 
# 
   "L_BBCODE_F_HELP" => $lang['bbcode_f_help'], 
# 
#-----[ ACTION: add below ]-------------------------------- 
# 
   "L_BBCODE_K_HELP" => $lang['bbcode_k_help'], 

# 
#-----[ ACTION: save, close, upload ]---------------------------- 
# 

# 
#-----[ ACTION: open ]--------------------------------- 
# 
    forumroot/templates/forumtheme/posting_body.tpl 

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

f_help = "{L_BBCODE_F_HELP}"; 

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

k_help = "{L_BBCODE_K_HELP}"; 


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

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

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

bbtags = new Array('','','','','','','[quote]','[/quote]','','
  • ','
','
  • ','
','[img]','[/img]','','','[strike]','[/strike]');

# NOTE: Other Mods ? Be carefull and just add ( ,'[strike]','[/strike]' ) at 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="k" name="addbbcode18" value="Strike" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('k')" />
</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: save, close, upload ]---------------------------------
#
#
#-----[ EOF ]------------------------------------------ [/code]

Ik weet niet ik dit zo mag posten, maar vind het wel een goede code die toch iedereen op mijn forum moet hebben

Geplaatst: 25 nov 2002, 13:01
door .::Neo::.
En wa tdoet het precies? (Ik heb gee zin om de hele code door te pluisen :D)

Geplaatst: 25 nov 2002, 19:28
door Floyds
Wat dit doet is dat er door de text een streep loopt.. (doorhalen)
Altijd makkelijk voor opsommingen van dingen en als er aan paar gedaan zijn, kan je die doorhalen (strike)

Geplaatst: 13 okt 2003, 12:24
door timgoud