Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: icasm on August 04, 2011, 12:20:03 AM

Title: Cleaner Post Div
Post by: icasm on August 04, 2011, 12:20:03 AM
(http://www.codeism.net/mystuffs/postdiv.jpg)

Can it be done? Instead of the user info spanning the entire left side of the post wrapper, it only uses as much space as it needs.
Title: Re: Cleaner Post Div
Post by: Ricky. on August 04, 2011, 12:28:31 AM
Yes, it can be done, you may have to strip down few things. Anyways, what SMF version you are using ?
Title: Re: Cleaner Post Div
Post by: icasm on August 04, 2011, 12:30:16 AM
2.3.2

I'm using the default Curve theme.
Title: Re: Cleaner Post Div
Post by: Hj Ahmad Rasyid Hj Ismail on August 04, 2011, 01:32:18 AM
Quote from: icasm on August 04, 2011, 12:30:16 AM
2.3.2

I'm using the default Curve theme.
There is no such version. There is SMF 2.0 RCx and SMF 2.0 (gold of course). What you want to do is actually to float the whole poster info to the left. For this you may want to create a new div in your Display.template.php to float the whole poster info like <div style="float:left;>. You might want to limit your poster info to the very minimum just like the attached image too, so in this case certain code in poster info part (which is quite a lot) need to be removed or comment off.
Title: Re: Cleaner Post Div
Post by: Ricky. on August 04, 2011, 01:34:04 AM
In default css file :
Find :
.post, .personalmessage {
    line-height: 1.4em;
    overflow: auto;
    padding: 0.1em 0;
}


Replace it with

.post, .personalmessage {
    line-height: 1.4em;
    padding: 0.1em 0;
}


Also Find :
.postarea, .moderatorbar {
    margin: 0 0 0 16em;
}

Replace with :
.postarea, .moderatorbar {
    margin: 0 0 0 1em;
}


This is just basic idea, you may need to modify little more CSS to achieve what you need.

Lols.. regarding version, I am not sure what he may have checked for version but I only wanted to know about theme, that is enough!
Title: Re: Cleaner Post Div
Post by: icasm on August 04, 2011, 02:42:26 AM
2.0.. my mistake. xD

(http://www.codeism.net/mystuffs/kk.jpg)

That was my result.

(http://www.codeism.net/mystuffs/kk2.jpg)

This is what I'm going for.
Title: Re: Cleaner Post Div
Post by: Hj Ahmad Rasyid Hj Ismail on August 04, 2011, 02:53:23 AM
Meaning you have done it?
Title: Re: Cleaner Post Div
Post by: Ricky. on August 04, 2011, 06:03:28 AM
Well, the code I gave you was tested to some extend and I think you have achieved what you wanted !
Title: Re: Cleaner Post Div
Post by: icasm on August 04, 2011, 03:53:16 PM
Again.. my mistake. The second image is just a PS mockup to show you what I'm trying to achieve. I haven't actually done so. The other code edits you provided were helpful though! I hope this isn't considered advertising, but you can take a look for yourself if you'd like. click (http://novusff.net/index.php?topic=16.msg17#new)
Title: Re: Cleaner Post Div
Post by: MrGrumpy on August 04, 2011, 04:03:12 PM
I don't belive you will achieve this with css edits alone, you are probably going to need to edit the Dispaly.template.php and move the box for the user info/postprofile (.poster) into the main body of the post (.postarea)
Title: Re: Cleaner Post Div
Post by: icasm on August 04, 2011, 06:56:26 PM
Hrm.. how about this?

(http://www.codeism.net/mystuffs/kk3.jpg)
Title: Re: Cleaner Post Div
Post by: Hj Ahmad Rasyid Hj Ismail on August 04, 2011, 07:15:41 PM
I agree with MrGrumpy. It may be looking properly by simply editing CSS though it may be possible like what have been done here (http://www.simplemachines.org/community/index.php?topic=444605.0) with smf main menu. I have a mod (Poster Info To Top) that move poster info to top with several modifications on Display.template.php and index.css. That can be used as a guideline, if you like.

The concept that you are trying to achieve is something like Xenforo where the poster is separated in a different box. A sample may be viewed in this live site here (http://www.darkyrom.com/community/index.php?threads/odin-darkyrom-10-2-resurrection-gt-i9000.4272/).

I have also written a tip or trick on how to rearrange your post page to be like Xenforo here (http://www.simplemachines.org/community/index.php?topic=443064.0). I may update it so it have a better look (well separate box for poster info like Xenforo is really nice, isn't it?). But first, let me do some further test. I'll post back later.
Title: Re: Cleaner Post Div
Post by: Eliana Tamerin on August 04, 2011, 08:08:32 PM
The CSS attribute float is what you need.
Title: Re: Cleaner Post Div
Post by: MrGrumpy on August 04, 2011, 08:23:48 PM
A float attribute won't solve this, this is going to need the post section of the Display.template.php modified and css tweeked.

At the moment my pc is dismantled due to decorating and i'm on my laptop that doesn't have any of my programs or files for editing smf but I will hook it back up tomorrow and look at the coding for this and try to post the solution to do it or at least point you in the right direction.
Title: Re: Cleaner Post Div
Post by: Hj Ahmad Rasyid Hj Ismail on August 04, 2011, 08:28:48 PM
Quote from: icasm on August 04, 2011, 02:42:26 AM
(http://www.codeism.net/mystuffs/kk2.jpg)

I have tested and my finding is that it is possible to achieve the above just by modifying the styling in index.css. I have posted a tip or trick for this in the graphic section here (http://www.simplemachines.org/community/index.php?topic=445250.msg3127514#msg3127514) (may be moved to tip and trick section later).

Quote from: icasm on August 04, 2011, 06:56:26 PM
(http://www.codeism.net/mystuffs/kk3.jpg)

Regarding this second format, I hope you can try it on your own using the given tip or trick. Otherwise, wait for my update to Xenforo Like Display / Post Page (http://www.simplemachines.org/community/index.php?topic=443064.0). I'll try to include the Poster Info section modification (or beautification, hah ha) later on.
Title: Re: Cleaner Post Div
Post by: icasm on August 04, 2011, 08:30:50 PM
Quote from: ahrasis on August 04, 2011, 08:28:48 PM
Quote from: icasm on August 04, 2011, 02:42:26 AM
(http://www.codeism.net/mystuffs/kk2.jpg)

I have tested and my finding is that it is possible to achieve the above just by modifying the styling in index.css. I have posted a tip or trick for this in the graphic section here (http://www.simplemachines.org/community/index.php?topic=445250.msg3127514#msg3127514) (may be moved to tip and trick later).

Quote from: icasm on August 04, 2011, 06:56:26 PM
(http://www.codeism.net/mystuffs/kk3.jpg)

Regarding this second format, I hope you can try it on your own using the given tip or trick.

:o Thanks! That's exactly what I was looking for. If I can figure out the second bit I'll post it here.
Title: Re: Cleaner Post Div
Post by: MrGrumpy on August 04, 2011, 08:35:49 PM
I was planning on doing something different with the layout but if that works for you then cool.
Title: Re: Cleaner Post Div
Post by: Hj Ahmad Rasyid Hj Ismail on August 04, 2011, 08:42:17 PM
I can see that you have several custom themes. They are very cool too.  ;D
Title: Re: Cleaner Post Div
Post by: MrGrumpy on August 04, 2011, 08:52:37 PM
Thanx, meaning to make some more but in the middle of decorating my house from top to bottom so it's slowing me down.
Title: Re: Cleaner Post Div
Post by: icasm on August 04, 2011, 09:01:51 PM
Quote from: ahrasis on August 04, 2011, 08:42:17 PM
I can see that you have several custom themes. They are very cool too.  ;D

Agreed.

Sorry to go off-topic, but how do you use the Anchor tag? I looked it up, tried the code, and yeh.. didn't work. Are you able to anchor content within the same post, or does it only redirect to other posts?

nvm, figured it out! :]
Title: Re: Cleaner Post Div
Post by: Eliana Tamerin on August 04, 2011, 09:10:36 PM
The anchor bbc tag is used alone in the following fashion:
[anchor=name]

When you wish to link to it, you can link like so:
[url=#name]Name[/url]

I haven't tried to link to sections of other posts yet. You can experiment and see how it might have to work. I imagine you may have to link to the topic page, and then add the anchor has to the end.
Title: Re: Cleaner Post Div
Post by: Ricky. on August 05, 2011, 02:45:46 AM
ahrasis,

You were very quick to do the improvements. Good work, I had actually tested my suggestion on firefox and it was working with my suggested tweaking in index.css only but later on I checked in Chrome and IE, then found its not working. I now fixed the issue but looks like you have already given similar solution here[/here] .
(http://www.simplemachines.org/community/index.php?topic=445250.msg3127514#msg3127514)
Title: Re: Cleaner Post Div
Post by: Xarcell on August 05, 2011, 01:06:40 PM
This can easily be done. I would have to do it myself to debug everything...

However, it would go something like this in conjuction with Ricky's css edited.

In Display.template.php

Find: <div class="poster">

Change to: <div class="poster floatleft">

This is untested, but can easily be done. I may try this myself sometime this week when I get time.
Title: Re: Cleaner Post Div
Post by: MrGrumpy on August 05, 2011, 01:16:29 PM
This has already been posted as a Tip/Trick http://www.simplemachines.org/community/index.php?topic=445250.0
Title: Re: Cleaner Post Div
Post by: Xarcell on August 05, 2011, 01:27:05 PM
Quote from: MrGrumpy on August 05, 2011, 01:16:29 PM
This has already been posted as a Tip/Trick http://www.simplemachines.org/community/index.php?topic=445250.0

Good deal...