[宅技术]如何在emlog套用其他PHP网站

发布于 2017-04-11  5129 次阅读


0x001   前言

有一次无意间看到旭博客分享一个全能VIP视频播放源码,按道理这个源码已经泛滥,但是他的源码是镶嵌到网站上的,所以比较好奇,于是乎折腾之路又开始了.........


0x002   过程

首先你要了解你所用的模板自定义文件在哪里,我的是大前端4.5版本,路径为/content/templates/emlog_dux/page.php


然后把page.php下载到本地,进行解剖,改造。

旭博客给的源代码,他是镶嵌到FLY主题内的,每个主题是不一样的,所以我们要把里面的JS路径跟其他文件路径根据自己使用的主题路径进行更改。

<script src="/content/templates/FLY/xbktv/jquery.min.js" ></script>
  <script src="/content/templates/FLY/xbktv/bootstrap.min.js" ></script>
  <script src="/content/templates/FLY/xbktv/jquery-1.7.2.min.js" ></script>
  <script type="text/javascript">eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('b a(){0 6=1.2("9").4;0 5=1.2("3");0 3=1.2("3").c;0 8=5.e[3].4;0 7=1.2("f");7.d=8+6}',16,16,'var|document|getElementById|jk|value|jkurl|diz|cljurl|jkv|url|dihejk|function|selectedIndex|src|options|player'.split('|'),0,{}))</script>
<hr>
	<table class="table table-bordered">
	<tbody>
	   <div class="col-md-14 column">
    <div class="panel panel-default">
     <div id="kj" class="panel-body">
      <iframe src="/content/templates/FLY/vip_js/index.htm" id="player" width="100%" height="400px" allowtransparency="true" frameborder="0" scrolling="no"></iframe>
     </div>
    </div>
   </div>
		<tr>
   <div class="col-md-14 column">
    <form method="post" id="khname">
     <div class="input-group" style="width: 100%;">
      <span class="input-group-addon input-lg" style="width: 80px; ">选择接口</span>
      <select class="form-control input-lg" id="jk">
<option rel="nofollow" value="http://qtzr.net/s/?qt=">万能磁力链接解析</option> </select>
     </div>
     <br>
     <div class="input-group" style="width: 100%;">
      <span class="input-group-addon input-lg" style="width: 80px;">播放地址</span>
      <input class="form-control input-lg" type="search" placeholder="输入视频页面网址" id="url">
     </div>
     <br>
     <div>
      <button id="bf" type="button" class="btn btn-success btn-lg btn-block" onclick="dihejk()">Go</button>
     </div>
	 </br>
 </div>
    </form>
		</tr>
      </tbody>
	  <!--换行-->
          </table>

复制主题代码到自己主题page.php中

例如大前端系类,记着替换JS跟其他文件路径。大前端可以不用更改直接复制就可以使用。

<?php 
/**
 * 独立页面
 */
if(!defined('EMLOG_ROOT')) {exit('error!');} 
?>
<div class="single single-post postid- single-format-standard nav_fixed">
<section class="container"><div class="content-wrap"> <div class="content"> <header class="article-header"> <h1 class="article-title"><?php echo $log_title; ?></h1> </header> <article class="article-content">
<?php echo $log_content; ?>
 </article> 
 /**************************************************************以上为大前端样式******************************************************************************************
  <script src="/content/templates/emlog_dux/xbktv/jquery.min.js" ></script>
  <script src="/content/templates/emlog_dux/xbktv/bootstrap.min.js" ></script>
  <script src="/content/templates/emlog_dux/xbktv/jquery-1.7.2.min.js" ></script>
  <script type="text/javascript">eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('b a(){0 6=1.2("9").4;0 5=1.2("3");0 3=1.2("3").c;0 8=5.e[3].4;0 7=1.2("f");7.d=8+6}',16,16,'var|document|getElementById|jk|value|jkurl|diz|cljurl|jkv|url|dihejk|function|selectedIndex|src|options|player'.split('|'),0,{}))</script>
//JS加载
  
 / *主体代码开始
  <hr>
	<table class="table table-bordered">
	<tbody>
	   <div class="col-md-14 column">
    <div class="panel panel-default">
     <div id="kj" class="panel-body">
      <iframe src="/content/templates/emlog_dux/vip_js/index.htm" id="player" width="100%" height="400px" allowtransparency="true" frameborder="0" scrolling="no"></iframe>
     </div>
    </div>
   </div>
		<tr>
   <div class="col-md-14 column">
    <form method="post" id="khname">
     <div class="input-group" style="width: 100%;">
      <span class="input-group-addon input-lg" style="width: 80px; ">选择接口</span>
      <select class="form-control input-lg" id="jk">
<option rel="nofollow"  value="http://www.chepeijian.cn/jiexi/vip.php?url=">①号引擎系统【推荐】</option>

     </div>
     <br>
     <div class="input-group" style="width: 100%;">
      <span class="input-group-addon input-lg" style="width: 80px;">播放地址</span>
      <input class="form-control input-lg" type="search" placeholder="输入视频页面网址" id="url">
     </div>
     <br>
     <div>
      <button id="bf" type="button" class="btn btn-success btn-lg btn-block" onclick="dihejk()">Go</button>
     </div>
	 </br>
 </div>
    </form>
		</tr>
      </tbody>
	  <!--换行-->
          </table>
          
  / *主体代码结束
			
			/*大前端评论
			<div class="article_related"><?php doAction('log_related', $logData); ?></div>
			<div class="article_post_comment" id="comment-place">
				<?php blog_comments_post($logid,$ckname,$ckmail,$ckurl,$verifyCode,$allow_remark); ?>
			</div>
			<a name="comments"></a>
			<?php 
			if(isShowComment($comnum)) {
				echo '<h3 class="comment-header">网友评论<b>('.$comnum.')</b></h3>';
				echo '<div class="article_comment_list">';}
			?>
			<?php blog_comments($comments,$comnum); ?>
			<?php
			if(isShowComment($comnum)) {
				echo '</div>';}
			?>



</div> </div></div>
<?php
 include View::getView('side');
 include View::getView('footer');
?>

然后把其他需要的文件扔到主题文件夹中,新建页面查看一下效果。

点击下载其他文件VIP视频解析page源码

相同道理,把其他页面镶嵌到博客页面中,例如镶嵌个表白网生成页面,

源码网上一大堆,就不给下载链接了。

源代码

<?php 
if(!defined('EMLOG_ROOT')) {exit('error!');} //大前端源码
?>

<script src="https://www.zkjd.me/jy/jquery.js"></script>//首先加载页面需要的JS
<script src="https://www.zkjd.me/js/gundong.js"></script>//首先加载页面需要的JS
<script src="https://www.zkjd.me/js/height.js"></script>//首先加载页面需要的JS
<!-- 引入封装了failback的接口 initGeetest -->
<script src="https://static.geetest.com/static/tools/gt.js"></script>//首先加载页面需要的JS
<!-- Loading Bootstrap -->

<div class="single single-post postid- single-format-standard nav_fixed">//大前端源码
<section class="container"><div class="content-wrap"> <div class="content"> <header class="article-header"> <h1 class="article-title"><?php echo $log_title; ?></h1> </header> <article class="article-content">
<?php echo $log_content; ?>//大前端源码
 </article> //大前端源码
 
// 主体代码套入//
<?php
$url = 'love/ali/index.html';//读取源文件地址
$test = file_get_contents($url);//替换函数
$h1 =str_replace("小明",$_POST['yourname'],str_replace("小红",$_POST['yourlove'],str_replace("狮子座",$_POST['xing'],str_replace("情人节自动生成表白程序",$_POST['title'],str_replace("http://sc1.111ttt.com/2015/1/10/16/103162208210.mp3",$_POST['music'],$test)))));
?>//给需要替换的文字加上标签
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="user-scalable=no, width=500"> 
<div class="message shadow tran">
  </div>
  <br />
<center><a href="https://www.zkjd.me" target="_blank"><img width="50%" height="50%" src="img/love.jpg"></a></center><br />
<form action = "?post=92#id1" method = "post">//表单生成网页
  <center>网页标题:<input type="text" placeholder="" class="form-control" name="title" /></center>
  <br />
  <center>网页背景音乐(需加http://):<input type="text" placeholder="" class="form-control" name="music"/></center>
  <br />
  <center>你的名字:<input type="text" placeholder="" class="form-control" name="yourname" /></center>
  <br />
  <center>你"女盆友"的名字:<input type="text" placeholder="" class="form-control" name="yourlove"/></center>
  <br />
  <center>你"女盆友"喜欢的星座:<input type="text" placeholder="" class="form-control" name="xing"/></center>
  <br />
<center>自定义网址(不支持中文):<?php echo $_SERVER['HTTP_HOST'].'/love/' ?><input type="text" name="www" style="width:100px";/>.html</center>
  <div class="form-group has-success" id=id1>
    <?php
    $_POST['www']=trim($_POST['www']);
    if(isset($_POST['submit'])){
      echo '<br />';
      if($_POST['www']=='index'){
        echo '<center>小伙子,你的行为很像小学生呐</center>';
      }else{
      if($_POST['www']!=''){
        $diy=$_POST['www'].'.html';
        file_put_contents($diy,$h1);
        echo '<center><a href="'.$diy.'" target="_blank"><input class="form-control" type="button" value="点击预览"/></a></center>';
      }else{
        $a=(microtime(true)*10000).'.html';
        file_put_contents($a,$h1);
        echo '<center><a href="'.$a.'" target="_blank"><input class="form-control" type="button" value="点击预览"/></a></center>';
      }
    }
  }
    ?>
  </div>
  <style>
  #float-captcha {
      width: 268px;
      margin: 0 auto;
  }
  </style>
  <div id="float-captcha"></div>
  <center><p id="wait" class="show">正在加载验证码......</p></center>
  <center><br /><p id="notice" class="hide">请先拖动验证码到相应位置</p></center>
  <center><a href="http://t.2ii.me/template/love/index.html" target="_blank"><input type="button" class="btn btn-embossed btn-primary" value="查看演示"/></a>&nbsp;&nbsp;
  <input type="submit" class="btn btn-embossed btn-primary" name="submit" id="float-submit" value="生成网页" /></center>
</form>
<script>
    var handlerEmbed = function (captchaObj) {
        $("#float-submit").click(function (e) {
            var validate = captchaObj.getValidate();
            if (!validate) {
                $("#notice")[0].className = "show";
                setTimeout(function () {
                    $("#notice")[0].className = "hide";
                }, 2000);
                e.preventDefault();
            }
        });
        // 将验证码加到id为captcha的元素里
        captchaObj.appendTo("#float-captcha");
        captchaObj.onReady(function () {
            $("#wait")[0].className = "hide";
        });
        // 更多接口参考:http://www.geetest.com/install/sections/idx-client-sdk.html
    };
    $.ajax({
        // 获取id,challenge,success(是否启用failback)
        url: "jy/web/StartCaptchaServlet.php?t=" + (new Date()).getTime(), // 加随机数防止缓存
        type: "get",
        dataType: "json",
        success: function (data) {
            // 使用initGeetest接口
            // 参数1:配置参数
            // 参数2:回调,回调的第一个参数验证码对象,之后可以使用它做appendTo之类的事件
            initGeetest({
                gt: data.gt,
                challenge: data.challenge,
                product: "float", // 产品形式,包括:float,embed,popup。注意只对PC版验证码有效
                offline: !data.success // 表示用户后台检测极验服务器是否宕机,一般不需要关注
            }, handlerEmbed);
        }
    });
</script>

//主体代码结束//

评论开始//
	<div class="article_related"><?php doAction('log_related', $logData); ?></div>
			<div class="article_post_comment" id="comment-place">
				<?php blog_comments_post($logid,$ckname,$ckmail,$ckurl,$verifyCode,$allow_remark); ?>
			</div>
			<a name="comments"></a>
			<?php 
			if(isShowComment($comnum)) {
				echo '<h3 class="comment-header">网友评论<b>('.$comnum.')</b></h3>';
				echo '<div class="article_comment_list">';}
			?>
			<?php blog_comments($comments,$comnum); ?>
			<?php
			if(isShowComment($comnum)) {
				echo '</div>';}
			?>



</div> </div></div>
<?php
 include View::getView('side');
 include View::getView('footer');
?>

然后把页面需要的文件传输到该到的位置就好啦。。。。

写到这里我都不知道我在说什么了,反正就是这样啦,,,,不说了,睡觉!!!!

郑州90后一名计算机爱好者,希望能通过网络结交更多朋友!
最后更新于 2017-04-11