SMF : ดึงกระทู้มาหน้าแรกเว็บได้แต่กดเข้าไ&#36

ตอนนี้ผมทำการดึงข้อมูล 10 กระทู้ล่าสุดลงเว็บไซค์หน้าแรกได้เเล้วครับแต่ปัญหาคือ พอกดเข้าลิ้งค์กลับเข้าไม่ได้

อ้างอิง : กดเข้าจากลิ้งค์หน้าเว็บจะพาไปที่ลิ้งค์ www.ชื่อโดเมน.com/index.php?topic=1.msg1;topicseen#new

ถึงความจริงต้องลิ้งค์ไปที่ www.ชื่อโดเมน.com/forum/index.php?topic=1.msg1;topicseen#new

ไม่ทราบว่าต้องไปแก้ไฟล์ไหนหรอกครับให้ลิ้งค์มันตรงกัน

ไฟล์ Show_ssi_recentTopics1.php

<?php require("forum/SSI.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
<html>
<head>
<meta http-equiv="Content-Language" content="th">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="900" >
<title>โชว์กระทู้์ล่าสุด smf2.0.2 | welovethailand.com</title>
<base target="_blank">
<style type="text/css">

body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #0066FF;}
a {font-size: 12px;color: #E79A0C;}
a:link { color: navy; text-decoration: none}
a:visited { color: #0000FF; text-decoration: none}
a:active { color: #FF9900; text-decoration: underline}
a:hover { color: Orange; text-decoration: underline}
td { height:22px}
</style>
</head>

<body >
<!--เริ่ม recentTopics แบบ ssi_recentTopics2 แบบใส่ตาราง-->
<?php
$welovetopic = ssi_recentTopics('10',array(4,5,6), array(1,2,3),'array'); //10 กระทู้ที่ต้องการให้แสดง, array(4,5,6)บอร์ดที่จะไม่ให้แสดง, array(1,2,3)บอร์ดที่จะให้แสดง ปล่อยว่าง array() มาทุกบอร์ด (ให้ใส่เพียงอันใดอันหนึ่งแล้วเว้นว่างอีกอันหนึ่งไว้)
echo'
<table width="770" border="1" cellpadding="0" cellspacing="0" bordercolor="#E8E8E8">
  <tr>
    <td width="500" bgcolor="#F4F4F4"><div align="center"><strong>หัวข้อ</strong></div></td>
    <td width="50" bgcolor="#F4F4F4"><div align="center"><strong>อ่าน</strong></div></td>
    <td width="50" bgcolor="#F4F4F4"><div align="center"><strong>ตอบ</strong></div></td>
    <td width="170" bgcolor="#F4F4F4"><div align="center"><strong>วัน/เวลา</strong></div></td>
  </tr>';
 
  foreach ($welovetopic as $post)
  {
  echo'
  <tr>
    <td><a href="', $post['href'], '">', $post['subject'], ' </a>', $txt['by'], ' ', $post['poster']['link'], '</td>
    <td bgcolor="#F4F4F4"><div align="center">', $post['views'],'</div></td>
    <td bgcolor="#F4F4F4"><div align="center">',$post['replies'],'</div></td>
    <td bgcolor="#F4F4F4"><div align="center">', $post['time'],'</div></td>
  </tr>';
  }
  echo'
    <tr>
    <td bgcolor="#F4F4F4"> </td>
    <td bgcolor="#F4F4F4"> </td>
    <td bgcolor="#F4F4F4"> </td>
    <td bgcolor="#F4F4F4"> </td>
  </tr>
</table>
';
?>
<!--จบ recentTopics แบบ ssi_recentTopics2 แบบใส่ตาราง-->
</body>
</html>


ไฟล์ index.html (หน้าแรก ตำแหน่งที่ให้เว็บบอร์ดโชว์ครับ)

<div align="left">
    <iframe src="Show_ssi_recentTopics1.php" frameBorder="0" width="200%" height="600px" scrolling="no"allowtransparency="true"></iframe>
    </div>


edit เพิ่มเติมนะครับ : เวลากดเข้าลิ้งค์หน้าเว็บเเล้วจะขึ้น Not Found

The requested URL www.ชื่อโดเมน.index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

ขอขอบคุณล่วงหน้านะครับ
🏷️ หัวข้อที่เกี่ยวข้อง

💬 การตอบกลับ 6

#1
Moshi
Moshi
16,996 โพสต์
ขอชื่อโดเมนด้วยครับ

จากโค๊ดไม่มี target="_balnk" ด้วยครับตรง Tag a มันไม่เปิดหน้าต่างใหม่นะครับ
#2
inside04
inside04
0 โพสต์
— Moshi link=topic=15765.msg30377#msg30377 date=1350550335

ขอชื่อโดเมนด้วยครับ

จากโค๊ดไม่มี target="_balnk" ด้วยครับตรง Tag a มันไม่เปิดหน้าต่างใหม่นะครับ


ขอโทษทีครับ ตอนนี้ยังไม่ได้จดชื่อโดเมน กำลังอยู๋ในช่วงทดลองครับ

ตอนนี้เข้าแบบ IP อยู่ครับผม : http://122.155.18.22/~zp6747/
#3
Moshi
Moshi
16,996 โพสต์
จากที่ดู ไฟล์ path น่าจะมีปัญหาครับ

เว็บบอร์ดที่ลงไว้จะมี /forum แต่ที่ดู มันเรียกไป index.php ไม่มี forum ครับ เลยขึ้น not found

เป็นไปได้ไหมครับ upload ไฟล์ ssi.php มาให้ดูหน่อยครับ

ประมาณบรรทัดที่ 502 จะเจอ 'href' => $scripturl

ถ้าไม่ใช่ ให้เปลี่ยนเป็นแบบนี้ครับ

'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',


เฉพาะ href นะครับ
#4
inside04
inside04
0 โพสต์
ไฟล์ SSI.php นะครับ ตั้งแต่บรรทัดที่ 502 - 510 ครับ ไม่ได้แก้ไขอะไร

			'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new" rel="nofollow">' . $row['subject'] . '</a>',
// Retained for compatibility - is technically incorrect!
'new' => !empty($row['is_read']),
'is_new' => empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" />',
);
}

✏️ แก้ไขล่าสุด: 20 ตุลาคม 2555

#5
Moshi
Moshi
16,996 โพสต์
ลองแก้เป็นแบบนี้นะครับ ใช้แบบแก้ไขง่ายๆ manual ไปก่อนครับ

พอจดโดเมนจริงมาเปลี่ยน พาทด้วยนะครับ


$scripturl = "http://122.155.18.22/~zp6747/forum/index.php&quot;,
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new" rel="nofollow">' . $row['subject'] . '</a>',
// Retained for compatibility - is technically incorrect!
'new' => !empty($row['is_read']),
'is_new' => empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" />',
);
}



แต่เมื่อซักครู่นี่เองผมลองเข้าไปดูก็ปกติแล้วนะครับ
#6
inside04
inside04
0 โพสต์
ขอบคุณมากครับ :) :-*