View Full Version : Stylename (and Stylecounter) Modification v1.0.3.1
Hellspire
05-07-2005, 10:00 PM
Note: This module has been changed to 1.0.3 since these were basically bugfixes.
Greetings, these are simple hacks made by me that show what stylename a user is using. Stylecounter module has been removed while I revise it to do a few things you guys requested!
The stylename hack adds 0 queries and will adjust for:
- Child and parent styles, including 'use forum default styles'
- Will account for the current user (the one in the $bbuserinfo array) and which temp style he/she is using.
- Same display orders (display order doesn't even matter...)
Thanks go out to gnu- and cinq. The former for pointing out some odd little mistakes I made in cyphering the stylechoosercache with child and parent styles that I ignored (sorry!) and the latter for contributing a screenshot.
I'm sorry for the hassle I caused some of you who installed, please know that when I did so, I was under duress from other issues and I did not account for a few things that I thought I had. Makes me look like a fool, sure... but since I corrected this basically.... a day, I don't expect to be treated harshly. (Be kind!)
Update: v1.0.3.1
- Added optional instructions on how to make QuickStyleChanges permanent for logged-in users.
FightRice.com
05-08-2005, 06:22 AM
Awesome hack. First time i've seen one like it and i've been wondering who is using what style on my forums..
Deaths
05-08-2005, 06:50 AM
Very nice!
Allan
05-08-2005, 07:41 AM
screen please :)
screen please :)
:rolleyes:
Mr. Brian
05-08-2005, 09:06 AM
Cool.. Took not more then a minute and ur done! Thumbs up!
Allan
05-08-2005, 09:09 AM
:rolleyes:
lol, thank Cinq ;)
BarHopper
05-08-2005, 11:04 AM
I've seen it before, but this one is better.
Hellspire
05-08-2005, 01:27 PM
Heh, I would tend to agree with barhopper. Other hacks like this are just too attached to the showthread functions that they are not portable, whereas this is. Of course, that means it demands two or three more edits, but meh... I don't think it matters.
I will be posting some addon hacks to this in the future as soon as I finish my spring semester ;D
GsVnEt
05-08-2005, 01:29 PM
Heh, I would tend to agree with barhopper. Other hacks like this are just too attached to the showthread functions that they are not portable, whereas this is. Of course, that means it demands two or three more edits, but meh... I don't think it matters.
I will be posting some addon hacks to this in the future as soon as I finish my spring semester ;D
Nice job, Matt!
I am sure lots of people will enjoy this add-on =)
Doesn't work for me :( Checked two times. It shows "Default Style" for everyone. Even for myself, and no, I'm not using it. :l
Hellspire
05-08-2005, 05:47 PM
GNU please be specific as to which addon you refer. Do you mean the stylecount or stylename mods?
Also if you could please do the following, take the array $styleusercache and print_r it so you can see its structure, then paste it in a code bb tag here, so I can see if it is something specific to your forum.
I'm refering to that stylename in postbit mod, but I understood it wrong first, after reading that description the second time I noticed that it in deed doesn't get those styles that have been changed via quick change. Now I'm looking something to solve this. :)
EDIT: Though, it would be nice if you would add that one extra query, if that's what it needs, in to instructions. ;)
Hellspire
05-08-2005, 06:35 PM
Ah yes, I am already planning on coding a modifcation to this script (very simple but I don't have time at the moment) that will check the bbuserinfo of the current user in relation to the post to correct the discrepency. Thus, relative to all users each will appear to have the correct information, but not so for the others without adding an extra query. Give me some time with this, in the mean time, install the hack as normal and when I update it, you just have to add another line or two to the construct_style_options function.
Have a nice day.
Well, there's no construct_style_options in the hack I'm refering, but I'm sure to chek this out until you got it done. :)
Hellspire
05-08-2005, 06:49 PM
Already done, please following the upgrade guide, 3 changes to 2 files (virtually same change). Cheers.
Btw. - Find the following
if ($threadedmode == 2) // hybrid display mode
I can find that line two times and it confuses me :D
Hellspire
05-08-2005, 06:59 PM
This will sound very newbish, but it is the first instance of (I will make a note of it in the installer) and not the second, although if you feel thus inclined you can add in both places. Doesn't make a difference, but will affect load time for the cypher.
yet another thing :D- Add the following 2 lines after this (this is after the '}')
wtf? :D there is like five lines? :D
and edit: nah. it's still doing this. in attachment left is a screen shot of the postbit and at the right is my options. :(
Nice...installing now.
Oh, one thing:
/*================================================= =====================*\
That's not really good practice, asking people to search for that. It could very well have been put in by another hack. Best practice (and AFAIK, part of the Read This First Before You Post A Hack thread) is to use unique blocks of code in your find parts.
*edit*
Also:- Find the following
$template = 'postbit';
- Add the following 2 lines after this (this is after the '}')
That line is terribly written. Sorry, but it is.
If the addition is meant to go after the }, why not write 'find $template = 'postbit'; }' ?
*edit* Uninstalled. This hack is of no use to me until it can display the styles correctly when they have been changed using the quickchooser.
And....it doesn't add 5 seconds to load time, even when using 13 styles. 5 seconds would be insane.
Hi
Does this update the user profile when changing a style or it is only a cookie thing
Still a wounderful hack
Thanks
Hellspire
05-08-2005, 11:58 PM
Nice...installing now.
Oh, one thing:
That's not really good practice, asking people to search for that. It could very well have been put in by another hack. Best practice (and AFAIK, part of the Read This First Before You Post A Hack thread) is to use unique blocks of code in your find parts.
*edit*
Also:
That line is terribly written. Sorry, but it is.
If the addition is meant to go after the }, why not write 'find $template = 'postbit'; }' ?
*edit* Uninstalled. This hack is of no use to me until it can display the styles correctly when they have been changed using the quickchooser.
And....it doesn't add 5 seconds to load time, even when using 13 styles. 5 seconds would be insane.
Might I point out that I released this yesterday? So lighten up for one....
Two, 1.2 DOES display the quick changes from the quickchooser, but will only do so for the username that is currently browsing, not for others (it is a relative fix). If you had read, you would have noticed that I mentioned this and that I said I would make such quick changes permanent for users logged in, or store in some way the styleid in a different field when it is not the same as realstyleid.
The installation guides were simply written in 5 or so minutes so you will have to forgive the lack of 'unprofessional' crap that you want me to exhibit. Give me a break geez.
In regards, to the 5 second thing, i said anywhere from 1-5 seconds at most, which MEANS that it is a relative thing friend, even if it is less than 1 second, these are approximations!
Sheesh.
GsVnEt
05-09-2005, 12:01 AM
Nice...installing now.
Oh, one thing:
That's not really good practice, asking people to search for that. It could very well have been put in by another hack. Best practice (and AFAIK, part of the Read This First Before You Post A Hack thread) is to use unique blocks of code in your find parts.
*edit*
Also:
That line is terribly written. Sorry, but it is.
If the addition is meant to go after the }, why not write 'find $template = 'postbit'; }' ?
*edit* Uninstalled. This hack is of no use to me until it can display the styles correctly when they have been changed using the quickchooser.
And....it doesn't add 5 seconds to load time, even when using 13 styles. 5 seconds would be insane.
This was a free hack released yesterday. Do you expect anything more?
Lighten up.
Hellspire
05-09-2005, 12:57 AM
Whatever, while all instances of what I asked to find were unique, and asking them to put it 2 lines below or above is too much apparently, I have made the instruction guides for installation and upgrade into html docs found in their respective zips. As for the stylecounter, I don't have the time to do it at the moment.
Hi
Does this update the user profile when changing a style or it is only a cookie thing
Still a wounderful hack
Thanks
1.2 makes it a note to temporary override the style selection like so:
$useid = ($bbuserinfo['userid']==$post['userid']) ? $bbuserinfo['styleid'] : $post['styleid'];
So if the thread belongs to the user currently viewing then it will use his temp id (over the realstyleid if it is different) to make it relatively fixed for users. The only way to accurately know if user A is using style 'b' as his temp or main would be to make the stylechooser update the userinformation. What some people in this thread FAIL to grasp is that such is NOT the purview of my hack. My hack is simply to to show what styles people are using, and 1.2 to make it believable by the user viewing if there is a discrepency.
For those of you who are having problems with the thing, I can only tell you that you installed it WRONG. I'm sorry, but I don't make stupid mistakes in my coding, but the installation guide was rather newbish like that guy said, so I made it easier for people to find the exact space where I want you to add it.
Yeah, it's not that bad :D
Well, after new fresh install again it still does that what I said above, with the screenshot. All are just Default. :S You have any idea what's wrong? And EDIT note. No, I did NOT install it wrong like seven times :D
And take that extra "<if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>" out of your instructions :P
Hellspire
05-09-2005, 01:06 AM
LOL Omg, sigh... removed, thank you. I was a bit pissed when I had to make that installation over again. Never thought I would have to provide so much time for this simple crap.
Hellspire
05-09-2005, 01:12 AM
Yeah, it's not that bad :D
Well, after new fresh install again it still does that what I said above, with the screenshot. All are just Default. :S You have any idea what's wrong? And EDIT note. No, I did NOT install it wrong like seven times :D
...
I really don't see how that is possible unless your $stylechoosercache is somehow screwed around. Can you perhaps do the following in your showpost?
$post['styleid'] = $result[0];
$post['styletitle'] = $result[1];
Take that, and change it to the following:
$post['styleid'] = $result[0];
ob_start();
print_r($stylechoosercache);
$post['styletitle'] = ob_get_clean();
Then go to any post using showpost.php then copy and paste the array structure of stylechoosercache. (Then obviously reverse the temp change I had you make ;D) I strongly doubt there is anything wrong with this array, but you never know?
hmm, yeah :D
Array ( [-1] => Array ( [1] => Array ( [0] => Array ( [styleid] => 1 [title] => Default Style [parentid] => -1 [displayorder] => 1 [userselect] => 0 ) [1] => Array ( [styleid] => 2 [title] => AlienSkin [parentid] => -1 [displayorder] => 1 [userselect] => 1 ) [2] => Array ( [styleid] => 3 [title] => Fusion [parentid] => -1 [displayorder] => 1 [userselect] => 1 ) [3] => Array ( [styleid] => 4 [title] => Blue by gnu- [parentid] => -1 [displayorder] => 1 [userselect] => 1 ) [4] => Array ( [styleid] => 5 [title] => Butter's Style tryout [parentid] => -1 [displayorder] => 1 [userselect] => 0 ) [5] => Array ( [styleid] => 6 [title] => DarkChild doing this >:| [parentid] => -1 [displayorder] => 1 [userselect] => 0 ) [6] => Array ( [styleid] => 8 [title] => Adam [parentid] => -1 [displayorder] => 1 [userselect] => 0 ) ) ) )
Hellspire
05-09-2005, 01:31 AM
I see the problem, your array is COMPLETELY different than mine, because you are creating completely new styles that don't act as children but as copies of the parent. So the way they are stored in the cache are different than most. I didn't predict something like that... meh, I will draft a replacement function for your case. Give me a few minutes ;D
Oh man :D Yeah, we accidentlly went like that from the start and are not changing it now ;)
Thanks mate :)
Hellspire
05-09-2005, 01:37 AM
In includes/functions_showthread.php, find the function that the installer told you to add, and replace it with this:
* NOT APPLICABLE, WAIT FOR 1.3 *
Edit: Ew! Looking at the array you sent me again, I see that you don't have different displayorders for each =\ I would assume that if you changed the display orders to different things, then they would all be displayed as the old function worked =\
I will code a new function for it now... give me a few minutes for 1.3 sigh......
Yeah, Changed the display order and works fine :) But yeah, update it of course :P
Hellspire
05-09-2005, 02:17 AM
Yeah, Changed the display order and works fine :) But yeah, update it of course :P
I did already, display order wont matter anymore, and will effectively handle child styles. Thanks for pointing it out!
vakvak
05-09-2005, 02:17 AM
thank you:)
Hellspire
05-09-2005, 02:18 AM
NP (smiley of teardrop on head inserted here)
almost good :D now it shows 'UNKNOWN' for everything ;) Can I find the earlier version somehere :p :D
(oh okay it's in the same instructions :D )
Hellspire
05-09-2005, 02:27 AM
almost good :D now it shows 'UNKNOWN' for everything ;) Can I find the earlier version somehere :p :D
(oh okay it's in the same instructions :D )
Sigh, I see... in this update I removed the cover for the default id. Will resolve immediately.
Edit: Done, and it was reuploaded. You should have no further problems. Seriously, I think I got them all.
Sorry :D Plain unknown all the way. I'm sticking with the old one for now as it works great if you just have those different display orders. ;) I'm off to sleep :D It's morning already :p
Hellspire
05-09-2005, 03:06 AM
Sigh, *hits head against the wall* I will look at it tomorrow when I have a clear head, I'm sick of the simplistic avoiding solution in my dazed state.
Edit: Wow what a stupid mistake... it has been corrected and the files updated. If another problem happens for gnu- I swear I will quit coding, because there is no other way that cache can be programmed.
And NO I will not support people who have styles like this
Parent 1
-Offspring 1
--Child of Offspring 1
---Child of Child of Offspring 1
Seriously, if you need those many parents you have optimization issues (although I THINK it is possible that I accounted for that -.- who knows...)
Hellspire
05-09-2005, 04:11 PM
Heh, I have no idea what I was thinking before -.-
Just wondered that are you ever going to implement that everyone would see everyones quickly changed styles too :p
Just because that, that you see your own style doesn't help so much :D
Hellspire
05-10-2005, 11:38 AM
I was thinking about it. Perhaps later this week!
Quick Changer works like a charm, just what I was looking for, thank you :)
Hellspire
05-11-2005, 03:23 PM
GNU- (or anyone for that matter) I am at work right now and really can't check, so if you have time check this out for me:
It occurred to me that forum specific style overrides may simply update $bbuserinfo['styleid'] in which case, that would be updated as the main style.
Lacking the means to check, I can't really say that it does this, and I believe it doesn't. Meh.
angelicGrace
05-12-2005, 02:44 AM
ok i have vb3.0.7. I installed both the quick style perminat and the style in postbit completely par directions to the letter.
Quick style works perfectly! Great job.
The style in postbit doesn't work just right. It shows the phrase Style in the postbit, but not the style the person is using. It is totaly blank. I have my styles set up as one parent (a default style) the others are children of it. They all have unquie style id numbers and names.
Any clue why it isn't showing a style for anyone?
Yeah I am a total novice at installing hacks, so please feel free to tell me if it is something stupid I am looking over.
Hellspire
05-12-2005, 02:57 AM
You probably pasted something in the wrong space, most likely in showpost.php or showthread.php. Most likely what is happening is that you are setting the value of post['def_style'] AFTER it has already been sent. Please double check that you have placed everything in the proper spot.
angelicGrace
05-12-2005, 02:02 PM
Thanks. I see my problem. I added something after instead of before a particular line of code. Thanks.
Acers
05-12-2005, 05:25 PM
very very nice....this is just what was needed. get job m8.
can you incorporate something like style stats for admins where admin can see what style the people are using on forums.(from admincp) for one thing it may help to scrap some defunct themes. if possible....
Hellspire
05-12-2005, 06:02 PM
Perhaps next week when I have time. Since you are an installee, you will receive an update on these hacks if I decide to do one.
angelicGrace
05-12-2005, 06:11 PM
Acers that was a great suggestion and one I know that could be useful for me. My forum has 20 styles. It would be nice to know what ones are used and which one's aren't.
paul41598
05-31-2005, 10:31 PM
um how come the style updates for myself when I switch it, but it shows the default style for every other user.
Hellspire
06-01-2005, 12:51 AM
um how come the style updates for myself when I switch it, but it shows the default style for every other user.
Um, considering this is something that happens at the process level of php I would doubt that browser would have anything to do with it. What you did most likely is miss an unset function that the instructions specify to add. I couldn't really say though considering that I don't update this script anymore. Let me know if you made any mistakes of that type.
Nicely done, working just perfect :)
Hellspire
06-23-2005, 11:57 AM
It always will providing the display orders of the styles are different. If not, the postbit name will be screwed up.
Yawn, I will probably convert this to 3.5 when it goes stable.
mkdevo
01-10-2006, 02:11 PM
was this (or anything like it) ever ported to 3.5?
Hellspire
01-10-2006, 11:19 PM
was this (or anything like it) ever ported to 3.5?
Nope, and don't think I will.
elenora
05-09-2006, 02:33 PM
Is the style not supposed to show up in the pms? Cause mine certainly doesn't...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.