创意电子

标题: Discuz 修改网站首页为插件或别的链接为首页的方法 [打印本页]

作者: 创意电子    时间: 2022-7-21 19:55
标题: Discuz 修改网站首页为插件或别的链接为首页的方法
一、电脑版的很简单,论坛有这个功能,在论坛后台界面导航实现,如图:
资源名称: 
下载次数:0  文件大小:  记录
购买VIP 充值创意币 运营教程 免费赚创意币 
安全检测,请放心下载

二、手机版的需要修改index,也很简单,可以用以下方法实现,如图:
资源名称: 
下载次数:0  文件大小:  记录
购买VIP 充值创意币 运营教程 免费赚创意币 
安全检测,请放心下载


修改网站根目录下的index.php文件,直接在<?php下面的/*注释*/下面(如上图)第一行添加以下代码:


注意:以下红色代码部分为要访问的首页链接,示例的链接是积分钱包首页,可以用手机访问,看看效果!

也就是说以下红色链接换成你的链接!


有时发现不能访问插件首页,而是强制跳转到论坛页,可以看教程
  1. if(it618_is_mobile()){ //手机访问时跳转
  2.         header("location:你想设置的插件链接");
  3.         exit;
  4. }

  5. function it618_is_mobile(){
  6.         $user_agent = $_SERVER['HTTP_USER_AGENT'];
  7.         $mobile_agents = Array("240x320","acer","acoon","acs-","abacho","ahong","airness","alcatel","amoi","android","anywhereyougo.com","applewebkit/525","applewebkit/532","asus","audio","au-mic","avantogo","becker","benq","bilbo","bird","blackberry","blazer","bleu","cdm-","compal","coolpad","danger","dbtel","dopod","elaine","eric","etouch","fly ","fly_","fly-","go.web","goodaccess","gradiente","grundig","haier","hedy","hitachi","htc","huawei","hutchison","inno","ipad","ipaq","ipod","jbrowser","kddi","kgt","kwc","lenovo","lg ","lg2","lg3","lg4","lg5","lg7","lg8","lg9","lg-","lge-","lge9","longcos","maemo","mercator","meridian","micromax","midp","mini","mitsu","mmm","mmp","mobi","mot-","moto","nec-","netfront","newgen","nexian","nf-browser","nintendo","nitro","nokia","nook","novarra","obigo","palm","panasonic","pantech","philips","phone","pg-","playstation","pocket","pt-","qc-","qtek","rover","sagem","sama","samu","sanyo","samsung","sch-","scooter","sec-","sendo","sgh-","sharp","siemens","sie-","softbank","sony","spice","sprint","spv","symbian","tablet","talkabout","tcl-","teleca","telit","tianyu","tim-","toshiba","tsm","up.browser","utec","utstar","verykool","virgin","vk-","voda","voxtel","vx","wap","wellco","wig browser","wii","windows ce","wireless","xda","xde","zte");
  8.         $is_mobile = false;
  9.         foreach ($mobile_agents as $device) {
  10.         if (stristr($user_agent, $device)) {
  11.         $is_mobile = true;
  12.         break;
  13.         }
  14.         }
  15.         return $is_mobile;
  16. }
复制代码






欢迎光临 创意电子 (https://wxcydz.cc/) Powered by Discuz! X3.4