<?phprequire_once(dirname(__FILE__)."/../include/common.inc.php");require_once(DEDEINC."/channelunit.func.php");$db = new dedesql();$curtime = time();//获得时间戳if(empty($date)){ $timestamp = $curtime; $date =date('Y-n-d',$timestamp);}else{ $timestamp = strtotime($date);} $selectedyear = date('Y',$timestamp); $selectedmonth = date('n',$timestamp); $selectedday = date('d',$timestamp); $starttime = mktime(0,0,0,$selectedmonth,$selectedday,$selectedyear); $endtime = $starttime+86400;$where = '';$tid = intval($tid);if($tid > 0){ $where = " and typeid=$tid";}$pagesize = 30;//默认一页30条数据$maxpages=9;//$pagepre=4;//分页用$pageno = isset($_GET["pageno"]) ? intval($_GET["pageno"]) : 1;$csql = "select count(*) as c from #@__archives,#@__arctype where pubdate>$starttime and pubdate <$endtime $where AND #@__arctype.id = #@__archives.typeid";$crow = $db->GetOne($csql);$GLOBALS['datacount']=$datacount = $crow['c'];//总条数$startrow =($pageno-1) * $pagesize;//开始数$rili = rili($date,'',true,$db);if($datacount>0)//获取页码 { $maxpage = $datacount%$pagesize;// if($maxpage>0) { $maxpage= ceil($datacount/$pagesize); }else{ $maxpage= $datacount/$pagesize;//获取总页数 } }else{ $maxpage=0; }if($pageno>$maxpage&&$maxpage!=0){ echo "<script>alert('好像没有这么多页数据!');history.go(-1);</script>"; exit();}$query = "select #@__archives.id,#@__archives.pubdate,#@__archives.title,#@__archives.senddate,#@__archives.ismake,#@__archives.arcrank,#@__archives.money,#@__arctype.namerule,#@__arctype.typedir,#@__archives.typeid from #@__archives,#@__arctype where pubdate>$starttime and pubdate <$endtime and ismake=1 $where AND #@__arctype.id = #@__archives.typeid LIMIT $startrow,$pagesize";$db->setquery($query);$db->execute();$list = array();while($row = $db->getarray()){ $row['time'] = date('20y-m-d H:i',$row['pubdate']); $row['pubdate'] = date('20ymd',$row['pubdate']); $list[] = $row;}require_once(dirname(__FILE__)."/../date/date.htm");function GetArcUrl($aid,$typeid,$timetag,$title,$ismake=0,$rank=0,$namerule="",$artdir="",$money=0){ return GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$namerule,$artdir,$money); }function rili($date, $file = '/date/index.php', $nomax = false,$db=''){ $curtime = time(); //获得时间戳 if(empty($date)){ $timestamp = $curtime; }else{ $timestamp = strtotime($date); } $selectedyear = date('Y',$timestamp); $selectedmonth = date('n',$timestamp); $selectedday = date('d',$timestamp); //给定月份第一天星期几 $firstday = date('w',mktime(0,0,0,$selectedmonth,1,$selectedyear)); ////给定月份所应有的天数 $lastday = date('t',$timestamp);//给定月份所应有的天数 $preyear = date('Y',mktime(0,0,0,$selectedmonth,0,$selectedyear)); $nextyear = date('Y',mktime(0,0,0,$selectedmonth,$lastday+1,$selectedyear)); $premonth = date('n',mktime(0,0,0,$selectedmonth,0,$selectedyear)); $nextmonth = date('n',mktime(0,0,0,$selectedmonth,$lastday+1,$selectedyear)); $premonthdays = date('t',mktime(0,0,0,$selectedmonth,0,$selectedyear)); $nextmonthdays = date('t',mktime(0,0,0,$selectedmonth,$lastday+1,$selectedyear)); $preday = min($selectedday,$premonthdays); $nextday = min($selectedday,$nextmonthdays); //显示日历头 $days = array("日","一","二","三","四","五","六"); $months = array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); $monthName = $months[$selectedmonth-1]; $str = "<table bgcolor=\"#F0F9EE\">"; $str .= "<caption valign=\"center\"><a href=\"$file?date=$preyear-$premonth-$preday\"><<</a> <b> $selectedyear $monthName</b> "; if($nomax && mktime(0,0,0,$nextmonth,1,$nextyear) > $curtime){ $str .= ">></caption>"; }else{ $str .= "<a href=\"$file?date=$nextyear-$nextmonth-$nextday\">>></a></caption>"; } $str .= "<tr>"; for($i=0;$i<7;$i++){ $str .= "<td width=10%>$days[$i]</td>"; } $str .= "</tr>"; //空出当月第一天的位置 $i = 0; while($i < $firstday){ $str .= "<td></td>"; $i++; } $day = 0; while($day < $lastday){ if(($i % 7) == 0){ $str .= "</tr><tr>"; } $day++; $i++; //查找每天是否存在文章 $starttime = mktime(0,0,0,$selectedmonth,$day,$selectedyear); $endtime = $starttime+86400; $csql2 = "select count(*) as c from #@__archives,#@__arctype where pubdate>$starttime and pubdate <$endtime and ismake=1 $where AND #@__arctype.id = #@__archives.typeid"; $crow = $db->GetOne($csql2); $datacount = $crow['c']; //所选当天不存在文章 if($day == $selectedday&&!$datacount) { $prevdate=date('Y-m-d',$GLOBALS['articleDate']); //如果当天之前到月初都没有文章,则找上个月 if(!$GLOBALS['articleDate']) { $csql2 = "select pubdate from #@__archives,#@__arctype where pubdate<=$starttime and ismake=1 $where AND #@__arctype.id = #@__archives.typeid order by pubdate desc"; $crow = $db->GetOne($csql2); $prevdate=date('Y-m-d ',$crow['pubdate']); } header("Location:index.php?date=".$prevdate); exit(); } //当天用红色表示 if($day == $selectedday){ $str .= "<td class=calendarToday align=center><font color=#ffffff>$day</font>($datacount)</td>"; }elseif($nomax && mktime(0,0,0,$selectedmonth,$day,$selectedyear) > $curtime){ $str .= "<td>$day</td>"; }elseif($datacount) { $str .= "<td><a href=\"$file?date=$selectedyear-$selectedmonth-$day\">$day</a>($datacount)</td>"; $currenttime=mktime(0,0,0,$selectedmonth,$selectedday,$selectedyear); if($starttime<=$currenttime) $GLOBALS['articleDate']=$starttime; } else $str.="<td>$day</td>"; } $str .= "</tr></table>"; return $str;}?>
回复讨论(解决方案)
求大神指点一二啊
大神,求详细使用方法啊,我在百度,Google都搜索了好些天了,真心没办法啊。

PHP主要是过程式编程,但也支持面向对象编程(OOP);Python支持多种范式,包括OOP、函数式和过程式编程。PHP适合web开发,Python适用于多种应用,如数据分析和机器学习。

PHP起源于1994年,由RasmusLerdorf开发,最初用于跟踪网站访问者,逐渐演变为服务器端脚本语言,广泛应用于网页开发。Python由GuidovanRossum于1980年代末开发,1991年首次发布,强调代码可读性和简洁性,适用于科学计算、数据分析等领域。

PHP适合网页开发和快速原型开发,Python适用于数据科学和机器学习。1.PHP用于动态网页开发,语法简单,适合快速开发。2.Python语法简洁,适用于多领域,库生态系统强大。

PHP在现代化进程中仍然重要,因为它支持大量网站和应用,并通过框架适应开发需求。1.PHP7提升了性能并引入了新功能。2.现代框架如Laravel、Symfony和CodeIgniter简化开发,提高代码质量。3.性能优化和最佳实践进一步提升应用效率。

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP类型提示提升代码质量和可读性。1)标量类型提示:自PHP7.0起,允许在函数参数中指定基本数据类型,如int、float等。2)返回类型提示:确保函数返回值类型的一致性。3)联合类型提示:自PHP8.0起,允许在函数参数或返回值中指定多个类型。4)可空类型提示:允许包含null值,处理可能返回空值的函数。

PHP中使用clone关键字创建对象副本,并通过\_\_clone魔法方法定制克隆行为。1.使用clone关键字进行浅拷贝,克隆对象的属性但不克隆对象属性内的对象。2.通过\_\_clone方法可以深拷贝嵌套对象,避免浅拷贝问题。3.注意避免克隆中的循环引用和性能问题,优化克隆操作以提高效率。

PHP适用于Web开发和内容管理系统,Python适合数据科学、机器学习和自动化脚本。1.PHP在构建快速、可扩展的网站和应用程序方面表现出色,常用于WordPress等CMS。2.Python在数据科学和机器学习领域表现卓越,拥有丰富的库如NumPy和TensorFlow。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

Dreamweaver CS6
视觉化网页开发工具

WebStorm Mac版
好用的JavaScript开发工具

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

记事本++7.3.1
好用且免费的代码编辑器