1731
brash
Date & Time displayed in realtime?
  • 2003/10/10 12:22

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Hi All,

I was wondering if there is a easy way to print the servers current date & time in real time for inclusion in a titlebar?



1732
brash
Re: Block for displaying last online members?
  • 2003/10/10 4:27

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Anyone?...



1733
brash
Block for displaying last online members?
  • 2003/10/9 0:35

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Hi All,

I've seen a few XOOPS sites around the traps which have a block showing a list of the most recently online members, and the time that has elapsed since they were last online. You can see an example of this at www.4thefort.com in the block titled " Hey! Didn't I See You..." in the left hand column of the main page.

I imagine this is done via a custom block? I'm just wondering if anyone knows how to do this, and what code is needed. Thanks .



1734
brash
Re: What Infrastructure Do You Use To Serve Your Xoops Site?
  • 2003/10/8 7:55

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Yeah I tried that, but it still seems to run the same anount of queries

Thanks for the suggestion though. Perhaps I could try using a MySQL DB optimiser to get a bit of speed?




1735
brash
Re: This page loaded in x seconds
  • 2003/10/8 6:46

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Might also be worth mentioning that you I think you need to have all caching in system admin -> preferences -> general settings turned off for this feature to work.



1736
brash
What Infrastructure Do You Use To Serve Your Xoops Site?
  • 2003/10/8 6:44

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Hi All,

I have just implemented some code as per this thread to show the page loading time at the bottom of each page, and am finding (as I suspected) that my loading times are a bit slow at around 1.3 seconds to load my main page. This is about 1 second slower than what I'd consider a decent average time.

I think this is attributable to two main reasons;
(a) My hardware is getting a bit old
(b) My site runs too many queries on site entry

I ran the MySQL/Blocks dubugging mode, and I found that upon entry to my site the server runs 77 queries, 23 blocks in about 1.3 seconds. Short of removing content, or upgrading my hardware I have no idea if there are any other methods to reduce this time.

Anyway, I was just curious as to what infrastructure other Xoopers used to serve their XOOPS sites, and if possible a few other details such as I've provided below. Mine is as follows;


Hardware & Internet Connection Environment

PIII 550Mhz
1024MB PC-133 SDRAM
10GB ATA-66 5400RPM HDD

512k/512k SDSL Connection


Software & XOOPS Environment

Windows 2000 Adv Server
IIS 5
Xoops 2.0.4
MySQL 4.0.13
PHP 4.3.2

Total queries run upon site entry = 77
Total blocks on site entry = 23
Approximate average time taken = 1.3 seconds



1737
brash
Re: This page loaded in x seconds
  • 2003/10/8 1:00

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Thanks so much Olorin ! I was wondering where the time logging was kicked off.

I've also managed to get the page load time displayed in the footer just as I wanted. I searched phpkaox theme.html for this bit of code;

Quote:
<{$xoops_footer}>


Then just added your code directly after this, with a <p> tag on the end to space it out a bit. So after I added the code it looked like this;

Quote:
<{$xoops_footer}><{php}>global $ftime;
echo"This page is loaded in $ftime seconds.";
<{/php}><p>


You can see what it looks like at www.it-hq.org

Once again, thank you so much Olorin!



1738
brash
Re: Top Posters Block GONE!
  • 2003/10/7 1:25

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Have you tried turning on the MySQL debug?



1739
brash
Re: This page loaded in x seconds
  • 2003/10/7 1:20

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Thanks heaps for you help Olorin

I tried entering the code you posted into the theme.html file of the theme I am using (phpkaox), but nothing is printed to the screen (I placed it at the very bottom just before the </body> tag) . I also tried putting the code into the footer (as this is where I was wanting it anyway), and all it seems to do was print the entire code to screen. I tried making an adaption to suit my needs;

Quote:
This page loaded in <? php global $ftime; echo $ftime; ?> seconds


This prints correctly at in the footer, except the actual load time is absent as when I replace $ftime with text such as hello, the text is displayed, so I assume I'm missing something to get the $ftime value to print.

I also made the other code changes you specified. One thing I was wondering is what kicks off the time log? Would I have to include something like

Quote:
$xoopsLogger->startTime();


in the header.php to start the time logging process?

Thanks again



1740
brash
Re: This page loaded in x seconds
  • 2003/10/6 6:05

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


OK, I've done a bit of reading and searching, and I keep coming back to the /class/logger.php file for XOOPS 2.X based systems. I found an XOOPS doc at SourceForge which I think is relevant, and it refers to the dumpTime function. I also fount this in the /class/logger.php file which looks to me to be relevant, but then again I can barely spell PHP let alone code it.

Quote:

/**
* get the current execution time of a timer
*
* @param string $name name of the counter
* @return float current execution time of the counter
*/
function dumpTime($name = 'XOOPS')
{
if (!isset($this->logstart[$name])) {
return 0;
}
if (!isset($this->logend[$name])) {
$stop_time = explode(' ', microtime());
} else {
$stop_time = $this->logend[$name];
}
return ((float)$stop_time[1] + (float)$stop_time[0]) - ((float)$this->logstart[$name][1] + (float)$this->logstart[$name][0]);
}



Can anyone tell me if I'm going down the right track with this, or even better how to implement this into my footer?




TopTop
« 1 ... 171 172 173 (174) 175 176 177 »



Login

Who's Online

213 user(s) are online (136 user(s) are browsing Support Forums)


Members: 0


Guests: 213


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits