<?php

/*
  PHP version 5
  Copyright (c) 2002-2018 ECISP.CN、EarcLink.COM
  警告：这不是一个免费的软件，请在许可范围内使用，请尊重知识产权，侵权必究，举报有奖
  作者：黄祥云 E-mail:6326420@qq.com  QQ:6326420 TEL:18665655030
 */

namespace inc_application\link;

class MemberLink {

	public static function get_link($linkcode = false, $read = array()) {
		global $espcms_command;
		$link_array = array();
		if ($espcms_command['IS_REWRITE']) {
			$link_array['login'] = espcms_url_out(array('Member_Login'), true);
			$link_array['loginver'] = espcms_url_out(array('Member_LoginVerify'), true);
			$link_array['reg'] = espcms_url_out(array('Member_RegInitialized'), true);
			$link_array['regsave'] = espcms_url_out(array('Member_RegInitializedSave'), true);
			$link_array['verify'] = espcms_url_out(array('Member_verifyAccount'), true);
			$link_array['findpw'] = espcms_url_out(array('Member_FindPassword'), true);
			$link_array['findpw_save'] = espcms_url_out(array('Member_FindPasswordSave'), true);
			$link_array['quit'] = espcms_url_out(array('Member_Quit'), true);
			$link_array['checkmailsend'] = espcms_url_out(array('Member_CheckMailSend'), true);
			$link_array['checkmailsendsave'] = espcms_url_out(array('Member_checkmailsendsave'), true);
			$link_array['center'] = espcms_url_out(array('MemberMain_Center'), true);
			$link_array['integral_list'] = espcms_url_out(array('MemberMain_IntegralList'), true);
			$link_array['edit_info'] = espcms_url_out(array('MemberMain_EditInfo'), true);
			$link_array['edit_mail'] = espcms_url_out(array('MemberMain_EditEmail'), true);
			$link_array['edit_password'] = espcms_url_out(array('MemberMain_EditPassword'), true);
			$link_array['edit_save'] = espcms_url_out(array('MemberMain_EditSave'), true);
			$link_array['binding'] = espcms_url_out(array('MemberMoblie_BindingMoblie'), true);
			$link_array['binding_save'] = espcms_url_out(array('MemberMoblie_BindingMoblieSave'), true);
			$link_array['vercode'] = espcms_url_out(array('MemberMoblie_VerMoblieCode'), true);
			$link_array['bingding_login'] = espcms_url_out(array('Member_BindingLogin'), true);
			$link_array['edit_photo'] = espcms_url_out(array('MemberMain_EditPhoto'), true);
			$link_array['photo_save'] = espcms_url_out(array('MemberMain_PhotoSave'), true);
			$link_array['bindsns'] = espcms_url_out(array('MemberMain_Bindsns'), true);
		} else {
			$action_key['ac'] = 'Member';
			$action_key['at'] = 'Login';
			$link_array['login'] = espcms_url_out($action_key);
			$action_key['at'] = 'LoginVerify';
			$link_array['loginver'] = espcms_url_out($action_key);
			$action_key['at'] = 'RegInitialized';
			$link_array['reg'] = espcms_url_out($action_key);
			$action_key['at'] = 'RegInitializedSave';
			$link_array['regsave'] = espcms_url_out($action_key);
			$action_key['at'] = 'verifyAccount';
			$link_array['verify'] = espcms_url_out($action_key);
			$action_key['at'] = 'FindPassword';
			$link_array['findpw'] = espcms_url_out($action_key);
			$action_key['at'] = 'FindPasswordSave';
			$link_array['findpw_save'] = espcms_url_out($action_key);
			$action_key['at'] = 'Quit';
			$link_array['quit'] = espcms_url_out($action_key);
			$action_key['at'] = 'CheckMailSend';
			$link_array['checkmailsend'] = espcms_url_out($action_key);
			$action_key['at'] = 'CheckMailSendSave';
			$link_array['checkmailsendsave'] = espcms_url_out($action_key);
			$action_key['ac'] = 'MemberMain';
			$action_key['at'] = 'Center';
			$link_array['center'] = espcms_url_out($action_key);
			$action_key['at'] = 'IntegralList';
			$link_array['integral_list'] = espcms_url_out($action_key);
			$action_key['at'] = 'EditInfo';
			$link_array['edit_info'] = espcms_url_out($action_key);
			$action_key['at'] = 'EditEmail';
			$link_array['edit_mail'] = espcms_url_out($action_key);
			$action_key['at'] = 'EditPassword';
			$link_array['edit_password'] = espcms_url_out($action_key);
			$action_key['at'] = 'EditSave';
			$link_array['edit_save'] = espcms_url_out($action_key);
			$action_key['ac'] = 'MemberMoblie';
			$action_key['at'] = 'BindingMoblie';
			$link_array['binding'] = espcms_url_out($action_key);
			$action_key['at'] = 'BindingMoblieSave';
			$link_array['binding_save'] = espcms_url_out($action_key);
			$action_key['at'] = 'VerMoblieCode';
			$link_array['vercode'] = espcms_url_out($action_key);
			$action_key['ac'] = 'Member';
			$action_key['at'] = 'BindingLogin';
			$link_array['bingding_login'] = espcms_url_out($action_key);
			$action_key['ac'] = 'MemberMain';
			$action_key['at'] = 'EditPhoto';
			$link_array['edit_photo'] = espcms_url_out($action_key);
			$action_key['ac'] = 'MemberMain';
			$action_key['at'] = 'PhotoSave';
			$link_array['photo_save'] = espcms_url_out($action_key);
			$action_key['ac'] = 'MemberMain';
			$action_key['at'] = 'Bindsns';
			$link_array['bindsns'] = espcms_url_out($action_key);
		}
		return $linkcode ? $link_array[$linkcode] : $link_array;
	}

	public static function get_mailcheck($read = array()) {
		$action_key['ac'] = 'Member';
		$action_key['at'] = 'CheckMail';
		$action_key['userid'] = $read['userid'];
		$action_key['key'] = $read['user_key'];
		$action_key['code'] = $read['pass_key'];
		$link = espcms_url_out($action_key, false, false, true);
		return $link;
	}

	/**
	 * 会员积分查看
	 * @global type $espcms_command
	 * @param type $read	当前分类内容
	 * @param type $pageid	分类翻页ID
	 * @return type
	 */
	public static function get_member_Integral_link($read = array(), $pageid = 0) {
		global $espcms_command;
		if ($espcms_command['IS_REWRITE']) {
			$action_key[] = espcms_ismatches($pageid) && $pageid ? 'MemberMain_IntegralList_' . $pageid : 'MemberMain_IntegralList';
			$link = espcms_url_out($action_key, true);
		} else {
			$action_key['ac'] = 'MemberMain';
			$action_key['at'] = 'IntegralList';
			if (espcms_ismatches($pageid) && $pageid) {
				$action_key['pageid'] = $pageid;
			}
			$link = espcms_url_out($action_key);
		}
		return $link;
	}

	public static function member_js_link($linkcode = false, $read = array()) {
		$link_array = array();
		$action_key['ac'] = 'Member';
		$action_key['at'] = 'JsLogin';
		$action_key['login_file'] = $read['login_file'];
		$action_key['info_file'] = $read['info_file'];
		$link_array['js_login'] = espcms_url_out($action_key);
		return $linkcode ? $link_array[$linkcode] : $link_array;
	}

	public static function member_bingsns_link($type) {
		$action_key['ac'] = 'MemberMain';
		$action_key['at'] = 'BindsnsClear';
		$action_key['type'] = $type;
		return espcms_url_out($action_key);
	}

}
