腦友記廣場 -> 新手上路 -> Disappear--特輯 登錄 -> 註冊 -> 回復主題 -> 發表主題

xjohnrambox 2007-10-22 21:22
Dear Brother Maninnet or Never4get,
I Download the PHP code From the Forum,
for 壹週刊 issue 899

hknext.php?issue=899

the title 特輯 Disappear
Can anyone help to fix it

below are the PHP code


<?
   header('Content-type:text/html; charset=big5');
   $issue = $_GET['issue'];
   $baseurl = "http://next.atnext.com/template/next/";
   $front = file_get_contents($baseurl);
   if (!$issue){
       preg_match("/cache\/([0-9]+)\/issue_art_list.js/s",$front,$num);
       $issue = $num[1];
   }
       
   preg_match("/<ul id=\"maintab\" class=\"basictab\">(.*?)<\/ul>/s",$front,$nt);
   $newtitle = $nt[1];
   preg_match_all("/\">(.*?)</s",$newtitle,$sec);
   $artlist_url = "$baseurl"."cache/$issue/issue_art_list.js";
   $artlist = file_get_contents("$artlist_url");
   $artlist = eregi_replace("psec_name","p_name",$artlist);
   $artlist = eregi_replace("sub_title","s_t",$artlist);
   $artlist = eregi_replace("Nil","",$artlist);
   preg_match_all("/\{\n(.*?)\}\n/s",$artlist,$area);
   echo "<title>香港壹週刊 第 $issue 期</title>\n";
   echo "<img src=http://next.atnext.com/template/next/images/next_01.gif><br>\n";
echo "<b><font color=\"#996600\">第 $issue 期 香港壹週刊</font></b><br>\n";
echo "<img src=http://next.atnext.com/images/next-photos/NextMag/$issue/160pixfolder/cover/1.jpg> ";
echo "<img src=http://next.atnext.com/images/next-photos/NextMag/$issue/160pixfolder/cover/6.jpg><hr>\n";
   for ($i=0;$i<count($sec[1]);$i++){
       $sec_title = $sec[1][$i];
       echo "<img src=http://next.1-apple.com.tw/template/twnext/images/bullet.gif> <b><font color=red>$sec_title</font></b><br>\n";
           for ($j=0;$j<count($area[1]);$j++){
               $content = $area[1][$j];
               preg_match("/sec_name:\"(.*?)\"/s",$content,$sn);
               $sec_name = $sn[1];
               if ($sec_title == $sec_name){
                   preg_match_all("/art_id:(.*?)\,/s",$content,$ai);
                   preg_match_all("/s_t:\"(.*?)\"\,/s",$content,$st);
                   preg_match_all("/title:\"(.*?)\"\,/s",$content,$t);
                   preg_match_all("/columnist_name:\"(.*?)\"\,/s",$content,$cn);
                   for ($k=0;$k<count($ai[1]);$k++){
                       $art_id = $ai[1][$k];
                       $sub_title = $st[1][$k];
                       $title = $t[1][$k];
                       $cln = $cn[1][$k];
                       $sub_title = eregi_replace("[\]r<BR>","",$sub_title);
                       $sub_title = eregi_replace("[\]'","'",$sub_title);
                       $sub_title = eregi_replace("/new_hkfont/","/next.1-apple.com.tw/new_hkfont/",$sub_title);
                       $sub_title = eregi_replace("[\]\"/","http://",$sub_title);
                       $sub_title = eregi_replace("[\]\"","",$sub_title);
                       $sub_title = eregi_replace("[\]t","",$sub_title);
                       $title = eregi_replace("[\]'","'",$title);
                       echo "<li><font color=green>$title</font> <a href=view_next.php?mag=NextMagazine&issue=$issue&art_id=$art_id>$sub_title</a>    <font color=gray>$cln</font></li>\r\n";
               }
//                echo "<br>\n";
           }
       }
       echo "<br><br>\r\n";
   }
   echo "<hr>\r\n<img src=http://static.flickr.com/60/219160214_e6ed15d559_o.gif>";
?>


thanks for help



Sorry to bother again,
I found another bugs today,but i don't know how to slove the problem
for 飲食男女 issue 638

eat.php?issue=638

for the topic "World Walkers"
There are missing two title

台灣溫泉美食嘉年華13/10開鑼

齊畫格仔破世界紀錄

The original PhP code as below

<?
   header('Content-type:text/html; charset=big5');
   $issue = $_GET['issue'];
   $baseurl = "http://etw.atnext.com/template/etw/";
   $front = file_get_contents($baseurl);
   if (!$issue){
       preg_match("/cache\/([0-9]+)\/issue_art_list.js/s",$front,$num);
       $issue = $num[1];
   }
       
   preg_match("/<ul id=\"maintab\" class=\"basictab\">(.*?)<\/ul>/s",$front,$nt);
   $newtitle = $nt[1];
   preg_match_all("/\">(.*?)</s",$newtitle,$sec);
   $artlist_url = "$baseurl"."cache/$issue/issue_art_list.js";
   $artlist = file_get_contents("$artlist_url");
   $artlist = eregi_replace("psec_name","p_name",$artlist);
   $artlist = eregi_replace("sub_title","s_t",$artlist);
   $artlist = eregi_replace("Nil","",$artlist);
   preg_match_all("/\{(.*?)\}/s",$artlist,$area);
   echo "<title>飲食男女 第 $issue 期</title>\n";
   echo "<img src=http://etw.atnext.com/template/etw/images/etw_01.gif><br>\n";
echo "<b><font color=\"#996600\">第 $issue 期 飲食男女</font></b><br>\n";
echo "<img src=http://etw.atnext.com/images/next-photos/Eat_Travel/$issue/160pixfolder/cover/1.jpg> ";
echo "<img src=http://etw.atnext.com/images/next-photos/Eat_Travel/$issue/160pixfolder/cover/6.jpg><hr>\n";
   for ($i=0;$i<count($sec[1]);$i++){
       $sec_title = $sec[1][$i];
       echo "<img src=http://next.1-apple.com.tw/template/twnext/images/bullet.gif> <b><font color=red>$sec_title</font></b><br>\n";
           for ($j=0;$j<count($area[1]);$j++){
               $content = $area[1][$j];
               preg_match("/sec_name:\"(.*?)\"/s",$content,$sn);
               $sec_name = $sn[1];
               if ($sec_title == $sec_name){
                   preg_match_all("/art_id:(.*?)\,/s",$content,$ai);
                   preg_match_all("/s_t:\"(.*?)\"\,/s",$content,$st);
                   preg_match_all("/title:\"(.*?)\"\,/s",$content,$t);
                   preg_match_all("/columnist_name:\"(.*?)\"\,/s",$content,$cn);
                   for ($k=0;$k<count($ai[1]);$k++){
                       $art_id = $ai[1][$k];
                       $sub_title = $st[1][$k];
                       $title = $t[1][$k];
                       $cln = $cn[1][$k];
                       $sub_title = eregi_replace("[\]r<BR>","",$sub_title);
                       $sub_title = eregi_replace("[\]'","'",$sub_title);
                       $sub_title = eregi_replace("/new_hkfont/","/next.1-apple.com.tw/new_hkfont/",$sub_title);
                       $sub_title = eregi_replace("[\]\"/","http://",$sub_title);
                       $sub_title = eregi_replace("[\]\"","",$sub_title);
                       $sub_title = eregi_replace("[\]t","",$sub_title);
                       $title = eregi_replace("[\]'","'",$title);
                       echo "<li><font color=green>$title</font> <a href=view_next.php?mag=EatTravelWeekly&issue=$issue&art_id=$art_id>$sub_title</a>    <font color=gray>$cln</font></li>";
               }
               echo "<br>\n";
           }
       }
       echo "<br>\n";
   }
   echo "<hr>\n<img src=http://static.flickr.com/60/219160214_e6ed15d559_o.gif>";
?>

Thanks again for help
xjohnrambox

maninnet 2007-10-22 22:47
http://elife.maninnet.com/read.php?tid=946&fpage=1

xjohnrambox 2007-10-23 16:04
Dear Brother Maninnet,
Thanks for your prompt reply.
I know you have post your php codes for us to download.
I already have it and work perfect.
Thanks for yr efforts.

The above PHP code was create by brother Never4get.
I like his magazine layout.
Could you help me to exam the PHP Code and Fix the Bugs.
( I tried to fix it by myself, but still not success.
Because I don't know PHP much, it is very hard for me to do so.)
I want to learn form you how to fix the bugs.
If it doesn't bother you too much and if you have spare time.
Please help me.
Thanks in advance

never4get 2007-10-24 10:20
先試試看吧
hknext.php
CODE:

<?
   header('Content-type:text/html; charset=big5');
   $issue = $_GET['issue'];
   $baseurl = "http://next.atnext.com/template/next/";
   
   if (!$issue){
       $front = file_get_contents($baseurl);
       preg_match("/cache\/([0-9]+)\/issue_art_list.js/s",$front,$num);
       $issue = $num[1];
   
   }else{
               $front = file_get_contents("http://next.atnext.com/template/next/arc_sel.cfm?iss_id=$issue");
               }
   $artlist_url = "$baseurl"."cache/$issue/issue_art_list.js";
       
   preg_match("/<ul id=\"maintab\" class=\"basictab\">(.*?)<\/ul>/s",$front,$nt);
   $newtitle = $nt[1];
   preg_match_all("/\">(.*?)</s",$newtitle,$sec);
   $artlist = file_get_contents("$artlist_url");
   $artlist = eregi_replace("psec_name","p_name",$artlist);
   $artlist = eregi_replace("sub_title","s_t",$artlist);
   $artlist = eregi_replace("Nil","",$artlist);
   preg_match_all("/\{\n(.*?)\}\n/s",$artlist,$area);
   echo "<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=big5\">\r\n";
   echo "<title>香港壹週刊 第 $issue 期</title>\r\n";
   echo "<img src=http://next.atnext.com/template/next/images/next_01.gif><br>\r\n";
   echo "<b><font color=\"#996600\">第 $issue 期 香港壹週刊</font></b><br>\r\n";
echo "<img src=http://next.atnext.com/images/next-photos/NextMag/$issue/160pixfolder/cover/1.jpg> ";
echo "<img src=http://next.atnext.com/images/next-photos/NextMag/$issue/160pixfolder/cover/6.jpg><hr>\n";
   for ($i=0;$i<count($sec[1]);$i++){
       $sec_title = $sec[1][$i];
       echo "<img src=http://next.1-apple.com.tw/template/twnext/images/bullet.gif> <b><font color=red>$sec_title</font></b><br>\n";
           for ($j=0;$j<count($area[1]);$j++){
               $content = $area[1][$j];
               preg_match("/sec_name:\"(.*?)\"/s",$content,$sn);
               $sec_name = $sn[1];
               if ($sec_title == $sec_name){
                   preg_match_all("/art_id:(.*?)\,/s",$content,$ai);
                   preg_match_all("/s_t:\"(.*?)\"\,/s",$content,$st);
                   preg_match_all("/title:\"(.*?)\"\,/s",$content,$t);
                   preg_match_all("/columnist_name:\"(.*?)\"\,/s",$content,$cn);
                   for ($k=0;$k<count($ai[1]);$k++){
                       $art_id = $ai[1][$k];
                       $sub_title = $st[1][$k];
                       $title = $t[1][$k];
                       $cln = $cn[1][$k];
                       $sub_title = eregi_replace("[\]r<BR>","",$sub_title);
                       $sub_title = eregi_replace("[\]'","'",$sub_title);
                       $sub_title = eregi_replace("/new_hkfont/","/next.1-apple.com.tw/new_hkfont/",$sub_title);
                       $sub_title = eregi_replace("[\]\"/","http://",$sub_title);
                       $sub_title = eregi_replace("[\]\"","",$sub_title);
                       $sub_title = eregi_replace("[\]t","",$sub_title);
                       $title = eregi_replace("[\]'","'",$title);
                       echo "<li><font color=green>$title</font> <a href=view_next.php?mag=NextMagazine&issue=$issue&art_id=$art_id>$sub_title</a>    <font color=gray>$cln</font></li>\r\n";
               }

           }
       }
       echo "<br><br>\r\n";
   }
   echo "<hr>\r\n<img src=http://static.flickr.com/60/219160214_e6ed15d559_o.gif>";
?>


eat.php
CODE:

<?
   header('Content-type:text/html; charset=big5');
   $issue = $_GET['issue'];
   $baseurl = "http://etw.atnext.com/template/etw/";
   
   if (!$issue){
       $front = file_get_contents($baseurl);
       preg_match("/cache\/([0-9]+)\/issue_art_list.js/s",$front,$num);
       $issue = $num[1];
   }else{
       $front = file_get_contents("http://etw.atnext.com/template/etw/arc_sel.cfm?iss_id=$issue");
}
       
   preg_match("/<ul id=\"maintab\" class=\"basictab\">(.*?)<\/ul>/s",$front,$nt);
   $newtitle = $nt[1];
   preg_match_all("/\">(.*?)</s",$newtitle,$sec);
   $art_url = "$baseurl"."cache/$issue/issue_art_list.js";
   $artlist = file_get_contents("$art_url");
   $artlist = eregi_replace("psec_name","p_name",$artlist);
   $artlist = eregi_replace("sub_title","s_t",$artlist);
   $artlist = eregi_replace("Nil","",$artlist);
   preg_match_all("/\{(.*?)\}\n/is",$artlist,$area);
   echo "<title>飲食男女 第 $issue 期</title>\n";
   echo "<img src=http://etw.atnext.com/template/etw/images/etw_01.gif><br>\n";
echo "<b><font color=\"#996600\">第 $issue 期 飲食男女</font></b><br>\n";
echo "<img src=http://etw.atnext.com/images/next-photos/Eat_Travel/$issue/160pixfolder/cover/1.jpg> ";
echo "<img src=http://etw.atnext.com/images/next-photos/Eat_Travel/$issue/160pixfolder/cover/6.jpg><hr>\n";
   for ($i=0;$i<count($sec[1]);$i++){
       $sec_title = $sec[1][$i];
       echo "<img src=http://next.1-apple.com.tw/template/twnext/images/bullet.gif> <b><font color=red>$sec_title</font></b><br>\n";
           for ($j=0;$j<count($area[1]);$j++){
               $content = $area[1][$j];
               preg_match("/sec_name:\"(.*?)\"/s",$content,$sn);
               $sec_name = $sn[1];
               if ($sec_title == $sec_name){
                   preg_match_all("/art_id:(.*?)\,/s",$content,$ai);
                   preg_match_all("/s_t:\"(.*?)\"\,/s",$content,$st);
                   preg_match_all("/title:\"(.*?)\"\,/s",$content,$t);
                   preg_match_all("/columnist_name:\"(.*?)\"\,/s",$content,$cn);
                   for ($k=0;$k<count($ai[1]);$k++){
                       $art_id = $ai[1][$k];
                       $sub_title = $st[1][$k];
                       $title = $t[1][$k];
                       $cln = $cn[1][$k];
                       $sub_title = eregi_replace("[\]r<BR>","",$sub_title);
                       $sub_title = eregi_replace("[\]'","'",$sub_title);
                       $sub_title = eregi_replace("/new_hkfont/","/next.1-apple.com.tw/new_hkfont/",$sub_title);
                       $sub_title = eregi_replace("[\]\"/","http://",$sub_title);
                       $sub_title = eregi_replace("[\]\"","",$sub_title);
                       $sub_title = eregi_replace("[\]t","",$sub_title);
                       $title = eregi_replace("[\]'","'",$title);
                       echo "<li><font color=green>$title</font> <a href=view_next.php?mag=EatTravelWeekly&issue=$issue&art_id=$art_id>$sub_title</a>    <font color=gray>$cln</font></li>";
               }
               echo "<br>\n";
           }
       }
       echo "<br>\n";
   }
   echo "<hr>\n<img src=http://static.flickr.com/60/219160214_e6ed15d559_o.gif>";
?>



xjohnrambox 2007-10-30 13:18
Dear Brother Never4get,

wow

Very happy to see your reply here.
The above code slove my problems.
Thanks a million.

I really like your magazine layout.
Very appreciate yr great efforts.
thanks again.


查看完整版本: [-- Disappear--特輯 --] [-- top --]


Powered by PHPWind v4.0.1 Code © 2003-05 PHPWind
Gzip enabled

You can contact us