Version 2.2.0 RC-1

This commit is contained in:
Neo committed 2025-12-19 00:22:37 -08:00
1 parent f73f8bff6d
commit 22f1b963ee
1034 files changed
+178610 -70897

No files matched your search

+169 -129
View File
@@ -2,27 +2,17 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
| > $Revision: 23 $
| > $Date: 2006-10-06 12:18:32 +0100 (Fri, 06 Oct 2006) $
| > $Revision: 614 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
@@ -37,13 +27,15 @@
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class ad_bbcode {
var $functions = "";
var $ipsclass;
var $html;
/**
* Section title name
@@ -61,24 +53,16 @@ class ad_bbcode {
function auto_run()
{
$this->html = $this->ipsclass->acp_load_template('cp_skin_bbcode_badword');
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'BBCode Manager' );
//-----------------------------------------
// Require and RUN !! THERES A BOMB
//-----------------------------------------
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëÿåò âàì äîáàâëÿòü íîâûå BB-òýãè.";
$this->ipsclass->admin->page_title = "Ìåíåäæåð íàñòðîéêè BB-êîäîâ";
$this->ipsclass->admin->page_detail = "The BBCode manager allows you to create and manage your BBCodes.";
$this->ipsclass->admin->page_title = "BBCode Manager";
//-----------------------------------------
// Kill globals - globals bad, Homer good.
//-----------------------------------------
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
foreach ( $tmp_in as $k => $v )
{
unset($$k);
}
//-----------------------------------------
// What to do...
//-----------------------------------------
@@ -143,7 +127,7 @@ class ad_bbcode {
function bbcode_import()
{
$content = $this->ipsclass->admin->import_xml( 'ipb_bbcode.xml' );
$content = $this->ipsclass->admin->import_xml( 'bbcode.xml' );
//-----------------------------------------
// Got anything?
@@ -151,7 +135,7 @@ class ad_bbcode {
if ( ! $content )
{
$this->ipsclass->main_msg = "Íåâîçìîæíî çàãðóçèòü, ipb_bbcode.xml áûë íå íàéäåò èëè îêàçàëñÿ ïóòûì";
$this->ipsclass->main_msg = "Upload failed, ipb_bbcode.xml was either missing or empty";
$this->bbcode_start();
}
@@ -159,7 +143,7 @@ class ad_bbcode {
// Get xml mah-do-dah
//-----------------------------------------
require( KERNEL_PATH.'class_xml.php' );
require_once( KERNEL_PATH.'class_xml.php' );
$xml = new class_xml();
@@ -170,7 +154,7 @@ class ad_bbcode {
$xml->xml_parse_document( $content );
//-----------------------------------------
// Get current badwords
// Get current custom bbcodes
//-----------------------------------------
$tags = array();
@@ -192,29 +176,52 @@ class ad_bbcode {
$xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'][0] = $xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'];
}
foreach( $xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'] as $idx => $entry )
foreach( $xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'] as $entry )
{
$bbcode_title = $entry['bbcode_title']['VALUE'];
$bbcode_desc = $entry['bbcode_desc']['VALUE'];
$bbcode_tag = $entry['bbcode_tag']['VALUE'];
$bbcode_replace = $entry['bbcode_replace']['VALUE'];
$bbcode_useoption = $entry['bbcode_useoption']['VALUE'];
$bbcode_example = $entry['bbcode_example']['VALUE'];
$bbcode_title = $entry['bbcode_title']['VALUE'];
$bbcode_desc = $entry['bbcode_desc']['VALUE'];
$bbcode_tag = $entry['bbcode_tag']['VALUE'];
$bbcode_replace = $entry['bbcode_replace']['VALUE'];
$bbcode_useoption = $entry['bbcode_useoption']['VALUE'];
$bbcode_example = $entry['bbcode_example']['VALUE'];
$bbcode_switch_option = $entry['bbcode_switch_option']['VALUE'];
$bbcode_add_into_menu = $entry['bbcode_add_into_menu']['VALUE'];
$bbcode_menu_option_text = $entry['bbcode_menu_option_text']['VALUE'];
$bbcode_menu_content_text = $entry['bbcode_menu_content_text']['VALUE'];
if ( $tags[ $bbcode_tag ] )
{
$bbarray = array(
'bbcode_title' => $bbcode_title,
'bbcode_desc' => $bbcode_desc,
'bbcode_tag' => $bbcode_tag,
'bbcode_replace' => $this->ipsclass->txt_safeslashes($bbcode_replace),
'bbcode_useoption' => $bbcode_useoption,
'bbcode_example' => $bbcode_example,
'bbcode_switch_option' => $bbcode_switch_option,
'bbcode_add_into_menu' => $bbcode_add_into_menu,
'bbcode_menu_option_text' => $bbcode_menu_option_text,
'bbcode_menu_content_text' => $bbcode_menu_content_text,
);
$this->ipsclass->DB->do_update( 'custom_bbcode', $bbarray, "bbcode_tag='".$bbcode_tag."'" );
continue;
}
if ( $bbcode_tag )
{
$bbarray = array(
'bbcode_title' => $bbcode_title,
'bbcode_desc' => $bbcode_desc,
'bbcode_tag' => $bbcode_tag,
'bbcode_replace' => $this->ipsclass->txt_safeslashes($bbcode_replace),
'bbcode_useoption' => $bbcode_useoption,
'bbcode_example' => $bbcode_example,
'bbcode_title' => $bbcode_title,
'bbcode_desc' => $bbcode_desc,
'bbcode_tag' => $bbcode_tag,
'bbcode_replace' => $this->ipsclass->txt_safeslashes($bbcode_replace),
'bbcode_useoption' => $bbcode_useoption,
'bbcode_example' => $bbcode_example,
'bbcode_switch_option' => $bbcode_switch_option,
'bbcode_add_into_menu' => $bbcode_add_into_menu,
'bbcode_menu_option_text' => $bbcode_menu_option_text,
'bbcode_menu_content_text' => $bbcode_menu_content_text,
);
$this->ipsclass->DB->do_insert( 'custom_bbcode', $bbarray );
@@ -223,7 +230,7 @@ class ad_bbcode {
$this->bbcode_rebuildcache();
$this->ipsclass->main_msg = "XML ôàéë BB-êîäîâ áûë óñïåøíî èìïîðòèðîâàí";
$this->ipsclass->main_msg = "BBCode XML file import completed";
$this->bbcode_start();
@@ -239,7 +246,7 @@ class ad_bbcode {
// Get xml mah-do-dah
//-----------------------------------------
require( KERNEL_PATH.'class_xml.php' );
require_once( KERNEL_PATH.'class_xml.php' );
$xml = new class_xml();
@@ -278,7 +285,7 @@ class ad_bbcode {
// Send to browser.
//-----------------------------------------
$this->ipsclass->admin->show_download( $xml->xml_document, 'ipb_bbcode.xml' );
$this->ipsclass->admin->show_download( $xml->xml_document, 'bbcode.xml', '', 0 );
}
//-----------------------------------------
@@ -289,11 +296,11 @@ class ad_bbcode {
{
if ( ! $this->ipsclass->input['id'] )
{
$this->ipsclass->main_msg = "Íåò ïðèãîäíîãî ID, ïîïûòàéòåñü çàíîâî.";
$this->ipsclass->main_msg = "No ID was passed, please try again.";
$this->bbcode_start();
}
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'custom_bbcode', 'where' => 'bbcode_id='.$this->ipsclass->input['id'] ) );
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'custom_bbcode', 'where' => 'bbcode_id='.intval($this->ipsclass->input['id']) ) );
$this->bbcode_rebuildcache();
@@ -332,7 +339,9 @@ class ad_bbcode {
while ( $row = $this->ipsclass->DB->fetch_row() )
{
if ( substr_count( $row['bbcode_replace'], '{content}' ) > 1 )
$preg_tag = preg_quote($row['bbcode_tag'], '#' );
if ( substr_count( $row['bbcode_replace'], '{content}' ) >= 1 )
{
//-----------------------------------------
// Slightly slower
@@ -340,20 +349,43 @@ class ad_bbcode {
if ( $row['bbcode_useoption'] )
{
preg_match_all( "#(\[".$row['bbcode_tag']."=(?:&quot;|&\#39;)?(.+?)(?:&quot;|&\#39;)?\])(.+?)(\[/".$row['bbcode_tag']."\])#si", $t, $match );
preg_match_all( "#(\[".preg_quote($row['bbcode_tag'], '#' )."=(?:&quot;|&\#39;)?(.+?)(?:&quot;|&\#39;)?\])(.+?)(\[/".preg_quote($row['bbcode_tag'], '#' )."\])#si", $t, $match );
for ($i=0; $i < count($match[0]); $i++)
{
# XSS Check: Bug ID: 980
if ( $row['bbcode_tag'] == 'post' OR $row['bbcode_tag'] == 'topic' )
{
$match[2][$i] = intval( $match[2][$i] );
}
//-----------------------------------------
// Does the option tag come first?
//-----------------------------------------
$_option = 2;
$_content = 3;
$_o = strpos( $row['bbcode_replace'], '{option}' );
$_c = strpos( $row['bbcode_replace'], '{content}' );
if ( $_c < $_o )
{
$_option = 3;
$_content = 2;
}
$tmp = $row['bbcode_replace'];
$tmp = str_replace( '{option}' , $match[2][$i], $tmp );
$tmp = str_replace( '{content}', $match[3][$i], $tmp );
$tmp = str_replace( '{option}' , $match[ $_option ][$i], $tmp );
$tmp = str_replace( '{content}', $match[ $_content ][$i], $tmp );
$t = str_replace( $match[0][$i], $tmp, $t );
}
}
else
{
preg_match_all( "#(\[".$row['bbcode_tag']."\])(.+?)(\[/".$row['bbcode_tag']."\])#si", $t, $match );
# Tricky.. match anything that's not a closing tag, or nothing
preg_match_all( "#(\[$preg_tag\])((?!\[/$preg_tag\]).+?)?(\[/$preg_tag\])#si", $t, $match );
for ($i=0; $i < count($match[0]); $i++)
{
$tmp = $row['bbcode_replace'];
@@ -394,7 +426,7 @@ class ad_bbcode {
{
if ( ! $this->ipsclass->input['id'] )
{
$this->ipsclass->main_msg = "Íåò ïðèãîäíîãî ID, ïîïûòàéòåñü çàíîâî ";
$this->ipsclass->main_msg = "No ID was passed, please try again";
$this->bbcode_form($type);
}
}
@@ -405,38 +437,43 @@ class ad_bbcode {
if ( ! $this->ipsclass->input['bbcode_title'] or ! $this->ipsclass->input['bbcode_tag'] or ! $this->ipsclass->input['bbcode_replace'] )
{
$this->ipsclass->main_msg = "Âû äîëæíû çàïîëíèòü âñå ïîëÿ.";
$this->ipsclass->main_msg = "You must complete the form fully.";
$this->bbcode_form($type);
}
if ( ! strstr( $this->ipsclass->input['bbcode_replace'], '{content}' ) )
{
$this->ipsclass->main_msg = "Âû äîëæíû èñïîëüçîâàòü {content}, â òåõ ìåñòàõ, ãäå ïðîèñõîäèò çàìåíà BB-êîäîâ.";
$this->ipsclass->main_msg = "You must use {content} somewhere in the BBCode replacement section.";
$this->bbcode_form($type);
}
if ( ! strstr( $this->ipsclass->input['bbcode_replace'], '{option}' ) AND $this->ipsclass->input['bbcode_useoption'] )
{
$this->ipsclass->main_msg = "Âû äîëæíû èñïîëüçîâàòü {content}, â òåõ ìåñòàõ, ãäå ïðîèñõîäèò çàìåíà BB-êîäîâ èëè â ìåíþ 'Èñïîëüçîâàòü íàñòðîéêè â òåãàõ' ïîñòàâèòü 'íåò'.";
$this->ipsclass->main_msg = "You must use {option} somewhere in the BBCode replacement section or set 'Use Option in tag?' to 'no'.";
$this->bbcode_form($type);
}
$array = array( 'bbcode_title' => $this->ipsclass->input['bbcode_title'],
'bbcode_desc' => $this->ipsclass->txt_safeslashes( $_POST['bbcode_desc'] ),
'bbcode_tag' => $this->ipsclass->input['bbcode_tag'],
'bbcode_replace' => $this->ipsclass->txt_safeslashes( $_POST['bbcode_replace'] ),
'bbcode_example' => $this->ipsclass->txt_safeslashes( $_POST['bbcode_example'] ),
'bbcode_useoption' => $this->ipsclass->input['bbcode_useoption'] );
$array = array( 'bbcode_title' => $this->ipsclass->input['bbcode_title'],
'bbcode_desc' => $this->ipsclass->txt_safeslashes( $_POST['bbcode_desc'] ),
'bbcode_tag' => $this->ipsclass->input['bbcode_tag'],
'bbcode_replace' => $this->ipsclass->txt_safeslashes( $_POST['bbcode_replace'] ),
'bbcode_example' => $this->ipsclass->txt_safeslashes( $_POST['bbcode_example'] ),
'bbcode_useoption' => $this->ipsclass->input['bbcode_useoption'],
'bbcode_switch_option' => intval( $this->ipsclass->input['bbcode_switch_option'] ),
'bbcode_add_into_menu' => intval( $this->ipsclass->input['bbcode_add_into_menu'] ),
'bbcode_menu_option_text' => trim( $this->ipsclass->input['bbcode_menu_option_text'] ),
'bbcode_menu_content_text' => trim( $this->ipsclass->input['bbcode_menu_content_text'] )
);
if ( $type == 'add' )
{
$this->ipsclass->DB->do_insert( 'custom_bbcode', $array );
$this->ipsclass->main_msg = 'Íîâûé BB-êîä áûë äîáàâëåí';
$this->ipsclass->main_msg = 'New BBCode Added';
}
else
{
$this->ipsclass->DB->do_update( 'custom_bbcode', $array, 'bbcode_id='.$this->ipsclass->input['id'] );
$this->ipsclass->main_msg = 'BB-êîä îòðåäàêòèðîâàí';
$this->ipsclass->DB->do_update( 'custom_bbcode', $array, 'bbcode_id='.intval($this->ipsclass->input['id']) );
$this->ipsclass->main_msg = 'Custom BBCode Edited';
}
$this->bbcode_rebuildcache();
@@ -452,29 +489,35 @@ class ad_bbcode {
function bbcode_form($type='add')
{
$this->ipsclass->admin->page_detail = "Ìåíåäæåð BB-êîäîâ ïîìîæåò Âàì ñîçäàòü è íàñòðîèòü èõ äåÿòåëüíîñòü. ";
$this->ipsclass->admin->page_title = "Ìåíåäæåð íàñòðîéêè BB-êîäîâ";
$this->ipsclass->admin->page_detail = "The BBCode manager allows you to add new custom BBCode.";
$this->ipsclass->admin->page_title = "BBCode Manager";
$this->ipsclass->admin->nav[] = array( '', 'Add/Edit BBCode' );
if ( $type == 'edit' )
{
if ( ! $this->ipsclass->input['id'] )
{
$this->ipsclass->main_msg = "Íåò ïðèãîäíîãî ID, ïîïûòàéòåñü çàíîâî ";
$this->ipsclass->main_msg = "No ID was passed, please try again";
$this->bbcode_start();
}
$bbcode = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'custom_bbcode', 'where' => 'bbcode_id='.$this->ipsclass->input['id'] ) );
$bbcode = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'custom_bbcode', 'where' => 'bbcode_id='.intval($this->ipsclass->input['id']) ) );
$button = "Îòðåäàêòèðîâàòü";
$button = "Edit BBCode";
$code = 'bbcode_doedit';
$title = "Ðåäàêòèðîâàíèå BB-êîäà: ".$bbcode['bbcode_title'];
$title = "Editing BBCode: ".$bbcode['bbcode_title'];
}
else
{
$bbcode = array();
$bbcode = array( 'bbcode_title' => '',
'bbcode_desc' => '',
'bbcode_example' => '',
'bbcode_tag' => '',
'bbcode_useoption' => '',
'bbcode_replace' => '' );
$code = 'bbcode_doadd';
$title = "Äîáàâëåíèå íîâîãî BB-êîäà";
$button = "Äîáàâèòü";
$title = "Adding a new custom BBCode";
$button = "Add BBCode";
}
//-----------------------------------------
@@ -492,37 +535,55 @@ class ad_bbcode {
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $title );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íàçâàíèå BB-êîäà</b><div style='color:gray'>Èñïîëüçóåòñÿ âî âñïëûâàþùåé ïîäñêàçêå BB-êîäà</div>",
$this->ipsclass->adskin->form_input( 'bbcode_title', $this->ipsclass->input['bbcode_title'] ? $this->ipsclass->input['bbcode_title'] : $bbcode['bbcode_title'] )
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Custom BBCode Title</b><div style='color:gray'>Used on the BBCode pop-up legend</div>",
$this->ipsclass->adskin->form_input( 'bbcode_title', ( isset($this->ipsclass->input['bbcode_title']) AND $this->ipsclass->input['bbcode_title'] ) ? $this->ipsclass->input['bbcode_title'] : $bbcode['bbcode_title'] )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîëíîå îïèñàíèå ýòîãî BB-êîäà</b><div style='color:gray'>Èñïîëüçóåòñÿ âî âñïëûâàþùåé ïîäñêàçêå BB-êîä</div>",
$this->ipsclass->adskin->form_textarea( 'bbcode_desc', $this->ipsclass->input['bbcode_desc'] ? $this->ipsclass->input['bbcode_desc'] : $bbcode['bbcode_desc'] )
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Custom BBCode Description</b><div style='color:gray'>Used on the BBCode pop-up legend</div>",
$this->ipsclass->adskin->form_textarea( 'bbcode_desc', ( isset($this->ipsclass->input['bbcode_desc']) AND $this->ipsclass->input['bbcode_desc'] ) ? $this->ipsclass->input['bbcode_desc'] : $bbcode['bbcode_desc'] )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïðèìåð ýòîãî BB-êîäà</b><div style='color:gray'>Èñïîëüçóåòñÿ âî âñïëûâàþùåé ïîäñêàçêå BB-êîä<br />Òýã äëÿ ïðèìåðà: [tag]Çäåñü Âàø ïðèìåð![/tag]</div>",
$this->ipsclass->adskin->form_textarea( 'bbcode_example', $this->ipsclass->input['bbcode_example'] ? $this->ipsclass->input['bbcode_example'] : $bbcode['bbcode_example'] )
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Custom BBCode Example</b><div style='color:gray'>Used on the BBCode pop-up legend<br />Use the tag in the example: [tag]This is an example![/tag]</div>",
$this->ipsclass->adskin->form_textarea( 'bbcode_example', ( isset($this->ipsclass->input['bbcode_example']) AND $this->ipsclass->input['bbcode_example'] ) ? $this->ipsclass->input['bbcode_example'] : $bbcode['bbcode_example'] )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Òýã ýòîãî BB-êîäà</b><div style='color:gray'>Ïðèìåð: Äëÿ [tag] ââåäèòå <b>tag</b></div>",
'[ '.$this->ipsclass->adskin->form_simple_input( 'bbcode_tag', $this->ipsclass->input['bbcode_tag'] ? $this->ipsclass->input['bbcode_tag'] : $bbcode['bbcode_tag'], 10).' ]'
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Custom BBCode Tag</b><div style='color:gray'>Example: For [tag] enter <b>tag</b></div>",
'[ '.$this->ipsclass->adskin->form_simple_input( 'bbcode_tag', ( isset($this->ipsclass->input['bbcode_tag']) AND $this->ipsclass->input['bbcode_tag'] ) ? $this->ipsclass->input['bbcode_tag'] : $bbcode['bbcode_tag'], 10).' ]'
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èñïîëüçîâàòü îïöèè â òåãå?</b><div style='color:gray'>Èñïîëüçóåòñÿ äëÿ ñîçäàíèÿ BB-êîäà ñ îïöèÿìè: [tag=option]</div>",
$this->ipsclass->adskin->form_yes_no( 'bbcode_useoption', $this->ipsclass->input['bbcode_useoption'] ? $this->ipsclass->input['bbcode_useoption'] : $bbcode['bbcode_useoption'] )
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Use Option in tag?</b><div style='color:gray'>Use to create [tag=option] style tags</div>",
$this->ipsclass->adskin->form_yes_no( 'bbcode_useoption', ( isset($this->ipsclass->input['bbcode_useoption']) AND $this->ipsclass->input['bbcode_useoption'] ) ? $this->ipsclass->input['bbcode_useoption'] : $bbcode['bbcode_useoption'] )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Switch option around?</b><div style='color:gray'>Use this if you wish to swap the {content} for {option} (IE when using tags like [tag={content}]{option}[/tag]</div>",
$this->ipsclass->adskin->form_yes_no( 'bbcode_switch_option', ( isset($this->ipsclass->input['bbcode_switch_option']) AND $this->ipsclass->input['bbcode_switch_option'] ) ? $this->ipsclass->input['bbcode_switch_option'] : $bbcode['bbcode_switch_option'] )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Çàìåíà BB-êîäà</b><div style='color:gray'>&lt;tag&gt;{content}&lt;/tag&gt;<br />&lt;tag thing='{option}'&gt;{content}&lt;/tag&gt;</div>",
$this->ipsclass->adskin->form_textarea( 'bbcode_replace', $this->ipsclass->input['bbcode_replace'] ? $this->ipsclass->input['bbcode_replace'] : $bbcode['bbcode_replace'] )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Custom BBCode Replacement</b><div style='color:gray'>&lt;tag&gt;{content}&lt;/tag&gt;<br />&lt;tag thing='{option}'&gt;{content}&lt;/tag&gt;</div>",
$this->ipsclass->adskin->form_textarea( 'bbcode_replace', ( isset($this->ipsclass->input['bbcode_replace']) AND $this->ipsclass->input['bbcode_replace'] ) ? $this->ipsclass->input['bbcode_replace'] : $bbcode['bbcode_replace'] )
) );
//-----------------------------------------
// Insert Special Options
//-----------------------------------------
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Insert into the editor's 'Insert Special' menu?</b>",
$this->ipsclass->adskin->form_yes_no( 'bbcode_add_into_menu', ( isset($this->ipsclass->input['bbcode_add_into_menu']) AND $this->ipsclass->input['bbcode_add_into_menu'] ) ? $this->ipsclass->input['bbcode_add_into_menu'] : $bbcode['bbcode_add_into_menu'] )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Enter 'option' dialogue text</b><div style='color:gray'>Help text to use above the 'Option' text field. This will appear when the tag is chosen from the 'Insert Special' menu.</div>",
$this->ipsclass->adskin->form_simple_input( 'bbcode_menu_option_text', ( isset($this->ipsclass->input['bbcode_menu_option_text']) AND $this->ipsclass->input['bbcode_menu_option_text'] ) ? $this->ipsclass->input['bbcode_menu_option_text'] : $bbcode['bbcode_menu_option_text'], 50)
) );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Enter 'content' dialogue text</b><div style='color:gray'>Help text to use above the 'Content' text field. This will appear when the tag is chosen from the 'Insert Special' menu.</div>",
$this->ipsclass->adskin->form_simple_input( 'bbcode_menu_content_text', ( isset($this->ipsclass->input['bbcode_menu_content_text']) AND $this->ipsclass->input['bbcode_menu_content_text'] ) ? $this->ipsclass->input['bbcode_menu_content_text'] : $bbcode['bbcode_menu_content_text'], 50)
) );
$this->ipsclass->html .= $this->ipsclass->adskin->end_form( $button );
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
$this->ipsclass->html .= "<br /><div class='tableborder'><div class='tdrow1' style='padding:6px'><b>Äîïîëíèòåëüíàÿ èíôîðìàöèÿ </b><br />Âî âðåìÿ äîáàâëåíèÿ çàìåíû BB-êîäà, íå çàáóäüòå äîáàâèòü áëîê {content} òàì, ãäå ýòî òðåáóåòñÿ. <br />
Åñëè âû èñïîëüçóåòå îïöèþ BB-êîäà [tag=option][/tag], íå çàáóäüòå äîáàâèòü áëîê {option} òàì, ãäå ýòî òðåáóåòñÿ â çàìåíå BB-êîäà. </div></div>";
$this->ipsclass->html .= "<br /><div class='tableborder'><div class='tablerow1' style='padding:6px'><b>More Information</b><br />When adding the BBCode replacement, don't forget to add the {content} block where you wish the tag content to go when parsed.<br />
If you are using an option <b>[tag=option][/tag]</b> tag, don't forget to add in {option} in the BBCode replacement where you want the option to go.</div></div>";
//-----------------------------------------
@@ -536,31 +597,18 @@ class ad_bbcode {
function bbcode_start()
{
$this->ipsclass->admin->page_detail = "Ìåíåäæåð BB-êîäîâ ïîçâîëèò Âàì äîáàâèòü íîâûé BB-êîä. ";
$this->ipsclass->admin->page_title = "Ìåíåäæåð íàñòðîåê BB-êîäà";
$this->ipsclass->admin->page_detail = "The BBCode manager allows you to add new custom BBCode.";
$this->ipsclass->admin->page_title = "BBCode Manager";
//-----------------------------------------
// Show the codes mahn!
//-----------------------------------------
$this->ipsclass->adskin->td_header[] = array( "Çàãîëîâîê" , "30%" );
$this->ipsclass->adskin->td_header[] = array( "Òåã" , "40%" );
$this->ipsclass->adskin->td_header[] = array( "Îïöèè" , "30%" );
$export_button = $this->ipsclass->adskin->js_make_button("Ýêñïîðò BB-êîäà", $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=bbcode_export");
$table = "<table cellpadding='0' cellspacing='0' border='0' width='100%'>
<tr>
<td align='left' width='100%' style='font-weight:bold;font-size:11px;color:#FFF'>Âàøè BB-êîäû</td>
<td align='right' nowrap='nowrap' style='padding-right:2px'>{$export_button}</td>
</tr>
</table>";
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $table );
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode', 'order' => 'bbcode_title' ) );
$this->ipsclass->DB->simple_exec();
$bbcode_rows = "";
while ( $row = $this->ipsclass->DB->fetch_row() )
{
if ( $row['bbcode_useoption'] )
@@ -572,20 +620,12 @@ class ad_bbcode {
$option = '';
}
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>".$row['bbcode_title']."</b>",
'['.$row['bbcode_tag'].$option.']{content}[/'.$row['bbcode_tag'].']',
"<div align='center'>".
$this->ipsclass->adskin->js_make_button("Ðåäàêòèðîâàòü" , $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=bbcode_edit&id={$row['bbcode_id']}").'&nbsp;'.
$this->ipsclass->adskin->js_make_button("Óäàëèòü", $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=bbcode_delete&id={$row['bbcode_id']}")
."</div>",
) );
$row['bbcode_fulltag'] = '['.$row['bbcode_tag'].$option.']{content}[/'.$row['bbcode_tag'].']';
$bbcode_rows .= $this->html->bbcode_row( $row );
}
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
$this->ipsclass->html .= "<div class='tableborder'><div class='pformstrip' align='center'>".$this->ipsclass->adskin->js_make_button("Ñîçäàòü íîâûé BB-êîä" , $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=bbcode_add")."</div></div>";
$this->ipsclass->html .= "<br />";
$this->ipsclass->html .= $this->html->bbcode_wrapper( $bbcode_rows );
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'act' , 'bbcode' ),
2 => array( 'code' , 'bbcode_test' ),
@@ -595,13 +635,13 @@ class ad_bbcode {
$this->ipsclass->adskin->td_header[] = array( "&nbsp;" , "40%" );
$this->ipsclass->adskin->td_header[] = array( "&nbsp;" , "60%" );
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðîâåðèòü Âàø BB-êîä" );
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Test your custom BBCode" );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "Ïðîâåðèòü Âàø BB-êîäe",
$this->ipsclass->adskin->form_textarea( 'bbtest', $_POST['bbtest'] ),
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "Test your BBCode",
$this->ipsclass->adskin->form_textarea( 'bbtest', isset($_POST['bbtest']) ? $_POST['bbtest'] : '' ),
) );
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Íà÷àòü ïðîâåðêó");
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Run Test");
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
@@ -623,14 +663,14 @@ class ad_bbcode {
) , "uploadform", " enctype='multipart/form-data'" );
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Èìïîðò ñïèñîê BB-êîäà" );
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Import a BBCode List" );
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(
"<b>Çàãðóçèòü XML ñïèñîê BB-êîäà</b><div style='color:gray'>Âûáåðèòå íà Âàøåì êîìïüþòåðå 'ipb_bbcode.xml'. Äóáëèðîâàíèå [tag] íåâîçìîæíî, èìïîðòèðîâàòü íå óäàñòñÿ. </div>",
"<b>Upload XML BBCode List</b><div style='color:gray'>Browse your computer for 'bbcode.xml' or 'bbcode.xml.gz'. Duplicate [tag] entries will not be imported.</div>",
$this->ipsclass->adskin->form_upload( )
) );
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Èìïîðò");
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Import");
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();