This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Various variables


avatar
Rushian 0
From: -
Various variables

I'm a bit of a stat freak, so I'm wondering how to get the number of hits the site has gotten, and page views per day.

Also, the timestamp of the most recent news item. (To be displayed in the news headline header block)

And possibly page load time, number of DB queries, etc.

When using BBwrapper, how do I pull the date of the posts? (Also to be displayed in a header block)


[Edited by Rushian on 2005-05-19 01:47:14]

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Various variables
avatar
OP 0
From: -
Various variables

Ok, that'll be great! Smiling Face
1 Re: Various variables
avatar
Administrator
1340
From: Vienna, Austria
Various variables

Yes, I think this would be the best. Version 2.0 will store all stats in the database.
1 Re: Various variables
avatar
OP 0
From: -
Various variables

Hmm, I see. I'd rather have it in the 'headlines' block, but I'll move it to another template.

What about the other stuff? (hits, page views, page load time, number of DB queries) If ST 2.0 has it, I can wait till then..
1 Re: Various variables
avatar
Administrator
1340
From: Vienna, Austria
Various variables

The best thing is to move this code to a different template, such as site_header or login_header_xxxx.
1 Re: Various variables
avatar
OP 0
From: -
Various variables

Originally posted by Philipp:
Originally posted by Rushian:
I'm displaying this variable in the header block section. It works for the last 10 headlines section, but it also prints the same var for the last 10 forum posts. Can I either block the var from printing for the forum header, OR, better yet, get the last forum post var too, and then print the correct one at the correct place? Smiling Face

In which template did you add the code?

main_block_middle
1 Re: Various variables
avatar
Administrator
1340
From: Vienna, Austria
Various variables

Originally posted by Rushian:
I'm displaying this variable in the header block section. It works for the last 10 headlines section, but it also prints the same var for the last 10 forum posts. Can I either block the var from printing for the forum header, OR, better yet, get the last forum post var too, and then print the correct one at the correct place? Smiling Face

In which template did you add the code?
1 Re: Various variables
avatar
OP 0
From: -
Various variables

Originally posted by Philipp:
The stats are stored in the file system. Adding them to the main page would cause more overhead to the server.

To get the time of the latest news item:
dbconnect():

$query = DBQuery(“SELECT story_time FROM esselbach_st_stories ORDER BY story_time DESC LIMIT 1”);
list($last_time) = mysql_fetch_row($query);


You find the time of the last item in the $last_time variable


I don't mind about the overhead, I have a very low-use site. Smiling Face

This is close to what I need, but I'm dong something a bit tricky I guess.

I'm displaying this variable in the header block section. It works for the last 10 headlines section, but it also prints the same var for the last 10 forum posts. Can I either block the var from printing for the forum header, OR, better yet, get the last forum post var too, and then print the correct one at the correct place? Smiling Face

Sorry for all the questions, but I'm new to SQL and PHP.. Winking Face
1 Re: Various variables
avatar
Administrator
1340
From: Vienna, Austria
Various variables

The stats are stored in the file system. Adding them to the main page would cause more overhead to the server.

To get the time of the latest news item:
dbconnect():

$query = DBQuery(“SELECT story_time FROM esselbach_st_stories ORDER BY story_time DESC LIMIT 1”);
list($last_time) = mysql_fetch_row($query);


You find the time of the last item in the $last_time variable

Database queries, time, and bbwrapper need some modifications in the main script. I will look into it later.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.