西瓜同城新PC端插件配置详细教程!

一、如何购买:

DZ应用中心购买地址:https://addon.dismall.com/plugins/lianpen_xgpc.html

联系拿优惠劵,微信号:100931818(QQ同号)

二、安装教程:

1、本插件需要搭配西瓜同城分类信息插件使用

2、安装后启用,如果把西瓜同城设置成首页的,在DZ后台界面,导航处把西瓜同城设置成首页:plugin.php?id=xigua_hb

3、然后配置伪静态规则:

# ===== 根域名:内部转发到新PC首页(URL 保持域名根) =====
location = / {
    rewrite ^ /plugin.php?id=lianpen_xgpc last;
}

# ===== 西瓜同城新PC电脑端伪静态 =====
rewrite ^/info\.html$ /plugin.php?id=lianpen_xgpc last;
rewrite ^/info/city\.html$ /plugin.php?id=lianpen_xgpc&ac=city last;
rewrite ^/info/([0-9]+)\.html$ /plugin.php?id=lianpen_xgpc&ac=view&pubid=$1 last;
rewrite ^/info/([a-z]+[a-z0-9]*)\.html$ /plugin.php?id=lianpen_xgpc&stname=$1 last;
rewrite ^/info/list-([0-9]+)-([0-9]+)\.html$ /plugin.php?id=lianpen_xgpc&ac=list&catid=$1&page=$2 last;
rewrite ^/info/([a-z0-9]+)/list-([0-9]+)-([0-9]+)\.html$ /plugin.php?id=lianpen_xgpc&stname=$1&ac=list&catid=$2&page=$3 last;
rewrite ^/info/uid-([0-9]+)-([0-9]+)\.html$ /plugin.php?id=lianpen_xgpc&ac=member&uid=$1&page=$2 last;
rewrite ^/info/uid-([0-9]+)\.html$ /plugin.php?id=lianpen_xgpc&ac=member&uid=$1 last;

# ===== 搜索页 =====
rewrite ^/info/search\.html$ /plugin.php?id=lianpen_xgpc&ac=search last;
rewrite ^/info/([a-z0-9]+)/search\.html$ /plugin.php?id=lianpen_xgpc&stname=$1&ac=search last;

# ===== 商圈伪静态 =====
rewrite ^/shop\.html$ /plugin.php?id=lianpen_xgpc&ac=shopindex last;
rewrite ^/shop/(\d+)\.html$ /plugin.php?id=lianpen_xgpc&ac=shopview&shid=$1 last;
rewrite ^/shop/([a-z]+[a-z0-9]*)\.html$ /plugin.php?id=lianpen_xgpc&ac=shopindex&stname=$1 last;
rewrite ^/shop/([a-z0-9]+)/list-(\d+)-(\d+)\.html$ /plugin.php?id=lianpen_xgpc&ac=shoplist&stname=$1&hangye=$2&page=$3 last;
rewrite ^/shop/list-(\d+)-(\d+)\.html$ /plugin.php?id=lianpen_xgpc&ac=shoplist&hangye=$1&page=$2 last;

# ===== 帮助中心伪静态 =====
rewrite ^/help\.html$ /plugin.php?id=lianpen_xgpc&ac=help last;
rewrite ^/help/(\d+)\.html$ /plugin.php?id=lianpen_xgpc&ac=helpview&helpid=$1 last;

4、如果要电脑端访问西瓜的链接能跳转到对应新电脑端PC页面修改办法:

找到根目录的plugin.php文件,搜索下列代码:

include DISCUZ_ROOT.$modfile;

在上面代码的上方增加下列代码:

// ===== 西瓜 PC 端接管:电脑访问西瓜链接跳转到新PC端 =====
@include DISCUZ_ROOT . './source/plugin/lianpen_xgpc/common.php';
if (function_exists('xgpc_hb_redirect')) { xgpc_hb_redirect(); }

20260826121910286-QQ20260826-121900

5、后台可配置网站主题色,SEO等相关设置

20260826003753428-1

5、分站别名会自动生成对应城市的拼音,一般不建议修改,如下图位置:

20260826003830150-3

三、SEO配置解释:

1、后台可设置各个页面的SEO相关配置

20260826003753358-2

2、变量解释:

{sitename}: 网站名称
{stname}: 分站名称(总站时=网站名,调用的西瓜分站插件的筛选页站点名)
{username}: 用户名
{category}:分类名称(详情页挂子分类时显示”主分类,子分类”)
{title}:信息标题/商家名称(截取前40字,自动去除换行标签,适合用在标题 title)
{description}: 信息摘要(截取前80字,自动去除换行标签,适合用在描述 description)
{hangye}:商家行业名(商家 SEO 专用)
{addr}:商家地址(商家详情页 SEO 专用)
{intro}:商家介绍·短版(截取前40字,自动去除换行标签,适合用在标题 title)
{shopintro}:商家介绍·长版(截取前80字,自动去除换行标签,适合用在描述 description)

四、插件对应链接:

1、分类信息首页:https://域名/plugin.php?id=lianpen_xgpc&ac=index

伪静态链接:https://域名/fenlei.html

2、分类列表页:https://域名/plugin.php?id=lianpen_xgpc&ac=list&catid=457(457是分类的ID)

伪静态链接:https://域名/fenlei/list-457-1.html

3、内容详情页:https://域名/plugin.php?id=lianpen_xgpc&ac=view&pubid=825(825是内容的ID)

伪静态链接:https://域名/fenlei/825.html

4、用户个人主页:https://域名/plugin.php?id=lianpen_xgpc&ac=member&uid=9816(9816是用户的的UID)

伪静态链接:https://域名/fenlei/uid-9816.html

5、分站城市选择页:https://域名/plugin.php?id=lianpen_xgpc&ac=city

伪静态链接: https://域名/fenlei/city.html

6、商圈首页:https://域名/plugin.php?id=lianpen_xgpc&ac=shopindex

伪静态链接:https://域名/shop.html

7、商圈列表页:https://域名/plugin.php?id=lianpen_xgpc&ac=shoplist&hangye=1(1是行业的ID)

伪静态链接:https://域名/shop/list-1-1.html

8、商圈详情页:https://域名/plugin.php?id=lianpen_xgpc&ac=shopview&shid=847(847是商家的ID)

伪静态链接:https://域名/shop/847.html

9、帮助中心首页:https://域名/plugin.php?id=lianpen_xgpc&ac=help

伪静态链接:https://域名/help.html

10、帮助中心详情页:https://域名/plugin.php?id=lianpen_xgpc&ac=helpview&helpid=7(7是帮助信息的ID)

伪静态链接:https://域名/help/7.html

请登录后发表评论

    没有回复内容