解决双子星新版后台无法分类搜索

因有个使用这套玩意的兄弟一直解决不了这个问题,收了个小红包顺便帮他看看了

问题描述

双子星视频点播系统下的点击查找

出现的搜索结果,电影,电视剧,等结果都是同一个界面

问题分析

其实出现这个是因为搭配的后台源码跟APK不搭配。

抓包分析跟结合源码可以知道,结果分类参数是findtype

修改源码

新增79,80行代码,因为原代码中并没有对这个参数的判断,so easy…

意思是:如果findtype定义过,就把findtpe赋值给type,从而查询对应的分类数据库。否者永远查询到的结果是电影的。

  1. <?php
  2. header("Content-Type: text/html; charset=utf-8");
  3. include_once 'admindir.php';
  4. $a = new Adminer();
  5. include_once $a->ad . 'common.php';
  6.  
  7. include_once $a->ad . 'memcache.php';
  8. $mem = new GMemCache();
  9. $timeout = 1;
  10. if(get_set_xml_file($addir . "safe2.xml") == 1 && $mem->step1(__FILE__,$timeout) == false)
  11. {
  12. //echo "reload";
  13. exit;
  14. }
  15.  
  16. $sql = new DbSql();
  17.  
  18. $version = 88;
  19. $key = "";
  20. if(isset($_GET["version"]) && isset($_GET["key"]))
  21. {
  22. $version = intval($_GET["version"]);
  23. $key = $sql->str_safe($_GET["key"]);
  24. }
  25. check_key_out($version,$key,$a->ad);
  26.  
  27. set_zone();
  28.  
  29. $type = 0;
  30.  
  31. $page = 0;
  32.  
  33. $iarea = 0;
  34. $iyear = 0;
  35. $itype = "";
  36. $sort = 0;
  37. $find = "";
  38.  
  39. if(isset($_GET["page"]))
  40. $page = intval($_GET["page"]);
  41.  
  42. if(isset($_GET["iarea"]))
  43. $iarea = intval($_GET["iarea"]);
  44.  
  45. if(isset($_GET["iyear"]))
  46. $iyear = intval($_GET["iyear"]);
  47.  
  48. if(isset($_GET["itype"]))
  49. $itype = $_GET["itype"];
  50.  
  51. if(isset($_GET["sort"]))
  52. $sort = intval($_GET["sort"]);
  53.  
  54. if(isset($_GET["find"]))
  55. $find = $_GET["find"];
  56.  
  57. $size = 10;
  58. $offset = $page*$size;
  59.  
  60. if(isset($_GET["type"]))
  61. $type = intval($_GET["type"]);
  62.  
  63. $sql = new DbSql();
  64. $sql->connect_database_default();
  65. $mydb = $sql->get_database();
  66. $sql->create_database($mydb);
  67.  
  68.  
  69. $mytable = "vod_name_table";
  70. $sql->create_table($mydb, $mytable, "id smallint,name text, needps int, password text, num int, total int");
  71. $types_rows = $sql->fetch_datas($mydb, $mytable);
  72.  
  73. $mytable = "vod_type_table_".$type;
  74. $sql->create_table($mydb, $mytable, "value longtext, id smallint");
  75. $item_years = $sql->query_data($mydb, $mytable, "id", 1 ,"value");
  76. $item_year = explode("|", $item_years);
  77.  
  78.  
  79. if(isset($_GET["findtype"]))
  80. $type = intval($_GET["findtype"]);
  81.  
  82. $mytable = "vod_table_".$type;
  83. $sql->create_table($mydb, $mytable, "name text, image text,
  84. url text, area text, year text, type text, intro1 longtext, intro2 longtext,
  85. intro3 longtext, intro4 longtext, id int, clickrate int, recommend tinyint, chage float, updatetime int, firstletter text");
  86.  
  87. //$rows = $sql->fetch_datas_limit_desc($mydb, $mytable, $offset, $size, "id");
  88. $rows = array();
  89.  
  90. if(isset($_GET["hot"]))
  91. {
  92. $rows = array();
  93. for($ii=0; $ii<3; $ii++)
  94. {
  95. $needps = 0;
  96. for($kk=0; $kk<count($types_rows); $kk++)
  97. {
  98. if(intval($types_rows[$kk][0]) == $ii)
  99. {
  100. $needps = intval($types_rows[$kk][2]);
  101. break;
  102. }
  103. }
  104.  
  105. if($needps == 0)
  106. {
  107. $mytable = "vod_table_".$ii;
  108. $sql->create_table($mydb, $mytable, "name text, image text,
  109. url text, area text, year text, type text, intro1 longtext, intro2 longtext,
  110. intro3 longtext, intro4 longtext, id int, clickrate int, recommend tinyint, chage float, updatetime int, firstletter text");
  111.  
  112. $value =strtolower($find);
  113. $rows_tmp = $sql->fetch_datas_limit_desc($mydb, $mytable,0,10,"clickrate");
  114. $rows = array_merge_recursive($rows,$rows_tmp);
  115. }
  116. }
  117. }
  118. else if(isset($_GET["find"]))
  119. {
  120. $rows = array();
  121. for($ii=0; $ii<3; $ii++)
  122. {
  123. $needps = 0;
  124. for($kk=0; $kk<count($types_rows); $kk++)
  125. {
  126. if(intval($types_rows[$kk][0]) == $ii)
  127. {
  128. $needps = intval($types_rows[$kk][2]);
  129. break;
  130. }
  131. }
  132.  
  133. if($needps == 0)
  134. {
  135. $mytable = "vod_table_".$ii;
  136. $sql->create_table($mydb, $mytable, "name text, image text,
  137. url text, area text, year text, type text, intro1 longtext, intro2 longtext,
  138. intro3 longtext, intro4 longtext, id int, clickrate int, recommend tinyint, chage float, updatetime int, firstletter text");
  139.  
  140. $value =strtolower($find);
  141. $rows_tmp = $sql->fetch_datas_where_like_like_2($mydb, $mytable, "firstletter", $value, "name", $value);
  142. $rows = array_merge_recursive($rows,$rows_tmp);
  143. }
  144. }
  145. }
  146. else if(isset($_GET["iarea"]) || isset($_GET["iyear"]) || isset($_GET["itype"]))
  147. {
  148. $cmd = "SELECT * FROM " . $mytable;
  149. $cmd_v = 0;
  150.  
  151. if((isset($_GET["iarea"]) && $iarea > 0) || (isset($_GET["iyear"]) && $iyear > 0) || (isset($_GET["itype"]) && strcmp($itype,"0") != 0))
  152. $cmd = $cmd . " WHERE";
  153.  
  154. if(isset($_GET["iarea"]) && $iarea > 0)
  155. {
  156. $cmd_v++;
  157. $cmd = $cmd . " area='" . $iarea . "'";
  158. }
  159.  
  160. if(isset($_GET["iyear"]) && $iyear > 0)
  161. {
  162. if($cmd_v > 0)
  163. $cmd = $cmd . " AND";
  164. $cmd_v++;
  165. $cmd = $cmd . " year='" . $iyear . "'";
  166. }
  167.  
  168. if(isset($_GET["itype"]) && strcmp($itype,"0") != 0)
  169. {
  170. if($cmd_v > 0)
  171. $cmd = $cmd . " AND";
  172. $cmd_v++;
  173. $cmd = $cmd . " type like '%" . sprintf("%03d", intval($itype)) . "%'";
  174. }
  175.  
  176. $cmd = $cmd . " ORDER BY " . "id" . " DESC" . " LIMIT " . $offset . "," . $size;
  177. //echo $cmd;
  178. $rows = $sql->fetch_datas_limit_desc_cmd($mydb, $mytable, $cmd);
  179. }
  180. else
  181. {
  182. if($sort == 1)
  183. {
  184. $rows = $sql->fetch_datas_limit_desc($mydb, $mytable, $offset, $size, "clickrate");
  185. }
  186. else
  187. {
  188. $rows = $sql->fetch_datas_limit_desc_2($mydb, $mytable, $offset, $size, "year","id");
  189. }
  190. }
  191. $sql->disconnect_database();
  192.  
  193. $doc = new DOMDocument('1.0', 'utf-8'); // ÉùÃ÷°æ±¾ºÍ±àÂë
  194. $doc->formatOutput = true;
  195. $r = $doc->createElement("root");
  196. $doc->appendChild($r);
  197.  
  198. if($rows != null)
  199. {
  200. foreach($rows as $row)
  201. {
  202.  
  203. /*
  204. if(isset($_GET["iarea"]) && check_area($row,$iarea) == false)
  205. continue;
  206.  
  207. if(isset($_GET["iyear"]) && check_year($row,$iyear) == false)
  208. continue;
  209. */
  210.  
  211.  
  212. //if(isset($_GET["itype"]) && check_type($row,$itype) == false)
  213. // continue;
  214.  
  215. $b = $doc->createElement("item");
  216.  
  217. $name = $doc->createElement("name");
  218. $name->appendChild($doc->createTextNode($row[0]));
  219. $b->appendChild($name);
  220.  
  221. $image = $doc->createElement("image");
  222. $image->appendChild($doc->createTextNode($row[1]));
  223. $b->appendChild($image);
  224.  
  225. $url = $doc->createElement("url");
  226. $url->appendChild($doc->createTextNode($row[2]));
  227. $b->appendChild($url);
  228.  
  229. $area = $doc->createElement("area");
  230. $area->appendChild($doc->createTextNode($row[3]));
  231. $b->appendChild($area);
  232.  
  233. if(intval($row[4]) < 1000)
  234. {
  235. $year = $doc->createElement("year");
  236. $year->appendChild($doc->createTextNode($row[4]));
  237. $b->appendChild($year);
  238.  
  239. }
  240. else
  241. {
  242. $item_index = 1;
  243. if(count($item_year) > 0)
  244. {
  245. //foreach($item_year as $year)
  246. for($ll=0; $ll<count($item_year); $ll++)
  247. {
  248. if($item_year[$ll] == $row[4])
  249. {
  250. $item_index = $ll+1;
  251. break;
  252. }
  253. }
  254. }
  255.  
  256. $year = $doc->createElement("year");
  257. $year->appendChild($doc->createTextNode($item_index));
  258. $b->appendChild($year);
  259. }
  260.  
  261. $type = $doc->createElement("type");
  262. $type->appendChild($doc->createTextNode($row[5]));
  263. $b->appendChild($type);
  264.  
  265. $intro1 = $doc->createElement("intro1");
  266. $intro1->appendChild($doc->createTextNode($row[6]));
  267. $b->appendChild($intro1);
  268.  
  269. $intro2 = $doc->createElement("intro2");
  270. $intro2->appendChild($doc->createTextNode($row[7]));
  271. $b->appendChild($intro2);
  272.  
  273. $intro3 = $doc->createElement("intro3");
  274. $intro3->appendChild($doc->createTextNode($row[8]));
  275. $b->appendChild($intro3);
  276.  
  277. $intro4 = $doc->createElement("intro4");
  278. $intro4->appendChild($doc->createTextNode($row[9]));
  279. $b->appendChild($intro4);
  280.  
  281. $id = $doc->createElement("id");
  282. $id->appendChild($doc->createTextNode($row[10]));
  283. $b->appendChild($id);
  284.  
  285. $clickrate = $doc->createElement("clickrate");
  286. $clickrate->appendChild($doc->createTextNode($row[11]));
  287. $b->appendChild($clickrate);
  288.  
  289. $recommend = $doc->createElement("recommend");
  290. $recommend->appendChild($doc->createTextNode($row[12]));
  291. $b->appendChild($recommend);
  292.  
  293. $chage = $doc->createElement("chage");
  294. $chage->appendChild($doc->createTextNode($row[13]));
  295. $b->appendChild($chage);
  296.  
  297. $updatetime = $doc->createElement("updatetime");
  298. $updatetime->appendChild($doc->createTextNode($row[14]));
  299. $b->appendChild($updatetime);
  300.  
  301. $r->appendChild($b);
  302.  
  303. }
  304. }
  305. echo $doc->saveXML();
  306.  
  307. ?>
  308.  
  309. <?php
  310. function check_area($row,$area)
  311. {
  312. if($area == 0)
  313. return true;
  314.  
  315. if($row[3] == $area)
  316. return true;
  317. else
  318. return false;
  319. }
  320.  
  321. function check_year($row,$year)
  322. {
  323. if($year == 0)
  324. return true;
  325.  
  326. if($row[4] == $year)
  327. return true;
  328. else
  329. return false;
  330. }
  331.  
  332. function check_type($row,$type)
  333. {
  334. if(strlen($type) <= 0)
  335. return true;
  336.  
  337. if(strcmp($type,"0") == 0)
  338. return true;
  339.  
  340. $rows = explode("|",$row[5]);
  341.  
  342. for($ii=0; $ii<count($rows); $ii++)
  343. {
  344. if(strcmp($type,$rows[$ii]) == 0)
  345. return true;
  346. }
  347.  
  348. return false;
  349. }
  350. ?>
  1. hswgq说道:

    双子星首拼不能搜索怎样解决?

  2. Stephen说道:

    您好,请问是改哪个文件呀?能否透露一下?

  3. QQ :1193015710说道:

    ^_^我已经解决了

  4. 1193015710说道:

    麻烦这个怎么修改。谢谢!我QQ :1193015710

  5. 1193015710说道:

    麻烦这个怎么修改。谢谢!

    1. 隐士说道:

      文章已经写的很明白了

      1. 1193015710说道:

        麻烦这个怎么修改。谢谢!我QQ :1193015710

  6. 鲤鱼泡泡说道:

    能私下分享下这个双子星壳和后台文件吗?可以请发邮箱里,谢谢!

    1. 隐士说道:

      这出于职业操守不方便发,也答应过人。就算不用我不会公布。

发表评论

邮箱地址不会被公开。 必填项已用*标注