Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Auto Refresh

Auto Refresh

I am working on an internet live broadcast site and would like to be able to have a module that displays the current personality that is streaming live.  There is a chat room on the page and I don't want to auto refresh the entire page due to the fact that refreshing the page will reload the chat room and make the user log in again. 

Does anyone know a way to make metamod autorefresh at certain time intervals.  this must have been solved at some point.

adamburns_uk
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: Auto Refresh

Hi Adam,

good question, but you need to understand how some of this stuff works. In many respects MetaMod is just a module. It executes as part of a normal page request, and generates HTML that becomes part of the published page. So unless you do something out of the ordinary, a MetaMod can't "refresh itself" independently of the rest of the page.

There is a possible way around this but it's not particular to MetaMod (so I will not be giving full support to make this work). I'm happy to give some pointers though.

Basically what you need to do is to create some Javascript which runs on a timer and periodically calls a function.

In that function, you generate an AJAX request to the Joomla site.

You need to install RokModule (or similar) on your site. This allows an AJAX request to request the contents of a module. So, the AJAX request will ask for the contents of your "who's on now" module (or a MetaMod if you like). RokModule will return the contents of the module. Your JS code will then replace the HTML of the "old module" with the HTML of the "new module", and this will happen without a page refresh.

If you do a search on this site for rokmodule, you'll find a little more info about where to get it from, and what URL you use to retrieve the contents of a given module. You'll need to write all the JS yourself, or find someone who is good at it to be able to implement it.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5910
Total Posts Today:
1
User Info:
 
Total Users:
10152
Newest User:
kasautiizindagiikay
Members Online:
0
Guests Online:
255

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked