PDA

View Full Version : Miscellaneous Hacks - Make quick style chooser update user settings


Xoligy
12-11-2006, 10:00 PM
The Quick style chooser relies on sessions rather than updating the actual user's settings. This means when you want to see what skin a user is using, it's usually not correct. Since most users tend to change skins using just the Quick Style Chooser, this plug-in updates their settings to match it. It's specifically for use with my skin view plug-in (https://vborg.vbsupport.ru/showthread.php?t=133805), but also could be handy for other forums. Simply install it using the product manager.

Note: This will not update a user's settings until they re-visit your forums. It is also said to fix issues with psiStats (https://vborg.vbsupport.ru/showthread.php?t=127980) giving inaccurate results.

Update: This now lets users easily reset their options back to the default style.

You're free to do what you like with this code, although credit is appreciated, it's not required.

Brought to you by eXaltic - vBulletin skins (http://www.exaltic.com).

Allan
12-12-2006, 04:56 PM
i need install this product before ?

https://vborg.vbsupport.ru/showthread.php?threadid=133805

Xoligy
12-12-2006, 05:08 PM
It doesn't matter what order you install them in :)

Allan
12-12-2006, 05:25 PM
I have installed the 2 mod and i little problem :p

In postbit template, i have added this:

Style: $post[stylename]


Looking:

Xoligy
12-12-2006, 05:38 PM
As mentioned in the other thread, you should wrap <if condition="$post[stylename]"> </if> round it, so you'd have:

<if condition="$post[stylename]">Style: $post[stylename]</if>

AMG021
12-12-2006, 06:37 PM
Works like a charm!!!!!

Allan
12-12-2006, 06:48 PM
I'm stupid, excuse me, it work now :)

HPIA
12-12-2006, 10:09 PM
I dont understand...I installed them both and added that <if condition="$post[stylename]">Style: $post[stylename]</if> in the postbit template. What did I do wrong?

AMG021
12-13-2006, 02:25 AM
I dont understand...I installed them both and added that <if condition="$post[stylename]">Style: $post[stylename]</if> in the postbit template. What did I do wrong?
Try adding it to posbit_legacy too. I have them added in both templates

Xoligy
12-13-2006, 09:01 AM
If your site uses the 2 column view like vbulletin.org does, then you need to edit postbit_legacy.

Ramsesx
12-13-2006, 09:49 AM
Thanks for this (install it later), never understood that this isn't vbulletin default because how should the default user know it's only a temporary change if he use the quick style chooser?

Xoligy
12-13-2006, 01:32 PM
Ramsesx, yes I agree. I guess it saves writing to the database when people are just checking out the other skins. I guess there should really be a notice saying it's only a temporary change and with a link/button to save the changes. But for most forums, this plug-in will be effective enough, as it only updates the database when needed.

Bison
12-15-2006, 02:55 AM
For some unkown reason, but when I change my style, everyone else's style name inside a thead changes to my previous style.

Xoligy
12-15-2006, 09:32 AM
Thanks, I'll check it out. Does it change their actual style, or it just shows up in the postbit as their style being different?

Bison
12-15-2006, 09:37 AM
Just the style name, I had one user report that in the chooser, the name changed, but his style remained visable.

Xoligy
12-15-2006, 10:56 AM
Strange, I'll try and reproduce & fix it.

Falcon Capt
12-15-2006, 09:04 PM
What hook location should be used when installing this plug-in???

Ev!L ErN!E
12-15-2006, 09:29 PM
ok wait do I need that other one you made to? or can I just use this one?

Xoligy
12-16-2006, 09:28 AM
What hook location should be used when installing this plug-in???

It should install in the correct location.

"ok wait do I need that other one you made to? or can I just use this one?"

This plug-in is to be used in conjunction with the "show user style in postbit" plug-in. I released it separate as it also provides a fix for other plug-ins.

MathewC
12-16-2006, 02:38 PM
i go to add to member info temp using

<if condition="$post[stylename]"><strong>Forum Style Used:</strong> $post[stylename]</if>

And yet it doesnt appear?

Bison
12-16-2006, 03:24 PM
I thought this was just a posbit hack?

Xoligy
12-16-2006, 03:58 PM
You're getting confused between this hack and my other hack which shows their skin in the postbit.

Bison is right, it will only appear in their postbit, not their member info. I may add the ability to show it in their member info if I get time.

Bison
12-17-2006, 11:52 PM
This hack has is not properly working well with your other hack. I suggest that you pull this hack until you can fix the problem. I have disabled the hack to see if your other hack would work like it did before I installed this one, but now its broken too.

I am not good with writing SQL code, but there's something wrong with this query.

global $styleid;

// Are they the same?
if (isset($styleid) && $user['styleid'] != $styleid){
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET styleid = " . $styleid . " WHERE userid = ". $user['userid']);
}

Like I mentioned in another thread, once I change my style while inside a thread, everyone elses style name changes in the same thread to my previous style. If I refresh the thread once more, then they all inherit the style name I just selected. The funny thing about it is that they still can visually see the one that they originally selected, but their chooser points to the one I'm currently using.

Xoligy
12-18-2006, 01:29 PM
I spent 2 hours trying to debug the problem, but couldn't even reproduce it. I've added some extra checks, but I don't think they'll do much good.

If you don't mind, could you answer the following questions:
What is your userid on your forums?
Is it just you that can change other people's themes?
What other plug-ins do you have installed?
Would it be possible for me to register on your forums and experience the problem?

If you want, we can take this to PM or MSN (or another IM network).

Xoligy
12-18-2006, 05:53 PM
Updated to allow users to reset their skin to the forum default skin from the quick style chooser.

Make sure you remove the previous plug-in.

Bison
12-18-2006, 08:39 PM
Question(s):


Does removing the plugin reset their skin to the one that's currently set in their options?

Are there any templates or phrases associated with this plugin?

When applying the revised plugin, will the user need to do an overwrite?

Xoligy
12-19-2006, 08:59 AM
1. No
2. The previous plug-in had no templates or phrases.
3. The user won't need to do anything.

Also, I uploaded the wrong version. The latest version has been uploaded now.

da420
12-19-2006, 07:40 PM
Installed, but when i updated to the latest version it will not save the style when i choose the style in the style chooser. I choose it, it goes to the style, but when i click on new posts or any forum it goes right back to what I had it to. Disable the product and all is well again.

Bison
12-19-2006, 09:09 PM
This guy is very smart and I think he's close to figuring this one out. The problem lies in the query which changes the styleid for the user. He's going to have to join a few tables to get this one to work ... only for the person who changes his style. Right now, its changing everyone's style in the chooser.

Xoligy
12-20-2006, 10:11 AM
The query only changes the user's style, no-one elses. The where clause specifies only the current user's style will be changed, so that's not the problem.

I believe it may be something to do with the user's realistyleid variable not being updated - but I can't see why that changes what everyone elses style is specified as, I shall check it out and see, but I'm very busy at the moment so I can't promise anything. It could also be caching, since if you refresh it seems to rectify Bison's problem.

Bison
01-01-2007, 05:54 PM
Happy New Year y'all!

Any progress on fixing this hack, Xoligy?

Xoligy
01-10-2007, 01:19 PM
I'm now about to take a look at it. I know there are problems with it as I have been experiencing them myself.

Update: Ok I've fixed all the problems and it works like normal. Now I just need to fix the bugs with the other one.

KURTZ
01-10-2007, 02:26 PM
INSTALLED!

AMG021
01-11-2007, 02:38 AM
works like a charm
thanks again for not giving up :D

Forza
01-16-2007, 01:47 PM
im still not sure what this does exactly lol but atleast the 'show skin in postbit' works properly now! thanks for this!

KURTZ
02-06-2007, 01:24 PM
hi, i've a trouble with this fix, it fix correctly in the postbit the style that an user uses, BUT when an user reconnect on the board his style is changed automatically ...

Tralala
02-14-2007, 04:14 AM
Great, great, great add-on. I always lamented the fact that I could never get accurate stats on what skins were in use, since so many users tend to override their User Settings via the QuickChooser. Thanks to this, the stats will be more accurate.

/clicks install

Oh... will it work with this hack? Show Users using Style in Stylechooser (https://vborg.vbsupport.ru/showthread.php?t=95637)

Tralala
02-14-2007, 04:49 AM
Now that the user settings are somewhat more accurate, is there a way to discover specifically which users are using what skin? Like a search in the AdminCP or something? In other words, if psiStats reports there are two users who have chosen "style Z" is there a way to find out who those two users are?

I'm searching but not finding anything.

WNxWakko
02-19-2007, 02:34 PM
Now that the user settings are somewhat more accurate, is there a way to discover specifically which users are using what skin? Like a search in the AdminCP or something? In other words, if psiStats reports there are two users who have chosen "style Z" is there a way to find out who those two users are?

I'm searching but not finding anything.


I totally agree. Would be nice if I could quickly find out how many members are using each style.

Tralala
02-19-2007, 02:42 PM
I totally agree. Would be nice if I could quickly find out how many members are using each style.

According to this post (https://vborg.vbsupport.ru/showpost.php?p=1182602&postcount=370) by Psionic Vision:

You could run query. Something like this:
SELECT userid, username FROM user WHERE styleid = XXX

It'd be nice to have a nice AdminCP menu option for this though... just a quick screen that shows what users have selected what style. That way if you have an unpopular style (only 4 users) and you want to get rid of it, you can inform them ahead of time...

Sadie Frost
02-21-2007, 11:20 PM
Is anyone still having a problem with styles changing randomly for users?

:)

Tralala
02-22-2007, 12:30 AM
May I make a feature request? I have a mobile style/skin that some users access from their smart phone/PDA. When they get back to their PC now though, as a result of this hack, they find themselves in that mobile style. I've suggested they update their bookmarks to accomodate (adding a "?styleid=25" suffix, which brings them back to the default skin) but obviously that's not ideal.

So what I'm thinking is, maybe there'd be a way to allow some styles to be excluded from this behavior? If a user chooses "mobile," for example it wouldn't auto-update their style prefs?

Bison
02-22-2007, 12:39 AM
Is anyone still having a problem with styles changing randomly for users?

:)

Yes...

Xoligy
02-23-2007, 09:52 AM
May I make a feature request? I have a mobile style/skin that some users access from their smart phone/PDA. When they get back to their PC now though, as a result of this hack, they find themselves in that mobile style. I've suggested they update their bookmarks to accomodate (adding a "?styleid=25" suffix, which brings them back to the default skin) but obviously that's not ideal.

So what I'm thinking is, maybe there'd be a way to allow some styles to be excluded from this behavior? If a user chooses "mobile," for example it wouldn't auto-update their style prefs?

Is that PDA skin available at all? A few people on a forum I visit have been asking for one.

I'll add an option, but for now you can just edit the fetch_userinfo hook and change:

if ($user['userid'] != false && $dbstyleid !== false && $user['styleid'] !== false && $user['styleid'] != $dbstyleid){


Change it to something like:

if ($user['userid'] != false && $dbstyleid !== false && $user['styleid'] !== false && $user['styleid'] != $dbstyleid && $styleid != 34){

With 34 being the ID of your PDA skin.

Bison and co. I'll check it out, but I'm unable to recreate it. Try disabling all other plug-ins and tell me if it still happens. If it does, then I'll PM you to find out more information about the exact set-up. Is it changing everyone's style to the same when someone uses this plug-in, or does it change someone's theme randomly when they visit.

EDIT: Try this and see if it fixes the problem.

Tralala
02-23-2007, 01:24 PM
I'll add an option, but for now you can just edit the fetch_userinfo hook and change:


Thanks! Did the edit for now... I appreciate the help.

Is that PDA skin available at all? A few people on a forum I visit have been asking for one.

Here are two, I like the first one best:
http://www.vbulletin.com/forum/showpost.php?p=1085230&postcount=202
https://vborg.vbsupport.ru/showthread.php?t=92071

There is also one included in this hack:
https://vborg.vbsupport.ru/showthread.php?t=100764

And while we're on the subject, here's a new hack that promises to detect when a mobile device connects to your site and allow you to override the default style/skin with one you specify:
https://vborg.vbsupport.ru/showthread.php?t=130983

Xoligy
02-23-2007, 01:38 PM
Thanks :)

Sadie Frost
03-03-2007, 07:26 PM
Is it changing everyone's style to the same when someone uses this plug-in, or does it change someone's theme randomly when they visit.

It seems to mostly, though not always, change people to a random skin (not what they have previously chosen) when they log in to the board. It not all the same, it's random ones. And sometimes people report that it just changes mid visit. I'll try the new plugin :) Thanks for looking into this! :)

FuzzyWuzzy22
03-27-2007, 02:31 AM
It is a random occurrence for each user, the forum I help at was getting reports of users styles changing randomly after posting/refreshing/editing/ect.

Edit: We have tried the version posted here ( https://vborg.vbsupport.ru/showpost.php?p=1188936&postcount=44 ) and ended up with the same problems.

Tralala
04-08-2007, 03:53 PM
Bison and co. I'll check it out, but I'm unable to recreate it. Try disabling all other plug-ins and tell me if it still happens. If it does, then I'll PM you to find out more information about the exact set-up. Is it changing everyone's style to the same when someone uses this plug-in, or does it change someone's theme randomly when they visit.

EDIT: Try this and see if it fixes the problem.

It seems to mostly, though not always, change people to a random skin (not what they have previously chosen) when they log in to the board. It not all the same, it's random ones. And sometimes people report that it just changes mid visit. I'll try the new plugin :) Thanks for looking into this! :)

Sadie, did you have success with the new plugin? I ask because I came here to report similar issues; users are reporting random, unexpected style changes. I was thinking perhaps it had something to do with this plugin. Just wanted to get feedback from you regarding Xoligy's fix attempt before I installed it myself.

Aimee1969
05-28-2007, 02:12 AM
What am I doing wrong...It just says default.
No matter what skin I am using???

Lacie
06-09-2007, 03:39 AM
Has anyone with the randomly changing skins problem found a solution? I installed the updated version and my users are still having this problem. Looks like we'll have to uninstall if there's no fix.

FuzzyWuzzy22
06-09-2007, 05:00 AM
Has anyone with the randomly changing skins problem found a solution? I installed the updated version and my users are still having this problem. Looks like we'll have to uninstall if there's no fix.

well after I had the problem and couldn't find a solution, I had a friend write up a small plugin to use in place of Xoligy's mod. I haven't had any reported problems with it.

you're welcome to try it if you wish.

Sadie Frost
07-16-2007, 08:43 PM
That did not work for me - my style changed after I went to another page of the site. :(

iRO Wiki
10-22-2007, 10:09 PM
I can report I was having the same problem, totally random skins at random points. So it's not installed for the time being, but I'll leave the "installed" box checked incase you update it!

CrystaStarLight
11-03-2007, 09:39 PM
Its happening to me as well. I've got both Postbit Skin View and this mod installed. Styles have been changing randomly in the same way Sadie Frost explained.

TCE Killa
01-22-2008, 02:32 PM
Mine was working very good until I got a new style... Now when you change on the Quick Style Chooser, it just stays the same as the last skin you was using.

YdieresiS
02-14-2008, 01:15 PM
Excellent to use with this add-on: https://vborg.vbsupport.ru/showthread.php?t=168816

Thank you :)

jesus likes pie
01-26-2009, 03:41 AM
thanks!

[and a well deserved bump!]

I actually made my own "style name in postbit" because I couldn't find one here (obviously now I know you made one too haha) but I fortunately found this before making my own version! Awesome.

Pcwolfx?
02-06-2009, 07:53 PM
but not working on vbulletin 3.7. :(

zombietom
03-09-2009, 01:48 PM
i'm using it on 3.7.1 and it's working

GCSkye
03-26-2009, 04:16 AM
It is a random occurrence for each user, the forum I help at was getting reports of users styles changing randomly after posting/refreshing/editing/ect.

Edit: We have tried the version posted here ( https://vborg.vbsupport.ru/showpost.php?p=1188936&postcount=44 ) and ended up with the same problems.

Has a solution been found to stop this random skin change?

calvis
08-31-2009, 08:32 PM
Doesn't work at all on 3.8.4 in fact it brakes the setting saved in the User CP :(