News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1217928696:v:use_geshi-1:v:type-php

Started by Guest, Aug 05, 2008, 09:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Guest

$request = $smcFunc['db_query']('', '
SELECT t.id_topic, m.subject, l.id_msg
FROM smf_topics as t
INNER JOIN smf_messages as m ON (m.id_msg = t.id_first_msg)
LEFT JOIN smf_log_topics as l ON (t.id_topic = l.id_topic)
WHERE t.is_sticky = {int:is_sticky}
AND t.id_board = {int:id_board}',
array(
'is_sticky' => 1,
'id_board' => $board
));

Guest

$request = $smcFunc['db_query']('', '
   SELECT t.id_topic, m.subject, l.id_msg
   FROM smf_topics as t
      INNER JOIN smf_messages as m ON (m.id_msg = t.id_first_msg)
       LEFT JOIN smf_log_topics as l ON (t.id_topic = l.id_topic)
   WHERE t.is_sticky = {int:is_sticky}
      AND t.id_board = {int:id_board}',
   array(
      'is_sticky' => 1,
      'id_board' => $board
   ));

Guest

$request = $smcFunc['db_query']('', '
   SELECT t.id_topic, m.subject, l.id_msg
   FROM smf_topics as t
    INNER JOIN smf_messages as m ON (m.id_msg = t.id_first_msg)
    LEFT JOIN smf_log_topics as l ON (t.id_topic = l.id_topic)
   WHERE t.is_sticky = {int:is_sticky}
    AND t.id_board = {int:id_board}',
   array(
    'is_sticky' => 1,
    'id_board' => $board
   ));

Guest

$request = $smcFunc['db_query']('', '
   SELECT t.id_topic, m.subject, l.id_msg
   FROM smf_topics as t
    INNER JOIN smf_messages as m ON (m.id_msg = t.id_first_msg)
    LEFT JOIN smf_log_topics as l ON (t.id_topic = l.id_topic)
   WHERE t.is_sticky = {int:is_sticky}
    AND t.id_board = {int:id_board}',
   array(
    'is_sticky' => 1,
    'id_board' => $board
   ));

while ($row = $smcFunc['db_fetch_assoc']())
{
   if (empty($row['id_msg']))
    $context['unread_stickies'][$row['id_topic']] = $row['subject'];
   else
    $context['read_stickies'][$row['id_topic']] = $row['subject'];
}

Guest

$request = $smcFunc['db_query']('', '
   SELECT t.id_topic, m.subject, IFNULL(l.id_msg,0) as id_msg
   FROM smf_topics as t
    INNER JOIN smf_messages as m ON (m.id_msg = t.id_first_msg)
    LEFT JOIN smf_log_topics as l ON (l.id_topic = t.id_topic)
   WHERE t.is_sticky = {int:is_sticky}
    AND t.id_board = {int:id_board}',
   array(
    'is_sticky' => 1,
    'id_board' => $board
   ));

while ($row = $smcFunc['db_fetch_assoc']())
{
   if (empty($row['id_msg']))
    $context['stickied']['unread_stickies'][$row['id_topic']] = $row['subject'];
   else
    $context['stickied']['read_stickies'][$row['id_topic']] = $row['subject'];
}