vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Board Optimization - vBMicroStats (https://vborg.vbsupport.ru/showthread.php?t=140449)

maxicep 02-26-2007 09:03 AM

thanks nice hack,
i got a question how we uncached templates to cached ?

blockbusted 02-26-2007 10:19 AM

Thanks for update.

Pyrix 02-26-2007 11:11 AM

Can I suggest a small change?

Change '{microstats}' to '<!--{microstats}-->' in the template and in the str_replace in the plugin.

This way, on pages where the vb footer is used but it's not designed 'for' vbulletin (for example photopost, mediawiki) it doesn't leave the text {microstats} breaking your table, as it sees it as a comment.

It's what I've done on my site and it works a lot better.

Ollie

abramelin 02-26-2007 12:17 PM

i dont want regular users to see anything, what must i do?

Snake 02-26-2007 04:05 PM

Oh my god! I have been dying to see this hack to be ported over to 3.6.x. Hehe thank you very much, TECK, and welcome back of all sudden! :D

TECK 02-26-2007 05:06 PM

Quote:

Originally Posted by Pyrix (Post 1191016)
Can I suggest a small change?

Change '{microstats}' to '<!--{microstats}-->' in the template and in the str_replace in the plugin.

This way, on pages where the vb footer is used but it's not designed 'for' vbulletin (for example photopost, mediawiki) it doesn't leave the text {microstats} breaking your table, as it sees it as a comment.

Ollie

Excellent suggestion, Ollie. I updated the code. :)
The file in the first post will still show as 1.0.2 version, since it's just a cosmetic change, it does not replace any of the hack's functionalities.
Quote:

Originally Posted by abramelin (Post 1191052)
i dont want regular users to see anything, what must i do?

Hi abramelin,
I'm an old school guy, so I'm not really used to those questions. :)
The idea with a hack is to open the code and see how is done. I'm sure that if you open the .xml file you will see how to do it rightaway.

Still, is my pleasure to help you. Simply uninstall the product and run the new product-vbmicrostats_admin.xml file instead.
Since I implemented Ollie's request, you will have to edit ONLY the footer template like in the new readme.html file (see first post for the new file, it still shows as 1.0.2).
Leave the PHP files the way they are edited now, they are not needed to be re-modified in order to work with your hack request.

In exchange for my help, promise me this:
You will open the 2 .xml files and look at the code to compare it. :)

If you still don't understand it, let me know, I will explain you where are the changes.
The idea is to learn what is hapenning inside your code, not just to install a file.
Thanks. :)

TECK 02-26-2007 07:45 PM

Quote:

Originally Posted by Xplorer4x4 (Post 1190955)
0KB Used | DEBUG Mode OFF | GZIP ON (level 1) | 0.54 : 0.59 : 0.55 | NO Uncached Template

I have turned debug on in ACP options but it does not show on the forum.

How did you turned ON the debug mode?
Quote:

Originally Posted by maxicep (Post 1190963)
thanks nice hack,
i got a question how we uncached templates to cached ?

Show me what you got wrong. :)

Xplorer4x4 02-26-2007 11:40 PM

Quote:

Originally Posted by TECK (Post 1191353)
How did you turned ON the debug mode?

vbulletin options->BB MicroStats->
"Debug Mode"
"Display the Debug Mode status."
Set it to yes.

TECK 02-27-2007 12:47 AM

This is an option to display only the status of Debug Mode, not actually enable it.
I might look into it to automatically enable Debug mode, although, I think is not possible.

I will let you know in few minutes. :)

TECK 02-27-2007 01:49 AM

Guys and girls, say all Thank You to Xplorer4x4 for this excellent idea.

Version 1.0.3 brings a very powerful option. Now, vBMicroStats can actually turn On/Off the vBulletin Debug Mode.
Make sure you enable this option, ONLY with your board off, orelse it can lead to security breaches (yes, is that powerful).
If your board is turned off to public, you don't have to worry about anything, well sort of.
The best way is to make sure you don't leave this option enabled for a long time either ways.

How to upgrade to Version 1.0.3:
1. Uninstall your current vBMicroStats product. Leave the PHP files the way they are edited now, they are not needed to be re-modified in order to work with the new version.
2. Install the new product, included in the vbmicrostats_103.zip file.
3. Look in the readme file to see how to change the footer template.

You are done. Don't you like those hard upgrades? :)

TECK 02-27-2007 02:00 AM

I made the debug mode really visible, in RED.
The big advantage is that you will not be forced anymore to edit the config.php file and insert a variable there, in order to activate the Debug Mode.
My option will do this for you in a snap.

Still, remember to disable it when you don't need it anymore...
I repeat myself: Make sure you enable this option, ONLY with your board off, orelse it can lead to security breaches (yes, is that powerful).

Xplorer4x4 02-27-2007 02:02 AM

haha well it wasnt an idea so much as misunderstanding. :$

Question: Will this(debug mode) show to members and admins?

TECK 02-27-2007 02:06 AM

The Debug Mode is for advanced troubleshooting your board, you must use it only with your Board turned OFF.
If you leave it ON, a good hacker could grab all the data you don't want him to know about it... unless the board is OFF.
Even then, I don't like it to have it turned ON on a live setup. On my test board, is always ON.

You can start a new thread, asking what exacly does the Debug Mode in vBulletin. :)

TECK 02-27-2007 02:10 AM

Guys and girls, please let me know what you think about the new version. Thanks.

Lizard King 02-27-2007 03:00 AM

You saved us tons of time to enable debug each other time :) Thanks again Floren

Nominated HOTM :)

DementedMindz 02-27-2007 03:01 AM

yeah same here Nominated HOTM

ncweb 02-27-2007 03:47 AM

Quote:

Originally Posted by abramelin (Post 1191052)
i dont want regular users to see anything, what must i do?


I wanted the same for my live site, its simple to just use conditional statements...
Granted I have no idea if it’s bad to nest these <if> statements? It worked for me… :cool:

Code:

<if condition="is_member_of($bbuserinfo,5,6,7)">
<if condition="$show['microstats']">{microstats}</if>
</if>


I very much like the addition to turn debug on/off via cp, less time when testing... thanks again TECK

-I love it :up:

projectego 02-27-2007 11:21 AM

Thanks for the update!

TECK 02-27-2007 12:24 PM

Quote:

Originally Posted by ncweb (Post 1191651)
I wanted the same for my live site, its simple to just use conditional statements...
Granted I have no idea if it’s bad to nest these <if> statements? It worked for me… :cool:

Code:

<if condition="is_member_of($bbuserinfo,5,6,7)">
<if condition="$show['microstats']">{microstats}</if>
</if>


I very much like the addition to turn debug on/off via cp, less time when testing... thanks again TECK

-I love it :up:

Thanks a lot guys, I mean it. :)
ncweb, is best to filter it in the actual code, not only template. Why? Because the script will still process all the microstats code for nothing, if you are not an admin. Waisting memory and processing time for no reason.
Take a look at the admin attachment I made earlier to see the differences.

Also, you could use a simpler condition:
Code:

<if condition="$show['microstats'] AND is_member_of($bbuserinfo, 5, 6, 7)"><!-- {microstats} --></if>
Notice that the {microstats} changed, following Ollie's idea.

Go ahead and release it for everyone, have fun. :)

Adam21 02-27-2007 02:21 PM

I nominate this thread for HOTM.Saves us tons of times,thank you for your hard work.:up:

TECK 02-27-2007 06:07 PM

If you guys and girls notice something useful that should be added to the hack, let me know.
Make sure you post feedback about it, I would like to know from all of you how the hack is running on your sites, especially on large forums.

Thanks.

Hornstar 02-27-2007 09:05 PM

Quote:

Originally Posted by TECK (Post 1192062)
If you guys and girls notice something useful that should be added to the hack, let me know.
Make sure you post feedback about it, I would like to know from all of you how the hack is running on your sites, especially on large forums.

Thanks.

Is it possible to show everything only to the admins?

TECK 02-27-2007 11:00 PM

Yes. Go here:
https://vborg.vbsupport.ru/showpost....0&postcount=46

Download the XML file and edit it to fit the new version. :)
(compare the 2 installers)

If you post it, I will look to make sure everything is ok, then give you 5 stars and link it to the first post. :)
As you noticed, I try to involve people, like in the old golden vBulletin.org times.
Before, people used to post a lot more in the hack threads...

bluechris 02-28-2007 09:12 AM

Strangely when i uninstall 1.02 and i install 1.03 all my footers show

{microstats}

... If i uninstall 1.03 and reinstall 1.02 i see stats fine.

Xplorer4x4 02-28-2007 12:57 PM

Quote:

Originally Posted by bluechris (Post 1192511)
Strangely when i uninstall 1.02 and i install 1.03 all my footers show

{microstats}

... If i uninstall 1.03 and reinstall 1.02 i see stats fine.

Same for me. :(

TECK 02-28-2007 02:03 PM

Quote:

Originally Posted by bluechris (Post 1192511)
Strangely when i uninstall 1.02 and i install 1.03 all my footers show

{microstats}

... If i uninstall 1.03 and reinstall 1.02 i see stats fine.

I used Ollie's suggestion.
Check the template modification section, in the readme file.
See how to update your footer template, there. :)

Xplorer4x4 02-28-2007 03:42 PM

Thanks.

On one of my styles, I want to include the info in a table such as whoisonline table. I have a table made, it collapses fine, but i cant seem to find a template or any code to strip the template background from the code and simply display the stats. How could I do this?

Thanks tech!

TECK 02-28-2007 04:24 PM

Show me a screenshot so I understand better your example. Visual guy here. :)

Skavenger 02-28-2007 04:51 PM

Hi, first at all, thank you for the mod :)

I have a few questions about the results I see in the footer:
- I have enabled Memory Usage, the results are: 0KB Used, I read in the 'help' that I have to compile PHP with enable-memory-limit option, but... what does 0KB Used mean? and how do I compile PHP with enable-memory-limit option?

- What does Unchached Templates means?

Thank you

TECK 02-28-2007 05:29 PM

The value 0KB is displayed when PHP is not compiled with the option "--enable-memory-limit". It's just an indicator for you to know that the memory limit is disabled in PHP.
Otherwise, you will see values like 4,236.85KB, instead of 0KB.
All you have to do is contact your host and ask them to enable the option.

In vBulletin, a datastore is used to store into memory useful variables, templates, etc.
That system avoids calling the database each time you process some global info, increasing the script performance.
If you create a modification or a separate file and forget the cache your new templates (using the array variables defined into default vBulletin files), then each uncached template will execute a query instead of being stored into server memory.

Let's take an example. You install a new hack.
The hacker who created the hack forgot to cache one template. The result?
One extra query performed for nothing in each vBulletin page. The forum display would have 14 queries instead of 13 if you missed to cache 1 template, 15 queries if you missed to cache 2 templates and so on...
The microstats will show you always if there are any "forgotten" templates on your page, in order to avoid performing not needed queries. It will display the number of un-cached templates as well their names. The un-cached templates will be highlighted in light-blue, like in the first screenshot.
Cool, huh? :)

I hope this helps clearing your questions.
If I missed or forgot something, please let me know. :)

TECK 02-28-2007 05:40 PM

Ok guys and girls. I need you to "invent" a new option for MicroStats. :)
I need that because I plan to add phrases into main MicroStats template, so you can translate it easier.
I don't want to release a new version just for this, we need to excite the users with something new also, right? :)

Skavenger 02-28-2007 05:54 PM

I think you made a mistake here

Attachment 61169

vB instead of BB =P

Quote:

Originally Posted by TECK (Post 1192775)
The value 0KB is displayed when PHP is not compiled with the option "--enable-memory-limit". It's just an indicator for you to know that the memory limit is disabled in PHP.
...

Now I understand

Thank you again :)

TECK 02-28-2007 07:48 PM

No mistake, it's intended like this. You are not the first one who shows me this "typo". :)
It's a tradition that I kept from early versions, when I made this hack for vBulletin 2.x (year 2002 I think).
It also reminds me when I used to sleep only 4-5hrs/night while sharing most of my free time with the hackers to come up with all kind of useful edits in the raw vB code...
There were no plugins, way back. To tell you the truth, I like a lot better to edit directly the files. Many people learned PHP because of this. They were forced to watch the code closely...

TECK 02-28-2007 07:51 PM

Take a look how it used to be vBMicroStats for vBulletin 2.x on forum home:
(17 queries performed, as default)

ncweb 03-01-2007 01:00 AM

Quote:

Originally Posted by TECK (Post 1192785)
Ok guys and girls. I need you to "invent" a new option for MicroStats. :)
I need that because I plan to add phrases into main MicroStats template, so you can translate it easier.
I don't want to release a new version just for this, we need to excite the users with something new also, right? :)


Hey TECK, maybe if others would like to see this they will chime in :)
Not sure what good it would be in a shared environment but for dedicated it's nice to have.

I dont know much about how to do it but somthing like this maybe..
Code:

$memstats = shell_exec("grep Mem /proc/meminfo"); print '' . str_replace("\n", ' ', $memstats);

to display (i.e. MemTotal: 8299056 kB MemFree: 126812 kB ).

I for one would like to see an option to display all of the microstats to only admins via admincp.

Also, is it a good idea to compile PHP with the option "--enable-memory-limit". What would be the benefits of being able to set this in php conf or .htaccess. Thanks...

Xplorer4x4 03-01-2007 03:29 AM

I have debug mode on(just for a minute). But when i click explain so i can get more ifno on queries, it just loads showthread.php all over again rather then the query explanation page. :(

KevNJ 03-01-2007 05:36 AM

Quote:

Originally Posted by TECK (Post 1192785)
Ok guys and girls. I need you to "invent" a new option for MicroStats. :)
I need that because I plan to add phrases into main MicroStats template, so you can translate it easier.
I don't want to release a new version just for this, we need to excite the users with something new also, right? :)

Invent it to work with all 3.6.x versions? I tried to install it on 3.6.1 and it wouldnt let me. :(

TECK 03-01-2007 05:54 AM

That is pretty easy Kev. :)
Open the XML file and find:
Code:

<dependency dependencytype="vbulletin" minversion="3.6.4" maxversion="3.6.5" />
Change it to:
Code:

<dependency dependencytype="vbulletin" minversion="3.6.0" maxversion="3.6.5" />
If it breaks your site, please don't hit me. :)
Try it on a test board and let me know. Thanks.

Quote:

Originally Posted by Xplorer4x4 (Post 1193089)
I have debug mode on(just for a minute). But when i click explain so i can get more ifno on queries, it just loads showthread.php all over again rather then the query explanation page. :(

You are right, grrr. It looks like the only way to enable truly Debug mode is trough config.php file. Early, when the script loads the config variables, it won't detect fancy vBulletin options, just the basic ones contained into config.php file.

So what do you recommend me to do guys? We toss that option or simply simply display a text warning that the Debug mode is enabled/disabled?
I need your advice on this issue, since is your hack also. :)

Lizard King 03-01-2007 06:14 AM

Quote:

So what do you recommend me to do guys? We toss that option or simply simply display a text warning that the Debug mode is enabled/disabled?
If there is no work around then the best option is to disable the debug mode. But even if we may have an option with another file edit that may help us to get this working then that may be an option.

TECK 03-01-2007 07:13 AM

Is not possible, unfortunatelly. As I said before, at that early stage, you cannot combine something like:
Code:

$this->debug = $this->registry->options['vb36_mstats_debug'];
It won't recognize the vb options...


All times are GMT. The time now is 12:53 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.01553 seconds
  • Memory Usage 1,846KB
  • 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
  • (7)bbcode_code_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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