返回   CHF站长论坛 > 综合讨论区 > 网站开发与设计

网站开发与设计 网页设计、网站开发、网站维护与调试交流区。

双至强仅二千,企商在线,最早租用商 魔兽世界私服 魔兽世界私服 此文字广告位招租 天龙八部私服 传奇世界私服 新开传奇私服
传奇私服 热血江湖私服 全球最新的创意科技产品 魔域私服 魔域私服 新开传奇私服 魔域私服 传奇私服
发表新主题 回复
 
主题工具 主题评分 显示模式
旧 2006-09-30, 17:19   #1 (页面定位)
老鬼
版主
 
老鬼 的头像
 
注册日期: 2005-08-30
住址: 地球
帖子: 12523
老鬼 的声望功能已被禁用
默认 选错程序了,模板真难改

全是PHP代码

PHP 代码:
function GetRecentArticleList(&$NumArticles)
        {
            
// Get a list of featured articles to show
            
$output "";
            
$query sprintf("select *, unix_timestamp(StartDate) as SD from %sarticles inner join %susers on %sarticles.AuthorID = %susers.UserID where Featured=0 and Visible=1 and %sarticles.Status=1 and unix_timestamp(StartDate) <= %s and IsFinished=1 and (unix_timestamp(ExpiryDate) >= %s or EnableExpiry=0) order by StartDate DESC, ArticleID DESC limit %d"$GLOBALS["AL_CFG"]["tablePrefix"], $GLOBALS["AL_CFG"]["tablePrefix"], $GLOBALS["AL_CFG"]["tablePrefix"], $GLOBALS["AL_CFG"]["tablePrefix"], $GLOBALS["AL_CFG"]["tablePrefix"], time(), time(),$NumArticles);

            
$articleResult mysql_query($query);
            
$NumArticles mysql_num_rows($articleResult);

            if(
mysql_num_rows($articleResult) > 0)
            {
                while(
$articleRow mysql_fetch_array($articleResult))
                {
                    
// If it's a summary+link open it in a new window
                    
$target = ($articleRow["Type"] == 3) ? "_blank" "_top";

                    if(
$articleRow["FirstName"] != "" && $articleRow["LastName"] != "")
                        
$author sprintf("%s %s"$articleRow["FirstName"], $articleRow["LastName"]);
                    else
                        
$author $GLOBALS["AL_LANG"]["hpNA"];

                    
$output .= "<span class=\"Title\" style=\"width:100%\">&raquo;";
                    
                    if(
$articleRow["Type"] != 2)
                    {
                        
$output .= sprintf("

                            <A target='%s' href='%s'>
                                %s
                            </A>

                        "
$targetAL_HELPER::ArticleLink($articleRow["ArticleID"], $articleRow["Title"]), $articleRow["Title"]);
                    }
                    else
                    {
                        
$output .= sprintf("

                            <span>%s</span>

                        "
$articleRow["Title"]);
                    }
                        
                    
$output .= sprintf("

                        </span>
                        <div class=\"Details\">%s&nbsp;<a href='%s'>%s</a> 
                            | %s&nbsp;%s 
                            | %s | <span class='RatingDisplay'>%s</span>
                        </div>
                        <div class=\"Content\">
                        <table cellspacing=0 cellpadding=0><tr><td valign=top>
                            %s
                            </td><td valign=top class=content>
                            %s
                        </td></tr></table>
                        </div>
                        <div class=\"SmallLinks\">
                    
                    "
$GLOBALS["AL_LANG"]["hpBy"], AL_HELPER::AuthorLink($articleRow["AuthorID"], $author), $author$GLOBALS["AL_LANG"]["hpPublished"], AL_HELPER::GetRelativeDate($articleRow["SD"]), AL_HELPER::GetCategoryListCVS($articleRow["ArticleID"]), AL_HELPER::GetRatingBar($articleRow["ArticleID"],true,$articleRow), AL_HELPER::GetAuthorPic($articleRow["AuthorID"]), $articleRow["Summary"]);

                    if(
$articleRow["Type"] == 1)
                    {
                        
$output .= sprintf("

                            <a target='%s' href='%s'><img src='%s/icon_FullStory.gif' border=0 align=absmiddle>&nbsp;%s</a>&nbsp;&nbsp;
                        
                        "
$targetAL_HELPER::ArticleLink($articleRow["ArticleID"], $articleRow["Title"]), AL_TPL_IMAGE_PATH$GLOBALS["AL_LANG"]["hpFullStory"]);
                    }
                    else if(
$articleRow["Type"] == 3)
                    {
                        
$output .= sprintf("

                            <a href='%s' target='_blank'><img src='%s/icon_VisitSite.gif' border=0 align=absmiddle>&nbsp;%s</a>&nbsp;&nbsp;
                        
                        "
AL_HELPER::ArticleLink($articleRow["ArticleID"], $articleRow["Title"]), AL_TPL_IMAGE_PATH$GLOBALS["AL_LANG"]["hpVisitSite"]);
                    }

                    if(
$GLOBALS["AL_CFG"]["EnablePrintArticle"] == 1)
                    {
                        
$output .= sprintf("

                            <a target=_blank href='%s/%s/%d'>
                            <img src='%s/icon_Print.gif' border=0 align=absmiddle>&nbsp;%s</a>

                        "
AL_HELPER::ArticleLink($articleRow["ArticleID"], $articleRow["Title"]),$GLOBALS["AL_LANG"]["urlPrint"], $articleRow["ArticleID"], AL_TPL_IMAGE_PATH$GLOBALS["AL_LANG"]["hpPrinterVersion"]);

                    }

                    
$output .= "</div><br />";
                }
            }    
return 
$output;
        } 
老鬼 当前离线   回复时引用此帖
旧 2006-09-30, 17:35   #2 (页面定位)
zmnet
 
注册日期: 2006-05-03
帖子: 7338
zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就zmnet 有着超越历史的辉煌成就
默认

不喜欢 模板中带php代码的程序
zmnet 当前离线   回复时引用此帖
回复

书签

标签

主题工具
显示模式 对此主题评分
对此主题评分:



所有时间均为北京时间。现在的时间是 09:12