<?php
/**
* 我的助手
* @author moufer<moufer@163.com>
* @package modoer
* @copyright Moufer Studio(www.modoer.com)
* @version $Id: index.php 10 2008-08-25 15:18 $
*/
define('SCRIPTNAV', 'member');
require_once(substr(dirname(__FILE__), 0, -6).'./include/common.inc.php');

if($action == 'clearcookies') {
	if(is_array($_COOKIE)) {
		foreach ($_COOKIE as $key => $val) {
            del_cookie($key, 0);
		}
	}
    location($_config['siteurl'], false);
    exit;
}

if(!$user->isLogin) {
    location($_config['siteurl'].'member/login.php?forward='.rawurlencode($_config['siteurl'].'index.php'), false);
    exit;
}

$assmenus = array ( 
    'menu_pker' => '我是评客', 
    'menu_owner' => '我是商家',
    'menu_info' => '个人信息',
);
$menu_pker = array (
    'reviews' => '我的点评',
    'responds' => '我的回应',
    'addshops' => '我添加的商铺',
    'pictures' => '我添加的图片',
    'favorites' => '我的收藏夹',
    'pm' => '我的短信箱',
    'friends' => '我的好友',
    'gbook' => '我的留言板',
    'exchange' => '我兑换的礼品',
);
$menu_owner = array (
    'myitems' => '我的商铺',
    //'itemreviews' => '商铺点评',
    //'itemarticles' => '商铺资讯',
);
$menu_info = array (
    'myset' => '我的设置',
    'space' => '个人空间',
    'face' => '头像设置',
);

$menu_other = array(
    'edititem' => '编辑商铺',
    'deleteitems' => '删除商铺',
    'editreview' => '编辑点评',
    'postarticle' => '增加资讯',
    'itemapply' => '商铺认领',
);

// UC开启
if($ucenter_enable) {
    if($_config['uc_exange']){
        //积分兑换
        $menu_pker = array_merge($menu_pker, array('credits' => '积分兑换'));
    }
    if($_config['uc_uch']){
        //空间跳转,取消本地的个人空间设置
        unset($menu_info['space']);
    }
}
// article模块功能
if($_modules['article']) {
    $mod_article = read_cache(MUDDER_ROOT.'data/cachefiles/cache_article_config.php');
    if($mod_article['ownernews']) {
        $menu_owner['itemarticles'] = '商铺资讯';
    }
}

// 允许的操作行为
$allowacs = array_merge(array_keys($menu_pker), array_keys($menu_owner), array_keys($menu_info), array_keys($menu_other));
$ac = empty($ac) || !in_array($ac, $allowacs) ? 'main' : $ac;

include_once(MUDDER_ROOT.'./member/include/ac_'.$ac.'.php');

foreach($assmenus as $m_key => $m_val) {
    foreach($$m_key as $key => $val) {
        if($key == $ac) $ac_title = $val;
    }
}

require_once(template('header','member','./templates/member'));
require_once(template($ac,'member','./templates/member'));
require_once(template('footer','member','./templates/member'));
output();
?>