[1.1 RC2] vBulletin like Post Display template.

Started by TheMaTrIx, January 05, 2006, 11:56:03 AM

Previous topic - Next topic

TheMaTrIx

I created a post display template much like the vB one with some settings you can do from your themes css file.
This is for 1.1 RC2 only:
Add to your CSS:

.userinfo
{
font-weight: bold;
background-color: #7392B0;
background-image: url(images/userinfobg.gif);
background-repeat: repeat-x;
background-position: left bottom;
}


Replace the display.template.php file with the attached one(if you haven't changed your own themes one that is:

http://downloads.the-dome.org/Display.template.rar

Demo: Here

TheMaTrIx

I changed the "reply" "modify" "delete" and "split" icons to show as icons only (originaly they show as icon+text) with the text apearing as link titles when you move your mouse over them.

I had to use a lil bit of a trick for that.

Normaly its like this:

$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"');

The function builds the link and button by 'imagename', 'text to display', 'Alternate word in case image is gone', 'alignment'

I made the following out of it:


$reply_button = create_button('quote.gif" Title="Quote', 'smf240', '', 'align="middle"');
$modify_button = create_button('modify.gif" Title="Modify', '17', '', 'align="middle"');
$remove_button = create_button('delete.gif" Title="Delete', '31', '', 'align="middle"');
$split_button = create_button('split.gif" Title="Split', 'smf251', '', 'align="middle"');


I added the Title= tag to the image name, closing the src= trough the imput parsed into the function.

This trick helps you to keep the modifications purely in template, without having to change any function (sources) files.

TheMaTrIx

#2
To be able to change the text color in the userinfo block of the post display, add:


color: #colorcode

to

.userinfo
{
font-weight: bold;
background-color: #7392B0;
background-image: url(images/userinfobg.gif);
background-repeat: repeat-x;
background-position: left bottom;
}


so it becomes


.userinfo
{
font-weight: bold;
background-color: #7392B0;
background-image: url(images/userinfobg.gif);
background-repeat: repeat-x;
background-position: left bottom;
        color=#FFFFFF
}


Now, also a note about the size of the avatar box.
I hardcoded the width for it, I'm using 100px max size for avatars, but I can imagine some people use smaller or bigger.

If you open up display.template.php, search for "// Show information about the poster of this message."

the 4th line under it says:

<td class="userinfo" valign="top" align="left" width="100" style="overflow: hidden;">

Change width="100" to whatever you want to use.

You can also set a height="" there so that the userinfo part always uses the same height, no matter what size avatar they are using.

dtm.exe

Nice.  I'll get this moved to the Tipcs and Tricks board for you :).

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

TheMaTrIx

Its like the absolutely only thing I like about vB and thats how it displays posts !

TheMaTrIx

I did some bugfixes on the template.
For some reason I made the modify button and caption apear where the Quote button was supposed to show :p

Thats fixed now. As far as I know and have seen, there are no problems with this template.

If anyone likes some features added to it. Lemme know.

lazereth

I am extremely interested in this change, but the problem I have is that your link goes to a page not found. Is there some other location to download it from?

lazereth

Ok I can see that apparently this isnt checked on or anything like that guess will see if anyone else knows the process or can teach me the proper way to go about doing a mod like this without, killing my boards. I would love to have this ability and dont fully understand what parts of code I can move. I do understand layout for webpages but I dont fully understand the in's and outs of php. 

I am afraid to jump into files that I dont fully understand as to possibly mess up my board. I dont have a local install on my computer I do pretty much everything live (I know its a mistake, but I back up all the time to counter my mistakes if and when I do make em)

Can anyone help me out? Send me a pm with some info or something like that. I would even be willing to host a file dl if I could just get this done correctly.

evillair

Quote from: lazereth on February 19, 2006, 05:43:34 AM
I am extremely interested in this change, but the problem I have is that your link goes to a page not found. Is there some other location to download it from?

I too would like to get this...

lazereth

I am going to sit down this weekend and see if I can get this rolling without doing any dmg, and it looking good. I will try to have something posted later this weekend, got a couple things to get done.

lazereth

Nevermind I knew I didnt understand the full aspect of closing tags and what not in php. Thus all I was able to do without getting mass script errors telling me that I had to close out single quotes ' ' often with \ was move everything so its one big column. But all the spaceing is still the same and it just makes everything way to long.  I guess I need to sit down and read more about php before venturing into trying to customize smf.

Good luck at figuring that out, if anyone manages to do it and would be willing to toss it out to others, that would be great.

JayBachatero

Why don't you jus tuse the file provided on the first post?

Meh I just realized the link is broken.  TheMatrix send me the file to my email so that I can attach it to the first post.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

lazereth

That would be excellent if we could get an active link to that mod :). I am just not knowledgeble enough in php to do it myself.. I am still in the major learning curve.

lazereth

Still no reply on this one? Sorry trying to give it sometime, just really would love to add this to my site. Thank you again.

SeaOfSin

I'd be interested in this to, if someone gets the file

B Patterson

#16
It's honestly not as hard as you guys make it seem.  The hardest part is the index.template.php file.  What you need to change is the column that has the users info into a row with 3 columns: 1) avatar, 2 & 3) user info.

tomis

I've done a lot of similar stuff on my forum.  Basically just by tweaking Display.template.php.  You can see an example here.
~

B Patterson


Niteblade

Link in first post give error 404..

How 'bout making this into a mod so that those of us who already have installed a lot of mods can make use of it ?
affiliate blog

Advertisement: