vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Change Style of First Post (https://vborg.vbsupport.ru/showthread.php?t=35191)

Admin 02-17-2002 10:00 PM

This is a rather old hack I did some time ago for someone, but never really released it as a full hack. :)

Very simple, this hack lets you change the template the first post is using (in either all forums or only one), so it can look differently.
Great for article and review forums. :D

Before installing the hack, create a new template named "postbit_first" from the current "postbit" template. After you're done, you can edit that template and it will control the first post in the threads.

Everything else you need is in the attached file, have fun! :)

Chen

Lesane 02-18-2002 11:56 AM

Great for my reviews forum, thank you Firefly. Well done :up:

MarkB 02-18-2002 11:59 AM

That 'someone' was me :D You can see it on my forums in the 'zine' section. Definitely a great addition to my board, and still my favourite hack :)

snyx 02-18-2002 01:56 PM

creepy, I needed this very hack yesterday....
none the less, excelent job!! now I get to us it! :D

dost 02-18-2002 03:12 PM

is anyone else getting a parse error in showthread.php? i just installed it on my win32 test server.

Bald Bouncer 02-18-2002 08:29 PM

Im trying to get it working on 2.2.0, anyone had any luck Im getting a parse error in showthread :(

PHP Code:

$postbits getpostbit($post,iif($counter==and $pagenumber==1'postbit_first''postbit')); 

if I change the line in showthread to the above I dont get the error but it doesnt show the first post?

Psychdrone 02-19-2002 12:47 AM

could I seee a pic, pleas anyone?

Ambex Net 02-19-2002 01:39 AM

Yes can we have a picture of this in action please :D

X-Fan 02-19-2002 04:28 AM

Quote:

Originally posted by Bald Bouncer
Im trying to get it working on 2.2.0, anyone had any luck Im getting a parse error in showthread :(
I was getting that too, but all that's needed is a closing bracket after $pagenumber==1

Chen, this is an absolutely brilliant hack for my forums as I have a sponsor and needed to get my sponsor's ads in the faces of people who clicked through to my news articles from other sites. With this hack, I can do that with ease!

THANKS!!!!!!!!!

X-Fan 02-19-2002 05:11 AM

Screen Shot!

I've edited the left column (the one that usually contains username, registered date, # posts, etc) in the postbit_first template to include basic information about the poster (as they're staff) and an iframe with my sponsor's ad in it.

Of course, the great thing about this hack is it's completely customizable. You can edit the postbit_first to look however you want it to!

dost 02-19-2002 08:57 AM

Quote:

Originally posted by X-Fan
I was getting that too, but all that's needed is a closing bracket after $pagenumber==1
Thanks for the help but then I start getting this error:
Code:

Warning: Missing argument 2 for iif() in ./admin/functions.php on line 569

Warning: Missing argument 3 for iif() in ./admin/functions.php on line 569

Warning: Missing argument 2 for iif() in ./admin/functions.php on line 569

Warning: Missing argument 3 for iif() in ./admin/functions.php on line 569

Warning: Missing argument 2 for iif() in ./admin/functions.php on line 569

Warning: Missing argument 3 for iif() in ./admin/functions.php on line 569

Warning: Missing argument 2 for iif() in ./admin/functions.php on line 569


X-Fan 02-20-2002 01:10 AM

Sorry dost, but I'm no hacker. I just stumbled across that fix by accident and it worked for me.

SirSteve 02-20-2002 05:55 AM

And I got this:

Missing argument 2 for getpostbit() in /usr/www/users/gandalf/starwarsguide.com/forums/admin/functions.php on line 57

Line 57 is this:

function getpostbit($post,$templatename) {

also, my showthread.php has this:

$postbits = getpostbit($post);

(notice no period in front of the equal sign?)

but I still replaced it with:
$postbits .= getpostbit($post,iif($counter==1 and $pagenumber==1, 'postbit_first', 'postbit'));

Using 2.2.2

SirSteve 02-20-2002 04:00 PM

* gentle bump *

:pleased:

Admin 02-20-2002 04:49 PM

Reinstall the hack SirSteve. :) Trust me...

SirSteve 02-20-2002 05:18 PM

Quote:

Originally posted by FireFly
Reinstall the hack SirSteve. :) Trust me...
I bow down... ;)

I even did it twice last night! I guess one shouldn't do hacks late at night! :D

Thaks FireFly!

SirSteve 02-20-2002 06:17 PM

Any way to make it not include the other stuff like Forum Jump, Rate Thread, Author text, New Thread/Post Reply and Forum Rules? I basically don't want my News section to look like the forums.

dost 02-21-2002 10:18 PM

Are you sure that this hack is working FireFly?

SirSteve 02-21-2002 10:37 PM

It is working. Look here:
http://www.sirstevesguide.com/forums...&threadid=3963

Now I just need to get rid of all that other "Forum" stuff so it looks more like a News page!

:)

SirSteve 02-22-2002 12:13 PM

Well, now I am getting this error:

Warning: Missing argument 2 for getpostbit() in /usr/www/users/gandalf/starwarsguide.com/forums/admin/functions.php on line 57

Guess what line 57 is?

function getpostbit($post,$templatename) {

However, the hack IS working on the specified forum but this is not one of them!

Help!

Tim Wheatley 02-24-2002 09:32 PM

Problem.

All my old posts are working fine.

But NEW posts made into the specific forum all have an invisible first post??

The post IS still in the database, because you see it at the bottom of the page when you reply...

Any ideas??

New Post with invisible:
http://forum.racesimcentral.com/show...threadid=24433
Old post visible:
http://forum.racesimcentral.com/show...threadid=21590

Tim Wheatley 02-24-2002 09:36 PM

SirSteve

If I remember rightly there's two VERY similar lines in functions.php, one has a . (dot), one doesn't. You're editing the line without a dot. So it's trying to call the script in an area it can't. You have to edit the EXACT line the hack readme tells you to.

(from memory) you edited function getpostbit($post, the readme says to edit function .getpostbit($post - notice a dot? :)

Tim Wheatley 02-24-2002 09:53 PM

Hmm...! It seems that only the user I've setup in coranto to post news is able to post threads correctly. This is fine and I'll create a sub forum for users to post their news. :)

SirSteve 02-24-2002 10:21 PM

Well, I can't remember what I edited but no errors since so I'll leave it alone until one pops up. I still want to get rid of other stuff that looks like the forums (Forum Jump, Rate Thread, Author text, New Thread/Post Reply and Forum Rules)!

Tim Wheatley 02-24-2002 11:02 PM

Yuck... Firefly it's still doing this to me:
http://forum.racesimcentral.com/show...threadid=24445

SirSteve 02-24-2002 11:39 PM

Click contract all.

Admin 02-25-2002 05:13 AM

Are you sure you created a new postbit_first template?

Tim Wheatley 02-25-2002 06:25 PM

Hmm... it seems to be working now that people have replied...

SirSteve 02-27-2002 02:55 AM

I guess there is no hope to get the other "Forum" parts (as described in an earlier post) removed from this first page... :(

samtha25 03-01-2002 06:39 AM

Quote:

Originally posted by SirSteve
I guess there is no hope to get the other "Forum" parts (as described in an earlier post) removed from this first page... :(
Can't you just edit the template to remove whatever you don't want?

Tim Wheatley 03-02-2002 10:48 AM

There is definately a bug with this of some sort, it's that to see the 1st post on my board, you have to click 'contract all' :)

So I just have to edit my template. Maybe you could mention this in your first post Firefly? :) Thanks to the guy who said about this ;)

SirSteve 03-02-2002 02:24 PM

I have the same hack installed (contract/expand) and mine works just fine. I do have another bug though...

Warning: Missing argument 2 for getpostbit() in /usr/www/users/gandalf/starwarsguide.com/forums/admin/functions.php on line 57

amykhar 03-02-2002 04:04 PM

Gang, this is a very easy hack to do but it can take hours of work to get the templates right - depending on what you want to do with it. If these directions aren't quite right, check out the original instructions on vbulletin.com.

Amy

SirSteve 03-02-2002 04:19 PM

Quote:

Originally posted by amykhar
Gang, this is a very easy hack to do but it can take hours of work to get the templates right - depending on what you want to do with it. If these directions aren't quite right, check out the original instructions on vbulletin.com.

Amy

Can you provide the direct link? Thanks.

Tim Wheatley 03-02-2002 06:06 PM

Thanks Amy. :) It took me a while to figure out that the invisble post was because it was 'minimised', to only visible when I clicked expand all. Then I had to setup the template to counter this. Once I did it now works like a dream. :)

Tim Wheatley 03-02-2002 06:17 PM

If anyone wants the template I've used to make this:
http://www.racesimcentral.com/images/news.gif

Use and modify this: (NOTE: this uses the expand/contract hack!)
Code:

<table bgcolor="{pagebgcolor}" width="90%" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td><td width="100%"><!-- spacer -->

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<DIV id="p$post[postid]h" style="display:$ph">
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
        <td bgcolor="$post[backcolor]" valign="top" nowrap><nobr>$plusimg <normalfont>This news item was posted at <a href="http://www.racesimcentral.com" target="_blank">Racesim Central</a> or <a href="http://www.gplea.org" target="_blank">GPLEA.org</a> at
      $post[posttime] $post[postdate]</nobr></td>
</tr>
</table>
</DIV>

<DIV id="p$post[postid]e" style="display:$pe">
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
        <td bgcolor="$post[backcolor]" valign="top" nowrap>
    <p align="left">
        <a name="post$post[postid]"></a>
    $post[firstnewinsert] <nobr>$minusimg <normalfont>This news item was posted at <a href="http://www.racesimcentral.com" target="_blank">Racesim Central</a> or <a href="http://www.gplea.org" target="_blank">GPLEA.org</a> at
    $post[posttime] $post[postdate]</nobr>
    <p align="center"><nobr> </normalfont></nobr></p>
      <table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td><normalfont><b>News:</b></normalfont></td></tr><tr><td style="BORDER: #000000 1px solid; COLOR: black; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: #D0D0D0;"><normalfont>$post[message]</normalfont></td></tr></table>
      <p align="center"><br><smallfont>News Item: $usertherdcoun | Forum News Views: $personal<br>
<b>ADMIN:</b> <smallfont><a href="http://www.racesimcentral.com/news.html" target="_blank">POST RSC</a> | <a href="http://gplea.racesimcentral.com/news.html" target="_blank">POST GPLEA</a> | <a href="editpost.php?s=$session[sessionhash]&amp;action=editpost&amp;postid=$post[postid]">EDIT</a>
      $post[iplogged]<br><b>USERS:</b> <a href="http://forum.racesimcentral.com/newthread.php?s=$session[sessionhash]&action=newthread&forumid=122" target="_blank">SUPPLY RSC NEWS</a> | <a href="mailto:kotr@gmx.net">SUPPLY GPLEA NEWS</a> | <a href="search.php?s=$session[sessionhash]&amp;action=finduser&amp;userid=$post[userid]">SEARCH</a>&nbsp;|
      <a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]">QUOTE</a></p>
    </td>
       
</tr>
</table>
</DIV>
</td></tr></table>

<!-- spacer --></td><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td></tr></table>


SirSteve 03-02-2002 07:27 PM

Is your style still showing the other forum options like Author, New Thread and Post/Reply buttons?

Tim Wheatley 03-03-2002 01:10 PM

Yes it is - but I need it to anyway :D

SirSteve 03-03-2002 01:14 PM

Do you see a way of getting rid of it?

Tim Wheatley 03-16-2002 05:01 PM

No because the first post hack this is just edits what's shown on my screenshot, and then only on the first post. But what you want to do can be done (VERY EASILY).

Create another set of templates, edit the showthread and postbit templates, then under 'Forums & Moderators' click modify, then edit the forum you want to use those templates, and simply under 'Style Options' select the style you want it to use then 'yes' to 'Override users custom styles'...

There ya go. ;)

I'm sure someone with a bigger talkin tongue can type this out for more of an explanation. ;)


All times are GMT. The time now is 04:47 PM.

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.02344 seconds
  • Memory Usage 1,836KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete