#---------[ 1. ئهم پهرگانه بار بكه بۆ ناو پوخچهی مهكۆكهت ]---------------------------------------------------
#
modern_bbcode.js to /include/
/lang/ to /
/img/ to /
mod_modern_bbcode.php to /
smilies.php to /
#
#---------[ 2. ئهم پهرگهیه بكهرهوه ]---------------------------------------------------
#
header.php
#
#---------[ 3. بگهرێ (لههێلی:114) ]---------------------------------------------------
#
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
#
#---------[ 4. له پێشی ئهمه زیاد بكه ]---------------------------------------------------
#
if (in_array(basename($_SERVER['PHP_SELF']), array('viewtopic.php', 'post.php', 'edit.php')))
{
$modern_bbcode_enabled = ($pun_config['p_message_bbcode'] == '1') ? true : false;
if ($modern_bbcode_enabled)
echo '<script type="text/javascript" src="include/modern_bbcode.js"></script>';
}
#
#---------[ 3. بگهرێ (لههێلی:137) ]---------------------------------------------------
#
// END SUBST - <body>
#
#---------[ 4. له پێشی ئهمه زیاد بكه ]---------------------------------------------------
#
if ($modern_bbcode_enabled)
{
$tpl_main = str_replace('<body onload="', '<body onClick="documentClickHandler(event.target);" onload="fixOperaWidth();', $tpl_main);
$tpl_main = str_replace('<body>', '<body onClick="documentClickHandler(event.target);" onload="fixOperaWidth();">', $tpl_main);
}
#
#---------[ 5. ئهم پهرگهیه بكهرهوه ]---------------------------------------------------
#
post.php
#
#---------[ 6. بگهرێ (لههێلی:493) ]---------------------------------------------------
#
<?php endif; ?> <label><strong><?php echo $lang_common['Message'] ?></strong><br />
#
#---------[ 7. بیگۆره بۆ ]---------------------------------------------------
#
<?php endif; require PUN_ROOT.'mod_modern_bbcode.php'; ?>
<label>
#
#---------[ 5. ئهم پهرگهیه بكهرهوه ]---------------------------------------------------
#
edit.php
#
#---------[ 6. بگهرێ (لههێلی:210) ]---------------------------------------------------
#
<?php endif; ?> <label><?php echo $lang_common['Message'] ?><br />
#
#---------[ 7. بیگۆره بۆ ]---------------------------------------------------
#
<?php endif; $bbcode_form = 'edit'; $bbcode_field = 'req_message'; require PUN_ROOT.'mod_modern_bbcode.php'; ?>
<label>
#
#---------[ 5. ئهم پهرگهیه بكهرهوه ]---------------------------------------------------
#
viewtopic.php
#
#---------[ 6. بگهرێ (لههێلی:365) ]---------------------------------------------------
#
<form method="post" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
#
#---------[ 7. بیگۆره بۆ ]---------------------------------------------------
#
<form id="post" method="post" name="qpost" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
#
#---------[ 6. بگهرێ (لههێلی:372) ]---------------------------------------------------
#
<label><textarea name="req_message" rows="7" cols="75" tabindex="1"></textarea></label>
#
#---------[ 7. له پێشی ئهمه زیاد بكه ]---------------------------------------------------
#
<?php require PUN_ROOT.'mod_modern_bbcode.php'; ?>
#
#---------[ 5. ئهم پهرگهیه بكهرهوه ]---------------------------------------------------
#
/include/parser.php
#
#---------[ 6. بگهرێ (لههێلی:44) ]---------------------------------------------------
#
$a = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
$b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
#
#---------[ 7. بیگۆره بۆ ]---------------------------------------------------
#
$a = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]', '[s]', '[/s]');
$b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]', '[s]', '[/s]');
#
#---------[ 6. بگهرێ (لههێلی:282) ]---------------------------------------------------
#
//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
#
#---------[ 7. له پێشی ئهمه زیاد بكه ]---------------------------------------------------
#
//
// Turns an URL from the [img], [imgr], [imgl] tags into an <img> tag or a <a href...> tag. ADDED BY MOD: MODERN BBCODE
//
function handle_img_tag_modern($align, $url, $is_signature = false)
{
global $lang_common, $pun_config, $pun_user;
$img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';
if ($is_signature && $pun_user['show_img_sig'] != '0')
$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
else if (!$is_signature && $pun_user['show_img'] != '0')
{
if ($align != '')
$img_tag = '<img class="postimg" style="float: '.$align.'; clear: '.$align.'" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
}
return $img_tag;
}
#
#---------[ 6. بگهرێ (لههێلی:319) ]---------------------------------------------------
#
//
// Convert BBCodes to their HTML equivalent
//
function do_bbcode($text)
{
global $lang_common, $pun_user;
if (strpos($text, 'quote') !== false)
{
$text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
$text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'[\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
$text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
}
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[url\]([^\[]*?)\[/url\]#e',
'#\[url=([^\[]*?)\](.*?)\[/url\]#e',
'#\[email\]([^\[]*?)\[/email\]#',
'#\[email=([^\[]*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>');
// This thing takes a while! :)
$text = preg_replace($pattern, $replace, $text);
return $text;
}
#
#---------[ 6. بیگۆره بۆ ]---------------------------------------------------
#
//
// Convert BBCodes to their HTML equivalent
//
function do_bbcode($text)
{
global $lang_common, $pun_user;
require PUN_ROOT.'lang/'.$pun_user['language'].'/modern_bbcode.php';
if (strpos($text, 'quote') !== false)
{
$text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
$text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'[\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
$text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
}
if (strpos($text, 'list') !== false)
{
$text = str_replace('[listo]', '</p><ol>', $text);
$text = str_replace('[list]', '</p><ul>', $text);
$text = str_replace('[li]', '<li>', $text);
$text = str_replace('[/li]', '</li>', $text);
$text = preg_replace('#\[\/listo\]\s*#', '</ol><p>', $text);
$text = preg_replace('#\[\/list\]\s*#', '</ul><p>', $text);
}
if (strpos($text, 'spoiler') !== false)
{
$text = str_replace('[spoiler]', '</p><blockquote><div class="spoilerbox"><h4>'.$lang_modern_bbcode['Spoiler'].':</h4><p>', $text);
$text = preg_replace('#\[\/spoiler\]\s*#', '</p></div></blockquote><p>', $text);
}
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[s\](.*?)\[/s\]#s',
'#\[mono\](.*?)\[/mono\]#s',
'#\[url\]([^\[]*?)\[/url\]#e',
'#\[url=([^\[]*?)\](.*?)\[/url\]#e',
'#\[email\]([^\[]*?)\[/email\]#',
'#\[email=([^\[]*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
'#\[center\](.*?)\[/center\]#s',
'#\[right\](.*?)\[/right\]#s',
'#\[size=([0-9]*)](.*?)\[/size\]#s');
$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'<span class="bbs">$1</span>',
'<code>$1</code>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>',
'</p><p class="center">$1</p><p>',
'</p><p class="right">$1</p><p>',
'<span style="font-size: $1px">$2</span>');
// This thing takes a while! :)
$text = preg_replace($pattern, $replace, $text);
return $text;
}
#
#---------[ 6. بگهرێ (لههێلی:449) ]---------------------------------------------------
#
if ($pun_config['p_message_img_tag'] == '1')
{
// $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
}
#
#---------[ 6. بیگۆره بۆ ]---------------------------------------------------
#
if ($pun_config['p_message_img_tag'] == '1')
{
// $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
$text = preg_replace('#\[imgr\]((ht|f)tps?://)([^\s<"]*?)\[/imgr\]#e', 'handle_img_tag_modern(\'right\', \'$1$3\')', $text);
$text = preg_replace('#\[imgl\]((ht|f)tps?://)([^\s<"]*?)\[/imgl\]#e', 'handle_img_tag_modern(\'left\', \'$1$3\')', $text);
}
#
#---------[ 5. ئهم پهرگهیه بكهرهوه ]---------------------------------------------------
#
style/imports/base.css
#
#---------[ 5. زیاد بكه له كۆیایی ههموو كۆدهكان ]---------------------------------------------------
#
/***************************************/
/* MOD MODERN BB-CODE STYLE INDICATORS */
/***************************************/
/********************************************************************/
/* MOD MODERN BBCODE: OVERRIDES FOR STANDART PUNBB STYLE INDICATORS */
/********************************************************************/
DIV.txtarea label {
padding: 0;
margin: 0;
}
DIV.txtarea textarea {
border: 1px;
padding: 1px;
}
DIV.txtarea input.longinput {
border: 1px;
padding: 2px 1px;
margin-bottom: 5px;
}
DIV.txtarea {
min-width: 650px;
width: 80%;
}
#smileyblock {
width: 70%;
}
#smileyblock #smileybox {
margin: 0;
padding: 0;
}
#smileyblock .tcl, #smileyblock .tcr {
text-align: center;
width: 50%;
}
/****************************************************************/
/* MOD MODERN BBCODE: TOOLBAR AND TOOLBUTTON STYLE INDICATORS */
/****************************************************************/
DIV.toolbar {
height: 2em;
margin-right: 5px;
width: 100%;
padding: 3px 1px;
}
DIV.toolbar .draghandle {
float: left;
width: 4px;
height: 2em;
margin-left: 3px;
}
DIV.toolbar .separator {
float: left;
width: 1px;
height: 2em;
margin:0 3px;
padding: 0;
}
DIV.toolbar a.tool_btn, DIV.toolbar a.dropdown, DIV.toolbar a.dropdown_OPENed {
float: left;
padding: 3px 7px;
margin: 0 2px 0 0;
text-decoration: none;
text-transform: uppercase;
display: block;
}
DIV.toolbar #bold {
font-weight: bold;
}
DIV.toolbar #italic {
font-style: italic;
}
DIV.toolbar #underline {
text-decoration: underline;
}
DIV.toolbar #strikeout {
text-decoration: line-through;
}
DIV.toolbar a.dropdown {
outline: none;
padding-right: 20px;
}
DIV.toolbar a.dropdown_OPENed {
outline: none;
overflow: hidden;
padding-right: 20px;
}
DIV.toolbar a.dropdown:hover {
outline: none;
}
DIV.toolbar #inctxt, DIV.toolbar #dectxt, DIV.toolbar #help {
float: right;
margin-right: 4px;
outline: none;
}
/****************************************************************/
/* MOD MODERN BBCODE: POPUP PALETTE INDICATORS */
/****************************************************************/
/* 0. Common popup panel indicators */
#colorpalette #colorbtn, #smilespanel #smilesbtn, #sizepanel #sizebtn, #imgpanel #imgbtn, #listpanel #listbtn {
float: left;
clear: right;
height: 4px;
padding: 0px 7px 0px 7px;
margin: 0;
text-decoration: none;
text-transform: uppercase;
border-bottom: 0;
border-top: 0;
margin-bottom: -1px;
outline: none;
padding-right: 20px;
}
#colorpalette, #smilespanel, #sizepanel, #imgpanel, #listpanel {
position: absolute;
display: none;
}
#colorpalette #colorcontent, #smilespanel #smilescontent, #sizepanel #sizecontent, #imgpanel #imgcontent, #listpanel #listcontent {
padding: 1px;
}
.popupcontent_ie {
float: left;
}
/* 1. Smileys popup panel indicators */
#smilespanel {
width: 90px;
}
#smilespanel #adv {
float: left;
width: 100%;
text-align: center;
padding: 1px 0 5px 0;
}
#smilespanel #adv a {
border: 0;
background-color: inherit;
float: none;
}
#smilespanel a {
padding: 0;
margin: 0;
}
#smilespanel a img {
padding: 2px 3px;
}
/* 2. Colors popup panel indicators */
#colorpalette {
width: 125px;
}
#colorpalette #colorcontent {
padding: 2px 1px 1px 2px;
}
#colorpalette #colorcontent a {
float: left;
width: 12px;
height: 12px;
margin: 0 1px 1px 0;
padding: 0;
}
/* 2. Font-sizes, Images and Lists popup panel indicators */
#sizepanel, #listpanel {
width: 12em;
}
#imgpanel {
width: 15em;
}
#sizepanel #sizecontent a, #imgpanel #imgcontent a, #listpanel #listcontent a {
float: left;
clear: left;
width: 95%;
margin: 0;
padding: 2px 2px;
display: block;
text-decoration: none;
}
#imgpanel #imgcontent a {
width: 96%;
}
#sizepanel #sizecontent a:hover, #imgpanel #imgcontent a:hover, #listpanel #listcontent a:hover {
padding: 2px 2px;
}
/*******************************************************/
/* MOD MODERN BBCODE: COLORPALETTE INDICATORS (COLORS) */
/*******************************************************/
#colorblack {background: #000;}
#colorbrown {background: #930;}
#colorolive {background: #330;}
#colordarkgreen {background: #030;}
#colordarkteal {background: #036;}
#colordarkblue {background: #000080;}
#colorindigo {background: #339;}
#colorgray80 {background: #333;}
#colordarkred {background: #800000;}
#colororange {background: #F60;}
#colordarkyellow {background: #808000;}
#colorgreen {background: #008000;}
#colorteal {background: #008080;}
#colorblue {background: #00F;}
#colorbluegray {background: #669;}
#colorgray50 {background: #808080;}
#colorred {background: #F00;}
#colorlightorange {background: #F90;}
#colorlime {background: #9C0;}
#colorseagreen {background: #396;}
#coloraqua {background: #3CC;}
#colorlightblue {background: #36F;}
#colorviolet {background: #800080;}
#colorgray40 {background: #969696;}
#colorpink {background: #F0F;}
#colorgold {background: #FC0;}
#coloryellow {background: #FF0;}
#colorbrightgreen {background: #00FF00;}
#colorturquoise {background: #0FF;}
#colorskyblue {background: #0CF;}
#colorplum {background: #936;}
#colorgray25 {background: #C0C0C0;}
#colorrose {background: #F9C;}
#colortan {background: #FC9;}
#colorlightyellow {background: #FF9;}
#colorlightgreen {background: #CFC;}
#colorlightturquoise {background: #CFF;}
#colorpaleblue {background: #9CF;}
#colorlavender {background: #C9F;}
#colorwhite {background: #FFF;}
/****************************************************************/
/* MOD MODERN BBCODE: ADDITIONAL BBCODE INDICATORS */
/****************************************************************/
p.center {
text-align: center;
}
p.right {
text-align: right;
}
span.bbs {
text-decoration: line-through;
}
code {
font-family: "Courier New";
font-size: 110%;
}
div.postmsg ol, div.postmsg ul {
padding: 5px;
}
div.postmsg li {
margin-left: 30px;
padding: 2px;
}
div.postmsg ol li {
list-style-type: decimal;
}
div.postmsg ul li {
list-style-type: square;
}
#
#---------[ 5. NOTE ]---------------------------------------------------
#
Now you need to update styles. Below you can find style blocks for standard styles.
All you need is to OPEN CSS file in /style/imports/<style_name>_cs.css and add style block TO THE END OF FILE.
If you want to add support for your own style, just copy one of this blocks and modify it as you need.
#
#---------[ 5. ئهم پهرگهیه بكهرهوه: Kurdish_rtl_cs.css, زیاد بكه له كۆتایی ههموو كۆدهكان ]---------------------------------------------------
#
/****************************************************************/
/* MOD MODERN BB-CODE STYLE INDICATORS */
/****************************************************************/
/****************************************************************/
/* MOD MODERN BBCODE: OVERRIDES FOR STANDART PUNBB STYLE INDICATORS */
/****************************************************************/
#post textarea, #post input.longinput, #edit textarea, #edit input.longinput {
border: 1px #0066B9 solid;
}
/****************************************************************/
/* MOD MODERN BBCODE: TOOLBAR AND TOOLBUTTON STYLE INDICATORS */
/****************************************************************/
DIV.toolbar {
background: #2277BC;
border-left: 1px #0066B9 solid;
border-top: 1px #0066B9 solid;
border-right: 1px #0066B9 solid;
}
DIV.toolbar .draghandle {
border-left: 2px #0066B9 dotted;
}
DIV.toolbar .separator {
border-left: 1px #0066B9 solid;
}
DIV.toolbar a.tool_btn, DIV.toolbar a.dropdown, DIV.toolbar a.dropdown_OPENed {
border: 1px #3E8AC7 solid;
color: #DEDFDF;
}
DIV.toolbar a.tool_btn:visited, DIV.toolbar a.dropdown:visited, DIV.toolbar a.dropdown_OPENed:visited {
color: #DEDFDF;
}
DIV.toolbar a.tool_btn:hover, DIV.toolbar a.dropdown:hover {
border: 1px #9CF solid;
color: #FFF;
background: #0066B9;
}
DIV.toolbar a.dropdown {
background: url(/../../img/modern_bbcode/oxygen_arrow.png) no-repeat top right;
}
DIV.toolbar a.dropdown_OPENed, DIV.toolbar a.dropdown_OPENed:hover, DIV.toolbar a.dropdown_OPENed:visited {
color: #FFF;
border: 1px #0066B9 solid;
background: #3E8AC7 url(/../../img/modern_bbcode/oxygen_arrow_OPENed.png) no-repeat top right;
}
DIV.toolbar a.dropdown:hover {
background: #0066B9 url(/../../img/modern_bbcode/oxygen_arrow_hover.png) no-repeat top right;
}
/****************************************************************/
/* MOD MODERN BBCODE: POPUP PALETTE INDICATORS */
/****************************************************************/
/* 0. Common popup panel indicators */
#colorpalette #colorbtn, #smilespanel #smilesbtn, #sizepanel #sizebtn, #imgpanel #imgbtn, #listpanel #listbtn {
border-left: 1px #0066B9 solid;
border-right: 1px #0066B9 solid;
color: #3E8AC7;
background: #3E8AC7;
}
#colorpalette #colorcontent, #smilespanel #smilescontent, #sizepanel #sizecontent, #imgpanel #imgcontent, #listpanel #listcontent {
border: 1px #0066B9 solid;
background: #3E8AC7;
}
/* 1. Smileys popup panel indicators */
#smilespanel #adv a, #smilespanel #adv a:visited {
color: #FFF;
}
#smilespanel #adv a:hover {
color: #0066B9;
}
/* 2. Colors popup panel indicators */
#colorpalette #colorcontent a {
border: 1px #2277BC solid;
}
#colorpalette #colorcontent a:hover {
border: 1px #9CF solid;
}
/* 3. Font-sizes, Images and Lists popup panel indicators */
#sizepanel #sizecontent a, #imgpanel #imgcontent a, #listpanel #listcontent a {
border: 1px solid #2277BC;
color: #FFF;
background: #2277BC;
}
#sizepanel #sizecontent a:hover, #imgpanel #imgcontent a:hover, #listpanel #listcontent a:hover {
border: 1px #0066B9 solid;
color: #FFF;
background: #3E8AC7;
}
/****************************************************************/
/* MOD MODERN BBCODE: ADDITIONAL BBCODE INDICATORS */
/****************************************************************/
code {
color: #B42000;
}
div.postmsg li {
color: #666;
}
DIV.spoilerbox p {
color: #F1F1F1;
}
DIV.spoilerbox p:hover {
color: #333;
}
IMG.postimg {
padding: 1px;
margin: 2px 5px;
border: 1px solid #0066B9;
background: #FFF;
}
DIV.postmsg a:hover IMG.postimg {
border: 1px solid #B42000;