News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Post Seperator (now Compatibility With "smf 2.0")

Started by islam2hamy, January 01, 2009, 05:05:42 PM

Previous topic - Next topic

islam2hamy

Link to Mod
Post Seperator
Old Author : Runic - New Author : islam2hamy


Description:

  This mod gives posts a new look, it seperates the posts... the screenshot attached shows the mod in action on my newest theme Classy, as the mod only modifies the Display.template.php it will work on most themes.

Thanks to Nascar for giving me the idea.




Compatibility With :

smf 1.1.X & smf 2.0

Arabic Translator - Web Designer
My Mods / My Themes  //  GfxLand





[unplugged]

#1
This really separates the posts nicely. Thanks!

For the same thing in SMF2.0 Beta4:

Code (Display.template.php) Select
// 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 '
<div class="clearfix ', !$message['first_new'] ? 'topborder ' : '', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', ' largepadding">';


and replace it with:

// Show the message anchor and a "new" anchor if this message is new.
if ($message['id'] != $context['first_message'])

echo'<div id="forumposts">
<h3 class="catbg3">
<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
<span>', $txt['author'], '</span>
<span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span>
</h3></div>';

echo'<a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';

echo '
<div class="clearfix ', !$message['first_new'] ? 'topborder ' : '', $message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg', ' largepadding">';
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



islam2hamy

loool thank you,
that is very cool.  ;D

Arabic Translator - Web Designer
My Mods / My Themes  //  GfxLand





brandonroy

I like it but... it doesn't look right on my forum theme because of some grey color that's showing up..

See?

http://i40.tinypic.com/15p49pv.gif

filament

this is something very useful and should be in original.
very nice job !!

Pwn Kyuubi

yeah :S I dont know how to change the color of the seperator (grey by default)

help plz

mforum

i have made a poll after installing it , to see if my members like it..... the result till now is 100% Yes i like it  :)

Thanks for this mod !!!!!

bullbreedluverz

#7
ive made a few changes to the layout of this mod to what i think best suits my forum because of my colour scheme i just didnt think it looked right with the size of the catbg image but i also want to reduce the space between the posts - (the actual visible background between posts) to about 50% of the size set, can this been done in the mod edits of the display.template?

if so how cuz its baffling me lol

solved thanks sunking

Afro

Its a very interesting small mod. Not heavy yet cool..i think its should be made a perm part of the default theme.

Marcus Forsberg

Quote from: Runic Warrior on January 01, 2009, 05:05:42 PM
Thanks to Nascar for giving me the idea.

I didn't give it to you, you stole it! :P
Nice mod :P

Antechinus

Quite a nice touch, although the styling could be optimised for different themes. I can see a lot of theme authors nicking this idea. Nascar should have patented it when he had the chance.  ;)

brandonroy

I'm still looking for a way to change the grey color! I've messed with the code but not sure how to do it. I'm assuming it's grey because it has no color code. So I need to know where to add it.

Antechinus

#12
Look for this is your style.css:

/* This is used for tables that have a grid/border background color (such as the topic listing.) */
.bordercolor {
background-color: #d5d2d2;
padding: 0px;
}


Because the mod works by changing the top padding inside the tborder you are seeing the background colour.
If you change the background colour it will also affect other areas of the theme (like the seperators between table cells on the board index). To get around that you may need to do custom edits to Display.template.php.

Anyway try changing that hex code and see what you can get. You can even change it to  background: none;  if you like.

Sabre™

I changed the class for my default theme, and made it 'aborder'
Yes, ingenious I know!  lol
here's the code Ive added.

Display template
    // Get all the messages...
   while ($message = $context['get_message']())
   {
      echo '
   <tr><td style="padding: 1px 1px 0 1px;" class="aborder">';
      // Show the message anchor and a "new" anchor if this message is new.
      if ($message['id'] != $context['first_message'])
         echo '   <br />
         <table width="100%" cellpadding="3" cellspacing="0" border="0" class="aborder" 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;">
                  ', $txt[118], ': ', $context['subject'], '(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
            </td>
      </tr></table>
         <a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';

      echo '
      <table width="100%" cellpadding="3" cellspacing="0" border="0" class="aborder">


added this to style.css
.aborder
{
background: #E5E5E8;      /*change to any color you'd like | rem: doesnt have to be hex.. eg, red*/
}


simple and sweet
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Antechinus

Yep, that's the sort of template edit I was thinking of. Nice job.

Sabre™

Yeah, simple is best.
I've actually gone from that, to 1.bmp, and decided to sit with 2.bmp.

Thanks Runic Warrior, I'm very pleased with your mod, and its easy to manage code.

Cheers :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Antechinus

That's nice. How did you code that?

Sabre™

Using moz-border-radius to get the curved box.
Only works for FF though, in other browsers the box corners aren't rounded, but it still looks nice though. Clean.

css
.lul
{
background: white;            /*box background*/
border: 1px solid #192B40;    /*thickness and color of box outline*/
padding: 7px;                 /*gap/space between text and edge of box*/
margin: 10px auto;            /*to push the gap between the posts*/
-moz-border-radius:10px;
}


then add the div attribute where you'd like in the display template.
This is for the layout in 2.bmp
    // Get all the messages...
   while ($message = $context['get_message']())
   {
      echo '
   <tr><td style="padding: 1px 1px 0 1px;" class="aborder"><div class="lul">';
      // Show the message anchor and a "new" anchor if this message is new.
      if ($message['id'] != $context['first_message'])
         echo '

         <table width="100%" cellpadding="3" cellspacing="0" border="0" class="aborder" 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></div>
            <td width="13%"> ', $txt[29], '</td>
            <td valign="middle" width="85%" style="padding-left: 6px;">
                  ', $txt[118], ': ', $context['subject'], '(', $txt[641], ' ', $context['num_views'], ' ', $txt[642], ')
            </td>
      </tr></table>
         <a name="msg', $message['id'], '"></a>', $message['first_new'] ? '<a name="new"></a>' : '';
      echo '
      <table width="100%" cellpadding="3" cellspacing="0" border="0" class="aborder">


The possibilities are close to endless, but looking at your templates, you already know that. ;)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Antechinus

Thanks for the tips and yeah, I do know that. Fun, isn't it? ;D

LLandL

Cool mod installed fine on my custom theme.

One thing though...

I noticed in the image brandonroy posted his forum displays the posts in the threads without the text 'Re: Thread Title Here' instead his just says 'Reply 2 on Jan 5th 2009' etc

How can I get my forum to display each post without the thread title in it like this and just have the reply number in it?

I only ask because now I've added this mod there's now the new seperator that has the thread title and page views in it and I don't feel I need this info basically repeated agian directly underneath.

Hope I made sense! I tried searching for an answer but didn't find anything so apologies for taking this slightly off topic.

Advertisement: