Auto refresh page after 30 seconds

michael chambers Posted in Component Development 4 years ago

Hi there how can i auto refresh the page say every 30 seconds. If a new user signs up and posts if you pull down to refresh you can see their posts even if your not there friend but you have to pull down to refresh. How can you auto refersh ?

Replies
Shona Sibel Ahmed Replied 4 years ago

Hello dear,
I'm Mrs. Sibel from Turkey, this is Important please email me back ( [email protected] )
thanks,I will be waiting to hear from you soon

gb Michael chambers Replied 4 years ago

Joey thank you

us Joey Champion Replied 4 years ago

I want to share the solution on the automatic page refreshing.
On your web server, you will find the newsfeed file, (newsfeed.php), in /var/www/html/ossn/themes/goblue/plugins/default/theme/page/layout

Edit the file with your favorite editor, ( I use nano).
Insert the following code...
<meta http-equiv="refresh" content="300">
right above the line that reads...
div class="container-fluid".

(((Warning))) Refreshing the page every 30 seconds creates a horrible user experience. The site flashes as it reloads too frequently. Stick with something like every 5 minutes or 10. Tested this and it works perfectly at 300 (every 5 minutes).
I hope this helps someone else out there.
Thanks

us Joey Champion Replied 4 years ago

Hello, I also need to have the newsfeed to refresh every 30 seconds. I found the newsfeed file, (newsfeed.php), in /var/www/html/ossn/themes/goblue/plugins/default/theme/page/layout.
When I pasted the code provided by Arsalan, nothing happens. I saved the file in nano as admin. I deleted all the cache from the pc and android mobile device, (I had already disabled cache on the server before I even began) . Still not refreshing. Please, somebody help.
Thank you.

gb Michael chambers Replied 4 years ago

where is the newsfeed file located thanks

Indonesian Arsalan Shah Replied 4 years ago

You can just add that in newsfeed file

<script>
$(document).ready(function(){
    acsetTimeout(function () {
        window.location.reload();
    }, 30000);                         
});
</script>

.