SMF Support > SMF 2.0.x Support

need help about preview Attachment on first page (index)

(1/1)

ittiphol:

how to preview Attachment on first page (index) same this web

look at middle page (เกาะสนาม EURO 2012 )

http://euro2012.bkkclub.net/



sorry my English

Akyhne:
I don't believe it's really a preview, just a mod that adds an image to a topic or board.

There are quite a few mods that can do suck things:

Board Icons:
http://mods.simplemachines.org/index.php?mod=511
http://custom.simplemachines.org/mods/index.php?mod=3023
http://custom.simplemachines.org/mods/index.php?mod=1103
http://custom.simplemachines.org/mods/index.php?mod=3209 (maybe the most interesting one for your purpose).

Message icons:
http://custom.simplemachines.org/mods/index.php?mod=1151
http://custom.simplemachines.org/mods/index.php?mod=1266

There may be more mods:
http://www.simplemachines.org/community/index.php?action=search2;search=board+icon;brd[]=59

ittiphol:
That really preview from Attachment Picture

this is my code but i don't know why Attachment Picture not show

ex.



show on index page



--- Quote ---<?
$host="localhost";
$user="xxxxxxx";
$pass="xxxxxxx";
$dbname="xxxxxxx";

$conn=mysql_connect($host,$user,$pass) or die("can't connect to database");
$db=mysql_select_db($dbname,$conn) or die("connect to database");

$ID_BOARD = '67.0'; //ID board

$sql = " SELECT * FROM smf_topics ";
$sql .= " INNER JOIN smf_messages ON smf_messages.ID_MSG = smf_topics.ID_FIRST_MSG ";
$sql .= " WHERE smf_topics.ID_BOARD = '".$ID_BOARD."'   ORDER BY smf_topics.ID_TOPIC DESC LIMIT 9";

$res['result'] = mysql_query($sql);     


$cols=5; //colum
$c=$cols;
echo "<table width='100%' bgcolor='#666666' style='
            border:solid;
            border-top-color: #000000;
            border-top-width:1px;
            border-left-color:#000000;
            border-left-width:1px;
            border-right-color:#000000;
            border-right-width:1px;
            border-bottom-color:#000000;
            border-bottom-width:1px;
         '>\n<tr>";
while ($rs = mysql_fetch_array($res['result'])) {
  $c--;
         $sql_thumb = " SELECT * FROM smf_attachments WHERE ID_MSG = '".$rs['ID_FIRST_MSG']."'  AND ID_THUMB !='0' ORDER BY ID_ATTACH ASC  LIMIT 1";
         $res['select_thumb'] = mysql_query($sql_thumb);     
         $rs_t = mysql_fetch_array($res['select_thumb']);
      echo "<td align='center' valign='top' >";
      ?>
      <table width="100%" cellpadding="2"   >
       <tr>
       <td align='center' valign="top"  onMouseOver="this.bgColor='#808080'" onMouseOut ="this.bgColor = ''"  style='
            border:solid;
            border-top-color: #FFFFFF;
            border-top-width:0px;
            border-left-color:#FFFFFF;
            border-left-width:0px;
            border-right-color:#FFFFFF;
            border-right-width:0px;
            border-bottom-color:#FFFFFF;
            border-bottom-width:0px;
         '>
      <?
         if($rs_t['ID_THUMB']==''){
            echo "<a href='webboard/index.php?topic=".$rs['ID_TOPIC']."' target='_blank' style='
                  text-decoration:none;'><img src='images/noimage.jpg' border='1' >[/url]
";
         }else{
            echo "<a href='index.php?topic=".$rs['ID_TOPIC']."' target='_blank'><img src='webboard/index.php?action=dlattach;topic=".$rs['ID_TOPIC'].";attach=".$rs_t['ID_THUMB'].";image' style='
            border:solid;
            border-top-color: #000000;
            border-top-width:1px;
            border-left-color:#000000;
            border-left-width:1px;
            border-right-color:#000000;
            border-right-width:1px;
            border-bottom-color:#000000;
            border-bottom-width:1px;
         ' >[/url]
";   
         }
         echo "<a href='webboard/index.php?topic=".$rs['ID_TOPIC']."' target='_blank' style='
                  text-decoration:none;'><font style='
                  text-decoration:none;
                  color:#FFFFFF;'>".$rs['subject']."</font>[/url]";
   ?>
   </td></tr></table>
   <?
  echo "</td>";
  //แสดงข้อมูลที่อ่านได้
  if ($c==0) {
    echo "</tr><tr>";
    $c=$cols;
  }
}
echo "</tr>\n</table>\n";
?>
--- End quote ---


like this
http://custom.simplemachines.org/mods/index.php?mod=977


Navigation

[0] Message Index

Go to full version