Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[求助] DZ数据调用问题

[复制链接]
www4074 发表于 2010-10-13 12:52:39 | 显示全部楼层 |阅读模式
问题描述
适用版本: Discuz! 6.0
浏览器: 其他(帖子中请注明浏览器) 
使用模板: 其他模板(请在回帖中说明模板的名称或者是模板的下载地址)
BUG地址: 无法调用数据
一个风格模板的问题大家帮忙看看能不能帮忙搞定
原帖地址https://discuz.dismall.com/forum.php?mod=viewthread&tid=913576&extra=page%3D4%26filter%3Dsortid%26sortid%3D82%26searchsort%3D1%26discuz_version%3D2此风格虽然作者发布了,但有一些问题,所以希望会PHP的朋友看一下,只需要能实现下面的数据调用的代码就可以了!
数据是直接从数据库调用的,但具体怎么调用就不知道 了,大家帮忙看看
10101217226310d5f5794c3cb5.jpg
//招聘信息首页调用
$hack_cut_str = 30; //标题字数
$hack_cut_strauthor = 9;
$hack_forumid = "52";//要显示的论坛的fid
$new_zhaopin_threadlist = array();
$zhaopinthread = array();
$query = $db->query("SELECT t.*, f.name, tt.name as typename FROM {$tablepre}threads t, {$tablepre}forums f,{$tablepre}threadtypes tt WHERE t.typeid=tt.typeid AND t.fid<>'$fid' AND f.fid=t.fid AND t.displayorder>=0 AND f.fid in($hack_forumid)  ORDER BY t.dateline DESC LIMIT 0, 8");
while($zhaopinthread = $db->fetch_array($query)) {
        $zhaopinthread['forumname'] = ereg_replace('<[^>]*>','',$zhaopinthread['name']);
        $zhaopinthread['view_subject'] = cutstr($zhaopinthread['subject'],$hack_cut_str);
        $zhaopinthread['view_author'] = cutstr($zhaopinthread['author'],$hack_cut_strauthor);
        $zhaopinthread['date']= gmdate("$dateformat $timeformat", $zhaopinthread['dateline'] + $timeoffset * 3600);
        $zhaopinthread['lastreplytime']= gmdate("$dateformat $timeformat", $zhaopinthread[lastpost] + ($timeoffset * 3600));
        if($zhaopinthread['highlight']) {
                $string = sprintf('%02d', $zhaopinthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $zhaopinthread['highlight'] = 'style="';
                $zhaopinthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $zhaopinthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $zhaopinthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $zhaopinthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $zhaopinthread['highlight'] .= '"';
        } else {
                $zhaopinthread['highlight'] = '';
        }
        $new_zhaopin_threadlist[] = $zhaopinthread;
}
//招聘结束

这是根目录下index.php里的代码
<div class="news_show">
             <div class="news_index">
                        <h3>招聘信息</h3>
                        <div class="news_list">
                                <!--{loop $new_zhaopin_threadlist $zhaopinthread}-->
                                <!--{if $zhaopinthread[replies]}-->
                                        <li><a href="viewthread.php?tid=$zhaopinthread[tid]" $zhaopinthread['highlight']>$zhaopinthread[view_subject]</a></li>
                                        <!--{else}-->
                                        <li><a href="viewthread.php?tid=$zhaopinthread[tid]" $zhaopinthread['highlight']>$zhaopinthread[view_subject]</a></li>
                                        <!--{/if}-->
                                <!--{/loop}-->
                        </div>
                </div>
                </div>

这是模版discuz.htm里的部份代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-6 02:28 , Processed in 0.122961 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表