QUICK NEWS

{NEW} - A new css video is up.

{OLD} - New video courtesy of Skhilled, Thanks for posting it up.

Video of the moment:


Internal Links

SMF Sites

Quick Info

Install date

Started by Bigguy, Nov 15, 2020, 09:26 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Bigguy

Is there a way to post the install date of the forum on the stats page. It shouldn't be that hard to do eh. :whi
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Oldiesmann

The only way you could get an install date would be to pull the registration date for the member with id_member = 1 (or the lowest id_member in the rare case there is no member with an ID of 1). I'm not sure what would need to be done to get it on the stats page.
Christian Metal Fans - https://www.christianmetal.fans

Bigguy

It's an interesting idea to show it there. Maybe I will look into it. :dontknow
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Skhilled

A quick look tells me it would most likely go into the /Sources/Stats.php file. Now, exactly where and how to add it? I "assume" you could make a "$context['install_date']" somewhere in the stats file and would have to add the actual text in Modifications.English.php. That would be my guess but I'm no real coder.

Bigguy

Stats.php eh. Well, that's as good a place to start as any. I'll check that out today.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Bigguy

In Stats.php there is this line:

// This would be the amount of time the forum has been up... in days...

$total_days_up = ceil((time() - strtotime($row['date'])) / (60 * 60 * 24));

But I don't see that on the stats page anywhere.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Skhilled

Yeah, I saw that and wondered the same...

Bigguy

Would be nice to use this instead of doing my own somehow.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Skhilled

Try doing the code I posted but use:
$total_days_up
I'm sure it can be done somehow since it is actually collecting that info...

Bigguy

I will hopefully try this later today. I have a few things to do here soon.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Neša

If you find the SQL that created $row['date'] you could run it and just rip out date.
I'm guessing it is a timestamp you can convert it to the users local time with php before you display it.


Bigguy

I'm not that good with sql but I will check out the code a bit more closely.
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Neša

#12
They are using the earliest date from the log_activity table.

SELECT
SUM(posts) AS posts, SUM(topics) AS topics, SUM(registers) AS registers,
SUM(most_on) AS most_on, MIN(date) AS date, SUM(hits) AS hits
FROM {db_prefix}log_activity'

You could run:
SELECT MIN(date)
FROM {db_prefix}log_activity

Pure SQL will be this assuming your database name is smf_forum and prefix bup_
SELECT MIN(date)
FROM smf_forum.bup_log_activity


Bigguy

That's very cool. Your really on top of things :rgton :chrs I will play around a bit tomorrow then maybe and see what I can do.  Thanks Nesa.  :)
"It's the American dream....cause ya have to be asleep to believe it." - George Carlin

Neša

I've been writing a website in PHP that will automate one of our manual process'
It is a lot easier for me to navigate PHP files now. I'm almost done after next week I can go back to Java, Ruby, Python, and Rust  :lb