论坛贴吧图片IP签名档源码(制作方法)
1000 2021-7-17

直接上源码

源码很简单用的都是imagettftext

应该都可以看懂了,喜欢的话,自己在美化一下,换换图片啥的!

github:https://github.com/xhboke/IP

 

简单几步,教你制作自己的显IP签名档

 

下面开始制作

 

=================================

 

例一

 

第一步,复制以下代码,另存为ip.php

 

CODE:

 

<?php

 

/*

 

function:显示ip

 

转载自www.idzc.com

 

*/

 

Header("Content-type: image/PNG");

 

$im = imagecreate(150,20);//生成IP图片

 

$white = ImageColorAllocate($im, 255,255,255); //背景颜色

 

$color = imagecolorallocate($im, 255, 180, 37); //文字颜色

 

imagefill($im,0,0,$white);

 

imagestring($im,5,2,2,"[".$REMOTE_ADDR."]",$color);

 

ImagePNG($im);

 

ImageDestroy($im);

 

?>

 

[Copy to clipboard]

 

第二步,上传到支持php的空间

 

没有空间的可以到 www.21windows.com 申请免费的空间

 

第三步,在签名档中输入ip.php文件的地址,例如我制作的这个,地址是

 

CODE:

 

[Copy to clipboard]

 

大功告成了,效果是这样的

 

========================================

 

是不是觉得有些单调呢?

 

没关系,再教你如何制作有图片背景的显IP签名档。

 

例二

 

第一步,复制以下代码,另存为ipcover.php

 

CODE:

 

<?/*

 

Function: Show your IP in image

 

Nov 14,2005

 

参考Internet上的教程,修改制作

 

-Freeware-

 

*/

 

if(!function_exists('imagetypes')) die("ERROR: GD LIB IS NOT LOADED!");

 

header("Content-type: image/png");

 

/*=================*/

 

$im = @imagecreatefrompng ("test.png");//读取图片名

 

$color = imagecolorallocate($im, 183, 150, 37); //文字颜色

 

imagestring($im,3,125,44,"[ From ".$_SERVER["REMOTE_ADDR"]." / ".show_system()." / ".show_browser()." ]",$color); //($im,字大小,左右,上下)

 

//imagestring($im,3,72,26,"[".show_system()." / ".show_browser()."]",$color);

 

imagepng($im);

 

imagedestroy($im);

 

function show_browser(){

$b = $_SERVER['HTTP_USER_AGENT'];

 

$ie50 = preg_match("/IE 5.0/i", $b);

 

$ie55 = preg_match("/IE 5.5/i", $b);

 

$ie60 = preg_match("/IE 6.0/i", $b);

 

$opera = preg_match("/Opera/i", $b);

 

if ($ie40 == 1) {

$browser = "Ie 4.0";

 

} else if ($ie50 == 1) {

$browser = "IE 5.0";

 

} else if ($ie55 == 1) {

$browser = "IE 5.5";

 

} else if ($ie60 == 1) {

$browser = "IE 6.0";

 

} else if ($opera == 1) {

$browser = "Opera";

 

} else {

$browser = "n/a";

 

}

 

return($browser);

 

}

 

function show_system(){

$so = $_SERVER['HTTP_USER_AGENT'];

 

$windowsxp = preg_match("/Windows nt 5.1/i", $so);

 

$windowsxp2 = preg_match("/Windows xp/i", $so);

 

$linux = preg_match("/Linux/i", $so);

 

$windowsme = preg_match("/Win 9x 4.90/i", $so);

 

$windowsme2 = preg_match("/Windows me/i", $so);

 

$windows2k = preg_match("/Windows nt 5.0/i", $so);

最后于 2021-7-19 被1000编辑 ,原因:
最新回复 (15)
全部楼主
  • 1000 楼主
    2021-7-17 2
    0

  • 1000 楼主
    2021-7-17 3
    0
    无法上传附件
  • oliolo 版主
    2021-7-17 4
    0
    可以做成插件放在网站右侧
  • 1000 楼主
    2021-7-17 5
    0
    这个任务交给你
  • 一秀十年
    2021-7-18 6
    1
    你这个github链接无法正常打开,无法访问,是封了吧?我用github镜像站打开了:https://hub.fastgit.org/xhboke/IP
  • 1000 楼主
    2021-7-18 7
    0
    连接可以打开了
  • oliolo 版主
    2021-7-18 8
    0

    //地址、温度
    $data = json_decode(curl_get('https://api.xhboke.com/ip/v1.php?ip='.$ip), true);
    $country = $data['site']['country']; 
    $region = $data['site']['region']; 
    $adcode = $data['site']['adcode']; 
    $weather = $data['city']['weather'];
    $temperature = $data['city']['temperature'];
    //历史上今天
    //$data = json_decode(get_curl('https://xhboke.com/mz/today.php'), true);

    xhboke.com 已经打不开了文件也不完整。

    /composer/autoload_real.php 这个文件在那?

    这个程序基本是废的。

     

     

     

     

     

     

     

  • xiaoshou
    2021-7-22 9
    0
    哈哈,不错哦!
  • tssz
    2021-8-16 10
    0
    原来是这样子来的。
  • 1349920358
    2021-8-19 11
    0
    楼主,你写得实在是太好了。我惟一能做的,就只有把这个帖子顶上去这件事了。 
  • aaa19880202
    2023-2-1 12
    0
    我要拿出这帖子奉献给世人赏阅,我要把这个帖子一直往上顶,往上顶!顶到所有人都看到为止! 
  • 481150395
    12月前 13
    0
    楼主,我只是来混个熟的!老板,侬亿雷凑闹嫩了!
  • aaa19880202
    8月前 14
    0
    我要拿出这帖子奉献给世人赏阅,我要把这个帖子一直往上顶,往上顶!顶到所有人都看到为止! 
  • brian218
    5月前 15
    0
    你就是我心中的那首忐忑,总是让我惊心动魄。 
  • weige
    1月前 16
    0
    顶顶顶顶顶顶顶!!!
返回