|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
基础这个东西是个比较笼统的概念,如果你之前学习过c语言, c语言被认为是 <?php
/**
*
* @author 狼吞虎咽, <bighuang at 126 dot com>
* @copyright Copyright (c) 闲情网站, 2004-2005
* @since ~
*/
/*+++++++++++++++++++++++++
* Copyright (c) 2004,闲情网站
* All rights reserved
*
* 体系称号:闲情音乐
* 文件称号:diary.php
* 文件标识:见设置装备摆设办理企图书
* 功 能:
* 摘 要:
*
* 以后版本:1.0
* 作 者:狼吞虎咽
* 作者主页:http://freeday.512j.com
* 作者邮箱:bighuang@126.com
* 作者 QQ:121173553
* 完成日期:2005年4月3日
*
* 代替版本:1.0
* 原 作 者:狼吞虎咽
* 完成日期:2005年4月3日
+++++++++++++++++++++++++*/
include "config/config.php";
include "config/dbclass.php";
include "include/FreeDayCodeChange.php";
$my = new mydb();
$my->c_all($db_host,$db_user,$db_psw,$db_table);
//require("include/sess.php");
$my = new mydb();
$my->c_all($db_host,$db_user,$db_psw,$db_table);
require("include/header.php");
require("config/Smarty_Freeday.php");
$smarty = new Smarty_Freeday;
$query = "select count(*) from fd_music order by MC_id desc";
$res =$my->query($query);
$total = $my->fetch_arr($res);
$total = $total[0];
$queryN = "select * from fd_music order by MC_id desc";
$result =$my->query($queryN);
$i = "0";
$j = "1";
$musicArr = array();
if ($result)
{
while ($n = $my->fetch_arr($result))
{
$i ++;
$musicItem[$j-1][name] = $n[MC_name];
$musicItem[$j-1][songer] = $n[MC_songer];
$musicItem[$j-1][url] = $n[MC_url];
$j ++;
if($i==$total && $j%5!=0)
{
$musicArr[] = $musicItem;
}
if($j%5 == 0)
{
$musicArr[] = $musicItem;
$musicItem = "";
$j = "1";
}
}
}
else
{
echo "<tr><td align=center >毗连数据库失足!</td></tr>";
}
$smarty->assign('total',$total);
$smarty->assign('musicArr',$musicArr);
$my->close();
$smarty->display('music.htm');
require("include/footer.php");
exit();
?> music.htm<table class="toutm" width="768" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" class="tdbc">总共有歌曲<font color="#FF0000"><{$total}></font>首 </td>
</tr>
<tr>
<td width="768" class="line"> </td>
</tr>
<tr>
<td>
<table> <tr> <td> <table>
<{section name=secF loop=$musicArr}>
<tr>
<{section name=secS loop=$musicArr[secF]}>
<td>
<IMG src="images/11.gif" width=12><A title="" href="http://freeday.512j.com/old/wj/sp.php?path=<{$musicArr[secF][secS].url}>" target=_blank><{$musicArr[secF][secS].name}>《<{$musicArr[secF][secS].songer}>》</A>
</td> <{/section}> </tr>
<{/section}>
</table> </td> </tr> </table>
</td>
</tr>
<tr>
<td width="768" class="line"></td>
</tr>
</table> 更复杂的办法:- [size=2][font=verdana,arial,helvetica]代码:[/font][/size][color=#000000][color=#0000bb]
- [/color][color=#007700]<[/color][color=#0000bb]table border[/color][color=#007700]=[/color][color=#dd0000]"1" [/color][color=#0000bb]width[/color][color=#007700]=[/color][color=#dd0000]"599" [/color][color=#0000bb]cellpadding[/color][color=#007700]=[/color][color=#dd0000]"0" [/color][color=#0000bb]cellspacing[/color][color=#007700]=[/color][color=#dd0000]"0" [/color][color=#0000bb]align[/color][color=#007700]=[/color][color=#dd0000]"center"[/color][color=#007700]>
- <[/color][color=#0000bb]tr[/color][color=#007700]>
- <{[/color][color=#0000bb]section name[/color][color=#007700]=[/color][color=#0000bb]mydata loop[/color][color=#007700]=[/color][color=#0000bb]$news[/color][color=#007700]}>
- <[/color][color=#0000bb]td width[/color][color=#007700]=[/color][color=#dd0000]"69%" [/color][color=#0000bb]align[/color][color=#007700]=[/color][color=#dd0000]"center"[/color][color=#007700]>
- <[/color][color=#0000bb]a href[/color][color=#007700]=[/color][color=#dd0000]"#?id=<{$news[mydata].news_id}>"[/color][color=#007700]><{[/color][color=#0000bb]$news[/color][color=#007700][[/color][color=#0000bb]mydata[/color][color=#007700]].[/color][color=#0000bb]news_title[/color][color=#007700]}></[/color][color=#0000bb]a[/color][color=#007700]>
- </[/color][color=#0000bb]td[/color][color=#007700]>
- <{if [/color][color=#0000bb]$smarty[/color][color=#007700].[/color][color=#0000bb]section[/color][color=#007700].[/color][color=#0000bb]mydata[/color][color=#007700].[/color][color=#0000bb]rownum is div by 3[/color][color=#007700]}>
- </[/color][color=#0000bb]tr[/color][color=#007700]>
- <[/color][color=#0000bb]tr[/color][color=#007700]>
- <{/if}>
- <{/[/color][color=#0000bb]section[/color][color=#007700]}>
- </[/color][color=#0000bb]tr[/color][color=#007700]>
- </[/color][color=#0000bb]table[/color][color=#007700]>
- [/color][color=#0000bb][/color][/color]
复制代码
会有很多高手的鼓励,新手的支持,慢慢你劲头就十足,有更多的信心和兴趣去学。 |
|