<?php
	//引入语言包
	$blo_langpackage=new bloglp;
	$lp_def_sort=$blo_langpackage->b_default_sort;
	$lp_private=$blo_langpackage->b_private;
	$lp_pals=$blo_langpackage->b_pals;
	$lp_public=$blo_langpackage->b_public;
	
function blog_sort_list($dbo,$t_blog_sort,$user_id,$selectedId){
	global $lp_def_sort;
	$sql="select id,name from $t_blog_sort where user_id='$user_id'";
	$blog_sort_rs=$dbo->getRs($sql);
	echo '<select name="blog_sort_list" id="blog_sort_list" onchange=document.getElementById("blog_sort_name").value=this.options[selectedIndex].text;>';
	$seleStr='';
	if($selectedId==""){ $seleStr='selected'; }
		echo '<option '.$seleStr.' value="">'.$lp_def_sort.'</option>';
			foreach($blog_sort_rs as $rs){
				if($selectedId==$rs['id']){ $seleStr='selected'; }else{ $seleStr=''; }
					echo '<option '.$seleStr.' value="'.$rs['id'].'">'.$rs['name'].'</option>';
			}
	echo '</select>';
}

function get_blog_sort($log_sort_name){
	global $lp_def_sort;
	if($log_sort_name=="-1")
		{
			return NULL;
		}
		else{
			return empty($log_sort_name)? $lp_def_sort:$log_sort_name;
		}
}
	
function get_blog_limit($blog_limit){
	global $lp_public;
	global $lp_pals;
	global $lp_private;
  if($blog_limit==0){echo $lp_public;}
	if($blog_limit==1){echo $lp_pals;}
	if($blog_limit==2){echo $lp_private;}	
}

function get_db_data($dbo,$table,$condition,$order_by,$type){
	$sql="select * from $table where $condition $order_by";
	$db_result=$dbo->{$type}($sql);
	return $db_result;
}


?>