The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

I would like to add auto-refresh

View previous topic View next topic Go down

I would like to add auto-refresh

Post by ChachachaChia on October 28th 2011, 4:47 am

Is there a code i can use to add auto refresh so that the posts automatically refresh while on the page or just lurking the forums? i used to use a VBulletin forum that had it and many of my members are from that site, they miss that feature.

this is a way to prevent backing out of the page or having to manually refresh the page.

ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

Re: I would like to add auto-refresh

Post by LGforum on October 28th 2011, 5:18 am

Puttin this code into a widget or annoucnement or something will sort that out for you.

This is to refresh every 30 seconds. Change the number accordingly for how often you want.

Code:

function autorefresh() {
window.location.reload();
setTimeout("autorefresh();",30000);
}
jQuery(function() {
 setTimeout("autorefresh();",60000);
});

Personally im not a fan of auto refreshing a whole page.


Last edited by LGforum on October 28th 2011, 5:03 pm; edited 1 time in total

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: I would like to add auto-refresh

Post by ChachachaChia on October 28th 2011, 5:31 am

Where exactly would you suggest placing that?

I am only doing it for my members as it is something they have requested.

Edit: I entered the code as an announcement and it didnt do anything. I then entered it in the javascript management and it caused the page to flash uncontrollably. think i did something wrong.

ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

Re: I would like to add auto-refresh

Post by LGforum on October 28th 2011, 5:02 pm

Sorry yeah i realise my mistake.

Actually i've made quite a feqw and didnt think here.

First of all, this code exectutes on page load, so it would reload your page straight away, which is easily fixable. (edited the code above)

But here is your issue, with auto-refresh.
Say you set it for 30 seconds... and your member is typing something in a message or something, and they take over 30 seconds... the page will refresh and they will lose there work.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: I would like to add auto-refresh

Post by Mike on October 28th 2011, 10:18 pm

Code:
<meta http-equiv="refresh" content="SECONDS">

add it wherever you can put code.

Mike
Hyperactive

Male Posts : 4242
Reputation : 466
Language : English, HTML, CSS
Location : Bozeman, Montana

Back to top Go down

Re: I would like to add auto-refresh

Post by LGforum on October 28th 2011, 10:40 pm

There's a META for auto refresh? ... learn something new everyday. HA thanks.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: I would like to add auto-refresh

Post by Mike on October 28th 2011, 10:43 pm

No problem, you can also make it refresh to a new website Very Happy

Mike
Hyperactive

Male Posts : 4242
Reputation : 466
Language : English, HTML, CSS
Location : Bozeman, Montana

Back to top Go down

Re: I would like to add auto-refresh

Post by ℋunni on October 29th 2011, 6:03 am

That code was extremely useful, Drogba. Thank you <3!

ℋunni
Forumember

Female Posts : 150
Reputation : 4
Language : English

Back to top Go down

Re: I would like to add auto-refresh

Post by ChachachaChia on October 29th 2011, 6:47 am

okay, thanks for that.
Now please excuse the newb in me but do i just place that in the java script section?

ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

Re: I would like to add auto-refresh

Post by FrozenX on October 29th 2011, 8:17 am

You put that code, at the top of the website, it's not a javascript.

(if you want the Auto-Refresh for every page, then put it in the Overall_header (PunBB/PhpBB2), but it seems that you're forum version, might be Invision, so i don't know where you could put that.)

FrozenX
Forumember

Male Posts : 69
Reputation : 8
Language : English, Dutch

http://www.lordslegends.forumotion.net

Back to top Go down

Re: I would like to add auto-refresh

Post by ChachachaChia on October 29th 2011, 8:32 am

yeah, i was using invision. swithed to pHpBB2, so how do i get to the header to add the code?

ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

Re: I would like to add auto-refresh

Post by FrozenX on October 29th 2011, 1:51 pm

Go to, ACP -> Display --> General --> Overall_header --> put that code in,at the top, save, see if it worked or not, then publish..

FrozenX
Forumember

Male Posts : 69
Reputation : 8
Language : English, Dutch

http://www.lordslegends.forumotion.net

Back to top Go down

Re: I would like to add auto-refresh

Post by LGforum on October 29th 2011, 2:40 pm

I believe there is a section in the ACP for adding Meta tags.

ACP>General>Search Engines
at the bottom you can add additional Meta's.

Thoug the information bit says that they only go onto the index and portal... bit pointless.

LGforum
Hyperactive

Male Posts : 2260
Reputation : 258
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

Re: I would like to add auto-refresh

Post by ChachachaChia on November 1st 2011, 5:34 am

okay, i placed it in the header and it seemed to work but is there a way to make it more seemless? as it is, the page flashes as it reloads. also, will this auto load any new posts, for instance in the chat thread where members sometimes just stay on one page. that way any new posts will just appear when they are posted.

on a side note, is there a way to remove the post notification when you post, so it doesnt take you to the page that asks for you to click on the forum link or the post link?

ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum