Version 2.1.7
This commit is contained in:
1 parent
0eecc172d9
commit
f73f8bff6d
941 files changed
+215301
-103093
No files matched your search
@@ -0,0 +1,668 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 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 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Administration Module
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: 27th January 2004
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
| > DBA Checked: Mon 24th May 2004
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class ad_bbcode {
|
||||
|
||||
var $functions = "";
|
||||
|
||||
/**
|
||||
* Section title name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $perm_main = "content";
|
||||
|
||||
/**
|
||||
* Section title name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $perm_child = "bbcode";
|
||||
|
||||
function auto_run()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Require and RUN !! THERES A BOMB
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëÿåò âàì äîáàâëÿòü íîâûå BB-òýãè.";
|
||||
$this->ipsclass->admin->page_title = "Ìåíåäæåð íàñòðîéêè BB-êîäîâ";
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill globals - globals bad, Homer good.
|
||||
//-----------------------------------------
|
||||
|
||||
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
||||
|
||||
foreach ( $tmp_in as $k => $v )
|
||||
{
|
||||
unset($$k);
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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( 'ipb_bbcode.xml' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got anything?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íåâîçìîæíî çàãðóçèòü, ipb_bbcode.xml áûë íå íàéäåò èëè îêàçàëñÿ ïóòûì";
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
require( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
//-----------------------------------------
|
||||
// Unpack the datafile
|
||||
//-----------------------------------------
|
||||
|
||||
$xml->xml_parse_document( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get current badwords
|
||||
//-----------------------------------------
|
||||
|
||||
$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 $idx => $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'];
|
||||
|
||||
if ( $tags[ $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,
|
||||
);
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'custom_bbcode', $bbarray );
|
||||
}
|
||||
}
|
||||
|
||||
$this->bbcode_rebuildcache();
|
||||
|
||||
$this->ipsclass->main_msg = "XML ôàéë BB-êîäîâ áûë óñïåøíî èìïîðòèðîâàí";
|
||||
|
||||
$this->bbcode_start();
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE: Export
|
||||
//-----------------------------------------
|
||||
|
||||
function bbcode_export()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
require( 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, 'ipb_bbcode.xml' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Remove
|
||||
//-----------------------------------------
|
||||
|
||||
function bbcode_delete()
|
||||
{
|
||||
if ( ! $this->ipsclass->input['id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íåò ïðèãîäíîãî ID, ïîïûòàéòåñü çàíîâî.";
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'custom_bbcode', 'where' => 'bbcode_id='.$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;
|
||||
}
|
||||
|
||||
$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() )
|
||||
{
|
||||
if ( substr_count( $row['bbcode_replace'], '{content}' ) > 1 )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Slightly slower
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $row['bbcode_useoption'] )
|
||||
{
|
||||
preg_match_all( "#(\[".$row['bbcode_tag']."=(?:"|&\#39;)?(.+?)(?:"|&\#39;)?\])(.+?)(\[/".$row['bbcode_tag']."\])#si", $t, $match );
|
||||
|
||||
for ($i=0; $i < count($match[0]); $i++)
|
||||
{
|
||||
$tmp = $row['bbcode_replace'];
|
||||
$tmp = str_replace( '{option}' , $match[2][$i], $tmp );
|
||||
$tmp = str_replace( '{content}', $match[3][$i], $tmp );
|
||||
$t = str_replace( $match[0][$i], $tmp, $t );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
preg_match_all( "#(\[".$row['bbcode_tag']."\])(.+?)(\[/".$row['bbcode_tag']."\])#si", $t, $match );
|
||||
|
||||
for ($i=0; $i < count($match[0]); $i++)
|
||||
{
|
||||
$tmp = $row['bbcode_replace'];
|
||||
$tmp = str_replace( '{content}', $match[2][$i], $tmp );
|
||||
$t = str_replace( $match[0][$i], $tmp, $t );
|
||||
}
|
||||
}
|
||||
}
|
||||
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 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$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->bbcode_start();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Save Form
|
||||
//-----------------------------------------
|
||||
|
||||
function bbcode_save($type='add')
|
||||
{
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
if ( ! $this->ipsclass->input['id'] )
|
||||
{
|
||||
$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 = "Âû äîëæíû çàïîëíèòü âñå ïîëÿ.";
|
||||
$this->bbcode_form($type);
|
||||
}
|
||||
|
||||
if ( ! strstr( $this->ipsclass->input['bbcode_replace'], '{content}' ) )
|
||||
{
|
||||
$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 = "Âû äîëæíû èñïîëüçîâàòü {content}, â òåõ ìåñòàõ, ãäå ïðîèñõîäèò çàìåíà 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'],
|
||||
'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'] );
|
||||
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
$this->ipsclass->DB->do_insert( 'custom_bbcode', $array );
|
||||
$this->ipsclass->main_msg = 'Íîâûé BB-êîä áûë äîáàâëåí';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->DB->do_update( 'custom_bbcode', $array, 'bbcode_id='.$this->ipsclass->input['id'] );
|
||||
$this->ipsclass->main_msg = 'BB-êîä îòðåäàêòèðîâàí';
|
||||
}
|
||||
|
||||
$this->bbcode_rebuildcache();
|
||||
|
||||
$this->bbcode_start();
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Start Form
|
||||
//-----------------------------------------
|
||||
|
||||
function bbcode_form($type='add')
|
||||
{
|
||||
$this->ipsclass->admin->page_detail = "Ìåíåäæåð BB-êîäîâ ïîìîæåò Âàì ñîçäàòü è íàñòðîèòü èõ äåÿòåëüíîñòü. ";
|
||||
$this->ipsclass->admin->page_title = "Ìåíåäæåð íàñòðîéêè BB-êîäîâ";
|
||||
|
||||
if ( $type == 'edit' )
|
||||
{
|
||||
if ( ! $this->ipsclass->input['id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íåò ïðèãîäíîãî ID, ïîïûòàéòåñü çàíîâî ";
|
||||
$this->bbcode_start();
|
||||
}
|
||||
|
||||
$bbcode = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'custom_bbcode', 'where' => 'bbcode_id='.$this->ipsclass->input['id'] ) );
|
||||
|
||||
$button = "Îòðåäàêòèðîâàòü";
|
||||
$code = 'bbcode_doedit';
|
||||
$title = "Ðåäàêòèðîâàíèå BB-êîäà: ".$bbcode['bbcode_title'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$bbcode = array();
|
||||
$code = 'bbcode_doadd';
|
||||
$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>Íàçâàíèå 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>Ïîëíîå îïèñàíèå ýòîãî 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>Ïðèìåð ýòîãî 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>Òýã ýòîãî 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>Èñïîëüçîâàòü îïöèè â òåãå?</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>Çàìåíà BB-êîäà</b><div style='color:gray'><tag>{content}</tag><br /><tag thing='{option}'>{content}</tag></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->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->admin->output();
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCODE Splash
|
||||
//-----------------------------------------
|
||||
|
||||
function bbcode_start()
|
||||
{
|
||||
$this->ipsclass->admin->page_detail = "Ìåíåäæåð BB-êîäîâ ïîçâîëèò Âàì äîáàâèòü íîâûé BB-êîä. ";
|
||||
$this->ipsclass->admin->page_title = "Ìåíåäæåð íàñòðîåê BB-êîäà";
|
||||
|
||||
//-----------------------------------------
|
||||
// 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();
|
||||
|
||||
while ( $row = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
if ( $row['bbcode_useoption'] )
|
||||
{
|
||||
$option = '={option}';
|
||||
}
|
||||
else
|
||||
{
|
||||
$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']}").' '.
|
||||
$this->ipsclass->adskin->js_make_button("Óäàëèòü", $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=bbcode_delete&id={$row['bbcode_id']}")
|
||||
."</div>",
|
||||
) );
|
||||
}
|
||||
|
||||
$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->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( "Ïðîâåðèòü Âàø BB-êîä" );
|
||||
|
||||
$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->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( "Èìïîðò ñïèñîê BB-êîäà" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(
|
||||
"<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("Èìïîðò");
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
$this->ipsclass->admin->output();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function perly_length_sort($a, $b)
|
||||
{
|
||||
if ( strlen($a['typed']) == strlen($b['typed']) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return ( strlen($a['typed']) > strlen($b['typed']) ) ? -1 : 1;
|
||||
}
|
||||
|
||||
function perly_word_sort($a, $b)
|
||||
{
|
||||
if ( strlen($a['type']) == strlen($b['type']) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return ( strlen($a['type']) > strlen($b['type']) ) ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user