vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Homepage Statistics Cache (https://vborg.vbsupport.ru/showthread.php?t=51163)

Boofo 04-25-2003 09:01 AM

Quote:

Yesterday at 05:23 PM Tigga said this in Post #39
Boofo - Actually the only thing that would affect is where it shows an admin the last time the cache was updated. The $datecut variable is what would need to be modified. ;)
It was just a guess, and not a very good one it seems. ;) I'll wait for your update then instead of messing it up. ;)

Sanjiyan 04-25-2003 10:05 AM

Can you get this to cache the front page stats on vbhome lite?

Heres the link to the stats listed:

www.theborg.cjb.net

the stats are along the left hand side.

thanks

Boofo 05-13-2003 03:17 AM

Quote:

04-24-03 at 06:23 PM Tigga said this in Post #39
Bofo - Actually the only thing that would affect is where it shows an admin the last time the cache was updated. The $datecut variable is what would need to be modified. ;)
Tigga, did you get a chance to look at this yet?

corsacrazy 05-18-2003 10:09 AM

mate how can i exempt a certain user id out of the Top Thread Starter ?

Tigga 05-18-2003 10:38 PM

Boofo - Actually I did. I just updated the text file with the new code. For anyone who's already installed this, you can just look for this code:
PHP Code:

$datecut mktime(0,0,0,date("m"), date("d"), date("y")); 

And replace it with this:
PHP Code:

$datecut mktime(0,0,0,date('m',"$ourtimenow"), date('d',"$ourtimenow"), date('y',"$ourtimenow")); 

There's no good way to have it go by the user's time offset, but this does at least go by your forum's default time.



corsacrazy - You would just need to look for this code:
PHP Code:

$topposter=$DB_site->query_first("SELECT username,posts,userid FROM user ORDER BY posts desc LIMIT 1"); 

And replace it with this:
PHP Code:

$topposter=$DB_site->query_first("SELECT username,posts,userid FROM user WHERE userid!='XX' ORDER BY posts desc LIMIT 1"); 

(Replace XX in that query with the user's id)

Boofo 05-18-2003 10:57 PM

Could you use that here, too?

PHP Code:

// members registered today
$datecut mktime(0,0,0,date("m,$ourtimenow"), date("d,$ourtimenow"), date("y,$ourtimenow"));
$getmemstoday=$DB_site->query_first("SELECT count(*) AS count FROM user WHERE usergroupid=2 AND joindate>='$datecut'"); 


Boofo 05-18-2003 11:11 PM

Shouldn't this:

PHP Code:

$datecut mktime(0,0,0,date("m,$ourtimenow"), date("d,$ourtimenow"), date("y,$ourtimenow")); 

be like this?

PHP Code:

$datecut mktime(0,0,0,date("m",$ourtimenow), date("d",$ourtimenow), date("y",$ourtimenow)); 


Tigga 05-18-2003 11:27 PM

Actually you can just remove that 2nd instance of $datecut. They will both have the same result, so there's no point in having it there twice. I thought I had already taken that out, but I guess I forgot about it.
Thanks for pointing out the errors in the code. I guess I was more tired than I thought when I did that. I updated the file and the post above with the correct code though. :)

corsacrazy 05-19-2003 06:09 AM

i set the user id to 0 as i hav the welcome hack installed and every time sum one registers a post is created to include the details of that person and the thread started is user id 0, so therefore the top thread starter is user id 0 but i get this error in index when adding 0 to where u said

PHP Code:

Invalid SQLSELECT COUNT(*) AS count,postuserid,postusername FROM thread WHERE userid!='0' GROUP BY postuserid ORDER BY count DESC LIMIT 1
mysql error
Unknown column 'userid' in 'where clause'

mysql error number1054 


Tigga 05-19-2003 01:42 PM

Blah, sorry about that. Try replacing userid with postuserid. :)

corsacrazy 05-19-2003 02:09 PM

^ much better cheers ;)

Crazy Pete 05-19-2003 08:03 PM

I can't figure out how to get Link14716's Newest Member's First Post! (v1.1) to work with this hack. It shows the member's first post for the first 10 minutes until the cache updates again, then it disappears and seems to pop back in at random. Any ideas? The query for the post is...
Code:

// get newest user's first post
if ($getnewestusers['lastpost']!=0){
$getnewusersposts=$DB_site->query_first("SELECT * FROM post WHERE userid=$newuserid LIMIT 1");
 $userfirstpost=$getnewusersposts['postid'];
 
 if (!$getnewusersposts) {
 $firstpost="";
 } else {
 $firstpost=" | <a href='showthread.php?postid=$userfirstpost#post$userfirstpost'>First Post!</a>";
 }
}


Crazy Pete 05-31-2003 06:09 PM

No one?

Tigga 05-31-2003 07:23 PM

Sorry Crazy Pete, for some reason I don't think I got email notification the first time you replied to this. To get that to work with the cache you will have to add some extra fields to the statscache table that can be updated. Or to just get it to work properly without being cached you would need to make sure your code isn't in the part where it gets the information for the cache. If you look for this code:
$statsupdate = '';
And put your code for the newest member's first right above that it should work fine.

Crazy Pete 05-31-2003 07:29 PM

Thanks Tigga, I'll try that and see if it solves the problem. :)

Lethal 08-03-2003 10:18 PM

sometimes my (total) # of users don't show up. The active users show up all the time but my total users don't. Just everyone once and awhile they do which is weird becuase if they show up once, shouldn't they show up all the time?

Till 08-03-2003 10:50 PM

<a href="http://0x00.org/php/phpCache/" target="_blank">http://0x00.org/php/phpCache/</a>

I use this one to cache various things on our forums. For example, all the forum jump dropdowns (yeah, how often do you modify your forums, yet this is pulled from the database on nearly every page).

blakkboy 10-08-2003 10:36 AM

i followed the directions and this is what i got

futureal 10-09-2003 03:43 AM

Out of curiosity, instead of updating every 10 (or however many) minutes, why not just create a cache table in your database and then update it whenever actions take place? That way, you still get "real time" stats but you still only need a single query on forumhome.

For example, you could:

- update cache whenever a post is made (posts today, total posts)
- update cache whenever a thread is started (total threads, total posts, posts today)
- update cache whenever someone registers (total members, newest member)

...and so on and so forth.

Is it just too much of a pain to implement it that way, or is there something else I am missing?

I like the idea of caching stats, but I am also bent on getting real-time stats. :)

Tigga 10-13-2003 02:59 AM

Well part of the point of this hack is to help decrease strain on the server. If you're updating that table every time a post/thread is made, a new user joins, and etc then that's quite a few more queries to the database. If you're that bent on getting real-time stats that method would work and your forum homepage would load quicker with all the stats, but it would be hard to tell if it would be any better or worse on your server...

futureal 10-13-2003 04:25 AM

It would certainly be easier on your server. Adding a single query when a new post is made does not add much strain on the server at all. Even on larger sites, the ratio of forumhome views to new posts has to be 40:1 or 50:1, if not greater. And obviously even moreso for new users and that sort of thing.

Anyway, just thoughts. :)

blakkboy 10-13-2003 09:27 PM

i could i add this in my welcome panel???

julius 10-24-2003 07:50 AM

Thanks!
Click install.

poetic 10-26-2003 09:58 PM

does this work with filberts hack that optimizes the forumhome??

blakkboy 03-03-2004 01:35 AM

Quote:

Originally Posted by blakkboy
i could i add this in my welcome panel???


let me rephrase my question

how can i add this in my welcome panel hack???


All times are GMT. The time now is 02:50 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.03001 seconds
  • Memory Usage 1,791KB
  • 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
  • (1)bbcode_code_printable
  • (8)bbcode_php_printable
  • (3)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
  • (25)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