Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,24 +2,15 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| (c) 2004 Invision Power Services
|
||||
| http://www.invisionboard.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Email: matt@invisionpower.com
|
||||
| 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)
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Admin: Attachment Functions
|
||||
@@ -35,7 +26,7 @@
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -43,6 +34,9 @@ if ( ! defined( 'IN_ACP' ) )
|
||||
class ad_attachments {
|
||||
|
||||
var $base_url;
|
||||
var $ipsclass;
|
||||
var $html;
|
||||
var $image_dir;
|
||||
|
||||
/**
|
||||
* Section title name
|
||||
@@ -60,21 +54,18 @@ class ad_attachments {
|
||||
|
||||
function auto_run()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Kill globals - globals bad, Homer good.
|
||||
//-----------------------------------------
|
||||
$this->html = $this->ipsclass->acp_load_template('cp_skin_attachments');
|
||||
|
||||
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Attachments Manager' );
|
||||
|
||||
foreach ( $tmp_in as $k => $v )
|
||||
{
|
||||
unset($$k);
|
||||
}
|
||||
$this->ipsclass->admin->page_detail = "This section will allow you to manage your member's attachments and attachment permissions";
|
||||
$this->ipsclass->admin->page_title = "Attachments Manager";
|
||||
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Óïðàâëåíèå ïðèêðåïëÿåìûìè ôàéëàìè' );
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'set_image_dir', 'from' => 'skin_sets', 'where' => 'set_default=1' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
$this->ipsclass->admin->page_detail = "Ýòà ñåêöèÿ ïîçâîëÿåò âàì óïðàâëÿòü ïðèêðåïëåííûìè ïîëüçîâàòåëÿìè ôàéëàìè è óñòàíàâëèâàòü ðàçðåøåíèÿ äëÿ ðàçëè÷íûõ òèïîâ ôàéëîâ";
|
||||
$this->ipsclass->admin->page_title = "Óïðàâëåíèå ïðèêðåïëÿåìûìè ôàéëàìè";
|
||||
$image_set = $this->ipsclass->DB->fetch_row();
|
||||
$this->image_dir = $image_set['set_image_dir'];
|
||||
|
||||
//-----------------------------------------
|
||||
// StRT!
|
||||
@@ -139,6 +130,9 @@ class ad_attachments {
|
||||
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':search' );
|
||||
$this->attach_search_complete();
|
||||
break;
|
||||
case 'master_xml_export':
|
||||
$this->master_xml_export();
|
||||
break;
|
||||
//-----------------------------------------
|
||||
// Default:
|
||||
//-----------------------------------------
|
||||
@@ -149,6 +143,74 @@ class ad_attachments {
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Export Master XML
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function master_xml_export()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$entry = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get XML class
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
$xml->doc_type = $this->ipsclass->vars['gb_char_set'];
|
||||
|
||||
$xml->xml_set_root( 'export', array( 'exported' => time() ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set group
|
||||
//-----------------------------------------
|
||||
|
||||
$xml->xml_add_group( 'group' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get templates...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
|
||||
'from' => 'attachments_type' ) );
|
||||
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$content = array();
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort the fields...
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $r as $k => $v )
|
||||
{
|
||||
$content[] = $xml->xml_build_simple_tag( $k, $v );
|
||||
}
|
||||
|
||||
$entry[] = $xml->xml_build_entry( 'row', $content );
|
||||
}
|
||||
|
||||
$xml->xml_add_entry_to_group( 'group', $entry );
|
||||
|
||||
$xml->xml_format_document();
|
||||
|
||||
$doc = $xml->xml_document;
|
||||
|
||||
//-----------------------------------------
|
||||
// Print to browser
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->admin->show_download( $doc, 'attachments.xml', '', 0 );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
//
|
||||
// SEARCH: Complete
|
||||
@@ -221,7 +283,7 @@ class ad_attachments {
|
||||
{
|
||||
$gt = $this->ipsclass->input['hits_gt'] == 'gt' ? '>=' : '<';
|
||||
|
||||
$query[] = "a.attach_hits $gt ".$this->ipsclass->input['hits'];
|
||||
$query[] = "a.attach_hits $gt ".intval($this->ipsclass->input['hits']);
|
||||
}
|
||||
|
||||
if ( $this->ipsclass->input['filename'] )
|
||||
@@ -246,12 +308,12 @@ class ad_attachments {
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => 'attach_pid != 0 '.$queryfinal,
|
||||
'where' => "attach_rel_module='post'".$queryfinal,
|
||||
'add_join' => array(
|
||||
# POST TABLE JOIN
|
||||
1 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_pid',
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
# TOPIC TABLE JOIN
|
||||
0 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
@@ -277,32 +339,32 @@ class ad_attachments {
|
||||
) );
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ôàéë", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ðàçìåð" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Àâòîð" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Òåìà" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Äàòà ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Attachment", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Size" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Author" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Topic" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Posted ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðèêðåïëÿåìûå ôàéëû: Ðåçóëüòàòû ïîèñêà" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Attachments: Search Results" );
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$r['stitle'] = $this->ipsclass->txt_truncate($r['title'], 30);
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='style_images/{$this->ipsclass->skin['_imagedir']}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a href='index.php?{$this->ipsclass->form_code}&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='{$this->ipsclass->vars['board_url']}/style_images/{$this->image_dir}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a href='{$this->ipsclass->vars['board_url']}/index.php?{$this->ipsclass->form_code}&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$this->ipsclass->size_format($r['attach_filesize']),
|
||||
$r['members_display_name'],
|
||||
"<a href='index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_pid']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
"<a href='{$this->ipsclass->vars['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
$this->ipsclass->get_date( $r['post_date'], 'SHORT', 1 ),
|
||||
"<div align='center'><input type='checkbox' name='attach_{$r['attach_id']}' value='1' /></div>",
|
||||
) );
|
||||
}
|
||||
|
||||
$removebutton = "<input type='submit' value='Óäàëèòü îòìå÷åííûå ôàéëû' class='realdarkbutton'></form>";
|
||||
$removebutton = "<input type='submit' value='Delete Checked Attachments' class='realdarkbutton'></form>";
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( $removebutton, "right", "pformstrip");
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( $removebutton, "right", "tablesubheader");
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
@@ -326,76 +388,86 @@ class ad_attachments {
|
||||
// HEADER
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->html .= "<script type='text/javascript' src='jscripts/ipb_xhr_findnames.js'></script>
|
||||
<div id='ipb-get-members' style='border:1px solid #000; background:#FFF; padding:2px;position:absolute;width:170px;display:none;z-index:100'></div>";
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "40%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "60%" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïîèñê ïðèêðåïëåííûõ ôàéëîâ" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Search Attachments" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'attach_search_complete' ),
|
||||
2 => array( 'act' , 'attach' ),
|
||||
3 => array( 'section', $this->ipsclass->section_code ),
|
||||
) );
|
||||
|
||||
$gt_array = array( 0 => array( 'gt', 'Áîëüøå ÷åì' ), 1 => array( 'lt', 'Ìåíüøå ÷åì' ) );
|
||||
$gt_array = array( 0 => array( 'gt', 'More Than' ), 1 => array( 'lt', 'Less Than' ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// FORM
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ðàñøèðåíèå ôàéëà</b><div style='color:gray'>Îñòàâüòå ïóñòûì, ÷òîáû ïðîïóñòèòü ïðè ïîèñêå</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'extension', $_POST['extension'], 10 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Match File Extension</b><div style='color:gray'>Leave blank to omit</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'extension', isset($_POST['extension']) ? $_POST['extension'] : '', 10 ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ðàçìåð ôàéëà (â Kb)</b><div style='color:gray'>Îñòàâüòå ïóñòûì, ÷òîáû ïðîïóñòèòü ïðè ïîèñêå</div>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'filesize_gt', $gt_array, $_POST['filesize_gt'] ).' '.
|
||||
$this->ipsclass->adskin->form_simple_input( 'filesize', $_POST['filesize'], 10 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Match File Size (in kb)</b><div style='color:gray'>Leave blank to omit</div>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'filesize_gt', $gt_array, isset($_POST['filesize_gt']) ? $_POST['filesize_gt'] : '' ).' '.
|
||||
$this->ipsclass->adskin->form_simple_input( 'filesize', isset($_POST['filesize']) ? $_POST['filesize'] : '', 10 ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Äîáàâëåí <em>n</em> äíåé</b><div style='color:gray'>Îñòàâüòå ïóñòûì, ÷òîáû ïðîïóñòèòü ïðè ïîèñêå</div>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'days_gt', $gt_array, $_POST['days_gt'] ).' '.
|
||||
$this->ipsclass->adskin->form_simple_input( 'days', $_POST['days'], 10 ).' äíåé íàçàä',
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Match Posted <em>n</em> Days</b><div style='color:gray'>Leave blank to omit</div>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'days_gt', $gt_array, isset($_POST['days_gt']) ? $_POST['days_gt'] : '' ).' '.
|
||||
$this->ipsclass->adskin->form_simple_input( 'days', isset($_POST['days']) ? $_POST['days'] : '', 10 ).' ago',
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïðîñìîòðåí <em>n</em> äíåé</b><div style='color:gray'>Îñòàâüòå ïóñòûì, ÷òîáû ïðîïóñòèòü ïðè ïîèñêå</div>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'hits_gt', $gt_array, $_POST['hits_gt'] ).' '.
|
||||
$this->ipsclass->adskin->form_simple_input( 'hits', $_POST['hits'], 10 ).' ðàç',
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Match Viewed <em>n</em> Times</b><div style='color:gray'>Leave blank to omit</div>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'hits_gt', $gt_array, isset($_POST['hits_gt']) ? $_POST['hits_gt'] : '' ).' '.
|
||||
$this->ipsclass->adskin->form_simple_input( 'hits', isset($_POST['hits']) ? $_POST['hits'] : '', 10 ).' times',
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èìÿ ôàéëà</b><div style='color:gray'>Îñòàâüòå ïóñòûì, ÷òîáû ïðîïóñòèòü ïðè ïîèñêå</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'filename', $_POST['filename'], 30 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Match File Name</b><div style='color:gray'>Leave blank to omit</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'filename', isset($_POST['filename']) ? $_POST['filename'] : '', 30 ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Àâòîð</b><div style='color:gray'>Îñòàâüòå ïóñòûì, ÷òîáû ïðîïóñòèòü ïðè ïîèñêå</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'authorname', $_POST['authorname'], 30 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Match Post Author Name</b><div style='color:gray'>Leave blank to omit</div>",
|
||||
$this->ipsclass->adskin->form_input( 'authorname', isset($_POST['authorname']) ? $_POST['authorname'] : '', 'text', "id='authorname'" ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Èñêàòü òîëüêî èçîáðàæåíèÿ?</b><div style='color:gray'>Åñëè âûáðàíî 'Äà', â ðåçóëüòàòàõ ïîèñêà áóäóò òîëüêî èçîáðàæåíèÿ.</div>",
|
||||
$this->ipsclass->adskin->form_yes_no( 'onlyimage', $_POST['onlyimage'], 30 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Match Only Images?</b><div style='color:gray'>If 'yes', this search will only return image attachments.</div>",
|
||||
$this->ipsclass->adskin->form_yes_no( 'onlyimage', isset($_POST['onlyimage']) ? $_POST['onlyimage'] : '', 30 ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñîðòèðîâàòü ïî</b>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'orderby', array( 0 => array( 'date' , 'äàòå ïðèêðåïëåíèÿ' ),
|
||||
1 => array( 'hits' , 'êîëè÷åñòâó ïðîñìîòðîâ' ),
|
||||
2 => array( 'filesize', 'ðàçìåðó ôàéëà' ),
|
||||
3 => array( 'file' , 'èìåíè ôàéëà' ),
|
||||
), $_POST['orderby'] ).' '.
|
||||
$this->ipsclass->adskin->form_dropdown( 'sort' , array( 0 => array( 'desc' , 'îò áîëüøåãî ê ìåíüøåìó [9-0]' ),
|
||||
1 => array( 'asc' , 'îò ìåíüøåãî ê áîëüøåìó [0-9]' ),
|
||||
), $_POST['sort'] )
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Order Results By</b>",
|
||||
$this->ipsclass->adskin->form_dropdown( 'orderby', array( 0 => array( 'date' , 'Attach Date' ),
|
||||
1 => array( 'hits' , 'Attach Views' ),
|
||||
2 => array( 'filesize', 'Attach File Size' ),
|
||||
3 => array( 'file' , 'Attach File Name' ),
|
||||
), isset($_POST['orderby']) ? $_POST['orderby'] : '' ).' '.
|
||||
$this->ipsclass->adskin->form_dropdown( 'sort' , array( 0 => array( 'desc' , 'Descending [9-0]' ),
|
||||
1 => array( 'asc' , 'Ascending [0-9]' ),
|
||||
), isset($_POST['sort']) ? $_POST['sort'] : '' )
|
||||
|
||||
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîêàçàòü <em>n</em> ðåçóëüòàòîâ</b><div style='color:gray'>Íå áîëåå 100 çà ðàç</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'show', $_POST['show'] ? $_POST['show'] : 25, 10 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Show <em>n</em> Results</b><div style='color:gray'>Maximum is 100 regardless of your entry</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'show', isset($_POST['show']) ? $_POST['show'] : 25, 10 ),
|
||||
) );
|
||||
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Èñêàòü");
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Search");
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
$this->ipsclass->html .= "<script type='text/javascript'>
|
||||
// INIT find names
|
||||
init_js( 'theAdminForm', 'authorname');
|
||||
// Run main loop
|
||||
var tmp = setTimeout( 'main_loop()', 10 );
|
||||
</script>";
|
||||
|
||||
//-----------------------------------------
|
||||
//-------------------------------
|
||||
|
||||
@@ -421,6 +493,8 @@ class ad_attachments {
|
||||
}
|
||||
}
|
||||
|
||||
$ids = $this->ipsclass->clean_int_array( $ids );
|
||||
|
||||
$attach_tid = array();
|
||||
|
||||
if ( count( $ids ) )
|
||||
@@ -459,13 +533,13 @@ class ad_attachments {
|
||||
$postlib = new class_post();
|
||||
$postlib->ipsclass =& $this->ipsclass;
|
||||
|
||||
foreach( $attach_tid as $apid => $tid )
|
||||
foreach( $attach_tid as $tid )
|
||||
{
|
||||
$postlib->pf_recount_topic_attachments($tid);
|
||||
}
|
||||
}
|
||||
|
||||
$this->ipsclass->main_msg = "Óäàëåííûå ïðèêðåïëåííûå ôàéëû";
|
||||
$this->ipsclass->main_msg = "Attachments Removed";
|
||||
|
||||
if ( $this->ipsclass->input['return'] == 'stats' )
|
||||
{
|
||||
@@ -518,13 +592,13 @@ class ad_attachments {
|
||||
// Get quick stats
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðèêðåïëåííûå ôàéëû: Îáçîð" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Attachments: Overview" );
|
||||
|
||||
$stats = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as count, sum(attach_filesize) as sum',
|
||||
'from' => 'attachments' ) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Êîëè÷åñòâî ôàéëîâ</b>" , $this->ipsclass->do_number_format($stats['count']),
|
||||
"<b>Çàíÿòîå ìåñòî íà äèñêå</b>", $this->ipsclass->size_format($stats['sum']),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Number of Attachments</b>" , $this->ipsclass->do_number_format($stats['count']),
|
||||
"<b>Attachments Disk Usage</b>", $this->ipsclass->size_format($stats['sum']),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
@@ -540,23 +614,23 @@ class ad_attachments {
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ôàéë", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ðàçìåðe" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Àâòîð" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Òåìà" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Äàòà ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Attachment", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Size" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Author" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Topic" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Posted ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðèêðåïëåííûå ôàéëû: Ïîñëåäíèå 5" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Attachments: Last 5 Attached" );
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => 'attach_pid != 0',
|
||||
'where' => "attach_rel_module='post'",
|
||||
'add_join' => array(
|
||||
# POST TABLE JOIN
|
||||
1 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_pid',
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
# TOPIC TABLE JOIN
|
||||
0 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
@@ -578,11 +652,11 @@ class ad_attachments {
|
||||
{
|
||||
$r['stitle'] = $this->ipsclass->txt_truncate($r['title'], 30);
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='style_images/{$this->ipsclass->skin['_imagedir']}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a href='index.php?act=attach&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='{$this->ipsclass->vars['board_url']}/style_images/{$this->image_dir}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a href='{$this->ipsclass->vars['board_url']}/index.php?act=attach&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$this->ipsclass->size_format($r['attach_filesize']),
|
||||
$r['members_display_name'],
|
||||
"<a href='index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_pid']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
"<a href='{$this->ipsclass->vars['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
$this->ipsclass->get_date( $r['post_date'], 'SHORT', 1 ),
|
||||
"<div align='center'><input type='checkbox' name='attach_{$r['attach_id']}' value='1' /></div>",
|
||||
) );
|
||||
@@ -595,23 +669,23 @@ class ad_attachments {
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ôàéë", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ðàçìåð" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Àâòîð" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Òåìà" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Äàòà ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Attachment", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Size" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Author" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Topic" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Posted ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðèêðåïëåííûå ôàéëû: 5 íàèáîëüøèõ" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Attachments: Largest 5 Topic Attachments" );
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => 'attach_pid != 0',
|
||||
'where' => "attach_rel_module='post'",
|
||||
'add_join' => array(
|
||||
# POST TABLE JOIN
|
||||
1 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_pid',
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
# TOPIC TABLE JOIN
|
||||
0 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
@@ -633,11 +707,11 @@ class ad_attachments {
|
||||
{
|
||||
$r['stitle'] = $this->ipsclass->txt_truncate($r['title'], 30);
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='style_images/{$this->ipsclass->skin['_imagedir']}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a href='index.php?act=attach&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='{$this->ipsclass->vars['board_url']}/style_images/{$this->image_dir}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a href='{$this->ipsclass->vars['board_url']}/index.php?act=attach&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$this->ipsclass->size_format($r['attach_filesize']),
|
||||
$r['members_display_name'],
|
||||
"<a href='index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_pid']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
"<a href='{$this->ipsclass->vars['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
$this->ipsclass->get_date( $r['post_date'], 'SHORT', 1 ),
|
||||
"<div align='center'><input type='checkbox' name='attach_{$r['attach_id']}' value='1' /></div>",
|
||||
) );
|
||||
@@ -650,23 +724,23 @@ class ad_attachments {
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ôàéë", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ïðîñìîòðîâ" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Àâòîð" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Òåìà" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Äàòà ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Attachment", "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Viewed" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Author" , "15%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Topic" , "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Posted ", "25%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ïðèêðåïëåííûå ôàéëû: 5 ñ íàèáîëüøèì êîëè÷åñòâîì ïðîñìîòðîâ" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Attachments: Top 5 Most Viewed" );
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => 'a.*',
|
||||
'from' => array( 'attachments' => 'a' ),
|
||||
'where' => 'attach_pid != 0',
|
||||
'where' => "attach_rel_module='post'",
|
||||
'add_join' => array(
|
||||
# POST TABLE JOIN
|
||||
1 => array( 'select' => 'p.author_id, p.author_name, p.post_date',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 'p.pid=a.attach_pid',
|
||||
'where' => 'p.pid=a.attach_rel_id',
|
||||
'type' => 'left' ),
|
||||
# TOPIC TABLE JOIN
|
||||
0 => array( 'select' => 't.tid, t.forum_id, t.title',
|
||||
@@ -690,19 +764,19 @@ class ad_attachments {
|
||||
|
||||
$size = $this->ipsclass->size_format($r['attach_filesize']);
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='style_images/{$this->ipsclass->skin['_imagedir']}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a title='{$size}' href='index.php?act=attach&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='{$this->ipsclass->vars['board_url']}/style_images/{$this->image_dir}/{$this->ipsclass->cache['attachtypes'][ $r['attach_ext'] ]['atype_img']}' border='0' />" ,
|
||||
"<a title='{$size}' href='{$this->ipsclass->vars['board_url']}/index.php?act=attach&type=post&id={$r['attach_id']}' target='_blank'>{$r['attach_file']}</a>",
|
||||
$r['attach_hits'],
|
||||
$r['members_display_name'],
|
||||
"<a href='index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_pid']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
"<a href='{$this->ipsclass->vars['board_url']}/index.php?showtopic={$r['tid']}&view=findpost&p={$r['attach_rel_id']}' target='_blank' title='{$r['title']}'>{$r['stitle']}</a>",
|
||||
$this->ipsclass->get_date( $r['post_date'], 'SHORT', 1 ),
|
||||
"<div align='center'><input type='checkbox' name='attach_{$r['attach_id']}' value='1' /></div>",
|
||||
) );
|
||||
}
|
||||
|
||||
$removebutton = "<input type='submit' value='Óäàëèòü îòìå÷åííûå ôàéëû' class='realdarkbutton'></form>";
|
||||
$removebutton = "<input type='submit' value='Delete Checked Attachments' class='realdarkbutton'></form>";
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( $removebutton, "right", "pformstrip");
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( $removebutton, "right", "tablesubheader");
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
|
||||
@@ -729,7 +803,7 @@ class ad_attachments {
|
||||
|
||||
if ( ! $content )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íåóäà÷íàÿ çàãðóçêà, â ôàéëå ipb_attachtypes.xml ÷òî-òî ïðîïóùåíî èëè ôàéë ïóñò";
|
||||
$this->ipsclass->main_msg = "Upload failed, ipb_attachtypes.xml was either missing or empty";
|
||||
$this->attach_type_start();
|
||||
}
|
||||
|
||||
@@ -737,7 +811,7 @@ class ad_attachments {
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
require( KERNEL_PATH.'class_xml.php' );
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
@@ -748,7 +822,7 @@ class ad_attachments {
|
||||
$xml->xml_parse_document( $content );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get current badwords
|
||||
// Get current attachment types
|
||||
//-----------------------------------------
|
||||
|
||||
$types = array();
|
||||
@@ -765,7 +839,7 @@ class ad_attachments {
|
||||
// pArse
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $xml->xml_array['attachtypesexport']['attachtypesgroup']['attachtype'] as $idx => $entry )
|
||||
foreach( $xml->xml_array['attachtypesexport']['attachtypesgroup']['attachtype'] as $entry )
|
||||
{
|
||||
$insert_array = array( 'atype_extension' => $entry['atype_extension']['VALUE'],
|
||||
'atype_mimetype' => $entry['atype_mimetype']['VALUE'],
|
||||
@@ -787,7 +861,7 @@ class ad_attachments {
|
||||
|
||||
$this->attach_type_rebuildcache();
|
||||
|
||||
$this->ipsclass->main_msg = "Èìïîðòèðîâàíèå òèïîâ ïðèêðåïëÿåìûõ ôàéëîâ óñïåøíî çàâåðøåíî";
|
||||
$this->ipsclass->main_msg = "Attachment Types XML file import completed";
|
||||
|
||||
$this->attach_type_start();
|
||||
|
||||
@@ -805,7 +879,7 @@ class ad_attachments {
|
||||
// Get xml mah-do-dah
|
||||
//-----------------------------------------
|
||||
|
||||
require( KERNEL_PATH.'class_xml.php' );
|
||||
require_once( KERNEL_PATH.'class_xml.php' );
|
||||
|
||||
$xml = new class_xml();
|
||||
|
||||
@@ -863,7 +937,7 @@ class ad_attachments {
|
||||
|
||||
$this->attach_type_rebuildcache();
|
||||
|
||||
$this->ipsclass->main_msg = "Òèï ïðèêðåïëÿåìîãî ôàéëà óäàëåí";
|
||||
$this->ipsclass->main_msg = "Attachment type deleted";
|
||||
|
||||
$this->attach_type_start();
|
||||
}
|
||||
@@ -884,7 +958,7 @@ class ad_attachments {
|
||||
|
||||
if ( ! $this->ipsclass->input['atype_extension'] or ! $this->ipsclass->input['atype_mimetype'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Âû äîëæíû ââåñòè ðàñøèðåíèå è MIME-òèï ôàéëà äëÿ ïðîäîëæåíèÿ.";
|
||||
$this->ipsclass->main_msg = "You must enter at least an extension and mime-type before continuing.";
|
||||
$this->attach_type_form( $type );
|
||||
}
|
||||
|
||||
@@ -905,20 +979,20 @@ class ad_attachments {
|
||||
|
||||
if ( $attach['atype_id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Ðàñøèðåíèå ôàéëà '{$save_array['atype_extension']}' óæå ñóùåñòâóåò, âûáåðèòå äðóãîå ðàñøèðåíèå ôàéëà.";
|
||||
$this->ipsclass->main_msg = "The extension '{$save_array['atype_extension']}' already exists, please choose another extension.";
|
||||
$this->attach_type_form($type);
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'attachments_type', $save_array );
|
||||
|
||||
$this->ipsclass->main_msg = "Òèï ïðèêðåïëÿåìîãî ôàéëà äîáàâëåí";
|
||||
$this->ipsclass->main_msg = "Attachment type added";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->DB->do_update( 'attachments_type', $save_array, 'atype_id='.$this->ipsclass->input['id'] );
|
||||
|
||||
$this->ipsclass->main_msg = "Òèï ïðèêðåïëÿåìîãî ôàéëà èçìåíåí";
|
||||
$this->ipsclass->main_msg = "Attachment type edited";
|
||||
}
|
||||
|
||||
$this->attach_type_rebuildcache();
|
||||
@@ -935,13 +1009,15 @@ class ad_attachments {
|
||||
|
||||
function attach_type_form( $type='add' )
|
||||
{
|
||||
$this->ipsclass->input['id'] = intval($this->ipsclass->input['id']);
|
||||
$this->ipsclass->input['baseon'] = intval($this->ipsclass->input['baseon']);
|
||||
$this->ipsclass->input['id'] = isset($this->ipsclass->input['id']) ? intval($this->ipsclass->input['id']) : 0;
|
||||
$this->ipsclass->input['baseon'] = isset($this->ipsclass->input['baseon']) ? intval($this->ipsclass->input['baseon']) : 0;
|
||||
|
||||
$this->ipsclass->admin->nav[] = array( '', 'Add/Edit Attachment Type' );
|
||||
|
||||
if ( $type == 'add' )
|
||||
{
|
||||
$code = 'attach_doadd';
|
||||
$button = 'Äîáàâèòü íîâûé òèï ôàéëà';
|
||||
$button = 'Add New Attachment Type';
|
||||
|
||||
if ( $this->ipsclass->input['baseon'] )
|
||||
{
|
||||
@@ -949,7 +1025,11 @@ class ad_attachments {
|
||||
}
|
||||
else
|
||||
{
|
||||
$attach = array();
|
||||
$attach = array( 'atype_extension' => '',
|
||||
'atype_mimetype' => '',
|
||||
'atype_post' => '',
|
||||
'atype_photo' => '',
|
||||
'atype_img' => '' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -963,13 +1043,14 @@ class ad_attachments {
|
||||
|
||||
while( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$dd .= "<option value='{$r['atype_id']}'>Áàçèðóåòñÿ íà òèïå: {$r['atype_extension']}</option>\n";
|
||||
$dd .= "<option value='{$r['atype_id']}'>Base on: {$r['atype_extension']}</option>\n";
|
||||
}
|
||||
|
||||
$title = "
|
||||
<div style='float:right;width:auto;padding-right:3px;'>
|
||||
<form method='post' action='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=attach_add'>
|
||||
<select name='baseon' class='realbutton'>{$dd}</select> <input type='submit' value='Ïðèìåíèòü' class='realdarkbutton' />
|
||||
<input type='hidden' name='_admin_auth_key' value='{$this->ipsclass->_admin_auth_key}' />
|
||||
<select name='baseon' class='realbutton'>{$dd}</select> <input type='submit' value='Go' class='realdarkbutton' />
|
||||
</form>
|
||||
</div><div style='padding-bottom:5px'>{$button}</div>";
|
||||
|
||||
@@ -977,13 +1058,13 @@ class ad_attachments {
|
||||
else
|
||||
{
|
||||
$code = 'attach_doedit';
|
||||
$button = 'Èçìåíèòü òèï ôàéëà';
|
||||
$button = 'Edit Attachment Type';
|
||||
$title = $button;
|
||||
$attach = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'attachments_type', 'where' => 'atype_id='.$this->ipsclass->input['id'] ) );
|
||||
|
||||
if ( ! $attach['atype_id'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íå âûáðàí íå îäèí ID.";
|
||||
$this->ipsclass->main_msg = "No ID was passed, please try again.";
|
||||
$this->attach_type_start();
|
||||
}
|
||||
}
|
||||
@@ -1007,24 +1088,24 @@ class ad_attachments {
|
||||
// FORM
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ðàñøèðåíèå ïðèêðåïëÿåìîãî ôàéëà</b><div style='color:gray'>Îáû÷íî ñîñòîèò èç òðåõ ñèìâîëîâ, ÿâëÿåòñÿ ñóôôèêñîì ôàéëà.<br />Íå òðåáóåòñÿ ââîäèòü òî÷êó '.' äî ðàñøèðåíèÿ ôàéëà.</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'atype_extension', $_POST['atype_extension'] ? $_POST['atype_extension'] : $attach['atype_extension'], 10 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Attachment File Extension</b><div style='color:gray'>This is the (usually) three character filename suffix.<br />You don't need to add the '.' before the extension</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'atype_extension', ( isset($_POST['atype_extension']) AND $_POST['atype_extension'] ) ? $_POST['atype_extension'] : $attach['atype_extension'], 10 ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>MIME-òèï ôàéëà</b><div style='color:gray'>Íå óâåðåíû êàêîé MIME-òèï ó âûáðàííîãî ôàéëà?..<br /><a href='http://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html' target='_blank'>Ïîïðîáóéòå íàéòè çäåñü</a></div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'atype_mimetype', $_POST['atype_mimetype'] ? $_POST['atype_mimetype'] : $attach['atype_mimetype'], 40 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Attachment Mime-Type</b><div style='color:gray'>Unsure what the correct mime-type is?. <a href='http://www.utoronto.ca/webdocs/HTMLdocs/Book/Book-3ed/appb/mimetype.html' target='_blank'>Try looking here</a></div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'atype_mimetype', ( isset($_POST['atype_mimetype']) AND $_POST['atype_mimetype'] ) ? $_POST['atype_mimetype'] : $attach['atype_mimetype'], 40 ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ðàçðåøèòü ïðèêðåïëÿòü ýòîò òèï ôàéëà ê ñîîáùåíèÿì?</b>",
|
||||
$this->ipsclass->adskin->form_yes_no( 'atype_post', $_POST['atype_post'] ? $_POST['atype_post'] : $attach['atype_post'] ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Allow this attachment in posts?</b>",
|
||||
$this->ipsclass->adskin->form_yes_no( 'atype_post', ( isset($_POST['atype_post']) AND $_POST['atype_post'] ) ? $_POST['atype_post'] : $attach['atype_post'] ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ðàçðåøèòü èñïîëüçîâàòü ýòîò òèï ôàéëà êàê àâàòàðó / ôîòîãðàôèþ?</b>",
|
||||
$this->ipsclass->adskin->form_yes_no( 'atype_photo', $_POST['atype_photo'] ? $_POST['atype_photo'] : $attach['atype_photo'] ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Allow this attachment in avatars / personal photos?</b>",
|
||||
$this->ipsclass->adskin->form_yes_no( 'atype_photo', ( isset($_POST['atype_photo']) AND $_POST['atype_photo'] ) ? $_POST['atype_photo'] : $attach['atype_photo'] ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ìèíèèçîáðàæåíèå ôàéëà</b><div style='color:gray'>Ìàëåíüêàÿ èêîíêà óêàçûâàþùàÿ òèï ôàéëà â ñîîáùåíèè.</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'atype_img', $_POST['atype_img'] ? $_POST['atype_img'] : $attach['atype_img'], 40 ),
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Attachment Mini-Image</b><div style='color:gray'>This is the little icon that represents the attachment type in a post.</div>",
|
||||
$this->ipsclass->adskin->form_simple_input( 'atype_img', ( isset($_POST['atype_img']) AND $_POST['atype_img'] ) ? $_POST['atype_img'] : $attach['atype_img'], 40 ),
|
||||
) );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_form($button);
|
||||
@@ -1046,24 +1127,6 @@ class ad_attachments {
|
||||
|
||||
function attach_type_start()
|
||||
{
|
||||
$this->ipsclass->adskin->td_header[] = array( " " , "1%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Ðàñøèðåíèå" , "20%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "MIME-òèï" , "40%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Èñïîëüçîâàíèå â ñîîáùåíèÿõ" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Èñïîëüçîâàíèå â àâàòàðàõ" , "10%" );
|
||||
$this->ipsclass->adskin->td_header[] = array( "Äåéñòâèÿ" , "20%" );
|
||||
|
||||
$export_button = $this->ipsclass->adskin->js_make_button("Ýêñïîðòèðîâàòü òèïû ïðèêðåïëÿåìûõ ôàéëîâ", $this->ipsclass->base_url."&{$this->ipsclass->form_code}&code=attach_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'>Òèïû ïðèêðåïëÿåìûõ ôàéëîâ</td>
|
||||
<td align='right' nowrap='nowrap' style='padding-right:2px'>{$export_button}</td>
|
||||
</tr>
|
||||
</table>";
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $table );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get 'em
|
||||
//-----------------------------------------
|
||||
@@ -1071,29 +1134,20 @@ class ad_attachments {
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'attachments_type', 'order' => 'atype_extension' ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
$attach_html = "";
|
||||
|
||||
while( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$checked_img = "<img src='{$this->ipsclass->skin_url}/images/acp_check.gif' border='0' alt='X' />";
|
||||
$apost_checked = $r['atype_post'] ? $checked_img : ' ';
|
||||
$aphoto_checked = $r['atype_photo'] ? $checked_img : ' ';
|
||||
$r['_imagedir'] = $this->image_dir;
|
||||
|
||||
$edit = $this->ipsclass->adskin->js_make_button("Èçìåíèòü", "{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=attach_edit&id={$r['atype_id']}" );
|
||||
$delete = $this->ipsclass->adskin->js_make_button("Óäàëèòü", "{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=attach_delete&id={$r['atype_id']}", 'realdarkbutton' );
|
||||
$checked_img = "<img src='{$this->ipsclass->skin_acp_url}/images/acp_check.gif' border='0' alt='X' />";
|
||||
$r['apost_checked'] = $r['atype_post'] ? $checked_img : ' ';
|
||||
$r['aphoto_checked'] = $r['atype_photo'] ? $checked_img : ' ';
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<img src='style_images/{$this->ipsclass->skin['_imagedir']}/{$r['atype_img']}' border='0' />",
|
||||
".<strong>{$r['atype_extension']}</strong>",
|
||||
$r['atype_mimetype'],
|
||||
"<div align='center'>{$apost_checked}</div>",
|
||||
"<div align='center'>{$aphoto_checked}</div>",
|
||||
"<div align='center'>{$edit} {$delete}</div>",
|
||||
) );
|
||||
$attach_html .= $this->html->attach_row( $r );
|
||||
}
|
||||
|
||||
$add_new = $this->ipsclass->adskin->js_make_button("Äîáàâèòü íîâûé òèï ïðèêðåïëÿåìîãî ôàéëà", "{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=attach_add" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( $add_new, "center", "pformstrip");
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
||||
$this->ipsclass->html .= $this->html->attach_wrapper( $attach_html );
|
||||
|
||||
//-----------------------------------------
|
||||
// IMPORT: Start output
|
||||
@@ -1106,14 +1160,14 @@ class ad_attachments {
|
||||
) , "uploadform", " enctype='multipart/form-data'" );
|
||||
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Èìïîðòèðîâàíèå ñïèñêà ïðèêðåïëåÿåìûõ ôàéëîâ" );
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Import an Attachment Types List" );
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(
|
||||
"<b>Çàãðóçêà XML-àðõèâà ñî ñïèñêîì ïðèêðåïëÿåìûõ ôàéëîâ</b><div style='color:gray'>Âûáåðèòå ôàéë äëÿ çàãðóçêè ñ âàøåãî êîìïüþòåðà 'ipb_attachtypes.xml' èëè 'ipb_attachtypes.xml.gz'. Äâîéíûå çàïèñè èìïîðòèðîâàíû íå áóäóò.</div>",
|
||||
"<b>Upload XML Attachment Types List</b><div style='color:gray'>Browse your computer for 'ipb_attachtypes.xml' or 'ipb_attachtypes.xml.gz'. Duplicate 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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user