Example #1
0
 function get_link_list($page)
 {
     $links = $tmp = array();
     $data = get_source($page, TRUE, TRUE);
     $html = convert_html($data);
     preg_match_all("'href=\"(https?://[^\"]+).*?>(.*?)<'si", $html, $tmp, PREG_PATTERN_ORDER);
     $str_redirect = get_cmd_absuri('redirect', '', 'u=');
     $spos = PKWK_USE_REDIRECT ? strlen($str_redirect) : 0;
     $ctr = count($tmp[1]);
     for ($i = 0; $i < $ctr; $i++) {
         if (xbel::is_ignore($tmp[1][$i])) {
             continue;
         }
         // 名称が無い場合
         if (empty($tmp[2][$i])) {
             continue;
         }
         $aname = trim($tmp[2][$i]);
         if ($aname == '') {
             continue;
         }
         // Redirect を有効にしている場合の対応
         if (strpos($tmp[1][$i], $str_redirect) === FALSE) {
             $href = $tmp[1][$i];
         } else {
             $href = rawurldecode(substr($tmp[1][$i], $spos));
         }
         // HREF でサマリする
         $links[$href] = $aname;
     }
     // GreyBox 対応
     preg_match_all("'GB_showFullScreen\\(\\'(.*?)\\'\\, \\'(.*?)\\'\\);\"'si", $html, $tmp, PREG_PATTERN_ORDER);
     $ctr = count($tmp[1]);
     for ($i = 0; $i < $ctr; $i++) {
         $links[$tmp[2][$i]] = $tmp[1][$i];
     }
     return $links;
 }