⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usercp.php

📁 极限网络智能办公系统—MYOA26—100%—源程序。
💻 PHP
📖 第 1 页 / 共 4 页
字号:
			if ( !$ibforums->input['p'] || $max_pages < $ibforums->input['p'] )
			{
				$ibforums->input['p'] = 1;
			}
			if ( 0 < $total_num )
			{
				foreach ( $file as $k => $image )
				{
					$this_page = $max_per_page * $ibforums->input['p'];
					if ( $this_page - $max_per_page <= $k && $k <= $this_page - 1 )
					{
						if ( $image == $avatar_gall_selected )
						{
							$selected = " checked";
						}
						else
						{
							$selected = "";
						}
						if ( $count_a == 0 & 1 < $count_b )
						{
							$av_html .= "<tr height='".$tbl_height_row."'>\n";
						}
						if ( $ibforums->input['cat'] )
						{
							$form_image = rawurlencode( $image );
						}
						else
						{
							$form_image = $image;
						}
						$image = rawurlencode( $image );
						$size = @getimagesize( $gallery_url.$this_cat."/".$image );
						if ( $ibforums->vars['av_width'] < $size[0] || $ibforums->vars['av_height'] < $size[1] )
						{
							if ( $size[1] < $size[0] )
							{
								$multiplier = $ibforums->vars['av_width'] / $size[0];
								$size[0] = $ibforums->vars['av_width'];
								$size[1] = ceil( $size[1] * $multiplier );
								$size[3] = "width='".$size[0]."' height='".$size[1]."'";
							}
							if ( $size[0] < $size[1] )
							{
								$multiplier = $ibforums->vars['av_height'] / $size[1];
								$size[0] = ceil( $size[0] * $multiplier );
								$size[1] = $ibforums->vars['av_height'];
								$size[3] = "width='".$size[0]."' height='".$size[1]."'";
							}
						}
						$data = array( );
						if ( $image == "noavatar.gif" && $size[0] < 5 && $size[1] < 5 )
						{
							$data = array(
								"tbl_width" => $tbl_width_pct,
								"def_width" => $ibforums->vars['av_width'],
								"def_height" => $ibforums->vars['av_height'],
								"av_file" => $image,
								"form_file" => $form_image,
								"selected" => $selected
							);
							$av_html .= $this->html->av_gallery_cell_noav( $data );
						}
						else
						{
							$data = array(
								"tbl_width" => $tbl_width_pct,
								"av_url" => $gallery_url.$this_cat."/",
								"av_file" => $image,
								"desc" => urldecode( $image ),
								"form_file" => $this_cat_form.$form_image,
								"size" => " ".$size[3],
								"selected" => $selected
							);
							$av_html .= $this->html->av_gallery_cell( $data );
						}
						++$count_a;
						if ( $count_a == $tbl_width )
						{
							$av_html .= "</tr>\n";
							$count_a = 0;
						}
						++$count_b;
					}
				}
				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;
				}
				if ( $max_per_page < $total_num )
				{
					$count = 1;
					if ( 0 < $total_cats )
					{
						$av_html .= $this->html->av_gallery_nav( $tbl_width + 1 );
					}
					else
					{
						$av_html .= $this->html->av_gallery_nav( $tbl_width );
					}
					while ( $count <= $max_pages )
					{
						if ( $ibforums->input['p'] == $count )
						{
							$av_html .= " ".$count;
						}
						else
						{
							$av_html .= " <a href='".$ibforums->base_url."&act=UserCP&CODE=24".$cat_link."&p=".$count."'>".$count."</a>";
						}
						++$count;
					}
					$av_html .= $this->html->av_gallery_end( );
				}
				else
				{
					$av_html .= "</table>\n";
				}
			}
		}
		else
		{
			$av_html .= "<br>".$ibforums->lang['no_av_gallery'];
		}
		$formextra = "";
		$hidden_field = "";
		if ( $ibforums->input['p'] )
		{
			$hidden_field .= "<input type='hidden' name='p' value='".$ibforums->input['p']."'>\n";
		}
		if ( $ibforums->input['cat'] )
		{
			$hidden_field .= "<input type='hidden' name='cat' value='".$ibforums->input['cat']."'>\n";
		}
		if ( $ibforums->member['g_avatar_upload'] == 1 )
		{
			$formextra = " enctype='multipart/form-data'";
			$hidden_field .= ( "<input type='hidden' name='MAX_FILE_SIZE' value='".$ibforums->vars['avup_size_max'] * 1024 )."'>";
		}
		$this->output .= $this->html->personal_avatar( array(
			"MEMBER" => $this->member,
			"AVATARS" => $av_html,
			"SHOW_AVS" => $show_avatar,
			"CUR_AV" => $my_avatar
		), $formextra, $hidden_field );
		if ( $ibforums->vars['avatar_url'] )
		{
			$this->output .= $this->html->personal_avatar_url( $this->member, $url_avatar, $allowed_ext );
			$text = $uploaded_avatar == 1 ? $ibforums->lang['avup_yes'] : $ibforums->lang['avup_no'];
			if ( $ibforums->member['g_avatar_upload'] == 1 )
			{
				$this->output = preg_replace( "/<!-- IBF\\.UPLOAD_AVATAR -->/e", "\$this->html->avatar_upload_field(\$text)", $this->output );
			}
		}
		$this->output .= $this->html->personal_avatar_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_avatar( )
	{
		$this->lib->do_avatar( );
	}

	function signature( )
	{
		global $ibforums;
		global $DB;
		global $std;
		global $print;
		$t_sig = $this->parser->unconvert( $this->member['signature'], $ibforums->vars['sig_allow_ibc'], $ibforums->vars['sig_allow_html'] );
		$ibforums->lang['the_max_length'] = $ibforums->vars['max_sig_length'] ? $ibforums->vars['max_sig_length'] : 0;
		$this->output .= $this->html->signature( $this->member['signature'], $t_sig );
		$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_signature( )
	{
		$this->lib->do_signature( );
	}

	function personal( )
	{
		global $ibforums;
		global $DB;
		global $std;
		global $print;
		if ( empty( $ibforums->member['g_edit_profile'] ) )
		{
			$std->error( array( "LEVEL" => 1, "MSG" => "cant_use_feature" ) );
		}
		$date = getdate( );
		$day = "<option value='0'>--</option>";
		$mon = "<option value='0'>--</option>";
		$year = "<option value='0'>--</option>";
		$i = 1;
		for ( ;	$i < 32;	++$i	)
		{
			$day .= "<option value='{$i}'";
			$day .= $i == $this->member['bday_day'] ? "selected>{$i}</option>" : ">{$i}</option>";
		}
		$i = 1;
		for ( ;	$i < 13;	++$i	)
		{
			$mon .= "<option value='{$i}'";
			$mon .= $i == $this->member['bday_month'] ? "selected>{$ibforums->lang["month".$i]}</option>" : ">{$ibforums->lang["month".$i]}</option>";
		}
		$i = $date['year'] - 1;
		$j = $date['year'] - 100;
		for ( ;	$j < $i;	--$i	)
		{
			$year .= "<option value='{$i}'";
			$year .= $i == $this->member['bday_year'] ? "selected>{$i}</option>" : ">{$i}</option>";
		}
		$required_output = "";
		$optional_output = "";
		$field_data = array( );
		$DB->query( "SELECT * from ibf_pfields_content WHERE member_id='".$ibforums->member['id']."'" );
		while ( $content = $DB->fetch_row( ) )
		{
			foreach ( $content as $k => $v )
			{
				if ( preg_match( "/^field_(\\d+)\$/", $k, $match ) )
				{
					$field_data[$match[1]] = $v;
				}
			}
		}
		$DB->query( "SELECT * from ibf_pfields_data WHERE fedit=1 ORDER BY forder" );
		while ( $row = $DB->fetch_row( ) )
		{
			$form_element = "";
			if ( $row['freq'] == 1 )
			{
				$ftype = "required_output";
			}
			else
			{
				$ftype = "optional_output";
			}
			if ( $row['ftype'] == "drop" )
			{
				$carray = explode( "|", trim( $row['fcontent'] ) );
				$d_content = "";
				foreach ( $carray as $entry )
				{
					$value = explode( "=", $entry );
					$ov = trim( $value[0] );
					$td = trim( $value[1] );
					if ( $ov != "" && $td != "" )
					{
						$d_content .= $field_data[$row['fid']] == $ov ? "<option value='{$ov}' selected>{$td}</option>\n" : "<option value='{$ov}'>{$td}</option>\n";
					}
				}
				if ( $d_content != "" )
				{
					$form_element = $this->html->field_dropdown( "field_".$row['fid'], $d_content );
				}
			}
			else if ( $row['ftype'] == "area" )
			{
				$form_element = $this->html->field_textarea( "field_".$row['fid'], $field_data[$row['fid']] );
			}
			else
			{
				$form_element = $this->html->field_textinput( "field_".$row['fid'], $field_data[$row['fid']] );
			}
			$$ftype .= $this->html->field_entry( $row['ftitle'], $row['fdesc'], $form_element );
		}
		$this->member['location'] = $this->parser->unconvert( $this->member['location'] );
		$this->member['interests'] = $this->parser->unconvert( $this->member['interests'] );
		$this->output .= $this->html->personal_panel( $this->member );
		if ( $ibforums->vars['post_titlechange'] && $ibforums->vars['post_titlechange'] < $this->member['posts'] )
		{
			$t_html = $this->html->member_title( $this->member['title'] );
			$this->output = preg_replace( "/<!--\\{MEMBERTITLE\\}-->/", $t_html, $this->output );
		}
		$t_html = $this->html->birthday( $day, $mon, $year );
		$this->output = preg_replace( "/<!--\\{BIRTHDAY\\}-->/", $t_html, $this->output );
		if ( $required_output != "" )
		{
			$this->output = str_replace( "<!--{REQUIRED.FIELDS}-->", $this->html->required_title( )."\n".$required_output, $this->output );
		}
		if ( $optional_output != "" )
		{
			$this->output = str_replace( "<!--{OPTIONAL.FIELDS}-->", "\n".$optional_output, $this->output );
		}
		$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_personal( )
	{
		$this->lib->do_profile( );
	}

	function splash( )
	{
		global $ibforums;
		global $DB;
		global $std;
		global $print;
		$info['MEMBER_EMAIL'] = $this->member['email'];
		$info['DATE_REGISTERED'] = $std->get_date( $this->member['joined'], "LONG" );
		$info['MEMBER_POSTS'] = $this->member['posts'];
		$info['DAILY_AVERAGE'] = $ibforums->lang['no_posts'];
		if ( 0 < $this->member['posts'] )
		{
			$diff = time( ) - $this->member['joined'];
			$days = $diff / 3600 / 24;
			$days = $days < 1 ? 1 : $days;
			$info['DAILY_AVERAGE'] = sprintf( "%.2f", $this->member['posts'] / $days );
		}
		$DB->query( "SELECT COUNT(*) as msg_total FROM ibf_messages WHERE member_id='".$this->member['id']."'" );
		$total = $DB->fetch_row( );
		$info['full_messenger'] = "";
		$info['full_percent'] = "";
		$info['space_free'] = "Unlimited";
		$info['total_messages'] = $total['msg_total'];
		if ( 0 < $ibforums->member['g_max_messages'] )
		{
			if ( $ibforums->member['g_max_messages'] <= $total['msg_total'] )
			{
				$info['full_messenger'] = "<span class='highlight'>".$ibforums->lang['folders_full']."</span>";
			}
			$info['full_percent'] = $total['msg_total'] ? sprintf( "%.0f", $total['msg_total'] / $ibforums->member['g_max_messages'] * 100 ) : 0;
			$info['full_percent'] = "(".$info['full_percent']."% ".$ibforums->lang['total_capacity'].")";
			$info['space_free'] = $ibforums->member['g_max_messages'] - $total['msg_total'];
		}
		$s_array = array( "s" => 5, "m" => 7, "l" => 15 );
		$info['NOTES'] = $this->notes ? $this->notes : $ibforums->lang['note_pad_empty'];
		$info['SIZE'] = $s_array[$this->size];
		$info['SIZE_CHOICE'] = "";
		if ( empty( $info['SIZE'] ) )
		{
			$info['SIZE'] = "5";
		}
		foreach ( $s_array as $k => $v )
		{
			if ( $v == $info['SIZE'] )
			{
				$info['SIZE_CHOICE'] .= "<option value='{$k}' selected>{$ibforums->lang["ta_".$k]}</option>";
			}
			else
			{
				$info['SIZE_CHOICE'] .= "<option value='{$k}'>{$ibforums->lang["ta_".$k]}</option>";
			}
		}
		$info['NOTES'] = preg_replace( "/<br>/", "\n", $info['NOTES'] );
		$this->output .= $this->html->splash( $info );
		if ( !$ibforums->member['g_use_pm'] )
		{
			$this->output = preg_replace( "/<!-- MSG -->.+?<!-- END MSG -->/s", "", $this->output );
		}
		$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 update_notepad( )
	{
		global $ibforums;
		global $DB;
		global $std;
		global $HTTP_POST_VARS;
		if ( $HTTP_POST_VARS['act'] == "" )
		{
			$std->error( array( "LEVEL" => 1, "MSG" => "complete_form" ) );
		}
		$DB->query( "SELECT id from ibf_member_extra WHERE id='".$this->member['id']."'" );
		if ( $DB->get_num_rows( ) )
		{
			$DB->query( "UPDATE ibf_member_extra SET notes='".$ibforums->input['notes']."', ta_size='".$ibforums->input['ta_size']."' WHERE id='".$this->member['id']."'" );
		}
		else
		{
			$DB->query( "INSERT INTO ibf_member_extra (id, notes, ta_size)  VALUES ('".$this->member['id']."', '".$ibforums->input['notes']."', '".$ibforums->input['ta_size']."')" );
		}
		$std->boink_it( $this->base_url."&act=UserCP&CODE=00" );
		exit( );
	}

	function show_image( )
	{
		global $ibforums;
		global $DB;
		$numbers = array( 0 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUDH5hiKsOnmqSPjtT1ZdnnjCUqBQAOw==", 1 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUjAEWyMqoXIprRkjxtZJWrz3iCBQAOw==", 2 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUDH5hiKubnpPzRQvoVbvyrDHiWAAAOw==", 3 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDH5hiKbaHgRyUZtmlPtlfnnMiGUFADs=", 4 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVjAN5mLDtjFJMRjpj1Rv6v1SHN0IFADs=", 5 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUhA+Bpxn/DITL1SRjnps63l1M9RQAOw==", 6 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVjIEYyWwH3lNyrQTbnVh2Tl3N5wQFADs=", 7 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIUhI9pwbztAAwP1napnFnzbYEYWAAAOw==", 8 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDH5hiKubHgSPWXoxVUxC33FZZCkFADs=", 9 => "R0lGODlhCAANAJEAAAAAAP////4BAgAAACH5BAQUAP8ALAAAAAAIAA0AAAIVDA6hyJabnnISnsnybXdS73hcZlUFADs=" );
		if ( $ibforums->input['p'] == "" )
		{
			return false;
		}
		if ( $ibforums->input['rc'] == "" )
		{
			return false;
		}
		$DB->query( "SELECT * FROM ibf_reg_antispam WHERE regid='".trim( addslashes( $ibforums->input['rc'] ) )."'" );
		if ( !( $row = $DB->fetch_row( ) ) )
		{
			return false;
		}
		$p = intval( $ibforums->input['p'] ) - 1;
		$this_number = substr( $row['regcode'], $p, 1 );
		flush( );
		header( "Content-type: image/gif" );
		echo base64_decode( $numbers[$this_number] );
		exit( );
	}

}

$idx = new usercp( );
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -