|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Possibly it's a bug in his cache, tho maybe the changes he made to the $date can be added to the base code so it's even snappier?
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
How many forums do you have? I have 18 in 5 sections. I get 40 queries just for the page (Threads only).
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
Well, here's what I do (explained somewhere else).
I set all my cache timeouts to 20 minutes. Then in sidebar.php I manually check for 10 minutes to have passed. If it has, then it sets $LastCacheTime to 0 (which forces a rebuild of the cache). At the end of the script (before the UPDATE), if the LastCacheTime is NOT 0 - then I set the Ca_TimeStamp to LastCacheTime. These few lines have the effect of forcing Ca_TimeStamp to only update when the 10 minute timeout has been passed. As, for the PALS, they wont update unless the 10 minute timeout was tripped (by being set to 0) or if the 20 minutes has passed.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
36 forums when I'm logged in and part of the "group" that sees everything.
I run the who's online on every page, which I know wastes some queries. I run my banner ad mod at the top and bottom, which blows queries. The birthday mod adds several queries as well. I'm not caching any of it, so my profile etc... updates with every page load. And I'm running the photopost pal box with a random photo in the sidebar.
Generated in 3.868 seconds in which 3.488 seconds were spent on a total of 85 queries. Zlib compression enabled.
A postlist page is much better: Generated in 1.151 seconds in which 0.818 seconds were spent on a total of 28 queries. Zlib compression enabled.
Although it's a little light right now. Only 42 people online. I've had as many as 100.
Here at thradsdev, we've got 24 forums on the main index: Generated in 0.168 seconds in which 0.11 seconds were spent on a total of 26 queries. Zlib compression enabled.
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
Well, it became pretty obvious when I opened newuserpal.php - there is no caching for New Users! This box gets done every call; thats whats causing the longer lags....
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Ah.... I'm not using that pal.
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
I forgot to mention, I have about 40,000 users which probably slows this query down:
SELECT U_Username,U_Registered,U_Picture,U_PicWidth,U_PicHeight,U_Number FROM {$config['tbprefix']}Users WHERE U_Approved = 'yes' ORDER BY U_Number DESC LIMIT 0,1
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Oy... yeah, that would defaintely slow it down. 
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Is this different from the IIP version (that shows up on index pages)?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
No... I think it's all the same stuff.
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
Its the same, just uses the sidebarpal.php to make them show up in a sidebar.
My w3t_Users table needed optomizing as well. But I think I'll leave the new user off anyways.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
hmmm.. this would explain IIP's speed drain on bigger sites then... possible to get it written to cache?
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
Well, IIP by itself has a problem with its cache - unless nobody hits on the page for the period of timeout, the cache never updates (this is because the Ca_TimeStamp is updated on each page load with the current time). If your timeout are 15 minutes - then as long as nobody goes to the page for 15 minutes, it will refresh.
The page load which reloads the cache can be pretty cumbersome; but some of the PALs appear to not cache information (like the New User PAL).
With my setup that one query was taking a long time - maybe optomization would help a little - and resulted in 30+ second load times with more than 100 users on the site.
My "workaround" for the cache seems to work okay for me - might have to increase the times from 10 to 20 minutes to help a little. Otherwise, on busy sites, you have to set your cache to 0 (which forces a new load everytime) to get updated material.
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
Keep in mind that sidebars also duplicate some of the calls made in ubbthreads.php - such as "newest user" and "who's online". By having the sidebar on your main index page, you are basically doing each of these queries twice - so I commented out the queries from the ubbthreads.php and then took out the Extra Information lines.
Probably the proper thing to do is check to see if a user has the sidebars turned off; but thats something for another day.
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
Another thing I noticed about SideBar - it reinits the Globals (already done in ubbthreads.php) and also reautheticates the user - would it be better to make the query directly to avoid the overhead of doing an authentication?
(I noticed that first visit I get a cookie error - on the session cookie - because SideBars cannot create cookies at that time.)
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
The globals issue was mentioned above in this post.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Would removing that section of code fix the problem? It sounds extraneous anyway, eh?
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
[]Warning: Cannot add header information - headers already sent by (output started at /home/sites/viperalley/web/templates/default/ubbt_header.tmpl:17) in /home/sites/viperalley/web/ubbt.inc.php on line 1871[/] Anyone else getting this message using the SideBars? Happens like on the first visit, but goes away when I hit refresh.
|
|
|
|
Joined: Oct 2002
Posts: 64
Power User
|
Power User
Joined: Oct 2002
Posts: 64 |
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
I think its because we are calling authenticate a second time; I've been trying to do just a query; but havent been able to get it to work yet.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Hmmmm.... Haven't seen that. In theory though we might not need to call authenticate again. The user should already be authenticated if the bar is on the right. I need to play with adding a call that if the bar is configured on the right, then it skips the authenticate call. 
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
Thanks, this seems to work properly for both the IIP (index.php) and the IIP sidebar (pals/sidebarpal.php).  For the benefit of others reading this: The only restriction is that the forced update interval (600 seconds, in extremebikini's post) should not exceed the cache update interval for any individual pal. Otherwise, that pal would update on each page refresh that occurred between its cache update interval and the forced update interval.
|
|
|
|
Joined: Apr 2002
Posts: 30
User
|
User
Joined: Apr 2002
Posts: 30 |
Trying to install this on 6.2.3... Ran into a problem with the instructions for editdisplay.php. This does not exist: <br />### Change this:<br /><br /> if (!$Display){<br /> $html -> not_right("{$ubbt_lang['NO_PROF']} '$Username'",$Cat);<br /> }<br />
Paul Fries Systems Administrator CWIE LLC
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Well it's a mod written for 6.3 so install it under 6.2 at your own risk.  It'll work in 6.2, but the instructions are for 6.3. I just didn't want to retro-write the instructions. You can try inserting the code from that part of the instructions below the little section that begins: // Find out if they already have a display preference I think that'll work.
|
|
|
|
Joined: Apr 2002
Posts: 30
User
|
User
Joined: Apr 2002
Posts: 30 |
Paul Fries Systems Administrator CWIE LLC
|
|
|
|
Joined: Apr 2002
Posts: 30
User
|
User
Joined: Apr 2002
Posts: 30 |
Just FYI, that worked great.
Also there is no w3t_Users.U_Banned in 6.2.3, so I just left that out of the SELECT statement in ubbt.inc.php.
Paul Fries Systems Administrator CWIE LLC
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Glad it worked for you. Right.. U_Banned is new in 6.3. Thanks for the tip. 
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
It is? Great, I needed that for a small change I wanted to make. Maybe I should try to get 6.3 installed, but since I haven't installed 6.2.x yet it might take a while. =]
|
|
|
|
Joined: Apr 2002
Posts: 474
Enthusiast
|
Enthusiast
Joined: Apr 2002
Posts: 474 |
Got it up and running, curious, I can't see it when not logged in. Did I do something wrong? I like how this site allows for log in via the sidebar but ON my site it doesn't show up.
Sugguestions?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
The setting in the theme file should apply to users who aren't logged in.
|
|
|
|
Joined: May 2003
Posts: 21
Junior Member
|
Junior Member
Joined: May 2003
Posts: 21 |
I made the changes to the files and get the following:
../threads/index.php: Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/domain/public_html/threads/ubbt.inc.php on line 1967
../threads/ubbthreads.php: Fatal error: Call to undefined function: getmicrotime() in /home/domain/public_html/threads/main.inc.php on line 16 Parse error: parse error, unexpected T_STRING in /home/domain/public_html/threads/ubbt.inc.php on line 1760
Fatal error: Call to undefined function: getmicrotime() in /home/domain/public_html/threads/main.inc.php on line 16
Not sure if I missed a step?
Thanks
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
I'd double check the steps again - that usually means you're either short a } or { or have an extra one somewhere in ubbt.inc.php file.
Might want to check the copy / paste steps in ubbt.inc.php.
|
|
|
|
Joined: May 2003
Posts: 21
Junior Member
|
Junior Member
Joined: May 2003
Posts: 21 |
Found the problem in the ubbt.inc.php file.
Have a question about the instructions for changing the editdisplay.php file. The actual select statement in the original file has the following statement with the U_Username, U-Bio at the beginning:
SELECT U_Username,U_Bio,U_Sort,U_Display,U_View,U_PostsPer,U_TextCols,U_TextRows,U_StyleSheet,U_Preview,U_PictureView,U_PicturePosts,U_Language,U_FlatPosts,U_TimeOffset,U_FrontPage,U_ActiveThread,U_StartPage,U_ShowSigs
The the change to be made listed in the instructions does not have those 2 variables:
### Change this: SELECT U_Sort,U_Display,U_View,U_PostsPer,U_TextCols,U_TextRows,U_StyleSheet,U_Preview,U_PictureView,U_PicturePosts,U_Language,U_FlatPosts,U_TimeOffset,U_FrontPage,U_ActiveThread,U_StartPage,U_ShowSigs ### to this:
SELECT U_Sort,U_Display,U_View,U_PostsPer,U_TextCols,U_TextRows,U_StyleSheet,U_Preview,U_PictureView,U_PicturePosts,U_Language,U_FlatPosts,U_TimeOffset,U_FrontPage,U_ActiveThread,U_StartPage,U_ShowSigs,U_SideBar
Also the list statment does not have the $CheckUser and $Bio variables:
### Change this:
list($Sort,$Display,$View,$PostsPer,$TextCols,$TextRows,$StyleSheet,$Preview,$PictureView,$PicturePost,$chosenlanguage,$FlatPosts,$TimeOffset,$FrontPage,$activethreads,$startpage,$sigview) = $dbh -> fetch_array($sth);
### to this:
list($Sort,$Display,$View,$PostsPer,$TextCols,$TextRows,$StyleSheet,$Preview,$PictureView,$PicturePost,$chosenlanguage,$FlatPosts,$TimeOffset,$FrontPage,$activethreads,$startpage,$sigview,$showsidebar) = $dbh -> fetch_array($sth);
Should the first 2 variables be used after the change?
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
The objective is to add U_SideBar to the SELECT, and $showsidebar to the list(). The actual position doesn't matter, as long as it's the same corresponding position in the two places.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
Yeah - 6.2 had the "U_Bio" field at the front - which wasn't being used. The instructions here are for 6.3. But Dave's got thr right idea. Add the sidebar stuff to the end.
Even pasting the current code shouldn't break it - as U_Bio isn't used in editdisplay. It was removed to "clean up" stuff in 6.3.
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
Just installed this on our test site - and all looks great except in 'my home' the 'post remnders', 'favourite threads', and 'main configuration' boxes are being displayed beneath the sidebar, when it is set to the left. If the sidebar is set to the right, the page displays fine. I can't find any errors.  I am running 6.3b4, using the stock IP supplied themes.
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
Strange the featured member pal, does not display either - shows up fine in the index page, but not on the side - it is also selected as item 3 in the config. Strange.
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
Okay in sidebar_leftopen.tmpl - it causes ubbthreads.php to be centred from top to bottom in Opera. Displays fine in IE. Changing <td align="center" valign="top"> to <td valign="top"> eliminates this problem. Still trying to track down the other issues, which is affecting 6.3b4 Beginning to wonder if it is my header/footer causing the problems.... ..... goes off to investigate them 
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
.... comes running back  Wasn't my header or footer  Excuse me whilst I talk to myself here 
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Apr 2002
Posts: 1,768
Addict
|
Addict
Joined: Apr 2002
Posts: 1,768 |
Hmmmm, I'm using the sidebar with 6.3b4, and I don't have that centering problem. But I've only checked it in IE and Mozilla.
Featured (spotlight?) member pal: Is that the same problem mentioned in a couple of other threads, where that box sometimes doesn't display because of a bug in that pal?
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|