vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Stylename (and Stylecounter) Modification v1.0.3.1 (https://vborg.vbsupport.ru/showthread.php?t=81135)

Hellspire 05-07-2005 10:00 PM

Stylename (and Stylecounter) Modification v1.0.3.1
 
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 :)

cinq 05-08-2005 07:44 AM

Quote:

Originally Posted by Allan
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

Quote:

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

Quote:

Originally Posted by Hellspire
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 =)

gnu- 05-08-2005 04:20 PM

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.

gnu- 05-08-2005 06:20 PM

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.

gnu- 05-08-2005 06:48 PM

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.

gnu- 05-08-2005 06:53 PM

Btw.
Quote:

- 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.

gnu- 05-08-2005 07:20 PM

yet another thing :D
Quote:

- 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. :(

kall 05-08-2005 07:36 PM

Nice...installing now.

Oh, one thing:
Quote:

/*================================================= =====================*\
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:
Quote:

- 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.

Remi 05-08-2005 07:59 PM

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

Quote:

Originally Posted by kall
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

Quote:

Originally Posted by kall
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.


Quote:

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

Code:

$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.

gnu- 05-09-2005 01:01 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




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

Quote:

Originally Posted by gnu-
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?

Code:

                $post['styleid'] = $result[0];
                $post['styletitle'] = $result[1];

Take that, and change it to the following:
Code:

$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?

gnu- 05-09-2005 01:19 AM

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

gnu- 05-09-2005 01:35 AM

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......

gnu- 05-09-2005 02:13 AM

Yeah, Changed the display order and works fine :) But yeah, update it of course :P

Hellspire 05-09-2005 02:17 AM

Quote:

Originally Posted by gnu-
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)

gnu- 05-09-2005 02:24 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 )

Hellspire 05-09-2005 02:27 AM

Quote:

Originally Posted by gnu-
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.

gnu- 05-09-2005 03:00 AM

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...)

gnu- 05-09-2005 02:10 PM

works like a dream :)


All times are GMT. The time now is 02:56 AM.

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.01249 seconds
  • Memory Usage 1,831KB
  • 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
  • (3)bbcode_code_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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