PDA

View Full Version : User Postbit Template Selection


WhSox21
30 Jun 2005, 21:55
I'm just getting back into the swing of things with vBulletin 3.5. Here's my first plugin being released (Others are still in progress).

What this does:
This allows users to select which postbit they wish to use via their control panel.

Installation
Upload the plugin and create a new user profile field by following the directions below.
Once you complete the top two steps you must edit the plugin and find: field5
Then change that to your user profile field number.

Add a New User Profile Field

Profile Field Type:
Single-Selection Menu

Title: Postbit Template Selection

Description:
If you prefer the old-style postbit, using two vertical columns rather than the new horizontal layout, you can switch back to using that template with this switch.

Options:
Horizontal Postbit
Vertical Postbit (Legacy)

Set Default:
Yes, but no First Blank Option

Display Order:
This is your choice.

Field Required:
No

Field Editable by User:
Yes

Private Field:
Yes

Field Searchable on Members List
No

Show on Members List
No

Allow user to input their own value for this option
No

The rest does not matter.

Mephisteus
01 Jul 2005, 17:25
http://www.vbulletin.com/forum/showthread.php?t=101577, still works ;)

Nice go though :)

WhSox21
01 Jul 2005, 17:43
Didn't know that was there. :(

FD929
01 Jul 2005, 23:41
Not working.

WhSox21
01 Jul 2005, 23:54
What seems to be the problem? I need more information. You most likely did not change the userfield in the plugin.

Christine
02 Jul 2005, 02:03
Wow -- you all are porting these so quickly that I won't be able to catch up in time to have to port anything I am using as everything on my list of ToDos is showing up here. LOL!

Thank you for sharing!! :D

Kirk Y
02 Jul 2005, 20:59
Not working.

Try going into the ACP -> vBulletin Options -> Style & Language Settings -> Set "Use Legacy (Vertical) Postbit Template" to "No".

That's what I had to do, it's working great now. Thanks for the Plugin, I've always wanted the Users to be able to select this. :classic:

FD929
02 Jul 2005, 21:47
Try going into the ACP -> vBulletin Options -> Style & Language Settings -> Set "Use Legacy (Vertical) Postbit Template" to "No".

That's what I had to do, it's working great now. Thanks for the Plugin, I've always wanted the Users to be able to select this. :classic:
Thanks acid, that was it.

Kirk Y
03 Jul 2005, 03:41
Thanks acid, that was it.

No problem.

Christine
03 Jul 2005, 03:53
http://www.vbulletin.com/forum/showthread.php?t=101577, still works ;)

Nice go though :) phpinclude_start is depreciated.

Chris M
03 Jul 2005, 10:34
global_start is the equivalent hook ;)

Satan

SlaPPiE
08 Jul 2005, 02:09
Try going into the ACP -> vBulletin Options -> Style & Language Settings -> Set "Use Legacy (Vertical) Postbit Template" to "No".

That's what I had to do, it's working great now. Thanks for the Plugin, I've always wanted the Users to be able to select this. :classic:

Is there a way to get around this? I would like the vertical postbit on by default for all existing members and guests, and enabling this would force all users to update the option in their User CP.

Kirk Y
08 Jul 2005, 03:51
Well... you could set the Vertical Postbit default for new registrations... but I'm not sure what you could do for the existing users.

Edit: I just thought of something, I'm not sure if this would work or not... but. When you're setting up the profile field, there's an option to make a selection default... try doing that. That should effect everyone's profiles, in theory anway.

WhSox21
08 Jul 2005, 13:38
I uploaded another version. Anyone that wants the forum default to work on either postbit option try that one. I did not test this though so let me know if it works.

prawn
11 Jul 2005, 09:44
Your script causes this problem (http://www.vbulletin.com/forum/showthread.php?goto=newpost&t=146288). Just wanted to let you know.

Christine
26 Jul 2005, 02:19
Heya,

This hook location conflicts with the ignore user function as well as the soft-delete noted above.

No biggie -- it is just an issue of when it is being called.

Tested with a minor change to the code and moving the hook to global_start. Add in the template cache I PM'd ya, and you are all set.

:)

Neutral Singh
26 Jul 2005, 08:47
Exactly what i was looking for thanks...

trancetopia
01 Aug 2005, 13:56
Works a treat. Thanks.

CMX_CMGSCCC
04 Aug 2005, 06:09
Can you attach the minor change you did to the code to fix the problem?

-CMX

Christine
06 Aug 2005, 20:51
Given that this isn't my hack, I would prefer for the hack author to fix and re-release it. No stepping on any toes that way.

:)

WhSox21
06 Aug 2005, 20:53
Given that this isn't my hack, I would prefer for the hack author to fix and re-release it. No stepping on any toes that way.

:)

Christine,

If you have the time would/could you PM me the working code? I'll re-release it along with giving you credit for your work.

I'm very busy right now getting the Help Desk plugin converted to 3.5.

Christine
06 Aug 2005, 22:26
Done. :)

InfiniteWebby
11 Aug 2005, 06:33
Has anyone figured out how to make this work if you have postbit_legacy selected in the vboptions. Because I have racked my brain trying to get it to work to no avail. And I would like to make postbit_legacy default for members AND guests.

InfiniteWebby
12 Aug 2005, 04:55
Ok the problem lies in functions.php



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



And



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



vBulletin replaces the templatename of postbit with postbit_legacy if you have the setting selected in the cp, no matter what you do before hand. So short of hacking files this sort of hack will never work with postbit_legacy selected in the cp.

CMX_CMGSCCC
12 Aug 2005, 06:06
Aha, I have figured it out.

I have my forums enabled for "Legacy Postbit" by default.

Add the plugin to the hook 'cache_templates'

Use this code:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



CHANGE the field9 to your userfield fieldname.

This way when it caches the template, it will disable the legacypostbit option and not force it to use postbit_legacy.

-CMX

InfiniteWebby
12 Aug 2005, 08:50
Aha, I have figured it out.

I have my forums enabled for "Legacy Postbit" by default.

Add the plugin to the hook 'cache_templates'

Use this code:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



CHANGE the field9 to your userfield fieldname.

This way when it caches the template, it will disable the legacypostbit option and not force it to use postbit_legacy.

-CMX

Thnx for the help man, sometimes the solution is right in front of you. You just need to get some alternate thinking =)

RoryF
17 Aug 2005, 18:37
Thanks CMX_CMGSCCC, works like a charm :)

ged
27 Sep 2005, 19:09
Is there any way to do it with plugin?

Loony BoB
03 Oct 2005, 01:17
I've tried to implement this and failed miserably.

I tried using the default version and had that same problem with the deleted posts. Then I tried using the above version instead, and I got the following message whenever I tried to edit my user options...

Could not find phrase '::$values for profile fields is not an array::'.

Any ideas on whether we can get a working version of this available for download instead of downloading the file just to find it doesn't work? :(

Martz
03 Oct 2005, 13:04
Thanks for this fix :)

The Wise One
04 Oct 2005, 02:09
works good on 3.5.0

nice and easy and especially nice with the add on.

installed.

Andreas
05 Oct 2005, 02:32
Everybody considering to use this should use this Code: http://www.vbulletin.org/forum/showpost.php?p=754751&postcount=25

The default Code of this Hack causes additional queries due to uncached Templates.

The Wise One
05 Oct 2005, 03:49
Everybody considering to use this should use this Code: http://www.vbulletin.org/forum/showpost.php?p=754751&postcount=25

The default Code of this Hack causes additional queries due to uncached Templates.
the code you link to works great if you have the legacy postbit set as default in options...but how can that code be reworked to work with the horizontal postbit when set as default so that the additional queries can be eliminated?

Loony BoB
05 Oct 2005, 17:24
Aye, that is also what I'm interested in doing. My website uses non-legacy by default but has legacy as an option, and we can't upgrade until we can figure out how to do this (using our test board).

jtallen123
05 Oct 2005, 22:02
So is there a version of this that works properly with the horizontal, non-legacy, as the default yet? I seemed to read conflicting reports in this thread. :)

The Wise One
05 Oct 2005, 22:17
So is there a version of this that works properly with the horizontal, non-legacy, as the default yet? I seemed to read conflicting reports in this thread. :)
from what i gather...the original code functions just fine as is...except its not cached causing extra queries?

the code Kirby linked to resolves that issue but legacy postbit needs to be set in ACP as default.

hopfully a version of that code is released to work with horizontal as default and without the extra queries. i tried playing with the plugin code, reversing and switching the code around...but was unsuccessful (no surprise there though...dont know a whole lot about php yet).

Samira
06 Oct 2005, 06:19
I did this, with the regular postbit as default:

http://www.vbulletin.org/forum/showpost.php?p=754751&postcount=25

I did away with the else portion and only used the first part. Works fine with legacy as an option but not default. :) I also made sure to set in the profile field for the 'Top' option to be the default selection, if that makes any difference.

shungo
06 Oct 2005, 08:48
Try going into the ACP -> vBulletin Options -> Style & Language Settings -> Set "Use Legacy (Vertical) Postbit Template" to "No".


That's i did exactly. But still not working on gold version even replacing by right field profile in module :(

jtallen123
06 Oct 2005, 16:44
hmm - I think I'll eventually use this on my forums if we ever get a confirmed version that works with 3.5.0 and horizontal as default.

Samira
07 Oct 2005, 01:35
Works for me, jtallen. :)

Andreas
07 Oct 2005, 02:48
hopfully a version of that code is released to work with horizontal as default and without the extra queries. i tried playing with the plugin code, reversing and switching the code around...but was unsuccessful (no surprise there though...dont know a whole lot about php yet).
Hmm, works fine for me on gold no matter if legacy is default or not?

The Wise One
15 Oct 2005, 00:40
Everybody considering to use this should use this Code: http://www.vbulletin.org/forum/showpost.php?p=754751&postcount=25

The default Code of this Hack causes additional queries due to uncached Templates.
another question about this. the code you recommend to use in the link above. is the caching done because of the code change or is it because of the hook it belongs to?

as it is now...it works great. when i add the add on, using the option to switch postbits (in the thread display mode menu) doesnt change the postbit. rather...it does, but it requires a refresh after clicking the option. if i use the code in the post you linked to...but change the hook to postbit_display_complete the refresh is no longer required and using the thread display mode menu option changes the postbit accordingly.

i guess what im trying to figure out is...are the additional queries you refer to being caused because of the hook used or the code used...

Mika
16 Oct 2005, 13:39
Hmm, works fine for me on gold no matter if legacy is default or not?Here as well (3.5 gold).

WhSox21
17 Oct 2005, 19:33
If anyone with spare time wants to take over this hack's support and functioning please let me know. I'll give you full credit to this hack and if the vb mods want to they can switch the thread starter via the database.

I just don't have time to update this at the moment. Too many things going on in my life.

dieselpowered
22 Nov 2005, 22:22
Everybody considering to use this should use this Code: http://www.vbulletin.org/forum/showpost.php?p=754751&postcount=25

The default Code of this Hack causes additional queries due to uncached Templates.

Ok Andreas...the code below is the correct code to use to not get those additional queries, is that right? I just want to be sure, cause it works just fine :)

global $vbulletin;
if ($vbulletin->userinfo['field9'] == "Vertical Postbit (Legacy)")
{
$vbulletin->options['legacypostbit'] = 1;
}
else if ($vbulletin->userinfo['field9'] == "Horizontal Postbit")
{
$vbulletin->options['legacypostbit'] = 0;
}

Flow Fusion
27 Nov 2005, 16:09
Thanks for the Fix also!

Quillz
10 Dec 2005, 22:55
Thanks for the plug-in. Works well.

jdebler
30 Dec 2005, 15:41
Kinda new to plugins, installed a few in the past but I got an error message that I never saw before when installing this one...

This file appears to be a Plugin, not a Product. Please use the Plugin Manager to add this file.

Is this right?

I went into the Plugin Manager and went to add it that way, but it asked me for information that I do not know, such as Hook Location.

Again, I am new to this so any help would be appreciated. Thanks!

YLP1
30 Dec 2005, 18:56
Does this plugin have the fixes stated above already included?

jesus likes pie
30 Dec 2005, 22:17
Hi.

http://www.vbulletin.com/forum/bugs35.php?do=view&bugid=2027


Any chance of a solution to this?

jesus likes pie
31 Dec 2005, 18:48
oh whoops.....its good to read previous pages :)

fixed :)

Oblivion Knight
01 Jan 2006, 09:47
I went into the Plugin Manager and went to add it that way, but it asked me for information that I do not know, such as Hook Location.

Again, I am new to this so any help would be appreciated. Thanks!Don't worry, we all have to start somewhere.. :)

Basically, there are 2 different plugin types. Products and Plugins.
Products contain plugins, and are generally used for larger mods. They can also install templates, phrases and settings automatically. Plugins don't do any of that, and simply add code in to vBulletin's hooks (as opposed to editing the source code)..

Since this is a plugin, we need to upload it as one.
Admin CP -> Plugin System -> Download / Upload Plugins -> Import Plugin Definitions XML File


Does this plugin have the fixes stated above already included?No, they need to be applied yourself.. Although it's a relatively easy job.

Gray Matter
10 Feb 2006, 02:36
I don't know if anyone else has this problem, but this plugin makes my forum act strange with deleted posts. Usually, when posts are soft-deleted, they take on the appropriate template. With this, it's just a blank postbit template for soft-deleted posts. So I've had to disable this plugin, for now.

jdebler
10 Feb 2006, 14:15
Any way to make this admin selectable for certain user groups only?



Oh, and uh...Oblivion Knight: I forgot to thank you for the basic info. Worked like a charm! :)

Hostboard
27 Feb 2006, 04:01
Is this working on 3.5.4?

welo
27 Feb 2006, 04:14
I have it on my 3.5.4 board and it seems to be fine.

Replicators
04 Mar 2006, 22:44
It's not working for me at all i am not new to applying mods. Maybe it is just a setting wrong, idk. It keeps staying at horizontal no matter what i set it at.

Red Blaze
04 Mar 2006, 23:08
Did you set your profile field number correctly? Go to your plugins, edit the plugin that belongs to the postbit selection thingie, and check the profile number. If the number doesn't match the one you have, that's your problem.

Also, if that's not the case, check the value of the radio buttons. That also must match what you have in the plugin.

Replicators
04 Mar 2006, 23:42
It all checks out correct, i think it's a conflict with something else, only thing it can be, i will look around and see.

jdebler
06 Mar 2006, 14:29
Is there any easy way to make this selectable only by certain user groups?

bulbasnore
11 Mar 2006, 04:02
Well, nothings happening. My admin user's field6 is 'horizontal postbit'. Here's the code:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Our 3.5.3(with plugin security patch) is set to legacy by default.

Nothing happens.

welo
11 Mar 2006, 08:27
Try this:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



You might want to reconsider those radio button labels though. Who except a VB geek is going to know what they mean?

jdebler
28 Mar 2006, 14:22
Is there any easy way to make this selectable only by certain user groups?

Anyone? :D

cmbehan
14 Apr 2006, 05:04
Is there any easy way to make this selectable only by certain user groups?

I'm very interested in this feature also.

Konstantinos
01 May 2006, 07:11
it doesnt work in 3.5.4

welo
01 May 2006, 07:53
I've had this running in all 3.5.x versions. Works fine.

Konstantinos
06 May 2006, 13:20
ok it works only when u have set in admin cp horizontal postbit by default, if in the admin cp post bit setting is vertical this mod doesnt change the postbig to horizontal

FinalAngel
08 May 2006, 10:38
It doesn't work in my forum too, i've this Code in the Plugin System:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



The other codes in this Thread doesn't work after all.

My field nr is 8, i've vb 3.5.4. I can choose between the two options but nothing happens...

Can anyone help me ?_?

VBUsers
12 May 2006, 09:12
finally got it to work thanks!

vBulletin THEN DAYLIGHT
22 May 2006, 17:08
finally got it to work thanks!
How. I can't get this to work at all :( Legacy is my default, I notice your forum has this as default as well.

What code are you using? I am using:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

vBulletin THEN DAYLIGHT
22 May 2006, 21:23
No worries, fixed!!!!!!!!!!!!!!! WOOOOOOOOOOOOO!!!!!!

gopherhockey
08 Aug 2006, 04:31
The posts and replies are too difficult to follow here.

Has anyone actually gotten this, or something similar, to work if you have the legacy postbit option set on in your admincp?

I want the legacy postbit to be the default for guests and all new registrations. Therefore, I have to keep this set. If not, it usese the new postbit, which I dislike but want users to select if they wish.

Basically I want the entire thing to work backwards.

I would just paste the legacy into postbit and postbit into legacy, but there are users who have selected their option and this would create a mess.

Oblivion Knight
08 Aug 2006, 09:01
How to get this working with EITHER postbit or postbit_legacy as default.

Move the plugin to use the hook cache_templates, and replace the code with:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Add an additional option to the custom profile field at the TOP of the list, "Use Forum Default".

This should work on both 3.5.x and 3.6.x setups.. :)

MotMann
24 Sep 2006, 23:42
@Oblivion Knight

It's not works on Vb 3.6.1 :(

I used the last code from you...

MotMann
13 Nov 2006, 10:57
No worries, fixed!!!!!!!!!!!!!!! WOOOOOOOOOOOOO!!!!!!

And what yo do? On my side it's not working.

Konstantinos
17 Dec 2006, 08:46
it doesnt work in 3.6.4

brvheart
08 Jan 2007, 15:47
Could we get a port to 3.6.x for this? This is a great option to give the members :)

gothicuser
10 Jan 2007, 14:41
Just managed to get this working perfectly under 3.6.4 using instructions from THIS post (http://www.vbulletin.org/forum/showpost.php?p=1047326&postcount=74)
Many thanks Oblivion Knight :D

brvheart
10 Jan 2007, 15:11
how do you move the plugin? Sorry never done that....I will be kick myself it is so easy...


EDIT: Nevermind I got and it is working :) thank you

SoftWareRevue
24 Apr 2007, 14:15
How to get this working with EITHER postbit or postbit_legacy as default....This should work on both 3.5.x and 3.6.x setups...Can someone explain this in a "step-by-step guide for the complete idiot" kind of way, please? :)

Digbijoy
29 Jun 2007, 08:09
How to get this working with EITHER postbit or postbit_legacy as default.

Move the plugin to use the hook cache_templates, and replace the code with:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Add an additional option to the custom profile field at the TOP of the list, "Use Forum Default".

This should work on both 3.5.x and 3.6.x setups.. :)

thank you very much. :up:
works like a charm !

thanx again.

kambiz
04 Oct 2007, 18:54
hmm.I did what Oblivion Knight said but it doesn't work on 3.6.8! is there any solution?

WhaLberg
05 Oct 2007, 04:32
http://www.vbulletin.org/forum/showthread.php?t=144644

kambiz
05 Oct 2007, 16:01
http://www.vbulletin.org/forum/showthread.php?t=144644
oops.
thanks.:D

Oblivion Knight
14 Jan 2008, 16:13
I still firmly believe that my version works best (even though it doesn't take style overrides into account), and have just tested on 3.6.8 PL2 with no problem.

jdebler
14 Jan 2008, 23:39
I still firmly believe that my version works best (even though it doesn't take style overrides into account), and have just tested on 3.6.8 PL2 with no problem.

Where is yours? I didn't see it listed in the modification list in your profile.

lifanovsky
28 Apr 2008, 14:28
Can someone direct me to the same plugin that works with 3.7? Thanks a lot in advance!

attroll
29 Apr 2008, 05:16
Can someone direct me to the same plugin that works with 7.7? Thanks a lot in advance!
What is 7.7 or was that a typo?

lifanovsky
29 Apr 2008, 09:29
I meant 3.7 indeed. 8)

lifanovsky
04 May 2008, 14:25
So is there any solution? Anyone? :)

attroll
18 Jun 2008, 05:22
I found a big flaw in this hack. I have been having problems with viewing my soft deleted posts in the forums for a long time and I could not figure out what was causing it. I finally took the time to troubleshoot this tonight. It was this hack here that was causing my deleted post from showing up properly.

This hack sets the Hook Location at "postbit_display_complete" but it should be set to "postdata_start" to work properly.

Brew
19 Feb 2010, 00:31
Please update this for ver 4.0.x?

Thanks!

Diablotic
13 Apr 2010, 22:35
Yeah, we need similiar mod for vB4 please

New Joe
27 Apr 2010, 08:52
Did anyone get this to work on vB 3.8.X?