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

 找回密码
 立即注册
搜索

[已答复] 如何能取得当前资讯的栏目名称及连接了

[复制链接]
 楼主| yayapi 发表于 2009-8-24 17:52:43 | 显示全部楼层
能帮的 都是人心人了
我是新手 有的不懂 哈哈 谢谢
回复

使用道具 举报

 楼主| yayapi 发表于 2009-8-25 09:03:53 | 显示全部楼层
自己顶顶 更健康
回复

使用道具 举报

lidq.jingwu 发表于 2009-8-25 09:07:14 | 显示全部楼层
你在后台没有设置变量名吧,再生成一次。
回复

使用道具 举报

 楼主| yayapi 发表于 2009-8-25 09:17:53 | 显示全部楼层
<!--{block name="spacenews" parameter="order/i.dateline/limit/0,8/cachetime/900/subjectlen/48/showcategory/1/cachename/ct/tpl/data"}-->
<!--{loop $_SBLOCK['ct'] $value}-->
<a href="$value[url]" target="_self">$value[name]</a>
<a href="$value[url]">$value[subject]</a>
<!--{/loop}-->

这样也不对 您帮我修正下,谢谢!!
回复

使用道具 举报

lidq.jingwu 发表于 2009-8-25 09:23:31 | 显示全部楼层
<!--{block name="spacenews" parameter="order/i.dateline/limit/0,8/cachetime/900/subjectlen/48/showcategory/1/cachename/ct/tpl/data"}-->
<!--{eval print_r($_SBLOCK['ct']);}-->
看打印出来是什么数据
回复

使用道具 举报

 楼主| yayapi 发表于 2009-8-25 09:29:43 | 显示全部楼层
Array
(
    [1] => Array
        (
            [itemid] => 1
            [catid] => 17
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 关联交易审计案例及对策
            [dateline] => 1248756151
            [lastpost] => 1248756151
            [viewnum] => 13
            [replynum] => 0
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 0
            [allowreply] => 1
            [hash] => 2b18cfab5e1ee597
            [folder] => 1
            [haveattach] => 0
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 0
            [subjectall] => 关联交易审计案例及对策
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-1
            [catname] => Array
                (
                    [catid] => 17
                    [upid] => 13
                    [name] => 报考指南
                    [subcatid] => 17
                )

        )

    [2] => Array
        (
            [itemid] => 2
            [catid] => 17
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 新工会会计制度特点
            [dateline] => 1248758226
            [lastpost] => 1250869011
            [viewnum] => 17
            [replynum] => 2
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 0
            [allowreply] => 1
            [hash] => 075077f2039c16be
            [folder] => 1
            [haveattach] => 0
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 0
            [subjectall] => 新工会会计制度特点
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-2
            [catname] => Array
                (
                    [catid] => 17
                    [upid] => 13
                    [name] => 报考指南
                    [subcatid] => 17
                )

        )

    [3] => Array
        (
            [itemid] => 3
            [catid] => 16
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 备考CPA的五大误区
            [dateline] => 1250000692
            [lastpost] => 1250000692
            [viewnum] => 8
            [replynum] => 0
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 0
            [allowreply] => 1
            [hash] => 4da330f52dfd4f8a
            [folder] => 1
            [haveattach] => 0
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 0
            [subjectall] => 备考CPA的五大误区
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-3
            [catname] => Array
                (
                    [catid] => 16
                    [upid] => 13
                    [name] => 考试动态
                    [subcatid] => 16
                )

        )

    [4] => Array
        (
            [itemid] => 4
            [catid] => 18
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 备考2009年初级会计职称考试的考友们
            [dateline] => 1250000858
            [lastpost] => 1250000858
            [viewnum] => 5
            [replynum] => 0
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 0
            [allowreply] => 1
            [hash] => accae745aa9ee883
            [folder] => 1
            [haveattach] => 0
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 0
            [subjectall] => 备考2009年初级会计职称考试的考友们
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-4
            [catname] => Array
                (
                    [catid] => 18
                    [upid] => 13
                    [name] => 复习指导
                    [subcatid] => 18
                )

        )

    [5] => Array
        (
            [itemid] => 5
            [catid] => 20
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 确认递延所得税负债
            [dateline] => 1250000891
            [lastpost] => 1250089362
            [viewnum] => 8
            [replynum] => 3
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 0
            [allowreply] => 1
            [hash] => ba107f11d32ae60a
            [folder] => 1
            [haveattach] => 0
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 0
            [subjectall] => 确认递延所得税负债
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-5
            [catname] => Array
                (
                    [catid] => 20
                    [upid] => 13
                    [name] => 考试交流
                    [subcatid] => 20
                )

        )

    [6] => Array
        (
            [itemid] => 6
            [catid] => 17
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 房地产开发企业代收费用的纳税分析
            [dateline] => 1250864379
            [lastpost] => 1250864379
            [viewnum] => 4
            [replynum] => 0
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 2
            [allowreply] => 1
            [hash] => 1fd7fad98e5fbdb5
            [folder] => 1
            [haveattach] => 0
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 0
            [subjectall] => 房地产开发企业代收费用的纳税分析
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-6
            [catname] => Array
                (
                    [catid] => 17
                    [upid] => 13
                    [name] => 报考指南
                    [subcatid] => 17
                )

        )

    [7] => Array
        (
            [itemid] => 7
            [catid] => 21
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 涉嫌偷税社团将被取消公益性捐赠税前扣除资格
            [dateline] => 1250960480
            [lastpost] => 1250960480
            [viewnum] => 3
            [replynum] => 0
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 1
            [allowreply] => 1
            [hash] => d394917e0aab32a1
            [folder] => 1
            [haveattach] => 1
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 1
            [subjectall] => 涉嫌偷税社团将被取消公益性捐赠税前扣除资格
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-7
            [catname] => Array
                (
                    [catid] => 21
                    [upid] => 11
                    [name] => 考试动态
                    [subcatid] => 21
                )

        )

    [8] => Array
        (
            [itemid] => 8
            [catid] => 18
            [uid] => 1
            [tid] => 0
            [username] => eftax
            [itemtypeid] => 0
            [type] => news
            [subtype] =>
            [subject] => 国土资源部下半年将严查囤地未建现象
            [dateline] => 1251097841
            [lastpost] => 1251097841
            [viewnum] => 1
            [replynum] => 0
            [goodrate] => 0
            [badrate] => 0
            [digest] => 0
            [top] => 1
            [allowreply] => 1
            [hash] => 91cc2e345508f658
            [folder] => 1
            [haveattach] => 0
            [grade] => 0
            [gid] => 0
            [gdigest] => 0
            [password] =>
            [styletitle] =>
            [picid] => 0
            [subjectall] => 国土资源部下半年将严查囤地未建现象
             => [url]http://127.0.0.1/sup/?action-viewnews-itemid-8
            [catname] => Array
                (
                    [catid] => 18
                    [upid] => 13
                    [name] => 复习指导
                    [subcatid] => 18
                )

        )
这样的!
回复

使用道具 举报

 楼主| yayapi 发表于 2009-8-25 11:28:30 | 显示全部楼层
还没搞定 继续求助 哈哈
回复

使用道具 举报

lidq.jingwu 发表于 2009-8-25 12:05:54 | 显示全部楼层
$_SBLOCK['ct'][key值][catname][name]里面存放的就是分类名啊。
回复

使用道具 举报

 楼主| yayapi 发表于 2009-8-25 14:16:56 | 显示全部楼层
我写的如下:

<!--{block name="spacenews" parameter="order/i.dateline/limit/0,8/cachetime/900/subjectlen/26/showcategory/1/cachename/ct/tpl/data"}-->
<!--{loop $_SBLOCK['ct'] $ckey $value}--><li><span><a href="#action/category/catid/$cat[catid]#" target="_self"> $_SBLOCK['ct'][$ckey][catname][name] </a>
</span><a href="$value[url]">$value[subject]</a></li>
<!--{/loop}-->

可以获取到栏目名称与标题了.

但是栏目链接不能出现,只有添加 $cat 才行,但是 <!--{loop $_SBLOCK['ct'] $ckey $value}只能存在两个,怎么才能解决阿.
回复

使用道具 举报

lidq.jingwu 发表于 2009-8-25 14:26:53 | 显示全部楼层
这样调用数据只能调出这条资讯自已的URL,调出栏目的URL,要一个个的写才行。
你想要的这种一起调用出来,是不可能做到的。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-13 06:15 , Processed in 0.077514 second(s), 12 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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