<?php
define('THIS_SCRIPT', 'smiley');
include_once 'global.php';
$lang = load_lang($lang, 'lostpass' );
head(1,0,0,$title_num);
PageLoad();
footer();
function PageLoad(){
	global $dv,$lang,$db,$file_list;
	global $pre,$page_size,$page,$total,$page_count,$offset,$p,$start,$next,$ten_page,$action;
	$action=$_GET['t'];
	if(intval($action)==1){
		user_portrait();
	}
	else{
		forum_face();
	}
	include_once printout('smiley');
}
function user_portrait(){
	global $dv,$lang,$db,$file_list;
	global $pre,$page_size,$page,$total,$page_count,$offset,$p,$start,$next,$ten_page;
	$file_list=array();
	if (is_dir($lang['dir'])) {
		if ($dir_hand = opendir($lang['dir'])) {
			while (($file = readdir($dir_hand)) !== false) {
				$pic_attr=strtolower(substr($file,-3));
				if($file=="." or $file==".." or $pic_attr==".db" or preg_match('/.html$/', $file)){
					continue;
				}
				else{
					$file_list[]=$file;
					$total+=1;
				}
			}
			$page_size=30;
			$page_count=ceil($total/$page_size);
			closedir($dir_hand);
		}
	}
	else{
		show_msg($lang['sys.info'],$lang['tmp.info13'],0,'','',$lang['url'],$lang['cmdback']);
	exit;
	}
}
function forum_face() {
	global $dv,$lang,$db,$file_list;
	global $pre,$page_size,$page,$total,$page_count,$offset,$p,$start,$next,$ten_page;
	$file_list=array();
	if (is_dir($lang['dir1'])) {
		if ($dir_hand = opendir($lang['dir1'])) {
			while (($file = readdir($dir_hand)) !== false) {
				$pic_attr=strtolower(substr($file,-3));
				if($file=="." or $file==".." or $pic_attr==".db"){
					continue;
				}
				else{
					$file_list[]=$file;
					$total+=1;
				}
			}
			$page_size=30;
			$page_count=ceil($total/$page_size);
			closedir($dir_hand);
		}
	}
	else{
		show_msg($lang['sys.info'],$lang['tmp.info13'],0,'','',$lang['url'],$lang['cmdback']);
	exit;
	}
} 
?>