<?php
	//引入语言包
	$alb_langpackage=new albumlp;
	$a_cho=$alb_langpackage->a_cho;
	$a_all=$alb_langpackage->a_all;
	$a_fri=$alb_langpackage->a_fri;
	$a_myself=$alb_langpackage->a_myself;
	
function album_name($dbo,$t_album,$user_id,$album_id){
	global $a_cho;
	 $sql="select album_id,album_name from $t_album where user_id='$user_id'";
	 $album_rs = $dbo -> getRs($sql);
   
    echo '<select name="album_name" id="album_name" onchange=document.getElementById("album_ufor").value=this.options[selectedIndex].text;>'
            .'<option value="">--'.$a_cho.'--</option>';
				foreach($album_rs as $val){
					echo"<option value=$val[album_id]";
					if($val['album_id']==$album_id){
						echo " selected ";
					}
					echo ">$val[album_name]</option>";
				}
   	echo '</select>';
  	  
}
function album_secret($secret){
	global $a_all;
	global $a_fri;
	global $a_myself;
	if($secret==0) echo $a_all;
	if($secret==1) echo $a_fri;
	if($secret==2) echo $a_myself;
}

function holder_name($is_self,$user_id,$holder_name){
	if($is_self=='N'){
		echo "<a target='_blank' href='home.php?h=".$user_id."'>".$holder_name."</a><br>";
	}
}

function upd_del($is_self,$album_id,$a_edit,$del_asc,$a_del){
	if($is_self=='Y'){
		echo "<a href='?app=album_update&album_id=".$album_id."'>".$a_edit."</a>
		        <a href='do.php?act=album_del&album_id=".$album_id."' onclick=\"return confirm('.$del_asc.')\";>".$a_del."</a>";
	}
}
function src_wh($size0,$size1,$photo_thumb_src){

	if($size0>$size1){
		echo "<img src='".$photo_thumb_src."' width='90' >";
	}else{
		echo "<img src='".$photo_thumb_src."' height='90' >";
	}
}
function do_url($type,$photo_src,$user_id){
	$do_url="?app=user_ico_cut&photo_url=".$photo_src;
	if($type!='' && $type=="blog_photo"){
		$do_url="javascript:AddContentImg('".$photo_src."',0);";
	}
	if($type!='' && $type=="index_pic"){
		$do_url="pic_cut.php?photo_url=".$photo_src."&user_id=".$user_id;
	}
	return $do_url;
}
?>
