⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 url.func.php

📁 Phpcms2008 是一款基于 PHP+Mysql 架构的网站内容管理系统
💻 PHP
字号:
<?php 
function space_url($userid)
{
	global $MODULE;
	return $MODULE['space']['url'].'?userid='.$userid;
}

function ip_url($ip)
{
	return 'http://tool.phpcms.cn/ip.php?ip='.$ip;
}

function content_url($contentid)
{
	global $db;
	$contentid = intval($contentid);
	if($contentid < 1) return '';
	$r = $db->get_one("SELECT `url` FROM `".DB_PRE."content` WHERE `contentid`=$contentid");
	return $r ? $r['url'] : '';
}

function member_view_url($userid)
{
	return "?mod=member&file=member&action=view&userid=$userid";
}

function avatar($userid)
{
	global $PHPCMS, $member_api, $attachment;
	if(!$PHPCMS['uc'])
	{
		if(!is_a($member, 'member_api'))
		{
			$member_api = load('member_api.class.php', 'member', 'api');
			$attachmentid = $member_api->get($userid, array('avatar'));
			$aid = $attachmentid['avatar'];
		}
		if(!is_a($attachment, 'attachment'))
		{
			if(!class_exists('attachment'))
			{
				require 'attachment.class.php';
			}
			$attachment = new attachment();
		}
		$filepath = $attachment->get($aid, 'filepath');
		if($aid)
		{
			$avatar = UPLOAD_URL.$filepath['filepath'];
			return $avatar;
		}
		$avatar = 'images/nophoto.gif';
	}
	else
	{
		if(!defined('UC_API'))
		{
			define('UC_API', $PHPCMS['uc_api']) ;
		}
		$avatar = UC_API."/avatar.php?uid=".$userid."&size=big";
	}
	return $avatar;
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -