Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: mitelforums on July 29, 2021, 10:04:56 AM

Title: Auto Refresh
Post by: mitelforums on July 29, 2021, 10:04:56 AM
I would like to do a refresh of the webpages and return to the main page every 30 minutes.
I.E. <meta http-equiv="refresh" content="1800; url=http://<mywebsite>/forum">';
I want to do this from the topic pages as well as the individual board indexs.

When digging into my question, I found this related page:  https://www.simplemachines.org/community/index.php?topic=271746.0

I was able to make it work on the main page by editing Boardindex.template.php but I can't figure which files to edit for the individual boards or topics.

What other files do I need to edit?

Thanks.
Title: Re: Auto Refresh
Post by: Kindred on July 29, 2021, 01:08:36 PM
first question: Why?   What perceived problem do you think you will solve by doing this?

second question: Why?  (as a user, this would **REALLY** piss me off)
Title: Re: Auto Refresh
Post by: mitelforums on July 29, 2021, 01:28:07 PM
Because that's what I want.  ;)
Prior to having upgraded that's the way it worked since 2012.  No user ever complained.  As a matter of fact, the refresh allows the user, (esp moderators) to keep the website up and see that there are new topics or topic updates at a quick glance.
Title: Re: Auto Refresh
Post by: Steve on July 29, 2021, 02:53:49 PM
Quote from: mitelforums on July 29, 2021, 01:28:07 PMAs a matter of fact, the refresh allows the user, (esp moderators) to keep the website up and see that there are new topics or topic updates at a quick glance.

Seems like a lot of work to do what can be accomplished by the user in one click. But, as you said:

Quote from: mitelforums on July 29, 2021, 01:28:07 PMBecause that's what I want.  ;)
Title: Re: Auto Refresh
Post by: Kindred on July 29, 2021, 04:28:07 PM
are you trying to just force a refresh of the page that they are on or bounce them back to the index?

If it's just a refresh of their page -- then you would NOT do it in boardindex....   you'd do it in the base index.template.php and use the variable to populate the URL instead of a fixed URL.
Title: Re: Auto Refresh
Post by: mitelforums on July 29, 2021, 04:33:05 PM
Quoteare you trying to just force a refresh of the page that they are on or bounce them back to the index?

Yes!  That's exactly what I want to do. After 30 minutes, bounce back to the index.

I thought I did that.  It seems to work if the page is already on the main index.  I'll check again to be sure I edited the right file but this is what I put in:
Quote// Output any remaining HTML headers. (from mods, maybe?)
   echo $context['html_headers'];

   echo '
<meta http-equiv="refresh" content="1800; url=http://<website>/forum/" >
</head>
<body>';
Title: Re: Auto Refresh
Post by: Kindred on July 29, 2021, 05:22:52 PM
holy crap...    you actually want to bounce them back to the main index?? ?? ?? ??

That is, far and above, one of the most stupid ideas I have ever heard of.

I am surprised that you still have any users, if you had this implemented before.   As I initially said, this would piss me off beyond belief.

What happens if a user is in the middle of reading a post/thread... steps away and comes back to find that the screen has reset, losing their last read spot?
Even worse... what happens if a user is in the middle of WRITING a post... steps away and comes back to find that the screen has reset -- LOSING EVERYTHING THEY JUST WROTE??

Title: Re: Auto Refresh
Post by: Mike66 on July 29, 2021, 07:04:01 PM
Firstly, I must agree with Kindred, as a user in the middle of posting a reply, that would very much annoy me!

But, for what you are trying to achieve, can I suggest checking out the SMFPacks Activity Stream mod. I have used this on my forum in the past and it works very well and is almost 'real time'.

Cheers
Mike
Title: Re: Auto Refresh
Post by: efk on July 29, 2021, 08:09:25 PM
Quote from: Kindred on July 29, 2021, 05:22:52 PM
holy crap...    you actually want to bounce them back to the main index?? ?? ?? ??

That is, far and above, one of the most stupid ideas I have ever heard of.

I am surprised that you still have any users, if you had this implemented before.   As I initially said, this would piss me off beyond belief.

What happens if a user is in the middle of reading a post/thread... steps away and comes back to find that the screen has reset, losing their last read spot?
Even worse... what happens if a user is in the middle of WRITING a post... steps away and comes back to find that the screen has reset -- LOSING EVERYTHING THEY JUST WROTE??
I completely agree on this, losing long post just because of what?

Quote from: mitelforums on July 29, 2021, 04:33:05 PM
Quoteare you trying to just force a refresh of the page that they are on or bounce them back to the index?

Yes!  That's exactly what I want to do. After 30 minutes, bounce back to the index.

I thought I did that.  It seems to work if the page is already on the main index.  I'll check again to be sure I edited the right file but this is what I put in:
mitelforums do you offer to your users refund in case they break their computer? Something like this might be better solution if its about only to refresh so your moderators can see new posts (in case if they are not capable to check with 2-3 clicks every 10-20 minutes) https://custom.simplemachines.org/mods/index.php?mod=2198
Title: Re: Auto Refresh
Post by: shadav on July 29, 2021, 08:11:45 PM
i'm confused, if it's just to see what new posts there might be, you can just click on the show unread posts since last visit
Title: Re: Auto Refresh
Post by: mitelforums on July 29, 2021, 08:14:00 PM
thank you everyone for your comments. 
I didn't realize that there would be such a passion about the issue.
I'll poll my users to see if they share the same concerns.

Thanks.

Title: Re: Auto Refresh
Post by: shadav on July 29, 2021, 08:19:15 PM
sorry I can't really help, was just trying to understand

but if it's something that you want you can try posting in the Help Wanted (not for support) (https://www.simplemachines.org/community/index.php?board=50.0)
make sure to read this post before posting there: The Help Wanted Board - Please Read this Topic Before Posting Here (https://www.simplemachines.org/community/index.php?topic=5417.0)

[edit] if that's how you had it set up before, if you have a backup from then you can use a program like winmerge and compare the old files with your new files and see if you can find the difference for the refresh
Title: Re: Auto Refresh
Post by: Mick. on July 29, 2021, 08:52:19 PM
You could try this one. Its outdated and I have not updated this since 2010 since really no one uses it lol but if you use our parser, you can quickly see the few edits.

It does not refresh within profile, post and admin.  Oh and I think it has admin settings.

https://custom.simplemachines.org/mods/index.php?mod=1492
Title: Re: Auto Refresh
Post by: efk on July 29, 2021, 08:56:44 PM
This can be useful for you:
https://custom.simplemachines.org/mods/index.php?mod=4088
https://custom.simplemachines.org/mods/index.php?mod=1128
Title: Re: Auto Refresh
Post by: Steve on July 29, 2021, 08:57:18 PM
I'll give you props, mitelforums, for taking the criticisms above onboard and not being offended by them. They weren't meant as offense so good on you.

Even the 'stupidest idea' remark by my boss who can be a little, okay, a lot, blunt at times. He absolutely has a valid point and I'll be shocked if your forum members feel otherwise. :)