Server : nginx/1.22.1
System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64
User : www ( 1000)
PHP Version : 5.6.40
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/www.jkmold.com/phpcms/modules/link/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/www.jkmold.com/phpcms/modules/link/index.php
<?php

defined('IN_PHPCMS') or exit('No permission resources.');

class index {

	function __construct() {

		pc_base::load_app_func('global');

		$siteid = isset($_GET['siteid']) ? intval($_GET['siteid']) : get_siteid();

  		define("SITEID",$siteid);

	}

	

	public function init() {

		$siteid = SITEID;

 		$setting = getcache('link', 'commons');

		$SEO = seo(SITEID, '', L('link'), '', '');

		include template('link', 'index');

	}

	

	 /**

	 *	友情链接列表页

	 */

	public function list_type() {

		$siteid = SITEID;

  		$type_id = trim(urldecode($_GET['type_id']));

		$type_id = intval($type_id);

  		if($type_id==""){

 			$type_id ='0';

 		}

   		$setting = getcache('link', 'commons');

		$SEO = seo(SITEID, '', L('link'), '', '');

  		include template('link', 'list_type');

	} 

 	

	 /**

	 *	申请友情链接 

	 */

	public function register() { 

 		$siteid = SITEID;

 		if(isset($_POST['dosubmit'])){

 			if($_POST['name']==""){

 				showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid");

 			}

 			if($_POST['url']=="" || !preg_match('/^http:\/\/(.*)/i', $_POST['url'])){

 				showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");

 			}

 			if(!in_array($_POST['linktype'],array('0','1'))){

 				$_POST['linktype'] = '0';

 			}

 			$link_db = pc_base::load_model(link_model);

 			$_POST['logo'] =new_html_special_chars($_POST['logo']);



			$logo = safe_replace(strip_tags($_POST['logo']));

			if(!preg_match('/^http:\/\/(.*)/i', $logo)){

				$logo = '';

			}

			$name = safe_replace(strip_tags($_POST['name']));

			$url = safe_replace(strip_tags($_POST['url']));

			$url = trim_script($url);

 			if($_POST['linktype']=='0'){

 				$sql = array('siteid'=>$siteid,'typeid'=>intval($_POST['typeid']),'linktype'=>intval($_POST['linktype']),'name'=>$name,'url'=>$url);

 			}else{

 				$sql = array('siteid'=>$siteid,'typeid'=>intval($_POST['typeid']),'linktype'=>intval($_POST['linktype']),'name'=>$name,'url'=>$url,'logo'=>$logo);

 			}

 			$link_db->insert($sql);

 			showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid");

 		} else {

  			$setting = getcache('link', 'commons');

			$setting = $setting[$siteid];

 			if($setting['is_post']=='0'){

 				showmessage(L('suspend_application'), HTTP_REFERER);

 			}

 			$this->type = pc_base::load_model('type_model');

 			$types = $this->type->get_types($siteid);//获取站点下所有友情链接分类

 			pc_base::load_sys_class('form', '', 0);

  			$SEO = seo(SITEID, '', L('application_links'), '', '');

   			include template('link', 'register');

 		}

	} 

	

}

?>