PDA

View Full Version : Change Style of First Post (from vb2 hack)


kira
07-19-2004, 08:01 AM
For vb2, Chen created the very useful "Change Style of First Post" hack (https://vborg.vbsupport.ru/showthread.php?p=430775#post430775) that allowed you to create a unique look for the first post in a thread. This gave you the option of making the first post appear more like an article, or even just an image, with the replies within that thread simply look like regular posts. (You could also restrict this layout change to specific forums only, so the rest of your forums could have the regular thread style.)

Here's an example from my site (http://www.epiguide.com/forums/showthread.php?&threadid=5836). Only the threads in my "article" forum use this hack.

I know that with the creation of the Articles hack, this may not have as much of a following, but what I liked about this hack was that since these first posts are regular forum posts (just with different template style), they appear within searches.

Is there any interest in creating something like this for vb3, assuming it seems like a useful hack to others? Or is there some other hack that has these capabilities?

Many thanks.

Xenon
07-19-2004, 01:03 PM
You don't need to hack that at all anymore, as it's doable with a postbit template modification

just use
<if condition="$post['postid'] == $threadinfo['firstpostid']">
first post bit in here
<else />
normal postbit here
</if>

nexialys
07-19-2004, 01:13 PM
you can even do a little change in showthread to select a different template of your choice when doing the first post... ;)

-- maybe someone can do a hack of that kind.. ;)

kira
07-19-2004, 05:55 PM
Ooh! Thank you, Xenon. So what I'd do is create a new style for that forum, add that conditional to the postbit template, and voila?

I'm sorry to be so needy. I'm so damn lame when it comes to conditionals and understanding what the various bits of code mean -- like, "firstpostid," I never would've thought of that, even though it seems so obvious. Do the vbulletin documentation pages have a reference section explaining how all these bits and pieces come together?

I do agree with Nexialys, though -- that "template switch" would be a very cool option to offer people. :)

Anyway, thanks again Xenon.

AN-net
07-19-2004, 07:53 PM
this not tested but it should work ^_^

in showthread.php
find:

if ($post['isdeleted'])
{
$template = 'postbit_deleted';
}


underneath that add:

else if($post['postid']==$threadinfo['firstpostid'])
{
$template ='postbit_whatevayouwant';
}

hockyfan
11-14-2004, 02:31 PM
I'm a bit confused as to how to do this; how exactly do I get/make a template for use in a specific forum, and consequently have the first post in that forum look as it does in kira's example?

I can't really use the articles hack since I have a lot of current "threads" which I would need to be made into articles, and apparently there's no way to do that. So changing the templates of that forum would really work well for me.

h

lancepoint
11-15-2004, 01:25 AM
how do i get the template used here on vb. the first post on on a thread thats hosting a hack. . i want to the bold text options on top... etc.

HiDeo
11-15-2004, 03:35 AM
how do i get the template used here on vb. the first post on on a thread thats hosting a hack. . i want to the bold text options on top... etc.
The modification used here is not released !

hockyfan
11-15-2004, 09:59 AM
And my question.....?

h