vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   User Postbit Template Selection (https://vborg.vbsupport.ru/showthread.php?t=91407)

WhSox21 06-29-2005 10:00 PM

User Postbit Template Selection
 
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 07-01-2005 03:25 PM

http://www.vbulletin.com/forum/showthread.php?t=101577, still works ;)

Nice go though :)

WhSox21 07-01-2005 03:43 PM

Didn't know that was there. :(

FD929 07-01-2005 09:41 PM

Not working.

WhSox21 07-01-2005 09:54 PM

What seems to be the problem? I need more information. You most likely did not change the userfield in the plugin.

Christine 07-02-2005 12:03 AM

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 07-02-2005 06:59 PM

Quote:

Originally Posted by FD929
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 07-02-2005 07:47 PM

Quote:

Originally Posted by acidburn0520
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 07-03-2005 01:41 AM

Quote:

Originally Posted by FD929
Thanks acid, that was it.

No problem.

Christine 07-03-2005 01:53 AM

Quote:

Originally Posted by DarkSSJ3

phpinclude_start is depreciated.

Chris M 07-03-2005 08:34 AM

global_start is the equivalent hook ;)

Satan

SlaPPiE 07-08-2005 12:09 AM

Quote:

Originally Posted by acidburn0520
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 07-08-2005 01:51 AM

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 07-08-2005 11:38 AM

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 07-11-2005 07:44 AM

Your script causes this problem. Just wanted to let you know.

Christine 07-26-2005 12:19 AM

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 07-26-2005 06:47 AM

Exactly what i was looking for thanks...

trancetopia 08-01-2005 11:56 AM

Works a treat. Thanks.

CMX_CMGSCCC 08-04-2005 04:09 AM

Can you attach the minor change you did to the code to fix the problem?

-CMX

Christine 08-06-2005 06:51 PM

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 08-06-2005 06:53 PM

Quote:

Originally Posted by Christine
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 08-06-2005 08:26 PM

Done. :)

InfiniteWebby 08-11-2005 04:33 AM

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 08-12-2005 02:55 AM

Ok the problem lies in functions.php

PHP Code:

    if ($vbulletin->options['legacypostbit'] AND in_array('postbit'$templates))
    {
        
$templateassoc['postbit'] = $templateassoc['postbit_legacy'];
    } 

And

PHP Code:

    if ($vbulletin->options['legacypostbit'] AND $templatename == 'postbit')
    {
        
$templatename 'postbit_legacy';
    } 

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 08-12-2005 04:06 AM

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:

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

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 08-12-2005 06:50 AM

Quote:

Originally Posted by CMX_CMGSCCC
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:

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

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 08-17-2005 04:37 PM

Thanks CMX_CMGSCCC, works like a charm :)

ged 09-27-2005 05:09 PM

Is there any way to do it with plugin?

Loony BoB 10-02-2005 11:17 PM

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 10-03-2005 11:04 AM

Thanks for this fix :)

The Wise One 10-04-2005 12:09 AM

works good on 3.5.0

nice and easy and especially nice with the add on.

installed.

Andreas 10-05-2005 12:32 AM

Everybody considering to use this should use this Code: https://vborg.vbsupport.ru/showpost....1&postcount=25

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

The Wise One 10-05-2005 01:49 AM

Quote:

Originally Posted by KirbyDE
Everybody considering to use this should use this Code: https://vborg.vbsupport.ru/showpost....1&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 10-05-2005 03:24 PM

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 10-05-2005 08:02 PM

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 10-05-2005 08:17 PM

Quote:

Originally Posted by jtallen123
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 10-06-2005 04:19 AM

I did this, with the regular postbit as default:

https://vborg.vbsupport.ru/showpost....1&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 10-06-2005 06:48 AM

Quote:

Originally Posted by acidburn0520
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 10-06-2005 02:44 PM

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 10-06-2005 11:35 PM

Works for me, jtallen. :)


All times are GMT. The time now is 04:50 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.03192 seconds
  • Memory Usage 1,827KB
  • 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
  • (2)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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