<?php
$listdb=get_star();
if($listdb){
$show='';
}else{
$show="您没有填写生日,无法判断星座";
}
$ThisModule['star']=<<<EOT
<table border=0 class="dragTable" cellspacing="0" cellpadding="0" id="star" width="100%">
<tr>
<td class="head"><h3 class="L"></h3><span class="Tag">星座</span><h3 class="R"></h3><span class="deletemodule" onclick="delete_module(this);">禁用</span></td>
</tr>
<tr>
<td class="middle">
$show
EOT;
foreach( $listdb AS $key=>$rs){
$ThisModule['star'].=<<<EOT
<div class="list_word">
<div style="word-break:break-all;"><font color="#FF6D00"><b> <font face="Webdings" size="1">4 </font>$rs[istar]|$rs[horo]</b></font></div>
<div class="list_content" style="word-break:break-all;"><img border="0" src="images/star/icon/$rs[horoscope].gif"><img border="0" src="images/star/girl/$rs[horoscope].gif"></div>
<font color="#FF6D00"><b> <font face="Webdings" size="1">4 </font>今日忠告</b></font>
<hr noshade color="#FF6D00">
<div ><div style="line-height:2.0; color:#666666">$rs[text]</div></div>
</div>
EOT;
}
$ThisModule['star'].=<<<EOT
</td>
</tr>
<tr>
<td class="foot"><h3 class="L"></h3><h3 class="R"></h3></td>
</tr>
</table>
EOT;
function get_star(){
global $db,$uid,$pre,$Mrows,$webdb,$VlogCfg,$BM;
$query = $db->query("SELECT * FROM {$pre}memberdata WHERE uid='$uid' ");
while($rs = $db->fetch_array($query)){
if($rs['bday']!="0000-00-00") {
$horoinfo = substr($rs['bday'],5,5);
$horoinfo = str_replace("-","",$horoinfo);
if ($horoinfo>="0321" && $horoinfo<="0419") $horoscope = 1;
elseif ($horoinfo>="0420" && $horoinfo<="0520") $horoscope = 2;
elseif ($horoinfo>="0521" && $horoinfo<="0620") $horoscope = 3;
elseif ($horoinfo>="0621" && $horoinfo<="0721") $horoscope = 4;
elseif ($horoinfo>="0722" && $horoinfo<="0822") $horoscope = 5;
elseif ($horoinfo>="0823" && $horoinfo<="0922") $horoscope = 6;
elseif ($horoinfo>="0923" && $horoinfo<="1022") $horoscope = 7;
elseif ($horoinfo>="1023" && $horoinfo<="1121") $horoscope = 8;
elseif ($horoinfo>="1122" && $horoinfo<="1221") $horoscope = 9;
elseif ($horoinfo>="0120" && $horoinfo<="0218") $horoscope = 11;
elseif ($horoinfo>="0219" && $horoinfo<="0320") $horoscope = 12;
else $horoscope = 10;
}
if (!$horoscope){
$horoscope=1;
}
$rs[horoscope]=$horoscope;
if(!$horoscope){$horoscope=1;}
switch ($horoscope) {
case 1:
$istar = "白羊座";
$horo = 'aries';
break;
case 2:
$istar = "金牛座";
$horo = 'taurus';
break;
case 3:
$istar = "双子座";
$horo = 'gemini';
break;
case 4:
$istar = "巨蟹座";
$horo = 'cancer';
break;
case 5:
$istar = "狮子座";
$horo = 'leo';
break;
case 6:
$istar = "处女座";
$horo = 'virgo';
break;
case 7:
$istar = "天秤座";
$horo = 'libra';
break;
case 8:
$istar = "天蝎座";
$horo = 'scorpio';
break;
case 9:
$istar = "射手座";
$horo = 'sagittarius';
break;
case 10:
$istar = "摩羯座";
$horo = 'capricorn';
break;
case 11:
$istar = "水瓶座";
$horo = 'aquarius';
break;
case 12:
$istar = "双鱼座";
$horo = 'pisces';
break;
}
$rs[istar]=$istar;
$rs[horo]=$horo;
$mode="today";
$astrourl = "http://appastro.qq.com/cgi-bin/astro_newluckday11?";
$openurl = $astrourl."astro=".$istar."&type=".$mode;
$fread = file_get_contents($openurl);
$textmain = explode("今日概述:",$fread);
$textmain = explode("昨日星运",$textmain[1]);
$textmain = html_pase($textmain[0]);
$text = addslashes($textmain);
//echo $text;
$rs[text]=$text;
$listdb[]=$rs;
}
return $listdb;
}
function html_pase($main){
$post = eregi_replace("<br>","{br}",$main);
$post = eregi_replace("<p>","{p}",$post);
$post = eregi_replace("</tr>","{br}",$post);
$post = eregi_replace(" : ","昨日星运:",$post);
$post = eregi_replace("</p>","{/p}",$post);
$post = strip_tags($post);
$post = eregi_replace("{p}","<p>",$post);
$post = eregi_replace("{/p}","</p>",$post);
$post = eregi_replace("{br}","<br>",$post);
return $post;
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
今日星座运势插件 for PHP168.rar
共1个文件
php:1个
需积分: 23 6 下载量 189 浏览量
2019-07-14
05:06:48
上传
评论
收藏 2KB RAR 举报
温馨提示
我是把星座放在blog里面 .其他地方应该也好放的 功能:能根据用户的生日自动判断星座及今日运程.修改下也可以查看到 昨日星运|明日星运|本周星运 |本月星运 (偷的QQ的) 喜欢的就下载去用用吧.第一次发.支持下. 找到php168/blog_setting.php 在$blogModuleDB['soonlink']='快速链接'; 下面加入 $blogModuleDB['star']='星座'; 再把文件放在 template\space\module下,在模块里面就可以选择了
资源推荐
资源详情
资源评论
收起资源包目录
今日星座运势插件.rar (1个子文件)
template
space
module
star.php 5KB
共 1 条
- 1
资源评论
weixin_39841882
- 粉丝: 443
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功