News:

Wondering if this will always be free?  See why free is better.

Main Menu

Bookmarks

Started by Matthew K., July 16, 2007, 01:07:24 PM

Previous topic - Next topic

Aaron

Quote from: MTF95 on April 28, 2008, 02:17:56 PM
Swedish translation

Thanks, I'll include it in the next version! :D

Quote from: Spike50 on May 01, 2008, 04:31:24 AM
Table 'DB284637.smf_bookmarks' doesn't exist
File: /mnt/web1/31/05/5538905/htdocs/unitedrant/Sources/Bookmarks.php
Line: 115

Is what I get when I try to bookmark anything...

Run this query manually in PHPMyAdmin:


CREATE TABLE smf_bookmarks
(
`ID_MEMBER` mediumint(8) unsigned NOT NULL,
`ID_TOPIC` mediumint(8) unsigned NOT NULL,
UNIQUE KEY `ID_MEMBER` (`ID_MEMBER`,`ID_TOPIC`)
);

Alan S

Hey aaron , just wondering , any solution for for the

[quote]
Unknown column 'bm.ID_MEMBER' in 'where clause'
File: /home/theftacl/public_html/smf/Sources/Bookmarks.php
Line: 57


problem?
Quote from: Eliana Tamerin on August 23, 2008, 04:10:10 PM
SMF 7 is where it gets good. That has time travel. You can go back and post before the guy who flamed you. :P

Aaron

Yes, and the solution is actually in the post above yours. ::)

Jed C

no help for me then  ::)

Aaron

Sorry, I must've overlooked your post. Just install the mod despite the warning, and then add the button manually to the display template, by opening Display.template.php and replacing:


$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']),


With:

$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']),
'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),


If another mod modified the bit of code cited above, be a bit creative. :)

Jed C

cheers Aaron will try that tomorrow  ;)

Jed C

Tried that Aaron but it did not work  ::)
here is copy of my display.template if thats any use

[code]<?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="' . ($modSettings['whovotedwhatMode'] != 'disabled' ? 5 : 0) . '" cellspacing="0">';

                                // Show each option with its corresponding percentage bar.
                        foreach ($context['poll']['options'] as $option)
                        {
        if (!allowedTo('poll_view_voters') || $modSettings['whovotedwhatMode'] == 'disabled')
        {
                                  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>';
        }
        else {
          switch ($modSettings['whovotedwhatMode'])
          {
            case 'select':
                                      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>' : '', '
                <td style="padding-left: 2ex;">
                  <select id="jumpto" name="voters' . $option['ID_OPTION'] . '" 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);" style="width: 150px;">';
              if (!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
              {
                echo '
                    <option selected="selected" value="#">' . $txt['poll_view_voters_expand_to_view'] . '</option>
                    <option disabled="disabled" value="">----------------------</option>';
                foreach ($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                {
                  echo '
                    <option value="?action=profile;u=' . $voter['ID_MEMBER'] . '"> => ' . $voter['realName'] . '</option>';
                }
                echo '
                    <option disabled="disabled" value="">----------------------</option>
                    <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help1'] . '</option>
                    <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help2'] . '</option>';
              }
              else
              {
                echo '
                    <option selected="selected" value="">----------------------</option>';
              }
              echo '
                  </select>
                </td>
                                                        </tr>';
              break;
            case 'table':
              echo '
              <tr>
                <td style="padding-right: 4ex; vertical-align: top;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>
                <td style="padding-right: 4ex;">
                  ', $option['bar'], '<br />';
              if (!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
              {
                foreach ($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                {
                  echo '<small><a href="?action=profile;u=' . $voter['ID_MEMBER'] . '">', $voter['realName'], '</a></small> ';
                }
              }
              echo '
                </td>
                <td style="padding-left: 2ex; padding-right: 2ex; text-align: center; vertical-align: top;">', $option['votes'], '</td>
                <td style="padding-left: 4ex; text-align: right; vertical-align: top;">', $option['percent'], '%</td>
              </tr>';
              break;
          }
        }
                        }

                        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']) == 1 ? $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'] == 1 ? $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', 66, 17, 'align="middle"');
        $remove_button = create_button('delete.gif', 121, 31, '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'] == 0 ? '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 />';

                        // 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 />';

                                require_once($GLOBALS['sourcedir'] . '/CustomProfile.php');
                                displayCustomFieldsPost($message);

                        // 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']

Aaron

Find (yes, it really is there):

        $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']),


Add after:

                'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),


That should do the trick.

ccbtimewiz

... you didn't do what he told you to do.

Find:
Code (display.template.php) Select
// 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'),
        );


And replace it with:

// 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']),
                'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),
                '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'),
        );


Make sure the edits are done on whatever theme you're editing if you're not using the default theme.

Jed C

thats the original un-modified  ::) ;)

ccbtimewiz

Quote from: steve b on May 15, 2008, 05:16:03 PM
thats the original un-modified  ::) ;)

Any errors in the error log?

Jed C

yep but don't know what they mean  ::)

Quote
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:44:22 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=modlog
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:44:22 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=modlog
Apply Filter: Only show the errors with the same message
8: Undefined index: elgm4
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Themes\default\Admin.template.php (eval?)
Line: 575
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:44:08 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=reports
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:44:08 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=reports
Apply Filter: Only show the errors with the same message
8: Undefined index: elgm4
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Themes\default\Admin.template.php (eval?)
Line: 575
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:44:00 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=reports
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:44:00 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=reports
Apply Filter: Only show the errors with the same message
8: Undefined index: elgm4
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Themes\default\Admin.template.php (eval?)
Line: 575
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:56 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=viewErrorLog;desc
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:56 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=viewErrorLog;desc
Apply Filter: Only show the errors with the same message
8: Undefined index: elgm4
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Themes\default\Errors.template.php (eval?)
Line: 575
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:26 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=viewErrorLog;desc
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:26 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=viewErrorLog;desc
Apply Filter: Only show the errors with the same message
8: Undefined index: elgm4
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Themes\default\Errors.template.php (eval?)
Line: 575
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:19 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=admin
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:19 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=admin
Apply Filter: Only show the errors with the same message
8: Undefined index: elgm4
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Themes\default\Admin.template.php (eval?)
Line: 575
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:16 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=admin
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:16 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php?action=admin
Apply Filter: Only show the errors with the same message
8: Undefined index: elgm4
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Themes\default\Login.template.php (eval?)
Line: 575
   
Apply Filter: Only show the error messages of this member nobodys fool    Today at 07:42:09 pm
Apply Filter: Only show the error messages of this IP address 90.203.215.213      Apply Filter: Only show the error messages of this session 0bb48ca9ddf58175a14c1cea6a0ba6a4
Apply Filter: Only show the error messages of this URL http://ecmdrivers.org/ecmforumbackup/index.php
Apply Filter: Only show the errors with the same message
8: Undefined index: REQUEST_URI
File: d:\Domains\ecmdrivers.org\wwwroot\ecmforumbackup\Sources\Subs.php
Line: 3336

Jed C

and modified display.template

Quote<?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="' . ($modSettings['whovotedwhatMode'] != 'disabled' ? 5 : 0) . '" cellspacing="0">';

                                // Show each option with its corresponding percentage bar.
                        foreach ($context['poll']['options'] as $option)
                        {
        if (!allowedTo('poll_view_voters') || $modSettings['whovotedwhatMode'] == 'disabled')
        {
                                  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>';
        }
        else {
          switch ($modSettings['whovotedwhatMode'])
          {
            case 'select':
                                      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>' : '', '
                <td style="padding-left: 2ex;">
                  <select id="jumpto" name="voters' . $option['ID_OPTION'] . '" 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);" style="width: 150px;">';
              if (!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
              {
                echo '
                    <option selected="selected" value="#">' . $txt['poll_view_voters_expand_to_view'] . '</option>
                    <option disabled="disabled" value="">----------------------</option>';
                foreach ($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                {
                  echo '
                    <option value="?action=profile;u=' . $voter['ID_MEMBER'] . '"> => ' . $voter['realName'] . '</option>';
                }
                echo '
                    <option disabled="disabled" value="">----------------------</option>
                    <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help1'] . '</option>
                    <option disabled="disabled" value="">' . $txt['poll_view_voters_expanded_help2'] . '</option>';
              }
              else
              {
                echo '
                    <option selected="selected" value="">----------------------</option>';
              }
              echo '
                  </select>
                </td>
                                                        </tr>';
              break;
            case 'table':
              echo '
              <tr>
                <td style="padding-right: 4ex; vertical-align: top;', $option['voted_this'] ? 'font-weight: bold;' : '', '">', $option['option'], '</td>
                <td style="padding-right: 4ex;">
                  ', $option['bar'], '<br />';
              if (!empty($context['poll']['options'][$option['ID_OPTION']]['voters']))
              {
                foreach ($context['poll']['options'][$option['ID_OPTION']]['voters'] as $voter)
                {
                  echo '<small><a href="?action=profile;u=' . $voter['ID_MEMBER'] . '">', $voter['realName'], '</a></small> ';
                }
              }
              echo '
                </td>
                <td style="padding-left: 2ex; padding-right: 2ex; text-align: center; vertical-align: top;">', $option['votes'], '</td>
                <td style="padding-left: 4ex; text-align: right; vertical-align: top;">', $option['percent'], '%</td>
              </tr>';
              break;
          }
        }
                        }

                        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']),
                'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),
                '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']) == 1 ? $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'] == 1 ? $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', 66, 17, 'align="middle"');
        $remove_button = create_button('delete.gif', 121, 31, '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'] == 0 ? '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 />';

                        // 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 />';

                                require_once($GLOBALS['sourcedir'] . '/CustomProfile.php');
                                displayCustomFieldsPost($message);

                        // 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 '
                                  &nbs

Jed C


SwapsRulez

Hi there, i've tried adding the custom table through phpmyadmin, but still no luck.
i've created the table mentioned here.

http://www.simplemachines.org/community/index.php?topic=182923.msg1526314#msg1526314

I'm getting successfull addition to bookmarks message, but still its not showing any bookmarks. Please help.
Thanks in advance.
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Aaron

Quote from: SwapsRulez on May 24, 2008, 06:41:33 AM
I'm getting successfull addition to bookmarks message, but still its not showing any bookmarks. Please help.
Thanks in advance.

Any errors related to the bookmarks mod in the forum's error log?

SwapsRulez

Quote from: Aäron on May 24, 2008, 09:06:54 AM
Quote from: SwapsRulez on May 24, 2008, 06:41:33 AM
I'm getting successfull addition to bookmarks message, but still its not showing any bookmarks. Please help.
Thanks in advance.

Any errors related to the bookmarks mod in the forum's error log?

Database Error: Table 'b8_1764301_smf.bookmarks' doesn't exist


SELECT
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from, b.id_board, b.name,
t.id_topic, ms.subject, ms.id_member, IFNULL(mem.real_name, ms.poster_name) AS real_name,
ml.id_msg_modified, ml.poster_time, ml.id_member AS id_member_updated,
IFNULL(mem2.real_name, ml.poster_name) AS last_real_name
FROM bookmarks AS bm
INNER JOIN topics AS t ON (t.id_topic = bm.id_topic AND t.approved = 1)
INNER JOIN boards AS b ON (b.id_board = t.id_board AND 1=1)
INNER JOIN messages AS ms ON (ms.id_msg = t.id_first_msg)
INNER JOIN messages AS ml ON (ml.id_msg = t.id_last_msg)
LEFT JOIN members AS mem ON (mem.id_member = ms.id_member)
LEFT JOIN members AS mem2 ON (mem2.id_member = ml.id_member)
LEFT JOIN log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = 1)
LEFT JOIN log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = 1)
WHERE bm.id_member = 1
ORDER BY ms.subject ASC

File: /home/vol5/byethost8.com/b8_1764301/project-bb.org/htdocs/Sources/Bookmarks.php
Line: 62



& this

http://www.project-bb.org/index.php?pretty;board=civil-engineering;topic=smart-materials-and-smart-structures-t2121.0&amp;action=bookmarks;sa=add

Database Error: Table 'b8_1764301_smf.bookmarks' doesn't exist


SELECT *
FROM bookmarks
WHERE
id_member = 1 AND
id_topic = 0
LIMIT 1

File: /home/vol5/byethost8.com/b8_1764301/project-bb.org/htdocs/Sources/Bookmarks.php
Line: 115
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

Aaron

Quote from: SwapsRulez on May 25, 2008, 02:15:19 AM
Database Error: Table 'b8_1764301_smf.bookmarks' doesn't exist


SELECT *
FROM bookmarks
WHERE
id_member = 1 AND
id_topic = 0
LIMIT 1

File: /home/vol5/byethost8.com/b8_1764301/project-bb.org/htdocs/Sources/Bookmarks.php
Line: 115

You probably created a table named 'smf_bookmarks', whilst you should've named it just 'bookmarks', because you're not using a table prefix. :)


CREATE TABLE bookmarks
(
   `id_member` mediumint(8) unsigned NOT NULL,
   `id_topic` mediumint(8) unsigned NOT NULL,
   UNIQUE KEY `id_member` (`id_member`,`id_topic`)
);


That query should do the trick. :)

SwapsRulez

#198
QuoteYou probably created a table named 'smf_bookmarks', whilst you should've named it just 'bookmarks', because you're not using a table prefix. :)


CREATE TABLE bookmarks
(
   `id_member` mediumint(8) unsigned NOT NULL,
   `id_topic` mediumint(8) unsigned NOT NULL,
   UNIQUE KEY `id_member` (`id_member`,`id_topic`)
);


That query should do the trick. :)

Thanks mate, but still it isnt solving the problem of the bookmarks. I created the above table. But still no luck. I uninstalled the MOD & created once again. Also created the "bookmarks" table again, but whenever i'm going to "My Bookmarks" Tab, it is showing me the following error message,

QuoteYou don't have any bookmarks at the moment. Add one by clicking 'Add bookmark' in topics.

I added the few topics to the bookmark, but it always says,

QuoteThe topic was successfully added to your bookmarks!

But below that it shows,

QuoteYou don't have any bookmarks at the moment. Add one by clicking 'Add bookmark' in topics.

I think the records are not get added in the table or they might not be displaying. Donno what id the actual problem. Also when i installed the MOD, there was no "smf_bookmarks" table in the database.
Now, i do have bookmarks table with me. :)
I think i'm missing something. Thanks for the above help, but still no luck.

Thanks in advance :)
Project-BB.org : Educational Forum For Engineering, Diploma & Technical Students

The Engineering, Diploma & All technical students lounge for Free Projects, Seminars, Syllabus, Question Papers, College Assignments, Placement Papers, E-Books, Company Information & other technical stuffs.

127.0.0.1

#199
Hi,

I am making a bookmark function, ssi_bookmarks($userID,$display_amount), for the SSI.php.

I want to take the original query code from Bookmarks.php

    // Load this user's bookmarks
    $request = db_query("
        SELECT
            IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from, b.ID_BOARD, b.name,
            t.ID_TOPIC, ms.subject, ms.ID_MEMBER, IFNULL(mem.realName, ms.posterName) AS realName,
            ml.ID_MSG_MODIFIED
        FROM ({$db_prefix}bookmarks AS bm, {$db_prefix}boards AS b, {$db_prefix}topics AS t, {$db_prefix}messages AS ms, {$db_prefix}messages AS ml)
            LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = ms.ID_MEMBER)
            LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
            LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)
        WHERE bm.ID_MEMBER = $ID_MEMBER
            AND t.ID_TOPIC = bm.ID_TOPIC
            AND ms.ID_MSG = t.ID_FIRST_MSG
            AND ml.ID_MSG = t.ID_LAST_MSG
            AND b.ID_BOARD = t.ID_BOARD
            AND $user_info[query_see_board]
        ORDER BY ms.subject ASC", __FILE__, __LINE__);


and trim it down to its bare essentials to provide only this information:

    $context['bookmarks'] = array();
    while ($row = mysql_fetch_assoc($request))
    {
        censorText($row['subject']);

        $context['bookmarks'][] = array(
            'id' => $row['ID_TOPIC'],
            'subject' => $row['subject'],
            'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',
            'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['subject'] . '</a>',
        );
    }


So what would the new db_query be?

Also I currently I have the above db_query as is in the SSI.php and a list of bookmarks are displayed on the side of the page. However, when I access the ?action=bookmarks, it does not show any bookmarks unless I remove the function that is displaying them on the side of the page.

Advertisement: