Version 2.2.2
This commit is contained in:
1 parent
22f1b963ee
commit
a3bb603c96
858 files changed
+479463
-188140
No files matched your search
@@ -2,17 +2,25 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:54 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-10-06 12:18:32 +0100 (Fri, 06 Oct 2006) $
|
||||
| > $Revision: 614 $
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-10-30 06:40:23 -0600 (Mon, 30 Oct 2006) $
|
||||
| > $Revision: 684 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
@@ -27,7 +35,7 @@
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -36,146 +44,147 @@ class ad_bbcode {
|
||||
var $functions = "";
|
||||
var $ipsclass;
|
||||
var $html;
|
||||
|
||||
|
||||
/**
|
||||
* Section title name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $perm_main = "content";
|
||||
|
||||
|
||||
/**
|
||||
* Section title name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $perm_child = "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' );
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Óïðàâëåíèå BB-êîäàìè' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Require and RUN !! THERES A BOMB
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->admin->page_detail = "The BBCode manager allows you to create and manage your BBCodes.";
|
||||
$this->ipsclass->admin->page_title = "BBCode Manager";
|
||||
|
||||
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëÿåò âàì äîáàâëÿòü íîâûå BB-êîäû.";
|
||||
$this->ipsclass->admin->page_title = "Ìåíåäæåð íàñòðîéêè BB-êîäîâ";
|
||||
|
||||
//-----------------------------------------
|
||||
// What to do...
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
switch($this->ipsclass->input['code'])
|
||||
{
|
||||
case 'bbcode':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );
|
||||
$this->bbcode_start();
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_add':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );
|
||||
$this->bbcode_form('add');
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_doadd':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );
|
||||
$this->bbcode_save('add');
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_edit':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
||||
$this->bbcode_form('edit');
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_doedit':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
||||
$this->bbcode_save('edit');
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_test':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );
|
||||
$this->bbcode_test();
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_delete':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':remove' );
|
||||
$this->bbcode_delete();
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_export':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':export' );
|
||||
$this->bbcode_export();
|
||||
break;
|
||||
|
||||
|
||||
case 'bbcode_import':
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':import' );
|
||||
$this->bbcode_import();
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );
|
||||
$this->bbcode_start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE: Import
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_import()
|
||||
{
|
||||
$content = $this->ipsclass->admin->import_xml( 'bbcode.xml' );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Got anything?
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Upload failed, ipb_bbcode.xml was either missing or empty";
|
||||
$this->ipsclass->main_msg = "Íåâîçìîæíî âûïîëíèòü èìïîðòèðîâàíèå, ïîèñêîëüêó â ôàéëå «bbcode.xml» îøèáêà èëè îí íå èìååò çàïèñåé.";
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Unpack the datafile
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$xml->lite_parser = 1;
|
||||
$xml->xml_parse_document( $content );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Get current custom bbcodes
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$tags = array();
|
||||
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$tags[ $r['bbcode_tag'] ] = 1;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// pArse
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( ! is_array( $xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'][0] ) )
|
||||
{
|
||||
$xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'][0] = $xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'];
|
||||
}
|
||||
|
||||
|
||||
foreach( $xml->xml_array['bbcodeexport']['bbcodegroup']['bbcode'] as $entry )
|
||||
{
|
||||
$bbcode_title = $entry['bbcode_title']['VALUE'];
|
||||
@@ -188,7 +197,7 @@ class ad_bbcode {
|
||||
$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(
|
||||
@@ -203,12 +212,12 @@ class ad_bbcode {
|
||||
'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(
|
||||
@@ -223,101 +232,101 @@ class ad_bbcode {
|
||||
'bbcode_menu_option_text' => $bbcode_menu_option_text,
|
||||
'bbcode_menu_content_text' => $bbcode_menu_content_text,
|
||||
);
|
||||
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'custom_bbcode', $bbarray );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->bbcode_rebuildcache();
|
||||
|
||||
$this->ipsclass->main_msg = "BBCode XML file import completed";
|
||||
|
||||
|
||||
$this->ipsclass->main_msg = "Çàïèñè ñ BB-êîäîâàìè óñïåøíî èìïîðòèðîâàí.";
|
||||
|
||||
$this->bbcode_start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE: Export
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_export()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Start...
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$xml->xml_set_root( 'bbcodeexport', array( 'exported' => time() ) );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Get emo group
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$xml->xml_add_group( 'bbcodegroup' );
|
||||
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$content = array();
|
||||
|
||||
|
||||
foreach ( $r as $k => $v )
|
||||
{
|
||||
$content[] = $xml->xml_build_simple_tag( $k, $v );
|
||||
}
|
||||
|
||||
|
||||
$entry[] = $xml->xml_build_entry( 'bbcode', $content );
|
||||
}
|
||||
|
||||
|
||||
$xml->xml_add_entry_to_group( 'bbcodegroup', $entry );
|
||||
|
||||
|
||||
$xml->xml_format_document();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Send to browser.
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$this->ipsclass->admin->show_download( $xml->xml_document, 'bbcode.xml', '', 0 );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Remove
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_delete()
|
||||
{
|
||||
if ( ! $this->ipsclass->input['id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again.";
|
||||
$this->ipsclass->main_msg = "Âû íå óêàçàëè ID BB-êîäà äëÿ óäàëåíèÿ.";
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
|
||||
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'custom_bbcode', 'where' => 'bbcode_id='.intval($this->ipsclass->input['id']) ) );
|
||||
|
||||
|
||||
$this->bbcode_rebuildcache();
|
||||
|
||||
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Rebuild Cache
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_rebuildcache()
|
||||
{
|
||||
$this->ipsclass->cache['bbcode'] = array();
|
||||
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode' ) );
|
||||
$bbcode = $this->ipsclass->DB->simple_exec();
|
||||
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row($bbcode) )
|
||||
{
|
||||
$this->ipsclass->cache['bbcode'][] = $r;
|
||||
@@ -325,32 +334,32 @@ class ad_bbcode {
|
||||
|
||||
$this->ipsclass->update_cache( array( 'name' => 'bbcode', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Test
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_test()
|
||||
{
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode', 'order' => 'bbcode_title' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
|
||||
$t = $this->ipsclass->txt_stripslashes($_POST['bbtest']);
|
||||
|
||||
|
||||
while ( $row = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$preg_tag = preg_quote($row['bbcode_tag'], '#' );
|
||||
|
||||
|
||||
if ( substr_count( $row['bbcode_replace'], '{content}' ) >= 1 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Slightly slower
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( $row['bbcode_useoption'] )
|
||||
{
|
||||
preg_match_all( "#(\[".preg_quote($row['bbcode_tag'], '#' )."=(?:"|&\#39;)?(.+?)(?:"|&\#39;)?\])(.+?)(\[/".preg_quote($row['bbcode_tag'], '#' )."\])#si", $t, $match );
|
||||
|
||||
|
||||
for ($i=0; $i < count($match[0]); $i++)
|
||||
{
|
||||
# XSS Check: Bug ID: 980
|
||||
@@ -358,23 +367,20 @@ class ad_bbcode {
|
||||
{
|
||||
$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 )
|
||||
|
||||
if ( $row['bbcode_switch_option'] )
|
||||
{
|
||||
$_option = 3;
|
||||
$_content = 2;
|
||||
}
|
||||
|
||||
|
||||
$tmp = $row['bbcode_replace'];
|
||||
$tmp = str_replace( '{option}' , $match[ $_option ][$i], $tmp );
|
||||
$tmp = str_replace( '{content}', $match[ $_content ][$i], $tmp );
|
||||
@@ -385,7 +391,7 @@ class ad_bbcode {
|
||||
{
|
||||
# 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'];
|
||||
@@ -397,7 +403,7 @@ class ad_bbcode {
|
||||
else
|
||||
{
|
||||
$replace = explode( '{content}', $row['bbcode_replace'] );
|
||||
|
||||
|
||||
if ( $row['bbcode_useoption'] )
|
||||
{
|
||||
$t = preg_replace( "#\[".$row['bbcode_tag']."=(?:"|&\#39;)?(.+?)(?:"|&\#39;)?\]#si", str_replace( '{option}', "\\1", $replace[0] ), $t );
|
||||
@@ -406,53 +412,53 @@ class ad_bbcode {
|
||||
{
|
||||
$t = preg_replace( '#\['.$row['bbcode_tag'].'\]#i' , $replace[0], $t );
|
||||
}
|
||||
|
||||
|
||||
$t = preg_replace( '#\[/'.$row['bbcode_tag'].'\]#i', $replace[1], $t );
|
||||
}
|
||||
}
|
||||
|
||||
$this->ipsclass->main_msg = "<b>BBCode Test:</b><br /><br />".$t;
|
||||
|
||||
|
||||
$this->ipsclass->main_msg = "<b>Ïðîâåðêà BB-êîäà:</b><br /><br />".$t;
|
||||
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Save Form
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_save($type='add')
|
||||
{
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
if ( ! $this->ipsclass->input['id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again";
|
||||
$this->ipsclass->main_msg = "Âû íå óêàçàëè ID äëÿ èçìåíåíèÿ.";
|
||||
$this->bbcode_form($type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// check...
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
if ( ! $this->ipsclass->input['bbcode_title'] or ! $this->ipsclass->input['bbcode_tag'] or ! $this->ipsclass->input['bbcode_replace'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "You must complete the form fully.";
|
||||
$this->ipsclass->main_msg = "Âû äîëæíû çàïîëíèòü âñå ïîëÿ.";
|
||||
$this->bbcode_form($type);
|
||||
}
|
||||
|
||||
|
||||
if ( ! strstr( $this->ipsclass->input['bbcode_replace'], '{content}' ) )
|
||||
{
|
||||
$this->ipsclass->main_msg = "You must use {content} somewhere in the BBCode replacement section.";
|
||||
$this->ipsclass->main_msg = "Âû äîëæíû èñïîëüçîâàòü {content} â òåõ ìåñòàõ, ãäå ïðîèñõîäèò çàìåíà BB-êîäîâ.";
|
||||
$this->bbcode_form($type);
|
||||
}
|
||||
|
||||
|
||||
if ( ! strstr( $this->ipsclass->input['bbcode_replace'], '{option}' ) AND $this->ipsclass->input['bbcode_useoption'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "You must use {option} somewhere in the BBCode replacement section or set 'Use Option in tag?' to 'no'.";
|
||||
$this->ipsclass->main_msg = "Âû äîëæíû èñïîëüçîâàòü {option}, â òåõ ìåñòàõ, ãäå ïðîèñõîäèò çàìåíà BB-êîäîâ èëè ïàðàìåòðó «Èñïîëüçîâàòü íàñòðîéêè â òåãàõ» óñòàíîâèòü çíà÷åíèå «Íåò».";
|
||||
$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'],
|
||||
@@ -464,48 +470,48 @@ class ad_bbcode {
|
||||
'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 = 'New BBCode Added';
|
||||
$this->ipsclass->main_msg = 'Íîâûé BB-êîä óñïåøíî äîáàâëåí.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->DB->do_update( 'custom_bbcode', $array, 'bbcode_id='.intval($this->ipsclass->input['id']) );
|
||||
$this->ipsclass->main_msg = 'Custom BBCode Edited';
|
||||
$this->ipsclass->main_msg = 'BB-êîä óñïåøíî èçìåíåí.';
|
||||
}
|
||||
|
||||
|
||||
$this->bbcode_rebuildcache();
|
||||
|
||||
|
||||
$this->bbcode_start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Start Form
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_form($type='add')
|
||||
{
|
||||
$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' );
|
||||
|
||||
$this->ipsclass->admin->page_detail = "Â ýòîé ñåêöèè âû ñìîæåòå ïðîñìîòðåòü âñå ñîçäàííûå âàìè BB-êîäû, à òàê æå èçìåíèòü èõ èëè óäàëèòü.";
|
||||
$this->ipsclass->admin->page_title = "Äîïîëíèòåëüíûå BB-êîäû";
|
||||
$this->ipsclass->admin->nav[] = array( '', 'Äîáàâëåíèå/èçìåíåíèå BB-êîäîâ' );
|
||||
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
if ( ! $this->ipsclass->input['id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again";
|
||||
$this->ipsclass->main_msg = "Âû íå óêàçàëè ID BB-êîäà äëÿ óäàëåíèÿ";
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
|
||||
$bbcode = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'custom_bbcode', 'where' => 'bbcode_id='.intval($this->ipsclass->input['id']) ) );
|
||||
|
||||
$button = "Edit BBCode";
|
||||
|
||||
$button = "Èçìåíèòü";
|
||||
$code = 'bbcode_doedit';
|
||||
$title = "Editing BBCode: ".$bbcode['bbcode_title'];
|
||||
$title = "Ðåäàêòèðîâàíèå BB-êîäà: ".$bbcode['bbcode_title'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -516,99 +522,99 @@ class ad_bbcode {
|
||||
'bbcode_useoption' => '',
|
||||
'bbcode_replace' => '' );
|
||||
$code = 'bbcode_doadd';
|
||||
$title = "Adding a new custom BBCode";
|
||||
$button = "Add BBCode";
|
||||
$title = "Äîáàâëåíèå íîâîãî BB-êîäà";
|
||||
$button = "Äîáàâèòü";
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Show the codes mahn!
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'act' , 'bbcode' ),
|
||||
2 => array( 'code' , $code ),
|
||||
3 => array( 'id' , $this->ipsclass->input['id'] ),
|
||||
4 => array( 'section', $this->ipsclass->section_code ),
|
||||
) );
|
||||
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $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->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Íàçâàíèå BB-êîäà</b><div style='color:gray'>Èñïîëüçóåòñÿ âî âñïëûâàþùåé ïîäñêàçêå BB-êîäà</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>Custom BBCode Description</b><div style='color:gray'>Used on the BBCode pop-up legend</div>",
|
||||
|
||||
$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', ( 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>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->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', ( 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>Custom BBCode Tag</b><div style='color:gray'>Example: For [tag] enter <b>tag</b></div>",
|
||||
|
||||
$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', ( 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>Use Option in tag?</b><div style='color:gray'>Use to create [tag=option] style tags</div>",
|
||||
|
||||
$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', ( 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->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñìåíèòü îïåðàíäû?</b><div style='color:gray'>Åñëè âû æåëàåòå çàìåíÿòü {content} íà {option} (ïðè èñïîëüçîâàíèè òåãîâ IE «ëþáèò» [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>Custom BBCode Replacement</b><div style='color:gray'><tag>{content}</tag><br /><tag thing='{option}'>{content}</tag></div>",
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Çàìåíà BB-êîäà</b><div style='color:gray'><tag>{content}</tag><br /><tag thing='{option}'>{content}</tag></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->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Äîáàâèòü â ìåíþ «Ñïåö. ýëåìåíòû» ðåäàêòîðà?</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->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ââåäèòå òåêñò äëÿ 'option' </b><div style='color:gray'>Òåêñò äëÿ ïîìîùè â èñïîëüçîâàíèè ïîëÿ 'Option'. Îí áóäåò îòîáðàæàòüñÿ, êîãäà áóäåò âûáðàí òåã â ðåäàêòîðå.</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->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ââåäèòå òåêñò äëÿ 'content' </b><div style='color:gray'>Òåêñò äëÿ ïîìîùè â èñïîëüçîâàíèè ïîëÿ 'Content'. Îí áóäåò îòîáðàæàòüñÿ, êîãäà áóäåò âûáðàí òåã â ðåäàêòîðå.</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='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>";
|
||||
|
||||
|
||||
$this->ipsclass->html .= "<br /><div class='tableborder'><div class='tablerow1' style='padding:6px'><b>Äîïîëíèòåëüíàÿ èíôîðìàöèÿ </b><br />Âî âðåìÿ äîáàâëåíèÿ çàìåíû BB-êîäà, íå çàáóäüòå äîáàâèòü áëîê {content} òàì, ãäå ýòî òðåáóåòñÿ. <br />
|
||||
Åñëè âû èñïîëüçóåòå îïöèþ BB-êîäà [tag=option][/tag], íå çàáóäüòå äîáàâèòü áëîê {option} òàì, ãäå ýòî òðåáóåòñÿ â çàìåíå BB-êîäà. </div></div>";
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$this->ipsclass->admin->output();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Splash
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
function bbcode_start()
|
||||
{
|
||||
$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->page_detail = "Â ýòîé ñåêöèè âû ñìîæåòå ñîçäàòü íîâûå BB-êîäû, êîòîðûå â ïîñëåäñâèå ñìîãóò èñïîëüçîâàòü ïîëüçîâàòåëè âàøåãî ôîðóìà.";
|
||||
$this->ipsclass->admin->page_title = "Äîáàâëåíèå íîâîãî äîïîëíèòåëüíîãî BB-êîäà";
|
||||
|
||||
//-----------------------------------------
|
||||
// Show the codes mahn!
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$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'] )
|
||||
@@ -619,65 +625,65 @@ class ad_bbcode {
|
||||
{
|
||||
$option = '';
|
||||
}
|
||||
|
||||
|
||||
$row['bbcode_fulltag'] = '['.$row['bbcode_tag'].$option.']{content}[/'.$row['bbcode_tag'].']';
|
||||
|
||||
|
||||
$bbcode_rows .= $this->html->bbcode_row( $row );
|
||||
}
|
||||
|
||||
|
||||
$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' ),
|
||||
4 => array( 'section', $this->ipsclass->section_code ),
|
||||
) );
|
||||
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Test your custom BBCode" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "Test your BBCode",
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðîâåðèòü BB-êîä" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "Ââåäèòå â ïîëå BB-êîä",
|
||||
$this->ipsclass->adskin->form_textarea( 'bbtest', isset($_POST['bbtest']) ? $_POST['bbtest'] : '' ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Run Test");
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Íà÷àòü ïðîâåðêó");
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// IMPORT: Start table
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// IMPORT: Start output
|
||||
//-----------------------------------------
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'bbcode_import' ),
|
||||
2 => array( 'act' , 'bbcode' ),
|
||||
3 => array( 'MAX_FILE_SIZE', '10000000000' ),
|
||||
4 => array( 'section', $this->ipsclass->section_code ),
|
||||
) , "uploadform", " enctype='multipart/form-data'" );
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Import a BBCode List" );
|
||||
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Èìïîðòèðîâàíèå ñïèñêà BB-êîäîâ" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(
|
||||
"<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>",
|
||||
"<b>Çàãðóçêà XML ñïèñêà BB-êîäîâ</b><div style='color:gray'>Âûáåðèòå íà âàøåì êîìïüþòåðå ôàéë «ipb_bbcode.xml». Äóáëèðîâàíèå [tag] íåâîçìîæíî — èìïîðòèðîâàòü íå óäàñòñÿ.</div>",
|
||||
$this->ipsclass->adskin->form_upload( )
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Import");
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Èìïîðòèðîâàòü");
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
|
||||
$this->ipsclass->admin->output();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function perly_length_sort($a, $b)
|
||||
{
|
||||
@@ -687,7 +693,7 @@ class ad_bbcode {
|
||||
}
|
||||
return ( strlen($a['typed']) > strlen($b['typed']) ) ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
function perly_word_sort($a, $b)
|
||||
{
|
||||
if ( strlen($a['type']) == strlen($b['type']) )
|
||||
@@ -696,12 +702,12 @@ class ad_bbcode {
|
||||
}
|
||||
return ( strlen($a['type']) > strlen($b['type']) ) ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user