Konu: Soldan sağa ya da sağdan sola kayan resimler bloğu  (Okunma sayısı 586 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

24 Mart 2014, 20:15
  • *
    • İleti: 2018
    • Karma: 41
    • Spina Bifida
    • Profili Görüntüle

php blok:
Kod: [Seç]
global $smcFunc, $scripturl;

$boards = array(151);

$request = $smcFunc['db_query']('', '
   SELECT t.id_topic, m.subject, m.body
   FROM {db_prefix}topics AS t
      INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
   WHERE t.id_board IN ({array_int:boards})
   ORDER BY t.id_topic DESC
        LIMIT {int:limit}',
   array(
     'boards' => $boards,
                'limit' => 5,
   )
);
$topics = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
   $topics[] = array(
      'id_topic' => $row['id_topic'],
      'subject' => $row['subject'],
      'body' => $row['body'],
      'first_image' => preg_match_all('~\[img\]([^\]]+)\[\/img\]~i', $row['body'], $images) ? '<img src="' . $images[1][0] . '" alt="' . $row['subject'] . '" height="100" width="100" />' : '',
   );
$smcFunc['db_free_result']($request);

echo '
<table>
<tr>
<td><input type="button" value="«" onclick="document.getElementById(\'images_marquee\').direction = \'left\';" /></td>
<td width="100%">
<marquee id="images_marquee" behavior="scroll" direction="left" scrollamount="8"  height="100" width="100%" onmouseover="this.stop();" onmouseout="this.start();">
<table>
<tr>';
foreach ($topics as $topic)
echo '
<td>
<a href="', $scripturl, '?topic=', $topic['id_topic'], '.0">', $topic['first_image'], '<br /><span></span></a>
</td>';
echo '
</tr>
</table>
</marquee>
</td>
<td><input type="button" value="»" onclick="document.getElementById(\'images_marquee\').direction = \'right\';" /></td>
</tr>
</table><br />';
151 bölüm idsidir.


24 Mart 2014, 20:41
Yanıtla #1
  • mavice

SP haricinde çalışır mı bu kod?
Deneme imkanım şu an zor , internet çok yavaş :(