vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Change Style of First Post (from vb2 hack) (https://vborg.vbsupport.ru/showthread.php?t=67365)

kira 07-19-2004 08:01 AM

Change Style of First Post (from vb2 hack)
 
For vb2, Chen created the very useful "Change Style of First Post" hack 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. 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
HTML Code:

<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:
PHP Code:

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

underneath that add:
PHP Code:

        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

Quote:

Originally Posted by lancepoint
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


All times are GMT. The time now is 06:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00961 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete