582 lines
23 KiB
PHP
582 lines
23 KiB
PHP
<?php
|
|
|
|
/*
|
|
+--------------------------------------------------------------------------
|
|
| 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
|
|
+---------------------------------------------------------------------------
|
|
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
|
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
|
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
|
+---------------------------------------------------------------------------
|
|
| > $Date: 2006-09-22 05:28:54 -0500 (Fri, 22 Sep 2006) $
|
|
| > $Revision: 567 $
|
|
| > $Author: matt $
|
|
+---------------------------------------------------------------------------
|
|
|
|
|
| > Custom profile field functions
|
|
| > Module written by Matt Mecham
|
|
| > Date started: 24th June 2002
|
|
|
|
|
| > Module Version Number: 1.0.0
|
|
| > DBA Checked: Tue 25th May 2004
|
|
+--------------------------------------------------------------------------
|
|
*/
|
|
|
|
if ( ! defined( 'IN_ACP' ) )
|
|
{
|
|
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
|
|
exit();
|
|
}
|
|
|
|
|
|
class ad_profilefields {
|
|
|
|
var $base_url;
|
|
var $func;
|
|
|
|
/**
|
|
* Section title name
|
|
*
|
|
* @var string
|
|
*/
|
|
var $perm_main = "content";
|
|
|
|
/**
|
|
* Section title name
|
|
*
|
|
* @var string
|
|
*/
|
|
var $perm_child = "field";
|
|
|
|
function auto_run()
|
|
{
|
|
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, 'Äîïîëíèòåëüíûå ïîëÿ' );
|
|
|
|
//-----------------------------------------
|
|
// get class
|
|
//-----------------------------------------
|
|
|
|
require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' );
|
|
$this->func = new custom_fields( $DB );
|
|
|
|
//-----------------------------------------
|
|
// switch-a-magoo
|
|
//-----------------------------------------
|
|
|
|
switch($this->ipsclass->input['code'])
|
|
{
|
|
case 'add':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );
|
|
$this->main_form('add');
|
|
break;
|
|
|
|
case 'doadd':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );
|
|
$this->main_save('add');
|
|
break;
|
|
|
|
case 'edit':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->main_form('edit');
|
|
break;
|
|
|
|
case 'doedit':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );
|
|
$this->main_save('edit');
|
|
break;
|
|
|
|
case 'delete':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':remove' );
|
|
$this->delete_form();
|
|
break;
|
|
|
|
case 'dodelete':
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':remove' );
|
|
$this->do_delete();
|
|
break;
|
|
|
|
default:
|
|
$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );
|
|
$this->main_screen();
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Rebuild cache
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function rebuild_cache()
|
|
{
|
|
$this->ipsclass->cache['profilefields'] = array();
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'pfields_data', 'order' => 'pf_position' ) );
|
|
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->cache['profilefields'][ $r['pf_id'] ] = $r;
|
|
}
|
|
|
|
$this->ipsclass->update_cache( array( 'name' => 'profilefields', 'array' => 1, 'deletefirst' => 1 ) );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Delete a group
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function delete_form()
|
|
{
|
|
if ($this->ipsclass->input['id'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ID äîïîëíèòåëüíîãî ïîëÿ");
|
|
}
|
|
|
|
$this->ipsclass->admin->page_title = "Óäàëåíèå äîïîëíèòåëüíîãî ïîëÿ";
|
|
|
|
$this->ipsclass->admin->page_detail = "Óáåäèòåñü, ÷òî âû äåéñòâèòåëüíî õîòèòå óäàëèòü èìåííî ýòî äîïîëíèòåëüíîå ïîëå ïðîôèëÿ, òàê êàê <b>âñÿ èíôîðìàöèÿ äîáàâëåííàÿ ïîëüçîâàòåëÿìè â ýòî ïîëå áóäåò óòåðÿíà</b>!";
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'pfields_data', 'where' => "pf_id=".intval($this->ipsclass->input['id']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $field = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè äîïîëíèòåëüíîå ïîëå ñ òàêèì ID");
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dodelete' ),
|
|
2 => array( 'act' , 'field' ),
|
|
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( "Ïîäòâåðæäåíèå óäàëåíèÿ" );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Óäàëÿåìîå äîïîëíèòåëüíîå ïîëå ïðîôèëÿ:</b>" ,
|
|
"<b>".$field['pf_title']."</b>",
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form("Óäàëèòü ýòî ïîëå");
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
}
|
|
|
|
|
|
|
|
function do_delete()
|
|
{
|
|
if ($this->ipsclass->input['id'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ID äîïîëíèòåëüíîãî ïîëÿ");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Check to make sure that the relevant groups exist.
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'pfields_data', 'where' => "pf_id=".intval($this->ipsclass->input['id']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( ! $row = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
$this->ipsclass->admin->error("Íåâîçìîæíî íàéòè äîïîëíèòåëüíîå ïîëå ñ òàêèì ID");
|
|
}
|
|
|
|
$this->ipsclass->DB->sql_drop_field( 'pfields_content', "field_{$row['pf_id']}" );
|
|
|
|
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'pfields_data', 'where' => "pf_id=".intval($this->ipsclass->input['id']) ) );
|
|
|
|
$this->rebuild_cache();
|
|
|
|
$this->ipsclass->admin->done_screen("Óäàëåíî äîïîëíèòåëüíîå ïîëå ïðîôèëÿ", "Äîïîëíèòåëüíûå ïîëÿ ïðîôèëÿ", "{$this->ipsclass->form_code}", 'redirect' );
|
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Save changes to DB
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function main_save($type='edit')
|
|
{
|
|
$this->ipsclass->input['id'] = intval($this->ipsclass->input['id']);
|
|
|
|
if ($this->ipsclass->input['pf_title'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè íàçâàíèå äîïîëíèòåëüíîãî ïîëÿ ïðîôèëÿ");
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// check-da-motcha
|
|
//-----------------------------------------
|
|
|
|
if ($type == 'edit')
|
|
{
|
|
if ($this->ipsclass->input['id'] == "")
|
|
{
|
|
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ID äîïîëíèòåëüíîãî ïîëÿ");
|
|
}
|
|
|
|
}
|
|
|
|
$content = "";
|
|
|
|
if ( $_POST['pf_content'] != "")
|
|
{
|
|
$content = $this->func->method_format_content_for_save( $_POST['pf_content'] );
|
|
}
|
|
|
|
$db_string = array( 'pf_title' => $this->ipsclass->input['pf_title'],
|
|
'pf_desc' => $this->ipsclass->input['pf_desc'],
|
|
'pf_content' => $this->ipsclass->txt_stripslashes($content),
|
|
'pf_type' => $this->ipsclass->input['pf_type'],
|
|
'pf_not_null' => intval($this->ipsclass->input['pf_not_null']),
|
|
'pf_member_hide' => intval($this->ipsclass->input['pf_member_hide']),
|
|
'pf_max_input' => intval($this->ipsclass->input['pf_max_input']),
|
|
'pf_member_edit' => intval($this->ipsclass->input['pf_member_edit']),
|
|
'pf_position' => intval($this->ipsclass->input['pf_position']),
|
|
'pf_show_on_reg' => intval($this->ipsclass->input['pf_show_on_reg']),
|
|
'pf_input_format' => $this->ipsclass->input['pf_input_format'],
|
|
'pf_admin_only' => intval($this->ipsclass->input['pf_admin_only']),
|
|
'pf_topic_format' => $this->ipsclass->txt_stripslashes( $_POST['pf_topic_format']),
|
|
);
|
|
|
|
|
|
if ($type == 'edit')
|
|
{
|
|
$this->ipsclass->DB->do_update( 'pfields_data', $db_string, 'pf_id='.$this->ipsclass->input['id'] );
|
|
|
|
$this->rebuild_cache();
|
|
|
|
$this->ipsclass->main_msg = "Èçìåíåíî äîïîëíèòåëüíîå ïîëå ïðîôèëÿ";
|
|
$this->main_screen();
|
|
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->DB->do_insert( 'pfields_data', $db_string );
|
|
|
|
$new_id = $this->ipsclass->DB->get_insert_id();
|
|
|
|
$this->ipsclass->DB->sql_add_field( 'pfields_content', "field_$new_id", 'text' );
|
|
|
|
$this->ipsclass->DB->sql_optimize_table( 'pfields_content' );
|
|
|
|
$this->rebuild_cache();
|
|
|
|
$this->ipsclass->main_msg = "Äîïîëíèòåëüíîå ïîëå ïðîôèëÿ èçìåíåíî";
|
|
$this->main_screen();
|
|
}
|
|
}
|
|
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Add / edit group
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function main_form($type='edit')
|
|
{
|
|
$this->ipsclass->input['id'] = intval($this->ipsclass->input['id']);
|
|
$this->ipsclass->admin->nav[] = array( '', 'Äîáàâëåíèå/èçìåíåíèå äîïîëíèòåëüíîãî ïîëÿ' );
|
|
|
|
if ($type == 'edit')
|
|
{
|
|
if ( ! $this->ipsclass->input['id'] )
|
|
{
|
|
$this->ipsclass->admin->error("Íè îäèí ID ãðóïïû íå âûáðàí, âåðíèòåñü è ïîïðîáóéòå ñíîâà.");
|
|
}
|
|
|
|
$form_code = 'doedit';
|
|
$button = 'Èçìåíèòü ýòî äîïîëíèòåëüíîå ïîëå';
|
|
|
|
}
|
|
else
|
|
{
|
|
$form_code = 'doadd';
|
|
$button = 'Äîáàâèòü ýòî äîïîëíèòåëüíîå ïîëå';
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// get field from db
|
|
//-----------------------------------------
|
|
|
|
if ( $this->ipsclass->input['id'] )
|
|
{
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'pfields_data', 'where' => "pf_id=".intval($this->ipsclass->input['id']) ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
$fields = $this->ipsclass->DB->fetch_row();
|
|
}
|
|
else
|
|
{
|
|
$fields = array( 'pf_topic_format' => '{title}: {content}<br />' );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Top 'o 'the mornin'
|
|
//-----------------------------------------
|
|
|
|
if ($type == 'edit')
|
|
{
|
|
$this->ipsclass->admin->page_title = "Èçìåíåíèå äîïîëíèòåëüíîãî ïîëÿ ".$fields['pf_title'];
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->admin->page_title = 'Äîáàâëåíèå äîïîëíèòåëüíîãî ïîëÿ';
|
|
$fields = array( 'pf_title' => '',
|
|
'pf_content' => '',
|
|
'pf_desc' => '',
|
|
'pf_type' => '',
|
|
'pf_max_input' => '',
|
|
'pf_position' => '',
|
|
'pf_input_format' => '',
|
|
'pf_topic_format' => '',
|
|
'pf_show_on_reg' => '',
|
|
'pf_not_null' => '',
|
|
'pf_member_edit' => '',
|
|
'pf_member_hide' => '',
|
|
'pf_admin_only' => '' );
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Wise words
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->admin->page_detail = "Ïîæàëóéñòà, äâàæäû òùàòåëüíî ïðîâåðüòå âñþ èíôîðìàöèþ ïðåæäå, ÷åì ïîäòâåðäèòü ýòî äîïîëíèòåëüíîå ïîëå ïðîôèëÿ";
|
|
|
|
//-----------------------------------------
|
|
// Start form
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , $form_code ),
|
|
2 => array( 'act' , 'field' ),
|
|
3 => array( 'id' , $this->ipsclass->input['id'] ),
|
|
4 => array( 'section', $this->ipsclass->section_code ),
|
|
) );
|
|
|
|
//-----------------------------------------
|
|
// Format...
|
|
//-----------------------------------------
|
|
|
|
$fields['pf_content'] = $this->func->method_format_content_for_edit($fields['pf_content'] );
|
|
|
|
//-----------------------------------------
|
|
// Tbl (no ae?)
|
|
//-----------------------------------------
|
|
|
|
$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->add_td_row( array( "<b>Íàçâàíèå</b><div class='graytext'>Ìàêñèìàëüíîå êîëè÷åñòâî ñèìâîëîâ: 200</div>" ,
|
|
$this->ipsclass->adskin->form_input("pf_title", $fields['pf_title'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îïèñàíèå</b><div class='graytext'>Ìàêñèìàëüíîå êîëè÷åñòâî ñèìâîëîâ: 250.<br />Ìîæåò áûòü èñïîëüçîâàíî äëÿ ïðèìå÷àíèé.</div>" ,
|
|
$this->ipsclass->adskin->form_input("pf_desc", $fields['pf_desc'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Òèï ïîëÿ</b>" ,
|
|
$this->ipsclass->adskin->form_dropdown("pf_type",
|
|
array(
|
|
0 => array( 'text' , 'Îäíîñòðî÷íîå òåêñòîâîå (input)' ),
|
|
1 => array( 'drop' , 'Âûïàäàþùåå ìåíþ (drowdown)' ),
|
|
2 => array( 'area' , 'Ìíîãîñòðî÷íîå òåêñòîâîå (textarea)' ),
|
|
),
|
|
$fields['pf_type'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ìàêñèìàëüíàÿ äëèíà</b><div class='graytext'>Äëÿ òåêñòîâûõ ïîëåé (òîëüêî öèôðû)</div>" ,
|
|
$this->ipsclass->adskin->form_input("pf_max_input", $fields['pf_max_input'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîðÿäîê ñîðòèðîâêè</b><div class='graytext'>Ïðè ðåäàêòèðîâàíèè è îòîáðàæåíèè.<br />Öèôðà 1 — ñàìàÿ íèçêàÿ ïîçèöèÿ.</div>" ,
|
|
$this->ipsclass->adskin->form_input("pf_position", $fields['pf_position'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ôîðìàò ïîëÿ</b><div class='graytext'>Èñïîëüçîâàíèå: <b>a</b> — áóêâû<br /><b>n</b> — öèôðû.<br />Íàïðèìåð, êðåäèòíàÿ êàðòà: nnnn-nnnn-nnnn-nnnn<br />Íàïðèìåð, äàòà ðîæäåíèÿ: nn-nn-nnnn<br />Îñòàâüòå ïîëå ïóñòûì äëÿ èñïîëüçîâàíèÿ ëþáûõ ñèìâîëîâ.</div>" ,
|
|
$this->ipsclass->adskin->form_input("pf_input_format", $fields['pf_input_format'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñîäåðæèìîå îïöèé äëÿ âûïàäàþùåãî ìåíþ</b><div class='graytext'>Èñïîëüçîâàíèå: <b>êëþ÷=çíà÷åíèå</b> (ïî îäíîìó çíà÷åíèþ íà ñòðîêó)<br />Ïðèìåð äëÿ ïîëÿ <b>Ïîë</b>:<br /><b>m=ìóæñêîé<br />f=æåíñêèé<br />u=íå ñêàæó</b><br />Ðåçóëüòàò: <select name='pants' class='dropdown'><option value='m'>ìóæñêîé</option><option value='f'>æåíñêèé</option><option value='u'>íå ñêàæó</option></select><br />Îäíî èç çíà÷åíèé: <b>m</b>, <b>f</b> èëè <b>u</b> áóäåò ñîõðàíåíî â áàçå äàííûõ.<br />Ïðè îòîáðàæåíèè â ïðîôèëå âûâîäèòñÿ <b>Ïîë: íå ñêàæó</b> (ïðè âûáîðå ïîëüçîâàòåëåì çíà÷åíèÿ <b>íå ñêàæó</b>)</div>" ,
|
|
$this->ipsclass->adskin->form_textarea("pf_content", $fields['pf_content'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Äîáàâèòü íà ñòðàíèöó ðåãèñòðàöèè?</b><div class='graytext'>Ïðè âûáîðå «Äà», ýòî äîïîëíèòåëüíîå ïîëå áóäåò ïðåäëîæåíî çàïîëíèòü ïðè ðåãèñòðàöèè.</div>" ,
|
|
$this->ipsclass->adskin->form_yes_no("pf_show_on_reg", $fields["pf_show_on_reg"] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ýòî ïîëå îáÿçàòåëüíî ê çàïîëíåíèþ?</b><div class='graytext'>Ïðè âûáîðå «Äà», áóäåò âûâîäèòüñÿ ñîîáùåíèå îá îøèáêå äî òåõ ïîð, ïîêà ïîëüçîâàòåëü åãî íå çàïîëíèò.</div>" ,
|
|
$this->ipsclass->adskin->form_yes_no("pf_not_null", $fields['pf_not_null'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ïîëå ìîæåò áûòü èçìåíåíî ïîëüçîâàòåëåì?</b><div class='graytext'>Ïðè âûáîðå «Íåò», ïîëüçîâàòåëü íå ñìîæåò ðåäàêòèðîâàòü ýòî ïîëå, íî ñìîãóò ñóïåðìîäåðàòîðû è àäìèíèñòðàòîðû.</div>" ,
|
|
$this->ipsclass->adskin->form_yes_no("pf_member_edit", $fields['pf_member_edit'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñäåëàòü ýòî ïîëå ëè÷íûì?</b><div class='graytext'>Ïðè âûáîðå «Äà», ïîëå áóäåò âèäèìûì òîëüêî äëÿ ñàìîãî ïîëüçîâàòåëÿ, ñóïåðìîäåðàòîðîâ è àäìèíèñòðàòîðîâ.<br />Ïðè âûáîðå «Íåò», îñòàëüíûå ïîëüçîâàòåëè ñìîãóò èñêàòü ïî ýòîìó ïîëþ.</div>" ,
|
|
$this->ipsclass->adskin->form_yes_no("pf_member_hide", $fields['pf_member_hide'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Ñäåëàòü âèäèìûì è èçìåíÿåìûì òîëüêî ñóïåðìîäåðàòîðàì è àäìèíèñòðàòîðàì?</b><div class='graytext'>Ïðè âûáîðå «Äà», ýòà îïöèÿ îòìåíèò ïðåäûäóùèå, òàê ÷òî òîëüêî ñóïåðìîäåðàòîðû è àäìèíèñòðàòîðû ñìîãóò âèäåòü è èçìåíÿòü ýòî ïîëå.</div>" ,
|
|
$this->ipsclass->adskin->form_yes_no("pf_admin_only", $fields['pf_admin_only'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>Îòîáðàæåíèå ïîëÿ â ñîîáùåíèè:</b><div class='graytext'>Îñòàâüòå ïîëå ïóñòûì, åñëè âû íå õîòèòå, ÷òîáû ýòî äîïîëíèòåëüíîå ïîëå äîáàâëÿëîñü ïîñëå èíôîðìàöèè îá àâòîðå ïðè îòîáðàæåíèè ñîîáùåíèé.<br />Äîñòóïíûå òåãè:<br /><b>{title}</b> — íàçâàíèå äîïîëíèòåëüíîãî ïîëÿ<br /><b>{content}</b> — ñîäåðæèìîå äîïîëíèòåëüíîãî ïîëÿ<br /><b>{key}</b> — âûáîð ïîëüçîâàòåëÿ èç âûïàäàþùåãî ìåíþ<br />Ïðèìåð: <b>{title}:{content}<br /></b><br />Ïðèìåð: <b>{title}:<img src='imgs/{key}.gif'></b></div>" ,
|
|
$this->ipsclass->adskin->form_textarea("pf_topic_format", $fields['pf_topic_format'] )
|
|
) );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_form($button);
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
$this->ipsclass->admin->output();
|
|
|
|
|
|
}
|
|
|
|
//-----------------------------------------
|
|
//
|
|
// Show "Management Screen
|
|
//
|
|
//-----------------------------------------
|
|
|
|
function main_screen()
|
|
{
|
|
$this->ipsclass->admin->page_title = "Äîïîëíèòåëüíûå ïîëÿ ïðîôèëÿ";
|
|
|
|
$this->ipsclass->admin->page_detail = "Äîïîëíèòåëüíûå ïîëÿ ïðîôèëÿ ìîãóò èñïîëüçîâàòüñÿ äëÿ ïîëó÷åíèÿ äîïîëíèòåëüíîé èíôîðìàöèè î âàøèõ ïîëüçîâàòåëÿõ, îíè ìîãóò èçìåíÿòüñÿ ïðè ðåãèñòðàöèè èëè âî âðåìÿ ðåäàêòèðîâàíèÿ ïðîôèëÿ.<br />Ýòà îïöèÿ î÷åíü ïîëåçíà, åñëè âû õîòèòå ñîáðàòü òó èíôîðìàöèþ î ïîëüçîâàòåëÿõ, êîòîðàÿ âàì íåîáõîäèìà, íî ïðè ýòîì íå äîñòóïíà â áàçîâîé âåðñèè ôîðóìà.";
|
|
|
|
$this->ipsclass->adskin->td_header[] = array( "Íàçâàíèå" , "20%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Òèï" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Îáÿçàòåëüíîå?" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Ëè÷íîå?" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Ïîêàçûâàòü ïðè ðåãèñòðàöèè?" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Òîëüêî àäìèí" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Èçìåíèòü" , "10%" );
|
|
$this->ipsclass->adskin->td_header[] = array( "Óäàëèòü" , "10%" );
|
|
|
|
//-----------------------------------------
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->start_table( "Ñïèñîê äîïîëíèòåëüíûõ ïîëåé ïðîôèëÿ" );
|
|
|
|
$real_types = array( 'drop' => 'âûïàäàþùåå ìåíþ',
|
|
'area' => 'òåêñòîâûé áëîê',
|
|
'text' => 'òåêñòîâîå ïîëå',
|
|
);
|
|
|
|
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'pfields_data', 'order' => 'pf_position' ) );
|
|
$this->ipsclass->DB->simple_exec();
|
|
|
|
if ( $this->ipsclass->DB->get_num_rows() )
|
|
{
|
|
while ( $r = $this->ipsclass->DB->fetch_row() )
|
|
{
|
|
|
|
$hide = ' ';
|
|
$req = ' ';
|
|
$regi = ' ';
|
|
$admin = ' ';
|
|
|
|
//-----------------------------------------
|
|
// Hidden?
|
|
//-----------------------------------------
|
|
|
|
if ($r['pf_member_hide'] == 1)
|
|
{
|
|
$hide = '<center><span style="color:red">Äà</span></center>';
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Required?
|
|
//-----------------------------------------
|
|
|
|
if ($r['pf_not_null'] == 1)
|
|
{
|
|
$req = '<center><span style="color:red">Äà</span></center>';
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Show on reg?
|
|
//-----------------------------------------
|
|
|
|
if ($r['pf_show_on_reg'] == 1)
|
|
{
|
|
$regi = '<center><span style="color:red">Äà</span></center>';
|
|
}
|
|
|
|
//-----------------------------------------
|
|
// Admin only...
|
|
//-----------------------------------------
|
|
|
|
if ($r['pf_admin_only'] == 1)
|
|
{
|
|
$admin = '<center><span style="color:red">Äà</span></center>';
|
|
}
|
|
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( "<b>{$r['pf_title']}</b><div class='graytext'>{$r['pf_desc']}</div>" ,
|
|
"<center>{$real_types[$r['pf_type']]}</center>",
|
|
$req,
|
|
$hide,
|
|
$regi,
|
|
$admin,
|
|
"<center><a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=edit&id=".$r['pf_id']."'>Èçìåíèòü</a></center>",
|
|
"<center><a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=delete&id=".$r['pf_id']."'>Óäàëèòü</a></center>",
|
|
) );
|
|
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic("Íå íàéäåíî", "center", "tablerow1");
|
|
}
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic("<div class='fauxbutton-wrapper'><span class='fauxbutton'><a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=add'>Äîáàâèòü</a></span></div>", 'center', 'tablefooter' );
|
|
|
|
$this->ipsclass->html .= $this->ipsclass->adskin->end_table();
|
|
|
|
|
|
$this->ipsclass->admin->output();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
?>
|