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

Started by SleePy, Nov 15, 2011, 02:54 am

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

SleePy

      // Get the tracked bugs
      $request = smcFunc::db_query('', '
         SELECT COUNT(DISTINCT t.id_topic)
         FROM {db_prefix}topics AS t
            INNER JOIN main_messages AS m ON (m.id_msg = t.id_first_msg)
         WHERE t.id_board = {int:bugs_board}
            AND m.subject REGEXP({string:regex})',
         array(
            'bugs_board' => 137,
            'regex' => '\[[0-9]{4}\]'
      ));
      list ($tracked) = smcFunc::db_fetch_row($request);
      smcFunc::db_free_result($request);

      // Get the total
      $request = smcFunc::db_query('', '
         SELECT COUNT(id_topic)
         FROM {db_prefix}topics
         WHERE id_board = {int:bugs_board}',
         array(
            'bugs_board' => 137
      ));
      list ($total) = smcFunc::db_fetch_row($request);
      smcFunc::db_free_result($request);

      // Get the locked
      $request = smcFunc::db_query('', '
         SELECT COUNT(id_topic)
         FROM {db_prefix}topics
         WHERE id_board = {int:bugs_board}
            and locked = {int:locked}',
         array(
            'bugs_board' => 137,
            'locked' => 1,
      ));
      list ($locked) = smcFunc::db_fetch_row($request);
      smcFunc::db_free_result($request);
No siggy! :D

Browser ID: smf ()
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 3: index+Modifications.english (default), Post.english (default), Editor.english (default).
Style sheets: 3: index.css, jquery.sceditor.css, responsive.css.
Hooks called: 47 (show)
Files included: 28 - 1020KB. (show)
Memory used: 1047KB.
Tokens: post-login.
Cache hits: 19: 0.00285s for 30,086 bytes (show)
Cache misses: 3: (show)
Queries used: 14.

[Show Queries]