vendredi 29 août 2014

Hak Tags H2 H3 H4 (DLE English)

Not to write every time hands tags and it was decided to add them to the BB panel, so that when you select text and press the button, the selected piece to wrap the tag.

Installation:

1) We go in the engine/classes/parse.class.php and find:
if ($count_start AND $count_start == $count_end) $source = str_ireplace( "[b]", "<b>", str_ireplace( "[/b]", "</b>", $source ) );


The following set:
 
$count_start = substr_count ($source, "[H2]");
$count_end = substr_count ($source, "[/H2]");

if ($count_start AND $count_start == $count_end) $source = str_ireplace( "[H2]", "<H2>", str_ireplace( "[/H2]", "</H2>", $source ) );




$count_start = substr_count ($source, "[H3]");
$count_end = substr_count ($source, "[/H3]");

if ($count_start AND $count_start == $count_end) $source = str_ireplace( "[H3]", "<H3>", str_ireplace( "[/H3]", "</H3>", $source ) );




$count_start = substr_count ($source, "[H4]");
$count_end = substr_count ($source, "[/H4]");

if ($count_start AND $count_start == $count_end) $source = str_ireplace( "[H4]", "<H4>", str_ireplace( "[/H4]", "</H4>", $source ) );


2. In the File engine/modules/bbcode.php find:
 
<b id="b_ol" class="bb-btn" onclick="tag_list('ol')" title="{$lang['bb_t_list2']}">{$lang['bb_t_list2']}</b>
<span class="bb-sep">|</span>


And put the following:
 
<div id="b_h2" class="editor_button" onclick="simpletag('H2')">H2</div>

<span class="bb-sep">|</span>
<div id="b_h3" class="editor_button" onclick="simpletag('H3')">H3</div>

<span class="bb-sep">|</span>
<div id="b_h4" class="editor_button" onclick="simpletag('H4')">H4</div>


3. Next go to the engine/ajax/bbcode.php find:
 
<b id="b_ol" class="bb-btn" onclick="tag_list('ol')" title="$lang[bb_t_list2]">$lang[bb_t_list2]</b>
<span class="bb-sep">|</span>


And put the following:
 
<div id="b_h2" class="editor_button" onclick="simpletag('H2')">H2</div>

<span class="bb-sep">|</span>
<div id="b_h3" class="editor_button" onclick="simpletag('H3')">H3</div>

<span class="bb-sep">|</span>
<div id="b_h4" class="editor_button" onclick="simpletag('H4')">H4</div>


4. To connect to the admin area codes need to go to the engine/inc/include/inserttag.php find:
 
<div id="b_ol" class="editor_button" onclick="tag_list('ol')"><img title="$lang[bb_t_list2]" src="engine/skins/bbcodes/images/ol.gif" width="23" height="25"></div>
<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25"></div>


The following is inserted:
 
<div id="b_h2" class="editor_button" onclick="simpletag('H2')">H2</div>

<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25"></div>
<div id="b_h3" class="editor_button" onclick="simpletag('H3')">H3</div>

<div class="editor_button"><img src="engine/skins/bbcodes/images/brkspace.gif" width="5" height="25"></div>
<div id="b_h4" class="editor_button" onclick="simpletag('H4')">H4</div>


Now, in any connected to the site .css file insert:
 
#b_h2 {
cursor: pointer;
width: 23px;
float: left;
margin: 3px 0px 0px 5px;
}

#b_h3 {
cursor: pointer;
width: 23px;
float: left;
margin: 3px 0px 0px 5px;
}

#b_h4 {
cursor: pointer;
width: 23px;
float: left;
margin: 3px 0px 0px 5px;
}

Aucun commentaire:

Enregistrer un commentaire