help with sql for recent topics module.. - Joomla! Forum - community, help and support


hi there have pulled out following sql module shows recent topics, further filter specific board via variable lets $theboardid

heres current sql

code: select all

select

            mem.realname, m.postertime, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name bname, t.numreplies, t.id_last_msg,

            ifnull(mem.realname, m.postername) postername, " . ($user_info['is_guest'] ? '1 isread, 0 new_from' : '

            ifnull(lt.id_msg, ifnull(lmr.id_msg, 0)) >= m.id_msg_modified isread,

            ifnull(lt.id_msg, ifnull(lmr.id_msg, -1)) + 1 new_from') . ", left(m.body, 384) body, m.smileysenabled, m.icon

        ({$str_table_prefix}messages m, {$str_table_prefix}topics t, {$str_table_prefix}boards b, {$str_table_prefix}messages ms)

            left join {$str_table_prefix}members mem on (mem.id_member = m.id_member)" . (!$user_info['is_guest'] ? "

            left join {$str_table_prefix}log_topics lt on (lt.id_topic = t.id_topic , lt.id_member = $id_member)

            left join {$str_table_prefix}log_mark_read lmr on (lmr.id_board = b.id_board , lmr.id_member = $id_member)" : '') . "

        t.id_last_msg >= " . ($modsettings['maxmsgid'] - 35 * min($int_num_topics, 5)) . "

            , t.id_last_msg = m.id_msg

            , b.id_board = t.id_board" . (empty($exclude_boards) ? '' : "

            , b.id_board not in (" . implode(', ', $exclude_boards) . ")") . "

            , $user_info[query_see_board]

            , ms.id_msg = t.id_first_msg

        order t.id_last_msg desc

        limit $int_num_topics"


im struggling pretty complex statement. help.

another way round use ssi include functions following example. places search box inside static page, im trying work inside joomla, problem in joomla action need changed, im doing simpler recent articles function related query above.

here code

code: select all

function ssi_quicksearch($output_method = 'echo')
{
   global $scripturl, $txt, $context;

   if ($output_method != 'echo')
      return $scripturl . '?action=search';

   echo '
      <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
         <input type="hidden" name="advanced" value="0" /><input type="text" name="search" size="30" /> <input type="submit" name="submit" value="', $txt[182], '" />
      </form>';
}


im not sure how return working after if...

essentially need action not $scripturl

$str_jsmf_url_mine = "index.php?option=com_smf&itemid=49&";
$str_jsmf_url_mine . '?board=' . $row['id_board'] . '.0&action=search';





Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor