 |
ช่วยผมที่ครับทำไมรูปภาพไม่ขึ้นไม่รู้ครับ เป็นเพราะหาตำแหน่งไม่เจอหรือเปล่าครับ |
|
 |
|
|
 |
 |
|
ช่วยผมที่ครับทำไมรูปภาพไม่ขึ้นไม่รู้ครับ เป็นเพราะหาตำแหน่งไม่เจอหรือเปล่าครับ
จากหน้าเวปครับ

พอผมไปคลิ๊กที่ข่าวจะขึ้นหน้านี้มารูปไม่ขึ้นครับ

แต่พอเอาเมาส์ไปคลิ๊กตำแหน่งของรุป
แต่มีรูปขึ้นน่ะครับ

จากรูปที่ 2 รุปภาพไม่ขึ้นเกิดจากอะไรเหรอครับ ช่วยผมทีครับ
จาก code น่ะครับ
<?
@include"pageload.php";
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="roverkid">
<META NAME="Keywords" CONTENT=" ">
<META NAME="Description" CONTENT=">
<link rel="shortcut icon" href="images_k/gear.jpg" type="image/x-icon" />
<!--<link rel="icon" href="http://www.goragod.com/favicon.gif" type="image/gif" />-->
<title><? echo"$page_title"; ?></title>
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript" src="includes/js/jover.js"></script>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background: #e7dfec url(images/bg_edit.jpg) repeat-x;
}
-->
</style>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="1000">
<tbody><tr><!-- header-->
<td>
<?@include"header.php";?>
</td>
</tr>
<tr style="background-color:#FFF;"><!-- center-->
<td>
<table border="0" cellpadding="0" cellspacing="0" width="1000">
<tbody><tr>
<td background="1-2.jpg" valign="top" width="225"><!--ข้อมูลทางซ้าย-->
<?@include"leftzone0.php";?>
</td>
</tr>
</tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="225">
<tbody><tr>
<td><img src="images_k/left_line_dot.jpg"></td>
</tr>
</tbody></table>
<?@include"leftZone.php";?>
</td>
<td background="images_k/2-2.jpg" valign="top" width="28"><!--เงาทางซ้าย-->
<table border="0" cellpadding="0" cellspacing="0" width="28">
<tbody><tr>
<td background="images_k/2-1.jpg" width="28" height="350">
</td>
</tr>
</tbody></table>
</td>
<td valign="top" width="682" height="350"><!--ข้อมูลตรงกลาง<img src="data_center.jpg">-->
<table border="0" cellpadding="0" cellspacing="0" width="682">
<tr><td><!--เริ่มตรงนี้-->
<table cellSpacing="0" cellPadding="0" width="682" border="0" >
<tr>
<td width="682" valign="top"><img src="images/title/title25.jpg" width="680" height="50" border="0"></td>
</tr>
<tr>
<td width="682" valign="top"> <a href="index.php" target="_self">หน้าแรก</a> > แสดงรายการข่าวทั้งหมด</td>
</tr>
<tr>
<td width="682" valign="top"> </td>
</tr>
<tr>
<td width="682" valign="top"><!--form center start here-->
<SCRIPT LANGUAGE="Javascript">
<!---
function decision(message, url){
if(confirm(message)) location.href = url;
}
// --></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function SelectCate(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<table cellSpacing="0" cellPadding="0" width="682" border="0" >
<tr>
<td width="682" valign="top"> </td>
</tr>
<tr>
<td width="682" valign="top"><!--form center start here-->
<table border="0" cellpadding="0" cellspacing="1" width="680">
<tr>
<td width="65%" align="center" bgcolor="#333333" class="nmsw_my_org" colspan="5"><b><font color="white">กรุณาเลือกหมวดข่าว/บทความ:</font></b>
<form>
<select onChange="SelectCate('parent',this,0)">
<option value='allNews.php'>แสดงข่าวทั้งหมด</option>
<?php
// กำหนดคำสั่ง SQL เรียกข้อมูลทั้งหมดจากตาราง tbl_category โดยเรียงตามฟิลด์ cat_name
$sqlcate = "SELECT * FROM news_cat ORDER BY news_cat_id";
// สั่งรัน SQL
$rscate = mysql_query($sqlcate);
// ทำลูป เพื่อแยกข้อมูลในแต่ละฟิลด์
while($rec = mysql_fetch_array( $rscate )) {
// ตรวจสอบฟิลด์ cat_id กับ ค่าตัวแปร cate ที่ผู้ใช้เลือกจากคอนโทรลหมวดสินค้า
if ( $rec['news_cat_id'] == $_REQUEST["cat"] || $rec['news_cat_id'] == $cat ) {
// เป็นจริง เพิ่มแอตทริบิวต์ selected ไว้ใน Tag <option>
// เพื่อเป็นการดีฟอลต์ชื่อหมวดสินค้าที่ผู้ใช้ได้เลือกเอาไว้
if(isset($_REQUEST["cat"])){
$_SESSION['cat']=$_REQUEST["cat"];
}else if(isset($_GET['page'])){
$_SESSION['cat']=$cat;
}else{
$_SESSION['cat']="";
}
session_write_close();
echo "\t\t<option value=\"?cat=". $rec['news_cat_id'] ."\" selected>". $rec['news_cat_name'] ."</option>\n";
} else {
// เป็นเท็จ สร้างคอนโทรลรายการชื่อหมวดสินค้าแบบปกติ
echo "\t\t<option value=\"?cat=". $rec['news_cat_id'] ."\">". $rec['news_cat_name'] ."</option>\n";
}
}
?>
</select>
</form>
</td>
<!--<td width="38%" align="center" bgcolor="#333333" class="nmsw_my_org"><b><font color="white">หัวข้อข่าว</font></b></td>-->
<!--<td width="10%" align="center" bgcolor="#333333" class="nmsw_my_org"><b><font color="white">จัดการภาพประกอบ</font></b></td>-->
<td width="35%" align="center" bgcolor="#333333" class="nmsw_my_org" ><b><font color="white">โดย</font></b></td>
</tr>
<tr>
<td width="100%" colspan="6" class="one" onMouseOver="changeOver(this.id)" onMouseOut="changeOut(this.id)"><div id="mySpan"></div></td>
</tr>
<?
if($page==""){
$page=1;
}
if($txtLevel=="0"){
$strSQL1 = "select * from news where news_cat_id like '%$cat%'";
$resultset1 = mysql_query($strSQL1) or die ("Error Query [".$strSQL1."]");
$NRow = mysql_num_rows($resultset1);
$count=1;
$rt = $NRow%$list_page;
if($rt!=0) {
$totalpage = floor($NRow/$list_page)+1;
}
else {
$totalpage = floor($NRow/$list_page);
}
$goto = ($page-1)*$list_page;
//-----จบการหาจำนวนหน้า-------//
$strSQL2 = "select * from news where news_cat_id like '%$cat%' order by news_id DESC limit $goto,$list_page";
$resultset2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]");
$numRow = mysql_num_rows($resultset2);
}else{
$strSQL1 = "select * from news where news_cat_id like '%$cat%'";
$resultset1 = mysql_query($strSQL1) or die ("Error Query [".$strSQL1."]");
$NRow = mysql_num_rows($resultset1);
$count=1;
$rt = $NRow%$list_page;
if($rt!=0) {
$totalpage = floor($NRow/$list_page)+1;
}
else {
$totalpage = floor($NRow/$list_page);
}
$goto = ($page-1)*$list_page;
//-----จบการหาจำนวนหน้า-------//
$strSQL2 = "select * from news where news_cat_id like '%$cat%' order by news_id DESC limit $goto,$list_page";
$resultset2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]");
$numRow = mysql_num_rows($resultset2);
}
?>
<?if($numRow!=0){?>
<?while($rs=mysql_fetch_array($resultset2)){?>
<?$id=$rs["news_id"];?>
<tr id="<?=$count;?>" class="one" onMouseOver="changeOver(this.id)" onMouseOut="changeOut(this.id)">
<td width="15%" align="center" class="nmsw_my_org"><img src='images/bullet/calendar.gif'> <?=$rs["news_postdate"];?>
</td>
<td width="10%" align="center" class="nmsw_my_org"><img border="1" width="50" height="50" src="news_pic/<?=$rs["news_picture"];?>" align='left' vspace='5' hspace='5'>
</td>
<td width="50%" align="left" class="nmsw_my_org" colspan="3">  <b><a href="menuView.php?article_id=<?=$rs["news_id"];?>" target='_self'><?=$rs["news_title"];?></a></b><br>
<font size="1" color="blue">
<?
$strSQL7 = "select * from news_cat where news_cat_id = '".$rs["news_cat_id"]."'";
$resultset7 = mysql_query($strSQL7) or die ("Error Query [".$strSQL7."]");
$rs7 = mysql_fetch_array($resultset7);
$cat_name = $rs7["news_cat_name"];
echo"กลุ่ม : ";
echo $cat_name ;
?>
</font>
</td>
<!--publish.php-->
<td align="center" class="nmsw_my_org" width="19%">  <?if($rs['position_id']=="1"){echo"โดย :ฝ่ายกิจการนักศึกษา";}else{
$strSQL3 = "select * from user where user_id=".$rs["user_id"]."";
$resultset3 = mysql_query($strSQL3) or die ("Error Query [".$strSQL3."]");
$rs3=mysql_fetch_array($resultset3);
$po_idd = $rs3["position_id"];
if($po_idd==1){
echo" โดย : ฝ่ายกิจการนักศึกษา";
}else{
echo" โดย :<font size=\"2\" color=\"#00B454\"> ".$rs3["user_name"]." ".$rs3["user_surname"]."</font>";
}
}?></td>
</tr>
<?
$count++;
}}?>
<tr>
<td colspan="6">
<?echo "\t กำลังแสดงหน้าที่ $page จากทั้งหมด $totalpage หน้า<br>\n";
if($page>1 && $page<=$totalpage) {
$prevpage = $page-1;
echo "\t<a target='_self' href='allNews.php?page=1$c'><img src='images/arrowlf.gif' width='14' height='14' border='0' title='หน้าแรก'></a>
<a target='_self' href='allNews.php?page=$prevpage$c'><img src='images/arrowl.gif' width='14' height='14' border='0' title='ก่อนหน้านี้ '></a> \n";
}
for($i=1 ; $i<$page ; $i++) {
echo "\t<a target='_self' href='allNews.php?page=$i$c'><font size='3'>$i</font></a> \n";
}
echo "\t<font size=3 color=red><b>$page</b></font> \n";
for($i=$page+1 ; $i<=$totalpage ; $i++) {
echo "\t<a target='_self' href='allNews.php?page=$i$c'><font size='3'>$i</font></a> \n";
}
if($page!=$totalpage) {
$nextpage = $page+1;
echo "\t <a target='_self' href='allNews.php?page=$nextpage$c'><img src='images/arrowr.gif' width='14' height='14' border='0' title='หน้าถัดไป'></a>\n
<a target='_self' href='allNews.php?page=$totalpage$c'><img src='images/arrowrl.gif' width='14' height='14' border='0' title='หน้าสุดท้าย'></a>";
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td><!--form center end here-->
</tr>
</table>
</td>
</tr>
</table>
</td>
<td background="images_k/3-2.jpg" valign="top" width="65" height="350"><!--เงาทางขวา-->
<table border="0" cellpadding="0" cellspacing="0" width="65">
<tbody><tr>
<td background="images_k/3-1.jpg" width="65" height="350">
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr style="background-color:#FFF;"><!-- footer-->
<?@include"footer.php";?>
</tr>
</tbody></table>
</body>
</html>
และจากหน้าที่ไม่เจอรูปคือ code นี้น่ะครับ
<?
@include"pageload.php";
$article_id = $_GET["article_id"];
$sql="update news set news_readcount=news_readcount+1 where news_id=$article_id";
$result = mysql_query($sql) or die("Can't Update !Please Try Again!");
$sql3 = "select * from news where news_id=$article_id";
$result3 = mysql_query($sql3);
$row3 = mysql_fetch_array($result3);
$news_id = $row3["news_id"];
$sql_pic2 = "select * from news_picture where news_id=$news_id order by pic_id";
$result_pic2= mysql_query($sql_pic2);
$NRow2 = mysql_num_rows($result_pic2);
$news_cat_id = $row3["news_cat_id"];
$sql8 = "select * from news_cat where news_cat_id=$news_cat_id";
$result8 = mysql_query($sql8);
$row8 = mysql_fetch_array($result8);
$news_cat_name = $row8["news_cat_name"];
$cur_cat_id = $row3["cat_id"];
$title = $row3["news_title"];
$detail = $row3["news_detail"];
$post_date1 = $row3["news_postdate"];
$publish = $row3["news_publish"];
$picture1 = $row3["news_picture"];
$member_only = $row3["news_memberonly"];
$read_only= $row3["news_readonly"];
$read_count= $row3["news_readcount"];
$abstract=$row3["news_abst"];
$cur_auther_id=$row3["user_id"];
$sql13 = "select * from user where user_id=$cur_auther_id";
$result13 = mysql_query($sql13);
$row13 = mysql_fetch_array($result13);
$post_by = $row13["user_name"];
$check_position = $row13["position_id"];
$sql33 = "select * from news_file where news_id=$news_id order by file_id DESC";
$result_file = mysql_query($sql33);
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="roverkid">
<META NAME="Keywords" CONTENT=" ">
<META NAME="Description" CONTENT="">
<link rel="shortcut icon" href="images_k/gear.jpg" type="image/x-icon" />
<!--<link rel="icon" href="http://www.goragod.com/favicon.gif" type="image/gif" />-->
<title><? echo"$title"; ?></title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
<script src="js/lightbox.js" type="text/javascript"></script>
<?/*?> <link rel="stylesheet" type="text/css" href="jquery.ad-gallery.css">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.ad-gallery.js"></script>
<script type="text/javascript">
$(function() {
$('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
$('img.image1').data('ad-title', 'Title through $.data');
$('img.image4').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
$('img.image5').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
var galleries = $('.ad-gallery').adGallery();
$('#switch-effect').change(
function() {
galleries[0].settings.effect = $(this).val();
return false;
}
);
$('#toggle-slideshow').click(
function() {
galleries[0].slideshow.toggle();
return false;
}
);
$('#toggle-description').click(
function() {
if(!galleries[0].settings.description_wrapper) {
galleries[0].settings.description_wrapper = $('#descriptions');
} else {
galleries[0].settings.description_wrapper = false;
}
return false;
}
);
});
</script>
<style type="text/css">
select, input, textarea {
font-size: 1em;
}
h2 {
margin-top: 1.2em;
margin-bottom: 0;
padding: 0;
border-bottom: 1px dotted #dedede;
}
h3 {
margin-top: 1.2em;
margin-bottom: 0;
padding: 0;
}
.example {
border: 1px solid #CCC;
background: #f2f2f2;
padding: 10px;
}
ul {
list-style-image:url(list-style.gif);
}
pre {
font-family: "Lucida Console", "Courier New", Verdana;
border: 1px solid #CCC;
background: #f2f2f2;
padding: 10px;
}
</style>
<?*/?>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background: #e7dfec url(images/bg_edit.jpg) repeat-x;
}
-->
</style>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="1000">
<tbody><tr><!-- header-->
<td>
<?@include"header.php";?>
</td>
</tr>
<tr style="background-color:#FFF;"><!-- center-->
<td>
<table border="0" cellpadding="0" cellspacing="0" width="1000">
<tbody><tr>
<td background="1-2.jpg" valign="top" width="225"><!--ข้อมูลทางซ้าย-->
<?@include"leftzone0.php";?>
</td>
</tr>
</tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="225">
<tbody><tr>
<td><img src="images_k/left_line_dot.jpg"></td>
</tr>
</tbody></table>
<?@include"leftZone.php";?>
</td>
<td background="images_k/2-2.jpg" valign="top" width="28"><!--เงาทางซ้าย-->
<table border="0" cellpadding="0" cellspacing="0" width="28">
<tbody><tr>
<td background="images_k/2-1.jpg" width="28" height="350">
</td>
</tr>
</tbody></table>
</td>
<td valign="top" width="682" height="350"><!--ข้อมูลตรงกลาง<img src="data_center.jpg">-->
<table border="0" cellpadding="0" cellspacing="0" width="682">
<tr><td><!--เริ่มตรงนี้-->
<table cellSpacing="0" cellPadding="0" width="682" border="0" >
<tr>
<td width="682" valign="top"><img src="images/title/title26.jpg" width="680" height="50" border="0"></td>
</tr>
<tr>
<td width="682" valign="top"> <a href="index.php" target="_self">หน้าแรก</a> > <a href="allNews.php" target="_self">แสดงรายการข่าวทั้งหมด</a> > แสดงเนื้อหาข่าวสาร</td>
</tr>
<tr>
<td width="682" valign="top"> </td>
</tr>
<tr>
<td width="682" valign="top"><!--form center start here-->
<table width="680" border="0" align="center" cellpadding="0" cellspacing="0" ><!--table1-->
<tr><td width="680" > </td></tr>
<tr><td width="680" > </td></tr>
<tr><td width="680" align="center" >
<table width="98%" border="0" cellpadding="0" cellspacing="0"><!--table2-->
<tr><!--tr1 3 col-->
<td width="10"><img src="images/block_1-2.gif" width="10" height="10" /></td>
<td background="images/block_2-2.gif"><img src="images/block_2-2.gif" width="1" height="10" /></td>
<td width="10"><img src="images/block_3-2.gif" width="10" height="10" /></td>
</tr>
<tr>
<td background="images/block_4-2.gif"><img src="images/block_4-2.gif" width="10" height="1" /></td><!--td1 tr2 table2-->
<td align="left" valign="top"><!--td2 tr2 table2-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><!--table3-->
<tr><!--tr1 3 col-->
<td bgcolor="#ffffff" valign="top" height="103" width="613">
<p align="center"><br><font size="3"><? echo"<font size='3' color='#3399FF'><b>$title</b></font></p><p align='left'><br><img src='images/bullet/calendar.gif'> <font size=1>$post_date1 :"; if($txtLevel==0){ ?>ฝ่ายกิจการนักศึกษา<?}else if($txtLevel==1){?>ฝ่ายกิจการนักศึกษา<?}echo": กลุ่ม $news_cat_name <br>$page_title <b>อ่าน [$read_count]</b>"; ?></font>
   <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php" share_url="http://www.not-or-project.com/alumni/menuView.php?article_id=<?=$article_id;?>" rel="nofollow"></a>
</p>
<p align='center'><font size="2" face="Tahoma">
<?
if($picture1!="" && $picture1!="smile.jpg" ){
$t="thumbnail_v.php?im=";
$f="news_pic/$picture1";
$file = $t .$f;
$v="<img src='$file' align='center' border='0' class='tab_box3'>";
echo"<a href=\"news_pic/$picture1\" rel=\"lightbox[roadtrip]\" title=\"$title\">$v</a>";
}else{
//echo"<img align='center' vspace='10' hspace='10' src='images/icons/no_picture.gif' class='tab_box3'>";
}
echo"</p><p align='left'><br><b>$abstract.....</b><p>$detail";
?><br></font></p>
<?/*ภาพประกอบ*/?>
<p align="center"><font size="1" face="Verdana"><?
$sql_pic = "select * from news_picture where news_id=$news_id order by pic_id";
$result_pic= mysql_query($sql_pic);
$NumRowPic = mysql_num_rows($result_pic);
if($NumRowPic!=0){
?>
<table width='100%'><!--table4-->
<tr>
<?
$jj=0;
while ($row_pic = mysql_fetch_array($result_pic)) {
$jj++;
$pic_id=$row_pic["pic_id"];
$article_id = $row_pic["news_id"];
$pic_file = $row_pic["pic_file"];
$pic_descript = $row_pic["pic_detail"];
$t="thumbnail_v1.php?im=";
$f="news_pic/$pic_file";
$file = $t .$f;
$v="<img src='$file' border='0'>";
?>
<td align="center">
<a href="news_pic/<?=$row_pic["pic_file"];?>" rel="lightbox[roadtrip]" title="<?=$row_pic["pic_detail"];?>"><?=$v;?></a>
</td>
<?
if($jj==4){?>
</tr><tr>
<?
$jj=0;
}
}?></tr></table><!--ปิดtable4-->
<?
}
?>
</font></p>
<hr>
<p><b><font size="2">ข่าวอื่นที่น่าสนใจ</font></b><br><font size="2"><?
$sql_news = "select * from news where (news_publish=1 and news_cat_id=$news_cat_id and news_id<>$article_id) and news_id between 1 and 5 order by news_id desc";
$result_news= mysql_query($sql_news);
$NumRowNews = mysql_num_rows($result_news);
if($NumRowNews!=0){
while ($row_news = mysql_fetch_array($result_news)) {
$article_id1 = $row_news["news_id"];
$title1 = $row_news["news_title"];
echo"<img src='images/bullet/0039_bullet3.png'> <a href='menuView.php?article_id=$article_id1' target='_self'>$title1</a><br>";
}
}
?>
</font><br> </p>
</td>
<!--เส้น-->
<td width="1" cellspacing="0" background="images/line_vertical.gif" WIDTH="1" HEIGHT="10" BORDER="0" valign="top"><div align="center"> <div>
</td>
<!--ทางขวา-->
<td bgcolor="#FFFFFF" valign="top" height="103" width="137">
<p align="center"><form name="search" method="post" action="news_search.php" target="_self">
<p align="center"><b>ค้นหาข่าว</b><br><input type="text" name="keyword" size="17"><br><input type="submit" value="Search"> </p>
</form>
<p align="center"><b><u><font size="2"><br>ไฟล์ที่เกี่ยวข้อง</span></font></u></b></p>
<p align="left"><font size="1">
<?
$sql_file = "select * from news_file where news_id=$news_id order by file_id";
$result_file= mysql_query($sql_file);
$NumRowFile = mysql_num_rows($result_file);
if($NumRowFile!=0){
while ($row_file = mysql_fetch_array($result_file)) {
$file_id=$row_file["file_id"];
$article_id = $row_file["news_id"];
$file_name = $row_file["file_file"];
$file_descript = $row_file["file_detail"];
list($filename_befor_dot,$filename_after_dot) = explode(".",$file_name);
if($filename_after_dot=="pdf"){
$icon="<img src='images/bullet/icon_pdf.png'>";
}else if($filename_after_dot=="doc"){
$icon="<img src='images/bullet/icon_word.png'>";
}else if($filename_after_dot=="xls"){
$icon="<img src='images/bullet/icon_excell.png'>";
}else if($filename_after_dot=="ppt"){
$icon="<img src='images/bullet/icon_powerpoint.png'>";
}else if($filename_after_dot=="pub"){
$icon="<img src='images/bullet/icon_publisher.png'>";
}else if($filename_after_dot=="txt"){
$icon="<img src='images/bullet/0177_document.png'>";
}else if($filename_after_dot=="zip"){
$icon="<img src='images/bullet/icon_zip.png'>";
}
echo"<a href='news_file/$file_name' target='_blank'>$icon <font size=2>$file_descript <img src='images/bullet/misc.png' border='0'></a><br>";
}
}
?>
</font></p>
</td>
</tr>
</table><!--ปิดtable3-->
</td>
<td background="images/block_6-2.gif"><img src="images/block_6-2.gif" width="10" height="1" /></td><!--td3 tr2 table2-->
</tr>
<tr>
<td><img src="images/block_7-2.gif" width="10" height="10" /></td>
<td background="images/block_8-2.gif"><img src="images/block_8-2.gif" width="1" height="10" /></td>
<td><img src="images/block_9-2.gif" width="10" height="10" /></td>
</tr>
</table></td></tr></table>
</td><!--form center end here-->
</tr>
</table>
</td>
</tr>
</table>
</td>
<td background="images_k/3-2.jpg" valign="top" width="65" height="350"><!--เงาทางขวา-->
<table border="0" cellpadding="0" cellspacing="0" width="65">
<tbody><tr>
<td background="images_k/3-1.jpg" width="65" height="350">
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr style="background-color:#FFF;"><!-- footer-->
<?@include"footer.php";?>
</tr>
</tbody></table>
</body>
</html>
รบกวนช่วยที่ครับ ขอบคุณครับ
Tag : PHP, MySQL, CakePHP
|
|
 |
 |
 |
 |
Date :
2014-10-08 14:08:41 |
By :
khoson |
View :
2279 |
Reply :
10 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ระบุพาทรูปผิดหรือเปล่าครับ ลองเช็คดูดีๆ
|
 |
 |
 |
 |
Date :
2014-10-08 14:12:45 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ครับเดียวผมจะลองเช็คดูครับ
|
 |
 |
 |
 |
Date :
2014-10-08 14:28:36 |
By :
khoson |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมหาจนทั่วแล้วครับไม่น่ามีผิดตำแหน่งครับแต่ภาพทำไมไม่ออกผมไม่เข้าใจ รบกวนท่านผู้รู้ที่ครับ
ตำแหน่งของมันคือ news_picture
พอดูใน database ก็ถูกน่ะครับ

จาก code ตัวนี้ที่หาไม่เจอครับ
<?
@include"pageload.php";
$article_id = $_GET["article_id"];
$sql="update news set news_readcount=news_readcount+1 where news_id=$article_id";
$result = mysql_query($sql) or die("Can't Update !Please Try Again!");
$sql3 = "select * from news where news_id=$article_id";
$result3 = mysql_query($sql3);
$row3 = mysql_fetch_array($result3);
$news_id = $row3["news_id"];
$sql_pic2 = "select * from news_picture where news_id=$news_id order by pic_id";
$result_pic2= mysql_query($sql_pic2);
$NRow2 = mysql_num_rows($result_pic2);
$news_cat_id = $row3["news_cat_id"];
$sql8 = "select * from news_cat where news_cat_id=$news_cat_id";
$result8 = mysql_query($sql8);
$row8 = mysql_fetch_array($result8);
$news_cat_name = $row8["news_cat_name"];
$cur_cat_id = $row3["cat_id"];
$title = $row3["news_title"];
$detail = $row3["news_detail"];
$post_date1 = $row3["news_postdate"];
$publish = $row3["news_publish"];
$picture1 = $row3["news_picture"];
$member_only = $row3["news_memberonly"];
$read_only= $row3["news_readonly"];
$read_count= $row3["news_readcount"];
$abstract=$row3["news_abst"];
$cur_auther_id=$row3["user_id"];
$sql13 = "select * from user where user_id=$cur_auther_id";
$result13 = mysql_query($sql13);
$row13 = mysql_fetch_array($result13);
$post_by = $row13["user_name"];
$check_position = $row13["position_id"];
$sql33 = "select * from news_file where news_id=$news_id order by file_id DESC";
$result_file = mysql_query($sql33);
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="roverkid">
<META NAME="Keywords" CONTENT=" ">
<META NAME="Description" CONTENT=">
<link rel="shortcut icon" href="images_k/gear.jpg" type="image/x-icon" />
<!--<link rel="icon" href="http://www.goragod.com/favicon.gif" type="image/gif" />-->
<title><? echo"$title"; ?></title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
<script src="js/lightbox.js" type="text/javascript"></script>
<?/*?> <link rel="stylesheet" type="text/css" href="jquery.ad-gallery.css">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.ad-gallery.js"></script>
<script type="text/javascript">
$(function() {
$('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
$('img.image1').data('ad-title', 'Title through $.data');
$('img.image4').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
$('img.image5').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
var galleries = $('.ad-gallery').adGallery();
$('#switch-effect').change(
function() {
galleries[0].settings.effect = $(this).val();
return false;
}
);
$('#toggle-slideshow').click(
function() {
galleries[0].slideshow.toggle();
return false;
}
);
$('#toggle-description').click(
function() {
if(!galleries[0].settings.description_wrapper) {
galleries[0].settings.description_wrapper = $('#descriptions');
} else {
galleries[0].settings.description_wrapper = false;
}
return false;
}
);
});
</script>
<style type="text/css">
select, input, textarea {
font-size: 1em;
}
h2 {
margin-top: 1.2em;
margin-bottom: 0;
padding: 0;
border-bottom: 1px dotted #dedede;
}
h3 {
margin-top: 1.2em;
margin-bottom: 0;
padding: 0;
}
.example {
border: 1px solid #CCC;
background: #f2f2f2;
padding: 10px;
}
ul {
list-style-image:url(list-style.gif);
}
pre {
font-family: "Lucida Console", "Courier New", Verdana;
border: 1px solid #CCC;
background: #f2f2f2;
padding: 10px;
}
</style>
<?*/?>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background: #e7dfec url(images/bg_edit.jpg) repeat-x;
}
-->
</style>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="1000">
<tbody><tr><!-- header-->
<td>
<?@include"header.php";?>
</td>
</tr>
<tr style="background-color:#FFF;"><!-- center-->
<td>
<table border="0" cellpadding="0" cellspacing="0" width="1000">
<tbody><tr>
<td background="1-2.jpg" valign="top" width="225"><!--ข้อมูลทางซ้าย-->
<?@include"leftzone0.php";?>
</td>
</tr>
</tbody></table>
<table border="0" cellpadding="0" cellspacing="0" width="225">
<tbody><tr>
<td><img src="images_k/left_line_dot.jpg"></td>
</tr>
</tbody></table>
<?@include"leftZone.php";?>
</td>
<td background="images_k/2-2.jpg" valign="top" width="28"><!--เงาทางซ้าย-->
<table border="0" cellpadding="0" cellspacing="0" width="28">
<tbody><tr>
<td background="images_k/2-1.jpg" width="28" height="350">
</td>
</tr>
</tbody></table>
</td>
<td valign="top" width="682" height="350"><!--ข้อมูลตรงกลาง<img src="data_center.jpg">-->
<table border="0" cellpadding="0" cellspacing="0" width="682">
<tr><td><!--เริ่มตรงนี้-->
<table cellSpacing="0" cellPadding="0" width="682" border="0" >
<tr>
<td width="682" valign="top"><img src="images/title/title26.jpg" width="680" height="50" border="0"></td>
</tr>
<tr>
<td width="682" valign="top"> <a href="index.php" target="_self">หน้าแรก</a> > <a href="allNews.php" target="_self">แสดงรายการข่าวทั้งหมด</a> > แสดงเนื้อหาข่าวสาร</td>
</tr>
<tr>
<td width="682" valign="top"> </td>
</tr>
<tr>
<td width="682" valign="top"><!--form center start here-->
<table width="680" border="0" align="center" cellpadding="0" cellspacing="0" ><!--table1-->
<tr><td width="680" > </td></tr>
<tr><td width="680" > </td></tr>
<tr><td width="680" align="center" >
<table width="98%" border="0" cellpadding="0" cellspacing="0"><!--table2-->
<tr><!--tr1 3 col-->
<td width="10"><img src="images/block_1-2.gif" width="10" height="10" /></td>
<td background="images/block_2-2.gif"><img src="images/block_2-2.gif" width="1" height="10" /></td>
<td width="10"><img src="images/block_3-2.gif" width="10" height="10" /></td>
</tr>
<tr>
<td background="images/block_4-2.gif"><img src="images/block_4-2.gif" width="10" height="1" /></td><!--td1 tr2 table2-->
<td align="left" valign="top"><!--td2 tr2 table2-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><!--table3-->
<tr><!--tr1 3 col-->
<td bgcolor="#ffffff" valign="top" height="103" width="613">
<p align="center"><br><font size="3"><? echo"<font size='3' color='#3399FF'><b>$title</b></font></p><p align='left'><br><img src='images/bullet/calendar.gif'> <font size=1>$post_date1 :"; if($txtLevel==0){ ?>ฝ่ายกิจการนักศึกษา<?}else if($txtLevel==1){?>ฝ่ายกิจการนักศึกษา<?}echo": กลุ่ม $news_cat_name <br>$page_title <b>อ่าน [$read_count]</b>"; ?></font>
   <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php" share_url="http://www.not-or-project.com/alumni/menuView.php?article_id=<?=$article_id;?>" rel="nofollow"></a>
</p>
<p align='center'><font size="2" face="Tahoma">
<?
if($picture1!="" && $picture1!="smile.jpg" ){
$t="thumbnail_v.php?im=";
$f="news_pic/$picture1";
$file = $t .$f;
$v="<img src='$file' align='center' border='0' class='tab_box3'>";
echo"<a href=\"news_pic/$picture1\" rel=\"lightbox[roadtrip]\" title=\"$title\">$v</a>";
}else{
//echo"<img align='center' vspace='10' hspace='10' src='images/icons/no_picture.gif' class='tab_box3'>";
}
echo"</p><p align='left'><br><b>$abstract.....</b><p>$detail";
?><br></font></p>
<?/*ภาพประกอบ*/?>
<p align="center"><font size="1" face="Verdana"><?
$sql_pic = "select * from news_picture where news_id=$news_id order by pic_id";
$result_pic= mysql_query($sql_pic);
$NumRowPic = mysql_num_rows($result_pic);
if($NumRowPic!=0){
?>
<table width='100%'><!--table4-->
<tr>
<?
$jj=0;
while ($row_pic = mysql_fetch_array($result_pic)) {
$jj++;
$pic_id=$row_pic["pic_id"];
$article_id = $row_pic["news_id"];
$pic_file = $row_pic["pic_file"];
$pic_descript = $row_pic["pic_detail"];
$t="thumbnail_v1.php?im=";
$f="news_pic/$pic_file";
$file = $t .$f;
$v="<img src='$file' border='0'>";
?>
<td align="center">
<a href="news_pic/<?=$row_pic["pic_file"];?>" rel="lightbox[roadtrip]" title="<?=$row_pic["pic_detail"];?>"><?=$v;?></a>
</td>
<?
if($jj==4){?>
</tr><tr>
<?
$jj=0;
}
}?></tr></table><!--ปิดtable4-->
<?
}
?>
</font></p>
<hr>
<p><b><font size="2">ข่าวอื่นที่น่าสนใจ</font></b><br><font size="2"><?
$sql_news = "select * from news where (news_publish=1 and news_cat_id=$news_cat_id and news_id<>$article_id) and news_id between 1 and 5 order by news_id desc";
$result_news= mysql_query($sql_news);
$NumRowNews = mysql_num_rows($result_news);
if($NumRowNews!=0){
while ($row_news = mysql_fetch_array($result_news)) {
$article_id1 = $row_news["news_id"];
$title1 = $row_news["news_title"];
echo"<img src='images/bullet/0039_bullet3.png'> <a href='menuView.php?article_id=$article_id1' target='_self'>$title1</a><br>";
}
}
?>
</font><br> </p>
</td>
<!--เส้น-->
<td width="1" cellspacing="0" background="images/line_vertical.gif" WIDTH="1" HEIGHT="10" BORDER="0" valign="top"><div align="center"> <div>
</td>
<!--ทางขวา-->
<td bgcolor="#FFFFFF" valign="top" height="103" width="137">
<p align="center"><form name="search" method="post" action="news_search.php" target="_self">
<p align="center"><b>ค้นหาข่าว</b><br><input type="text" name="keyword" size="17"><br><input type="submit" value="Search"> </p>
</form>
<p align="center"><b><u><font size="2"><br>ไฟล์ที่เกี่ยวข้อง</span></font></u></b></p>
<p align="left"><font size="1">
<?
$sql_file = "select * from news_file where news_id=$news_id order by file_id";
$result_file= mysql_query($sql_file);
$NumRowFile = mysql_num_rows($result_file);
if($NumRowFile!=0){
while ($row_file = mysql_fetch_array($result_file)) {
$file_id=$row_file["file_id"];
$article_id = $row_file["news_id"];
$file_name = $row_file["file_file"];
$file_descript = $row_file["file_detail"];
list($filename_befor_dot,$filename_after_dot) = explode(".",$file_name);
if($filename_after_dot=="pdf"){
$icon="<img src='images/bullet/icon_pdf.png'>";
}else if($filename_after_dot=="doc"){
$icon="<img src='images/bullet/icon_word.png'>";
}else if($filename_after_dot=="xls"){
$icon="<img src='images/bullet/icon_excell.png'>";
}else if($filename_after_dot=="ppt"){
$icon="<img src='images/bullet/icon_powerpoint.png'>";
}else if($filename_after_dot=="pub"){
$icon="<img src='images/bullet/icon_publisher.png'>";
}else if($filename_after_dot=="txt"){
$icon="<img src='images/bullet/0177_document.png'>";
}else if($filename_after_dot=="zip"){
$icon="<img src='images/bullet/icon_zip.png'>";
}
echo"<a href='news_file/$file_name' target='_blank'>$icon <font size=2>$file_descript <img src='images/bullet/misc.png' border='0'></a><br>";
}
}
?>
</font></p>
</td>
</tr>
</table><!--ปิดtable3-->
</td>
<td background="images/block_6-2.gif"><img src="images/block_6-2.gif" width="10" height="1" /></td><!--td3 tr2 table2-->
</tr>
<tr>
<td><img src="images/block_7-2.gif" width="10" height="10" /></td>
<td background="images/block_8-2.gif"><img src="images/block_8-2.gif" width="1" height="10" /></td>
<td><img src="images/block_9-2.gif" width="10" height="10" /></td>
</tr>
</table></td></tr></table>
</td><!--form center end here-->
</tr>
</table>
</td>
</tr>
</table>
</td>
<td background="images_k/3-2.jpg" valign="top" width="65" height="350"><!--เงาทางขวา-->
<table border="0" cellpadding="0" cellspacing="0" width="65">
<tbody><tr>
<td background="images_k/3-1.jpg" width="65" height="350">
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr style="background-color:#FFF;"><!-- footer-->
<?@include"footer.php";?>
</tr>
</tbody></table>
</body>
</html>
|
ประวัติการแก้ไข 2014-10-08 14:43:20
 |
 |
 |
 |
Date :
2014-10-08 14:42:13 |
By :
khoson |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
1. ทำไมไม่พิมพ์ลงใน
Code (PHP)
tag PHP
มาแบบนี้ดูยากครับ
2. ภาพที่ไม่แสดงอยู่บรรทัดไหนครับ ลองคลิกขวาที่รูปที่ไม่แสดง แล้วเลือกคัดลอก url รูปภาพ จากนั้นไปวางใน note pad แล้วไล่โุว่าพาทและชื่อรูปถูกต้องจริงๆ หรือไม่
3. หรือไม่ก็ view source code ดูครับ แล้วดูที่พาทรูปว่าถูกต้องหรือไม่
เมื่อตรวจสอบแล้ว จะทำไงต่อ
1. ถ้าพาทและชื่อรูปถูกทุกอย่าง ก็เข้าไปดูในโฟล์เดอร์ที่เก็บรูปว่ามีรูปที่ชื่อนั้นๆ จริงหรือไม่
2. ดูแล้วพาทถูก แต่ชื่อรูปไม่แสดง ตรงนี้ลองเช็ค echo ชื่อรูปภาพ
|
 |
 |
 |
 |
Date :
2014-10-08 15:17:53 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตรงนี้หรือเปล่าครับที่มีปัญหา?
Code (PHP)
<a href="news_pic/<?=$row_pic["pic_file"];?>" rel="lightbox[roadtrip]" title="<?=$row_pic["pic_detail"];?>"><?=$v;?></a>
|
 |
 |
 |
 |
Date :
2014-10-08 15:24:13 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช่ๆครับบรรทัดนี้ครับ จะแก้ยังไหงดีครับ

นี้คือตำแหน่งของมันครับ path ที่เก็บรูป
|
ประวัติการแก้ไข 2014-10-08 15:40:43
 |
 |
 |
 |
Date :
2014-10-08 15:38:37 |
By :
khoson |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แก้ง่ายมากครับ
Code (PHP)
<a href="news_pic/<?=$row_pic["pic_file"];?>" rel="lightbox[roadtrip]" title="<?=$row_pic["pic_detail"];?>"><img src='news_pic/<?=$row_pic["pic_file"];?>' border='0'></a>
|
 |
 |
 |
 |
Date :
2014-10-08 16:02:51 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมแก้ตามนี้แล้วครับ แต่พอรัน ไม่ขึ้นหน้าอะไรเลยครับเป็นหน้าว่างเปล่าครับ

ขอโทษที่ผมแก้ไรผิดไปป่าวไม่รู้ครับ
|
ประวัติการแก้ไข 2014-10-08 16:18:37 2014-10-08 16:20:06
 |
 |
 |
 |
Date :
2014-10-08 16:16:45 |
By :
khoson |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณไม่เช็คโครงสร้างภาษา HTML กับ PHP เลยนะครับ ให้ไปยังไงก็เอาไปใช้อย่างนั้นเลย  
Code (PHP)
echo "<a href=\"news_pic/".$row_pic["pic_file"]."\" rel=\"lightbox[roadtrip]\" title=\"".$row_pic["pic_detail"]."\"><img src=\"news_pic/".$row_pic["pic_file"]."\" border=\"0\"></a>";
|
 |
 |
 |
 |
Date :
2014-10-08 16:31:25 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ครับ ขอบคุณครับเดียวลองเอาไปใช้ดูครับ
|
 |
 |
 |
 |
Date :
2014-10-08 16:33:05 |
By :
khoson |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|