Customizing SMF > Now Available

[Tip&trick] Vb postbit

(1/8) > >>

babjusi:
Recently I made this for someone here who asked me. It displays the post info at the topic view in a bordered way, vb style. Which I think it's a more organized look and will be effective in every post on your forum. That guy had seen it at another forum, not smf, and asked me to port it over to his smf forum as well. So, I did that and I thought to share it here as well.


Here we go.

First of all make a backup of the files before you apply the changes

Add the following set of code all the way to the bottom of the style.css file in your theme''s directory


--- Code: ---.memdetails {
    padding-top: 3px;
    padding-right: 0px;
    padding-bottom: 3px;
    padding-left: 3px;
    margin: 3px 0px 3px 3px;
    background-color: #fafcfe;
    border-top: 1px solid #686868 ;
    border-right: 1px solid #686868 ;
    border-left: 3px solid #686868 ;
    border-bottom: 1px solid #686868;
}       
--- End code ---

Save the changes and re-upload the file back overwriting the old one.

Next, upload the Display.template.php file from your /Themes/ directory  to your pc and open it with a decent php editor program and find the following code:


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


Change it to:


--- Code: ---// Show the member's custom title, if they have one.
      if (isset($message['member']['title']) && $message['member']['title'] != '')
         echo '
                        <div class="memdetails">', $message['member']['title'], '</div>';
--- End code ---


Find:


--- Code: ---// 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 />';
--- End code ---


Change it to:


--- Code: ---// Show the member's primary group (like 'Administrator') if they have one.
      if (isset($message['member']['group']) && $message['member']['group'] != '')
         echo '
                        <div class="memdetails">', $message['member']['group'], '</div>';
--- End code ---


Find:


--- Code: ---// 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 />';
--- End code ---


Change it to:


--- Code: ---// 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 '
                        <div class="memdetails">', $message['member']['post_group'], '</div>';
         echo '
                        <div class="memdetails">', $message['member']['group_stars'], '</div>';
--- End code ---



Find:


--- Code: ---// 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 />';
--- End code ---

Change it to:


--- Code: ---// Is karma display enabled?  Total or +/-?
         if ($modSettings['karmaMode'] == '1')
            echo '
                       
                        <div class="memdetails">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</div>';
         elseif ($modSettings['karmaMode'] == '2')
            echo '
                        <div class="memdetails">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</div>';
--- End code ---


Find:


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

--- End code ---

Change it to:


--- Code: ---// Show online and offline buttons?
         if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
            echo '
                        <div class="memdetails">', $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 /></div>';

--- End code ---


Find:


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


Change it to:


--- Code: ---// Show how many posts they have made.
         echo '
                        <div class="memdetails">', $txt[26], ': ', $message['member']['posts'], '</div>';
--- End code ---


Find:


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

Change it to:


--- Code: ---// Show their personal text?
         if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
            echo '
                        <div class="memdetails">', $message['member']['blurb'], '</div>
                        <br />';
--- End code ---


That was it. Save the changes and re-upload the file back overwriting the old one. Personally I do think that this looks very nice on topic view. But you can judge by yourself based on the screenshot attached.

Here is like it looks in action. This is for the 1.1. series


The mod version can be found here
 
 http://custom.simplemachines.org/mods/index.php?mod=1371
 

Hoochie Coochie Man:
Very nice, thanks..

Eliana Tamerin:
Indexed.

ormuz:
How to add this trick to custom profile mod?

babjusi:

--- Quote from: ormuz on August 25, 2008, 02:38:45 PM ---How to add this trick to custom profile mod?

--- End quote ---

I am not sure that I understood you. What is is exactly that you mean or want to accomplish by doing that? Because this has nothing to do with the custom profile mod.

Navigation

[0] Message Index

[#] Next page

Go to full version