News:

Wondering if this will always be free?  See why free is better.

Main Menu

Auto Refresh index.php

Started by Tien, November 01, 2008, 03:10:05 PM

Previous topic - Next topic

Tien

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

Kermit

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...
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Tien

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!!!

iant

Hey Duncan,  I needed this also and it works brilliantly.  Simple but effective.

Thanks for the tip.

Alb4nian


Rehash D Internet

Hi. Is there a way to isolate just the index page and unread topics page for auto-refresh?
Thanks.

Rehash D Internet

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?

Kermit

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
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Rehash D Internet

Cheers pal, I got it through trial and error.

Gà Mái

Many thanks! Mark to find later ^^
-- I love SMF --

MrPhil

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.

Advertisement: