Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Tien on November 01, 2008, 03:10:05 PM

Title: Auto Refresh index.php
Post by: Tien on November 01, 2008, 03:10:05 PM
hi guys,

i understand that the auto refresh will increase the server load however i really need one for my forum.

I am using SMF 1.1.6 and I added <meta http-equiv="refresh" content="60"; url=" /> onto my indextemplate.php. It works but it refreshes not only the index page (index.php) but also refreshes all the board index. When it auto refresh, it will just redirect the current frame back to the main index page again.

The worst thing; before a user can finish typing his new post, it auto refreshed and redirected to the main index page.

Majority of my forum members requested to have an auto refresh for my forum, and I really need one.

I want only my forum main index page to auto refresh every 2 - 3minutes, but I don't want the board index to auto refresh. And I don't want the page to auto refresh when my user is typing a post.

Is there a way that I can dissolve this problem so that my forum will meets major users' requirement?

Thank you,
Tien
Title: Re: Auto Refresh index.php
Post by: Kermit on November 01, 2008, 03:17:54 PM
If you want,we can let just the Mainpage,also where categories are located,it wouldn't have effect on posting new messages


$themedir/BoardIndex.template.php


Code (find) Select

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;


Code (replace with) Select

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
echo'
<meta http-equiv="refresh" content="xx; url=',$scripturl,'">';



xx should be replaced with the time,that you wish...
Title: Re: Auto Refresh index.php
Post by: Tien on November 01, 2008, 03:52:16 PM
Quote from: Duncan85 on November 01, 2008, 03:17:54 PM
If you want,we can let just the Mainpage,also where categories are located,it wouldn't have effect on posting new messages


$themedir/BoardIndex.template.php


Code (find) Select

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;


Code (replace with) Select

function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
echo'
<meta http-equiv="refresh" content="xx; url=',$scripturl,'">';
:D
[
xx should be replaced with the time,that you wish...[/b]

Hey buddy,

IT REALLY WORKS!!!!!!!!! You Are GREAT!!!!

THANK YOU!!!
Title: Re: Auto Refresh index.php
Post by: iant on November 06, 2008, 05:32:02 PM
Hey Duncan,  I needed this also and it works brilliantly.  Simple but effective.

Thanks for the tip.
Title: Re: Auto Refresh index.php
Post by: Alb4nian on December 11, 2008, 02:40:50 AM
Thank you,

It works perfect!  ;)
Title: Re: Auto Refresh index.php
Post by: Rehash D Internet on January 29, 2009, 06:33:03 PM
Hi. Is there a way to isolate just the index page and unread topics page for auto-refresh?
Thanks.
Title: Re: Auto Refresh index.php
Post by: Rehash D Internet on January 31, 2009, 04:05:05 AM
Quote from: Rehash D Internet on January 29, 2009, 06:33:03 PM
Hi. Is there a way to isolate just the index page and unread topics page for auto-refresh?
Thanks.

I've found where to put the code in Recent.php but when it refreshes it takes me back to the  index. How can I alter this?
Title: Re: Auto Refresh index.php
Post by: Kermit on January 31, 2009, 04:11:04 AM
Quote from: Rehash D Internet on January 29, 2009, 06:33:03 PM
Hi. Is there a way to isolate just the index page and unread topics page for auto-refresh?
Thanks.

For unread topics page you should do that

in Themes/default/Recent.template.php

Code (find) Select

function template_unread()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;



Code (replace with) Select
function template_unread()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
echo'
<meta http-equiv="refresh" content="xx; url=',$scripturl,'?action=unread">';



again xx should be replaced with your desired auto-refresh time
Title: Re: Auto Refresh index.php
Post by: Rehash D Internet on January 31, 2009, 04:24:52 AM
Cheers pal, I got it through trial and error.
Title: Re: Auto Refresh index.php
Post by: Gà Mái on May 19, 2012, 12:34:30 PM
Many thanks! Mark to find later ^^
Title: Re: Auto Refresh index.php
Post by: MrPhil on May 19, 2012, 08:42:14 PM
Don't go marking topics with useless (to everyone else) posts. You just clutter up the boards that way. Bookmark the page/add to Favorites if it's something you want to keep close at hand.