Esempio n. 1
0
 public function content_public318search()
 {
     $qs = trim($_GET['qs']);
     $r = '';
     if ($qs == '') {
         $r .= "請輸入搜尋字(以下為隨機挑選)";
         $public318_ids = [10478, 11857, 11861, 11897, 11902, 11914, 11933, 11940, 11941, 11956, 11960, 11962, 12377, 12378, 12382, 12395, 12578, 12663, 12669, 12681, 12684, 13035, 13049, 13050, 13051, 13064, 13065, 13066, 13067, 13070, 13076, 13077, 13078, 13100, 13121, 13122, 13130, 13135, 13136, 13138, 13140, 13142, 13144, 13145, 13149, 13173, 13182, 13202, 13225, 13253, 13255, 13258, 13259, 13260, 13264, 13265, 13266, 13267, 13292, 13305, 13313, 13325, 13328, 13329, 13343, 13348, 13349, 13350, 13351, 13352, 13353, 13354, 13356, 13377, 13391, 13394, 13395, 13396, 13413, 13416, 13428, 14944, 14945, 14946, 14948, 14951, 14952, 14953, 14954, 14955, 14956, 14957, 14959, 14960, 14961, 14962, 14963, 14967, 14968, 14969, 14970, 14971, 14972];
         $cc = count($public318_ids);
         $tt = DT::random_num_list(0, $cc - 1, 18);
         $ids = [];
         foreach ($tt as $tk) {
             $ids[] = $public318_ids[$tk];
         }
         $qs = implode(',', $ids);
         $select = self::_content_public318search_search($qs);
         if ($select === false) {
             $r .= "找不到...";
         } else {
             $r .= $select;
         }
     } else {
         $select = self::_content_public318search_search($qs);
         if ($select === false) {
             $r .= "找不到...";
         } else {
             $r .= $qs;
             $r .= $select;
         }
     }
     echo $r;
     die;
 }
Esempio n. 2
0
 private static function _getRandomItems($storymax, $stickymax, $min, $max)
 {
     $story_cc = DT::random_num_list(4, 35, $storymax);
     $cc = DT::random_num_list($min, $max, $stickymax - $storymax);
     $ins_cc = DT::random_num_list(0, $stickymax - 1, $storymax);
     sort($ins_cc);
     $sss = array();
     $k = 0;
     for ($j = 0; $j < $stickymax; $j++) {
         if (in_array($j, $ins_cc)) {
             $id = array_shift($story_cc);
             $sss[] = array('itemtype' => 'story', 'id' => $id);
         } else {
             $id = array_shift($cc);
             $sss[] = array('itemtype' => 'public318', 'id' => $id);
         }
     }
     return $sss;
 }