📄 usercp.php
字号:
}
$topic['PAGES'] .= ")</span>";
}
if ( $topic['posts'] < 0 )
{
$topic['posts'] = 0;
}
$topic['last_post_date'] = $std->get_date( $topic['last_post'], "LONG" );
$this->output .= $this->html->subs_row( $topic );
}
}
else
{
$this->output .= $this->html->subs_none( );
}
$date_box = "<option value='1'>".$ibforums->lang['subs_today']."</option>\n";
foreach ( array( 1, 7, 14, 21, 30, 60, 90, 365 ) as $day )
{
$selected = $day == $date_cut ? " selected" : "";
$date_box .= "<option value='{$day}'{$selected}>".sprintf( $ibforums->lang['subs_day'], $day )."</option>\n";
}
$date_box .= "<option value='1000'>".$ibforums->lang['subs_all']."</option>\n";
$this->output .= $this->html->subs_end( $auto_explain, $date_box );
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array(
"<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>"
);
}
function do_delete_tracker( )
{
global $ibforums;
global $std;
global $DB;
if ( $ibforums->input['request_method'] != "post" )
{
$std->error( array( "LEVEL" => 1, "MSG" => "poss_hack_attempt" ) );
}
$ids = array( );
foreach ( $ibforums->input as $key => $value )
{
if ( !preg_match( "/^id-(\\d+)\$/", $key, $match ) && !$ibforums->input[$match[0]] )
{
$ids[] = $match[1];
}
}
if ( 0 < count( $ids ) )
{
$DB->query( "DELETE from ibf_tracker WHERE member_id='".$this->member['id']."' and trid IN (".implode( ",", $ids ).")" );
}
$std->boink_it( $this->base_url."&act=UserCP&CODE=26" );
}
function skin_langs( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$lang_array = array( );
$lang_select = "<select name='u_language' class='forminput'>\n";
$DB->query( "SELECT ldir, lname FROM ibf_languages" );
while ( $l = $DB->fetch_row( ) )
{
$lang_select .= $l['ldir'] == $this->member['language'] ? "<option value='{$l['ldir']}' selected>{$l['lname']}</option>" : "<option value='{$l['ldir']}'>{$l['lname']}</option>";
}
$lang_select .= "</select>";
$this->output .= $this->html->skin_lang_header( $lang_select );
if ( $ibforums->vars['allow_skins'] == 1 )
{
$DB->query( "SELECT uid, sid, sname FROM ibf_skins WHERE hidden <> 1" );
if ( $DB->get_num_rows( ) )
{
$skin_select = "<select name='u_skin' class='forminput'>\n";
while ( $s = $DB->fetch_row( ) )
{
$skin_select .= $s['sid'] == $this->member['skin'] ? "<option value='{$s['sid']}' selected>{$s['sname']}</option>" : "<option value='{$s['sid']}'>{$s['sname']}</option>";
}
$skin_select .= "</select>";
}
$this->output .= $this->html->settings_skin( $skin_select );
}
$this->output .= $this->html->skin_lang_end( );
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array(
"<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>"
);
}
function do_skin_langs( )
{
$this->lib->do_skin_langs( );
}
function board_prefs( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$time = $std->get_date( time( ), "LONG" );
$offset = $ibforums->member['time_offset'] != "" ? $ibforums->member['time_offset'] : $ibforums->vars['time_offset'];
$time_select = "<select name='u_timezone' class='forminput'>";
foreach ( $ibforums->lang as $off => $words )
{
if ( preg_match( "/^time_(\\S+)\$/", $off, $match ) )
{
$time_select .= $match[1] == $offset ? "<option value='{$match[1]}' selected>{$words}</option>" : "<option value='{$match[1]}'>{$words}</option>";
}
}
$time_select .= "</select>";
if ( $ibforums->member['dst_in_use'] )
{
$dst_check = "checked";
}
else
{
$dst_check = "";
}
if ( $ibforums->vars['postpage_contents'] == "" )
{
$ibforums->vars['postpage_contents'] = "5,10,15,20,25,30,35,40";
}
if ( $ibforums->vars['topicpage_contents'] == "" )
{
$ibforums->vars['topicpage_contents'] = "5,10,15,20,25,30,35,40";
}
list( $post_page, $topic_page ) = explode( "&", $ibforums->member['view_prefs'] );
if ( $post_page == "" )
{
$post_page = -1;
}
if ( $topic_page == "" )
{
$topic_page = -1;
}
$pp_a = array( );
$tp_a = array( );
$post_select = "";
$topic_select = "";
$pp_a[] = array(
"-1",
$ibforums->lang['pp_use_default']
);
$tp_a[] = array(
"-1",
$ibforums->lang['pp_use_default']
);
foreach ( explode( ",", $ibforums->vars['postpage_contents'] ) as $n )
{
$n = intval( trim( $n ) );
$pp_a[] = array(
$n,
$n
);
}
foreach ( explode( ",", $ibforums->vars['topicpage_contents'] ) as $n )
{
$n = intval( trim( $n ) );
$tp_a[] = array(
$n,
$n
);
}
foreach ( $pp_a as $id => $data )
{
$post_select .= $data[0] == $post_page ? "<option value='{$data[0]}' selected>{$data[1]}\n" : "<option value='{$data[0]}'>{$data[1]}\n";
}
foreach ( $tp_a as $id => $data )
{
$topic_select .= $data[0] == $topic_page ? "<option value='{$data[0]}' selected>{$data[1]}\n" : "<option value='{$data[0]}'>{$data[1]}\n";
}
$this->output .= $this->html->settings_header( $this->member, $time_select, $time, $dst_check );
$hide_sess = $std->my_getcookie( "hide_sess" );
$view_ava = "<select name='VIEW_AVS' class='forminput'>";
$view_sig = "<select name='VIEW_SIGS' class='forminput'>";
$view_img = "<select name='VIEW_IMG' class='forminput'>";
$view_pop = "<select name='DO_POPUP' class='forminput'>";
$html_sess = "<select name='HIDE_SESS' class='forminput'>";
$view_ava .= $this->member['view_avs'] ? "<option value='1' selected>".$ibforums->lang['yes']."</option>\n<option value='0'>".$ibforums->lang['no']."</option>" : "<option value='1'>".$ibforums->lang['yes']."</option>\n<option value='0' selected>".$ibforums->lang['no']."</option>";
$view_sig .= $this->member['view_sigs'] ? "<option value='1' selected>".$ibforums->lang['yes']."</option>\n<option value='0'>".$ibforums->lang['no']."</option>" : "<option value='1'>".$ibforums->lang['yes']."</option>\n<option value='0' selected>".$ibforums->lang['no']."</option>";
$view_img .= $this->member['view_img'] ? "<option value='1' selected>".$ibforums->lang['yes']."</option>\n<option value='0'>".$ibforums->lang['no']."</option>" : "<option value='1'>".$ibforums->lang['yes']."</option>\n<option value='0' selected>".$ibforums->lang['no']."</option>";
$view_pop .= $this->member['view_pop'] ? "<option value='1' selected>".$ibforums->lang['yes']."</option>\n<option value='0'>".$ibforums->lang['no']."</option>" : "<option value='1'>".$ibforums->lang['yes']."</option>\n<option value='0' selected>".$ibforums->lang['no']."</option>";
$html_sess .= $hide_sess == 1 ? "<option value='1' selected>".$ibforums->lang['yes']."</option>\n<option value='0'>".$ibforums->lang['no']."</option>" : "<option value='1'>".$ibforums->lang['yes']."</option>\n<option value='0' selected>".$ibforums->lang['no']."</option>";
$this->output .= $this->html->settings_end( array(
"IMG" => $view_img."</select>",
"SIG" => $view_sig."</select>",
"AVA" => $view_ava."</select>",
"POP" => $view_pop."</select>",
"SESS" => $html_sess."</select>",
"TPS" => $topic_select,
"PPS" => $post_select
) );
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array(
"<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>"
);
}
function do_board_prefs( )
{
$this->lib->do_board_prefs( );
}
function email_settings( )
{
global $ibforums;
global $DB;
global $std;
global $print;
$info = array( );
foreach ( array(
hide_email,
allow_admin_mails,
email_full,
email_pm,
auto_track
) as $k )
{
if ( !empty( $this->member[$k] ) )
{
$info[$k] = "checked";
}
}
$this->output .= $this->html->email( $info );
$this->page_title = $ibforums->lang['t_welcome'];
$this->nav = array(
"<a href='".$this->base_url."&act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>"
);
}
function do_email_settings( )
{
$this->lib->do_email_settings( );
}
function avatar( )
{
global $ibforums;
global $DB;
global $std;
global $print;
list( ) = explode( "x", $this->member['avatar_size'] );
list ) = explode( "x", $this->member['avatar_size'] );
$this->member['AVATAR_WIDTH'] = $this->member['AVATAR_HEIGHT'];
list( ) = explode( "x", $ibforums->vars['avatar_dims'] );
$ibforums->vars['av_height'] = $this->member;
list ) = explode( "x", $ibforums->vars['avatar_dims'] );
$ibforums->vars['av_width'] = $ibforums->vars['av_height'];
list( $w, $h ) = explode( "x", $ibforums->vars['avatar_def'] );
$my_avatar = $std->get_avatar( $this->member['avatar'], 1, $this->member['avatar_size'] );
$my_avatar = $my_avatar ? $my_avatar : "noavatar";
$avatar_gallery = array( );
$dh = opendir( $ibforums->vars['html_dir']."avatars" );
while ( $file = readdir( $dh ) )
{
if ( !preg_match( "/^..?\$|^index/i", $file ) )
{
$avatar_gallery[] = $file;
}
}
closedir( $dh );
$url_avatar = "http://";
$avatar_gall_selected = "noavatar.gif";
$uploaded_avatar = 0;
if ( $this->member['avatar'] != "" && $this->member['avatar'] != "noavatar" )
{
if ( preg_match( "/^upload:/", $this->member['avatar'] ) )
{
$uploaded_avatar = 1;
}
else if ( !preg_match( "/^http/i", $this->member['avatar'] ) )
{
if ( preg_match( "/^(\\w+?)\\/(\\w+?)/", $this->member['avatar'] ) )
{
$gallery_hack = explode( "/", $this->member['avatar'] );
$avatar_gall_selected = $gallery_hack[1];
}
else
{
$avatar_gall_selected = $this->member['avatar'];
}
}
else
{
$url_avatar = $this->member['avatar'];
}
}
$allowed_ext = ".".implode( " .", explode( "|", $ibforums->vars['avatar_ext'] ) );
$gallery_dir = $ibforums->vars['html_dir']."avatars";
$gallery_url = $ibforums->vars['html_url']."/avatars";
$gallery_base = 0;
if ( !$ibforums->input['cat'] || $ibforums->input['cat'] == "" || preg_match( "/^\\.\\.?/", $ibforums->input['cat'] ) )
{
$this_cat = "";
$this_cat_form = "";
$cat_link = "";
$ibforums->input['cat'] = "";
}
else
{
$this_cat = "/".$ibforums->input['cat'];
$this_cat_form = $ibforums->input['cat']."|";
$cat_link = "&cat=".$ibforums->input['cat'];
}
if ( $dir = @opendir( $gallery_dir ) )
{
while ( false !== ( $cat = readdir( $dir ) ) )
{
if ( @is_dir( $gallery_dir."/".$cat ) && !preg_match( "/^..?\$/", $cat ) )
{
$tmpcat[$cat] = $cat;
}
if ( !preg_match( "/^..?\$|^index/i", $bin ) && !is_dir( $gallery_dir."/".$cat ) )
{
$gallery_base = 1;
}
if ( @file_exists( $gallery_dir."/".$cat."/index_c.txt" ) )
{
$filename = $gallery_dir."/".$cat."/index_c.txt";
$fd = @fopen( $filename, "r" );
$desc[$cat] = @fread( $fd, @filesize( $filename ) );
@fclose( $fd );
}
else
{
$desc[$cat] = $cat;
}
}
if ( $tmpcat )
{
asort( $tmpcat );
$count = 0;
foreach ( $tmpcat as $k => $v )
{
$cats[$count] = $v;
++$count;
}
}
}
@closedir( $dir );
if ( $dir = @opendir( $gallery_dir.$this_cat ) )
{
while ( false !== ( $bin = readdir( $dir ) ) )
{
if ( !preg_match( "/^..?\$|^index/i", $bin ) && !is_dir( $gallery_dir.$this_cat."/".$bin ) )
{
$tmp[$bin] = $bin;
}
}
if ( $tmp )
{
asort( $tmp );
$count = 0;
foreach ( $tmp as $k => $v )
{
$file[$count] = $v;
++$count;
}
}
}
else
{
$av_html = $ibforums->lang['no_av_dir'];
}
@closedir( $dir );
$total_cats = count( $cats );
$total_num = count( $file );
if ( 0 < $total_num || 0 < $total_cats )
{
if ( !$ibforums->vars['gallery_size'] || $ibforums->vars['gallery_size'] == "x" )
{
$ibforums->vars['gallery_size'] = "4x3";
}
$gallery = explode( "x", $ibforums->vars['gallery_size'] );
$tbl_width = $gallery[0];
$tbl_height = $gallery[1];
$tbl_height_row = $ibforums->vars['av_height'] + 24;
$max_per_page = $tbl_width * $tbl_height;
$max_pages = ceil( $total_num / $max_per_page );
$tbl_width_pct = round( 100 / $tbl_width );
$av_html = $this->html->av_gallery_title( $tbl_width );
if ( 0 < $total_cats )
{
$tbl_width_pct = round( 100 / ( $tbl_width + 1 ) );
$av_html = $this->html->av_gallery_title( $tbl_width + 1 );
$cat_html = $this->html->av_gallery_cats( $tbl_height, $tbl_height_row, $tbl_width_pct );
if ( $gallery_base = 1 )
{
if ( $this_cat != "" )
{
$cat_html .= "<a href='".$this->base_url."&act=UserCP&CODE=24'>".$ibforums->lang['avatar_gallery_main']."</a><br>\n";
}
else
{
$cat_html .= $ibforums->lang['avatar_gallery_main']."<br>\n";
}
}
foreach ( $cats as $k => $directory )
{
if ( $directory == $ibforums->input['cat'] )
{
$cat_html .= $desc[$directory]."<br>\n";
}
else
{
$cat_html .= "<a href='".$this->base_url."&act=UserCP&CODE=24&cat=".$directory."'>".$desc[$directory]."</a><br>\n";
}
}
$cat_html .= "\t\t</td>\n";
$av_html .= $cat_html;
if ( $total_num <= 0 )
{
$count_a = 0;
$count_b = 1;
while ( $count_b <= $max_per_page )
{
if ( $count_a == 0 && 1 < $count_b )
{
$av_html .= "<tr height='".$tbl_height_row."'>\n";
}
$av_html .= $this->html->av_gallery_cell_blank( $tbl_width_pct );
++$count_a;
if ( $count_a == $tbl_width )
{
$av_html .= "</tr>\n";
$count_a = 0;
}
++$count_b;
}
$av_html .= "</table>\n";
}
}
$count_a = 0;
$count_b = 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -