PDA

View Full Version : Miscellaneous Hacks - Postbit Toggle in User CP


a simple fašade
10 Jul 2006, 05:44
Postbit Toggle in User CP

This hack was originally inspired by an old hack providing similar functions created by Darth Cow. It creates a toggle option in the User CP to determine which postbit a user wishes to use. It also includes optional instructions to include the information concerning this field in the postbits.

Template Edits: 2, optional
Files to Upload: 0
Plugins to Import: 1
Other: 3 (Add one Profile Field and change one vB Options setting; OPTIONAL - create a phrase)

====

Installation Instructions -

View the readme.txt in the ZIP archive.

====

Support -

I will offer support in this thread.

a simple fašade
10 Jul 2006, 05:46
Update 1: Hack moved out of beta stage. All appears to be working well.

utw-Mephisto
10 Jul 2006, 06:22
Nice one ... :)

a simple fašade
10 Jul 2006, 19:51
Nice one ... :)
Thank you. :)

slappy
10 Jul 2006, 20:11
How does this one differ from these?

http://www.vbulletin.com/forum/showthread.php?t=101577

http://www.vbulletin.org/forum/showthread.php?t=91620

Regards,

Snake
10 Jul 2006, 20:33
Excellent! :)

a simple fašade
11 Jul 2006, 16:34
How does this one differ from these?

http://www.vbulletin.com/forum/showthread.php?t=101577

http://www.vbulletin.org/forum/showthread.php?t=91620

Regards,
1. They both require another plugin to operate.

2. They allow the user to change their postbit view mid-thread.

This hack gives users the option, and then (this is the optional bit) allows this information to be part of the postbit (ie. Postbit: Profile on Top).

CrystaStarLight
27 Sep 2006, 19:14
It works very good! I was wondering how to make the "Profile on Top" the default view?

Cybershaolin
06 Dec 2006, 05:43
One problem here: Me too but on top of it I can't seem to revert to the Profile on top.. I don't get it.

I made all modifications asked and when I go to my control panel on "Modify Options" I see that the other options are there. If I choose to see my postbit at left, it works when I go to check a message, my profile info is at left. But if I select it in order to see my postbit on top, it still shows at left, like it does not want to change back on top my message's profile.

What could be wrong?

kambiz
06 Dec 2006, 08:12
works great.
thank you man.

tansu
06 Dec 2006, 14:44
Hi, it works for me, but no other members..
isnt it strange?

Cybershaolin
21 Jan 2007, 10:30
Any clue to my problem?

Cybershaolin
25 Jan 2007, 06:19
I got it working but with some problems and bugs:

1- The template postbit_legacy is not included in the cache.

2- Whenever a member decide to change his postbit choice's options, it seems to revert to the postbit_legacy all time even if my own choice is on postbit. (on top).

To correct this, I have to go in the vbulltin options under Style and language and save the settings without changing anything!

Really weird. Any idea?

It says in the first thread that this hack is supported, well, last online in September... is it really the case?

Exitilus
25 Jan 2007, 16:33
Sounds like there may be a setup issue. Check the following plugin

legacypostbit toggle

Make sure the Field is Correct and the Option it's pointing too.

Cybershaolin
25 Jan 2007, 17:16
This is what I have in the plugin: (the order option is set to 5 for field in my peronalized fields too).



$vbulletin->options['legacypostbit'] = 1;

if ($vbulletin->userinfo['field5'] == 'Profile on top')
{
$vbulletin->options['legacypostbit'] = 0;
}


Also, in my vBulletin Options > Style and Template Settings, 'Use Legacy (Vertical) Postbit Template' is set to No.

Exitilus
25 Jan 2007, 21:58
Order Option? Or the actual field # ?

Cybershaolin
26 Jan 2007, 06:26
Field1 = Biography: Order = 1
Field2 = Location: Order = 2
Field3 = Interests: Order = 3
Field4 = Occupation; Order = 4
Field5 = Postbit Toggle; Order = 5

So the answer is both.

I can't get this why it's happening. It's very annoying.

Exitilus
26 Jan 2007, 15:18
This is My Setup. You could try and see if it makes a difference.

$vbulletin->options['legacypostbit'] = 1;

if ($vbulletin->userinfo['field5'] == 'Top')
{
$vbulletin->options['legacypostbit'] = 0;
}

The Field Options are:
Left
Top

And I have Set Default: Yes, but no First blank option

Cybershaolin
26 Jan 2007, 17:03
And I have Set Default: Yes, but no First blank option

You mean this in User profile field?: If it's the case, it's also what I have.
59533

In Style and languages settings I also have this:
59534

I tried changing for
Left
Top

No changes. I'm without any clue.

One note, I did not install the option to have the toggle option in the message's profile, did you?

Exitilus
26 Jan 2007, 19:08
What type of Profile Field is it ? It should be Single-Selection Menu.

Also what version of VB are you using ?

Cybershaolin
26 Jan 2007, 19:48
I'm using 3.6.4.

Here are all options I have! :D

Exitilus
26 Jan 2007, 20:14
I think your using the wrong Profile Field. I think your using Single-Selection Radio Buttons

You need to use Single-Selection Menu

I don't think you can change the type on a whim unless you do it via the Database.

If the option is Radio Buttons (Round circles you click) that's wrong as it doesn't determine your setting by using the "Top" "left" or whatever text you entered. It uses the position of the button selected.

Cybershaolin
26 Jan 2007, 22:35
Oh I see! Maybe that's it because I use a translated mod and it said Radio Button List! (Single selection)...

I looked at the original mod here and you're right! How do I change this in the database? Which table, which field and what change?

Thanks a lot for your help. This was running me crazy!

Exitilus
27 Jan 2007, 02:25
Do this at your own risk. But I use PHPMYADMIN. Go to the table PROFILEFIELD and change TYPE to SELECT for that Field.

Sometimes when I do this .. and view the Profile Field in AdminCP it gives some errors. I just hit save .... and go back in and it's fine after that.

Cybershaolin
27 Jan 2007, 06:02
It seems to work! Bravo!

I'll see if it holds to the option using my board in the next days...

Once again thanks a lot.

steven99
28 Jan 2007, 06:00
I changed this plugs code to:

if ($vbulletin->userinfo['fieldxxxxx'] == 'Profile on top')
{
$vbulletin->options['legacypostbit'] = 0;
}
elseif ($vbulletin->userinfo['fieldxxxx'] == 'Profile on left')
{
$vbulletin->options['legacypostbit'] = 1;
}So that the option set in Style and Language will be used for everyone that hasn't this yet set -- especially guests. I specially wanted legacy postbit off and saw no need for it to set it to off again in this plug unless it needed to by the user option.

FockerFGAA
28 Jan 2007, 08:27
thats a nice mod. if i had seen this before i probably wouldnt have tried to figure it out on my own, but i think it was safer the way i ended up doing it for us not so code inclined (http://www.vbulletin.org/forum/showthread.php?t=136059) but my way required creating an extra style. ill have to consider this sometime so that i dont have to keep adding a duplicate style for every style i put on my site. thanks!

Cybershaolin
28 Jan 2007, 09:14
It seems to work! Bravo!

I'll see if it holds to the option using my board in the next days...

Once again thanks a lot.

I talked too fast! :(

I really don't understand why it's not working well. After using my board today, with my postbit options set to Profile on top, it went back again to the profile displayed at left... even if I made those changes in the DB.

When it does revert to the profile on left even if my options are ser to show it on top (I have the server options displays at the bottom hack installed) it says that the postbit template is not cache. When the profile on top is displayed, it does not show that.

I had that cache problem before but with the postbit_legacy and somebody told me to add this in order to cache it:
59592

I also tried the code posted by steven99 and it does not even want to give me a profile on top, even if it's selected in the my options.

So, in conclusion, it does not seem to work for me. I'm about to uninstall it if nobody can find a solution for me. It gives me headaches. I just don't catch it.