<?php
define("BOOK_USER_PER",0.5);
function moduleInit(){
	$shopid=0;
	if(isset($_GET["shopid"])){
		$shopid=get("shopid","i");
	}
	
	if(!$shopid){
		$shopid=intval($_COOKIE["ck_olprint_shopid"]);
	}
	
	define("SHOPID",$shopid);
}

function moduleShopInit(){
	if(ISWAP  ){
		C()->smarty->template_dir="module/olprint/themes/shop/wap";
		C()->smarty->assign(array(
			"skins"=>"module/olprint/themes/shop/wap/"
		)); 
	}else{
		C()->smarty->template_dir="module/olprint/themes/shop/pc";
		C()->smarty->assign(array(
			"skins"=>"module/olprint/themes/shop/pc/"
		)); 
	} 
	if(!isset($_SESSION["molprint_shop_admin"])){
		if(!in_array(get("m"),array("olprint_login"))){
			if(get("ajax")){
				if(!MM("olprint","olprint_login")->codeLogin()){
					echo json_encode(array(
						"message"=>"请先登录",
						"error"=>1000
					));
					exit;
				}
				
				
			}else{
				header("Location:/moduleshop.php?m=olprint_login");
				exit;
			}
			
		}
		
	}
	
	define("SHOPID",$_SESSION["molprint_shop_admin"]["shopid"]);
	define("SITEID",$_SESSION["molprint_shop_admin"]["siteid"]);
}
?>