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-1186271909:v:use_geshi-1:v:type-php

Started by IchBin, Aug 04, 2007, 11:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

   global $db_prefix, $context, $user_info;
   
   if (isset($context['jump_to']))
      return;

   // Find the boards/cateogories they can see.
   $request = db_query("
      SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel
      FROM {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
      WHERE $user_info[query_see_board]", __FILE__, __LINE__);
   $context['jump_to'] = array();
   $this_cat = array('id' => -1);
   while ($row = mysql_fetch_assoc($request))
   {
      if ($this_cat['id'] != $row['ID_CAT'])
      {
         $this_cat = &$context['jump_to'][];
         $this_cat['id'] = $row['ID_CAT'];
         $this_cat['name'] = $row['catName'];
         $this_cat['boards'] = array();
      }

      $this_cat['boards'][] = array(
         'id' => $row['ID_BOARD'],
         'name' => $row['boardName'],
         'child_level' => $row['childLevel'],
         'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board']
      );
   }
   mysql_free_result($request);


               echo '<select id="moveItTo" name="move_to" disabled="disabled">';

               foreach ($context['jump_to'] as $category){
                     foreach ($category['boards'] as $board){

                           echo '
                                    <option value="', $board['id'], '">', $board['name'], '</option>';
                     }
               }
               echo '</select>';

Guest

   global $db_prefix, $context, $user_info;
   
   if (isset($context['jump_to']))
      return;

   // Find the boards/cateogories they can see.
   $request = db_query("
      SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel
      FROM {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
      WHERE $user_info[query_see_board]", __FILE__, __LINE__);
   $context['jump_to'] = array();
   $this_cat = array('id' => -1);
   while ($row = mysql_fetch_assoc($request))
   {
      if ($this_cat['id'] != $row['ID_CAT'])
      {
         $this_cat = &$context['jump_to'][];
         $this_cat['id'] = $row['ID_CAT'];
         $this_cat['name'] = $row['catName'];
         $this_cat['boards'] = array();
      }

      $this_cat['boards'][] = array(
         'id' => $row['ID_BOARD'],
         'name' => $row['boardName'],
         'child_level' => $row['childLevel'],
         'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board']
      );
   }
   mysql_free_result($request);


echo '<select id="moveItTo" name="move_to" disabled="disabled">';

   foreach ($context['jump_to'] as $category){
      foreach ($category['boards'] as $board){

         echo '<option value="', $board['id'], '">', $board['name'], '</option>';
      }
   }
echo '</select>';

Guest

   global $db_prefix, $context, $user_info;
   
   if (isset($context['jump_to']))
      return;

   // Find the boards/cateogories they can see.
   $request = db_query("
      SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel
      FROM {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
      WHERE $user_info[query_see_board]", __FILE__, __LINE__);
   $context['jump_to'] = array();
   $this_cat = array('id' => -1);
   while ($row = mysql_fetch_assoc($request))
   {
      if ($this_cat['id'] != $row['ID_CAT'])
      {
         $this_cat = &$context['jump_to'][];
         $this_cat['id'] = $row['ID_CAT'];
         $this_cat['name'] = $row['catName'];
         $this_cat['boards'] = array();
      }

      $this_cat['boards'][] = array(
         'id' => $row['ID_BOARD'],
         'name' => $row['boardName'],
         'child_level' => $row['childLevel'],
         'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board']
      );
   }
   mysql_free_result($request);

echo '<form action="',$scripturl . '?' $_SERVER['QUERY_STRING'],'" method="post">';
echo '<select id="moveItTo" name="move_to">';

   foreach ($context['jump_to'] as $category){
      foreach ($category['boards'] as $board){

         echo '<option value="', $board['id'], '">', str_repeat('-', $board['child_level'] + 1), ' ', $board['name'], '</option>';
      }
   }
echo '</select>';
echo '<input type="submit" name="mySubmit" value="Submit">';
echo '</form>';

Guest

<?php
   global $db_prefix, $context, $user_info;
   
   if (isset($context['jump_to']))
      return;

   // Find the boards/cateogories they can see.
   $request = db_query("
      SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel
      FROM {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
      WHERE $user_info[query_see_board]", __FILE__, __LINE__);
   $context['jump_to'] = array();
   $this_cat = array('id' => -1);
   while ($row = mysql_fetch_assoc($request))
   {
      if ($this_cat['id'] != $row['ID_CAT'])
      {
         $this_cat = &$context['jump_to'][];
         $this_cat['id'] = $row['ID_CAT'];
         $this_cat['name'] = $row['catName'];
         $this_cat['boards'] = array();
      }

      $this_cat['boards'][] = array(
         'id' => $row['ID_BOARD'],
         'name' => $row['boardName'],
         'child_level' => $row['childLevel'],
         'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board']
      );
   }
   mysql_free_result($request);

echo '<form action="',$scripturl . '?' $_SERVER['QUERY_STRING'],'" method="post">';
echo '<select id="moveItTo" name="move_to">';

   foreach ($context['jump_to'] as $category){
      foreach ($category['boards'] as $board){

         echo '<option value="', $board['id'], '">', str_repeat('-', $board['child_level'] + 1), ' ', $board['name'], '</option>';
      }
   }
echo '</select>';
echo '<input type="submit" name="mySubmit" value="Submit">';
echo '</form>';

if (isset($_POST['mySubmit'])){
   $temp = $user_info['query_see_board'];
   $user_info['query_see_board'] .= "\nAND b.id_board = " .(int) $_POST['id'];
      ssi_recentPosts();
   $user_info['query_see_board'] = $temp;
}
?>

Guest

<?php
   global $db_prefix, $context, $user_info;
   
   if (isset($context['jump_to']))
      return;

   // Find the boards/cateogories they can see.
   $request = db_query("
      SELECT c.name AS catName, c.ID_CAT, b.ID_BOARD, b.name AS boardName, b.childLevel
      FROM {$db_prefix}boards AS b
         LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
      WHERE $user_info[query_see_board]", __FILE__, __LINE__);
   $context['jump_to'] = array();
   $this_cat = array('id' => -1);
   while ($row = mysql_fetch_assoc($request))
   {
      if ($this_cat['id'] != $row['ID_CAT'])
      {
         $this_cat = &$context['jump_to'][];
         $this_cat['id'] = $row['ID_CAT'];
         $this_cat['name'] = $row['catName'];
         $this_cat['boards'] = array();
      }

      $this_cat['boards'][] = array(
         'id' => $row['ID_BOARD'],
         'name' => $row['boardName'],
         'child_level' => $row['childLevel'],
         'is_current' => isset($context['current_board']) && $row['ID_BOARD'] == $context['current_board']
      );
   }
   mysql_free_result($request);

echo '<form action="',$scripturl . '?' $_SERVER['QUERY_STRING'],'" method="post">';
echo '<select id="moveItTo" name="move_to">';

   foreach ($context['jump_to'] as $category){
      foreach ($category['boards'] as $board){

         echo '<option value="', $board['id'], '">', str_repeat('-', $board['child_level'] + 1), ' ', $board['name'], '</option>';
      }
   }
echo '</select>';
echo '<input type="submit" name="mySubmit" value="Submit">';
echo '</form>';

if (isset($_POST['mySubmit'])){
   $temp = $user_info['query_see_board'];
   $user_info['query_see_board'] .= "\nAND b.id_board = " .(int) $_POST['move_to'];
      ssi_recentPosts();
   $user_info['query_see_board'] = $temp;
}
?>