首页 期权学习期权知识正文

dtcms一篇文章多个链接解决方法

xiaojiucai 期权知识 2020-08-18 505 0

dtcms一个文章有3个链接,怎么解决:

关于dtcms一篇文章多个连接解决方案如下

int id = DTRequest.GetQueryInt("id");

            int category_id = DTRequest.GetQueryInt("category_id");

            if (category_id != 0 || id != 0)

            {

                int index_ = requestPath.IndexOf('_');

                string channel = requestPath.Substring(0, index_);

                channel = channel.TrimStart('/');

                int channelId = 0;

                if (category_id != 0)

                {

                    if (new BLL.article_category().Exists(category_id))

                    { channelId = new BLL.article_category().GetModel(category_id).channel_id; }

                    else

                    {

                        HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode(config.webclosereason)));

                        return new Model.channel_site();

                    }

                }

                else

                {

                     if (new BLL.article().Exists(id))

                     { channelId = new BLL.article().GetModel(id).channel_id; }

                     else

                     {

                         HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode(config.webclosereason)));

                         return new Model.channel_site();

                     }

                }

                string channelName = new BLL.channel().GetModel(channelId).name;

                if (channelName != channel)

                {

                    HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode(config.webclosereason)));

                     return new Model.channel_site();

                }

            }

原文链接:https://www.qiquanji.com/post/8791.html

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

微信扫码关注

更新实时通知

版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。

评论