PDA

View Full Version : vb3 Postbit Style Option v1.0


g-force2k2
01-31-2004, 10:00 PM
What Does This Hack Do?
--
Allows for users to choose either the vb2 style postbit or the vb3 style postbit.
Note: Makes the vb3 setting 'legacypostbit' obsolete so that users can choose which postbit they prefer.

What To Do?
--
Queries To Run ( 1 )
File Modifications ( 9 )
includes/functions.php ( 2 )
profile.php ( 3 )
showpost.php ( 2 )
showthread.php ( 2 )
Template Modifications ( 1 )
modifyoptions template ( 1 )
Phrases To Add ( 4 )
postbit_style_title
postbit_style_desc
vb2_postbit
vb3_postbit

Note: Please respect my work, do not edit, modify, or redistribute in any form unless prior consent is given.
I would appreciate that if you installed this hack that you click install.

After viewing the discussion on vb.com though it can be done with no file modifications I choose this specific way because:

1. I don't like the postbit style option showing in with the profile fields it's better laid out in the user options under thread options.
2. I find it necessary to cache the posbit_legacy template. So if you want to get technical about file mods not needed, sure, but then you'll be running an extra query each time you load the showpost.php and showthread.php files if you use the vb2 postbit.

Screenshots and zip attached below. If you have any comments, suggestions, or concerns please share them here.

The postbit.gif screen shows the difference between vb2 style and vb3 style if you didn't know the difference.

Enjoy,
g-force2k2

gmarik
02-01-2004, 03:38 PM
Nice. Could be the third (avatar on the right side) as well. :rolleyes:

g-force2k2
02-01-2004, 03:41 PM
Nice. Could be the third (avatar on the right side) as well. :rolleyes:

It's possible to add custom postbits as well.

Regards,
g-force2k2

Oblivion Knight
02-01-2004, 04:41 PM
Awesome.. One of my users suggested this just today, you've saved me a job.!

Will install right away.. :)

zajako
02-01-2004, 04:55 PM
umm... this has been done, and done in a much easier way. In fact, you did tons more work than you needed to.

Its posted at vbulletin.nl, in the members area, ill ask floris if he plans to make it a public hack

Floris
02-01-2004, 04:58 PM
umm... this has been done, and done in a much easier way. In fact, you did tons more work than you needed to.

Its posted at vbulletin.nl, in the members area, ill ask floris if he plans to make it a public hack
Yes, this can be done with a template mod.
Freddie showed us how - see the discussion on vbulletin.com about this.
zajako, my tutorial on vbnl is for private members only :)

GoTTi
02-01-2004, 05:00 PM
alot of modifying for this but its a good addon...some users liked the old version of the postbit...

vb should also add this option to thier vb3.

g-force2k2
02-01-2004, 05:05 PM
umm... this has been done, and done in a much easier way. In fact, you did tons more work than you needed to.

Its posted at vbulletin.nl, in the members area, ill ask floris if he plans to make it a public hack

I did it my own way, don't like it then don't use it that simple. And if Floris did his with a template mod then its not a hack.

Freddie showed us how - see the discussion on vbulletin.com about this.

If you could link me I would appreciate it.

Cheers,
g-force2k2

Giveit2u43
02-01-2004, 05:12 PM
<a href="http://www.vbulletin.com/forum/showthread.php?t=88171" target="_blank">http://www.vbulletin.com/forum/showthread.php?t=88171</a>

Breaker
02-01-2004, 06:42 PM
yeh, this can be done with 1 template edit and a few added fields :D

Dean C
02-01-2004, 06:48 PM
Thanks for releasing :)

g-force2k2
02-01-2004, 06:53 PM
yeh, this can be done with 1 template edit and a few added fields :D

Yes, but then you will be running uncessary queries.

Thanks for the support Mist.

Cheers,
g-force2k2

Link14716
02-01-2004, 07:08 PM
I ask you, how?

Good job, but it's a little overkill. First, I have the legacy postbit setting set to '0' in the settings. I make a profile field giving the user this option, and in my phpinclude_start template, I add an if statement to check the value of the profile field, and if it is set to the vB2 style, set $vboptions['legacypostibt'] to '1'.

No hacking required, no unneeded queries, just a simple template mod.

Nice work, but it's just overkill to do 9 file edits when none are needed. ;)

g-force2k2
02-01-2004, 07:15 PM
I ask you, how?

Good job, but it's a little overkill. First, I have the legacy postbit setting set to '0' in the settings. I make a profile field giving the user this option, and in my phpinclude_start template, I add an if statement to check the value of the profile field, and if it is set to the vB2 style, set $vboptions['legacypostibt'] to '1'.

No hacking required, no unneeded queries, just a simple template mod.

Nice work, but it's just overkill to do 9 file edits when none are needed. ;)

Okay so you don't want to do unneeded queries, but by not making two file modifications you're running unnecessary queries, I don't see how people aren't understanding.

2. I find it necessary to cache the posbit_legacy template. So if you want to get technical about file mods not needed, sure, but then you'll be running an extra query each time you load the showpost.php and showthread.php files if you use the vb2 postbit.

Regards,
g-force2k2

Link14716
02-01-2004, 07:17 PM
And where would those unnecessary queries come from? It's a simple profile field/if statement combination. ;)

g-force2k2
02-01-2004, 07:18 PM
2. I find it necessary to cache the posbit_legacy template. So if you want to get technical about file mods not needed, sure, but then you'll be running an extra query each time you load the showpost.php and showthread.php files if you use the vb2 postbit.

Run the debug mode you will see the template will be uncached by both showpost.php and showthread.php.

No you're right about the profilefield and if conditional no queries are required, but simply by using the postbit_legacy template it is not a cache'd template. My hack further optimizes that simple fact

Regards,
g-force2k2

Link14716
02-01-2004, 07:23 PM
Yeah, I didn't see that part of your post. Shouldn't postbit_legacy be cached by default? *goes to file a bug report*

g-force2k2
02-01-2004, 07:25 PM
Yeah, I didn't see that part of your post. Shouldn't postbit_legacy be cached by default? *goes to file a bug report*

Yes it should be, but it wasn't there so I made the necessary modifications.

Regards,
g-force2k2

Xyphen
02-01-2004, 07:49 PM
There is a easier way to do this if you only want to switch between postbit_legacy and postbit templates in vBulletin 3. I'm using it without any file modifications or any extra queries.

But this is nice for having multiple style postbits :) Good Job G-force.

g-force2k2
02-02-2004, 03:58 AM
There is a easier way to do this if you only want to switch between postbit_legacy and postbit templates in vBulletin 3. I'm using it without any file modifications or any extra queries.

But this is nice for having multiple style postbits :) Good Job G-force.

Are you sure? Because I know that the vbdevs did not cache the postbit_legacy, so by just using the template it requires extra queries if you did not make any file modifications. Just giving you the heads up, its modification 1 for both the showthread.php and showpost.php.

Cheers,
g-force2k2

colicab-d
02-02-2004, 05:35 AM
hmm now i,ll have to mod up 2 post bits for my new style, but i,l be happy doing it thnks for the hack

KuraFire
02-02-2004, 07:16 PM
I made a one-file edit version that essentially does the same:
user option to choose postbit style;
caching of templates; (in more places than this hack does, too :))

No need for phrases, template modifications, or 9 (!!) file edits for such a very small but handy hack :)

In case anyone's interested (if only to see how I did this using only one file edit while maintaining caching-ness everywhere): https://vborg.vbsupport.ru/showthread.php?t=61086