|
如何完善poo兄的电话,EMAIL图片形式输出,并实现需要注册后才能看到联系图片
如何完善poo兄的电话,EMAIL图片形式输出,并实现需要注册后才能看到联系图片
poo兄的jiexiphone.php实现了电话,EMAIL图片形式输出,真是不错
有的需要保护隐私,比如招聘等,就只有让注册后的会员才可以看到
如何实现需要注册后才能看到联系方式的图片哪,谢谢大家的分享
下面的代码是我改的,可以实现会员登陆后显示图片了,可是没有登陆的游客不能显示,如何实现游客浏览时显示“请登录后查看”的
就是游客显示“需要注册后才可以查看”的图片,会员登陆后看到是图片格式输出的联系方式
<a href="" target="_blank" title="点击此处注册会员即可查看!"><img src="[!--news.url--]e/key/jiexiphone.php?data=<?= urlencode(jiajiemi($navinfor['tel'],'encode',''));?>" alt="[!--title--]信息发布者的联系电话" align="absmiddle"></a>
下面的我改的,可以实现只有登陆后才能看到联系方式的图片的,就是游客浏览时显示“请登录后查看”
那位高手给改改,游客浏览时显示“请登录后查看”
如何修改变色区域
--------------------------------------------------------------------------------
<?php
@require("../class/connect.php");
if(!defined('InEmpireCMS'))
{
exit();
}
include("../class/db_sql.php");
include("../class/config.php");
include("../class/userfun.php");
$link=db_connect();
$empire=new mysqlquery();
$myuser_id= getcvar("mluserid");
$mhavelogin=0;//初始化表示会员未登陆
if($myuser_id)
{
@include("e/class/MemberLevel.php");
$myusername=RepPostVar(getcvar('mlusername'));//用户名
$myrnd=RepPostVar(getcvar('mlrnd'));
if ($myusername)
{
$mhavelogin=1;//表示会员已登陆
}else{
$mhavelogin=0;//表示会员未登陆
}
}
//获取固定参数
$classid_s=intval($_GET['classid']);//获取栏目ID
$id_s=intval($_GET['id']);//获取信息ID
$istop_s=intval($_GET['istop']);//获取信息置顶级别
$groupid_s=1;//设置能执行该操作的会员组ID
//以下可以判断没有登录,如何实现输出“需要注册后才可以查看”的图片
if($mhavelogin==0){
function ShowData()
{
$key=$_GET['tel'];//对应字段属性
$data=$_GET['data'];//对应要解密的数据
$data=urldecode(jiajiemi($data,'DECODE',''));//进行解密
$strlen=strlen($data);
$data=strtolower($data);
$imgW=$strlen*10;
//支持gd库
if (function_exists("imagejpeg")) {
header ("Content-type: image/jpeg");
$img=imagecreate($imgW,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagejpeg($img);
imagedestroy($img);
}
elseif (function_exists("imagegif")) {
header ("Content-type: image/gif");
$img=imagecreate(140,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagegif($img);
imagedestroy($img);
}
elseif (function_exists("imagepng")) {
header ("Content-type: image/png");
$img=imagecreate($imgW,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagepng($img);
imagedestroy($img);
}
elseif (function_exists("imagewbmp")) {
header ("Content-type: image/vnd.wap.wbmp");
$img=imagecreate($imgW,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagewbmp($img);
imagedestroy($img);
}
else {
include("../class/functions.php");
echo ReadFiletext("../data/images/ecms.jpg");
}
}
ShowData();
}
//以下可以判断的已经登录,登录后可以正常生成图片
if($mhavelogin==1){
function ShowData()
{
$key=$_GET['tel'];//对应字段属性
$data=$_GET['data'];//对应要解密的数据
$data=urldecode(jiajiemi($data,'DECODE',''));//进行解密
$strlen=strlen($data);
$data=strtolower($data);
$imgW=$strlen*10;
//支持gd库
if (function_exists("imagejpeg")) {
header ("Content-type: image/jpeg");
$img=imagecreate($imgW,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagejpeg($img);
imagedestroy($img);
}
elseif (function_exists("imagegif")) {
header ("Content-type: image/gif");
$img=imagecreate(140,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagegif($img);
imagedestroy($img);
}
elseif (function_exists("imagepng")) {
header ("Content-type: image/png");
$img=imagecreate($imgW,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagepng($img);
imagedestroy($img);
}
elseif (function_exists("imagewbmp")) {
header ("Content-type: image/vnd.wap.wbmp");
$img=imagecreate($imgW,24);
$black=imagecolorallocate($img,255,0,0);
$gray=imagecolorallocate($img,255,255,255);
imagefill($img,0,0,$gray);
imagestring($img,5,5,3,$data,$black);
imagewbmp($img);
imagedestroy($img);
}
else {
include("../class/functions.php");
echo ReadFiletext("../data/images/ecms.jpg");
}
}
ShowData();
}
?>
|
|