The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

I would like to add auto-refresh

5 posters

Go down

I would like to add auto-refresh Empty I would like to add auto-refresh

Post by ChachachaChia 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.
avatar
ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by LGforum 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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by ChachachaChia 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.
avatar
ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by LGforum 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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

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

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

add it wherever you can put code.
Mike
Mike
Hyperactive

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

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

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

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

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

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

Male Posts : 4255
Reputation : 471
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

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

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

Female Posts : 150
Reputation : 4
Language : English

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by ChachachaChia 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?
avatar
ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by FrozenX 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
FrozenX
Forumember

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

http://www.lordslegends.forumotion.net

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by ChachachaChia 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?
avatar
ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by FrozenX 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
FrozenX
Forumember

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

http://www.lordslegends.forumotion.net

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by LGforum 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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

I would like to add auto-refresh Empty Re: I would like to add auto-refresh

Post by ChachachaChia 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?
avatar
ChachachaChia
New Member

Posts : 14
Reputation : 1
Language : english

Back to top Go down

Back to top

- Similar topics

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