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.

 

Hide/Show module by Speed User Web Connection

Hide/Show module by Speed User Web Connection

I have the last MetaMod addon and the last joomla 1.5.15
I wish to include/exclude modules in my front page by user connection type criterious.
For example: hide module if user connection type are = or less than...
It's possible?

Thanks a lot,
Mik

Edited By: mikel2004
13-Mar-10 07:10:26

mikel2004
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Hide/Show module by Speed User Web Connection

Hi Mik,

I don't know what you mean by "user connection type". Is that the Joomla user group, using some sort of ACL component? Or something defined in a component like JomSocial or CommunityBuilder?

Cheers,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Hide/Show module by Speed User Web Connection

Hi Stephen
Thanks for your answer
I mean User Broadband Speeds Connection... I want to hide modules when the User Web Connection Speed is less than 2 Mbps. It´s possible?
I need other plugin to recognize the user connection speed?
Thanks a lot

mikel2004
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Hide/Show module by Speed User Web Connection

Hi Mik,

at this time I don't know of any good way to do this, I'm sorry. If you can find a way for Joomla to know about the user connection speed, then MetaMod can use this information to turn the modules off. But so far I have never seen a good way of getting this information.

If you find anything, please let me know! There are other people who want to do this on their sites too.

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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Hide/Show module by Speed User Web Connection

Hi Stephen

I take the challenge!
I found this php code that calculates the user's download speed by calculating the weight of an image hosted on our web server and the user's download time for the same image.

      <form name="speed"> <script>
      function calculate(weight){
          end = new Date();
          spd = (weight/1024)/((end-start)/1000)+'';
          spd = spd.substring(0,5);
          document.forms.speed.valor.value = spd;
      }
      start = new Date();
      document.write('<img style="position:absolute; visibility:hidden"
src="WEB ADRESS" onload="calculate(this.fileSize)"> ');
      </script> Download Speed <input type="text" size="3" name="valor"
value="...">  kbps</form>

Only you must replace "WEB ADRESS" for your adress.
The idea looks great but I don´t know how it works or how to insert it into my web. And you?
You think this can work?

Best regards,
Mik

mikel2004
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Hide/Show module by Speed User Web Connection

Hi Mik,

ok, I can see how this works, though I don't think I would be happy to use it on any site of mine...

The issue then is how to get the information from this script back into Joomla, so that Joomla can use it to make a decision on which modules to include or not.

Part of the problem is that the first time someone visits your site, the page will be generated but it won't have the results of that Javascript - because that javascript has not been run on the browser yet. After that first page has been generated and run on the browser, then that page is going to have to submit the results of the script back to Joomla again, for use on the next page.

That's just a fundamental fact of life about trying to achieve this.

It gets worse (sorry to say) when you try to make it work if cookies are turned off. The reason is that you really want Joomla to be able to remember the net speed for the particular client for the duration of the session, because you don't want each page to have to be loaded twice (once in full, then once after being refreshed automatically). So you want to store the result in the session, but sessions are only going to work with cookies turned on. If you can't store the result in the session, then Joomla will always think that the speed check hasn't been done yet for that client (cos there's no way for it to remember the results from the last time, without cookie support), so Joomla will keep getting the client to do the speed test. It's all too easy for this to turn into an endless redirect loop.

That's the bad news. I'm afraid I don't have a good solution for this, and it's not high on my list of priorities.

Sorry,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Hide/Show module by Speed User Web Connection

Wow, thanks for your answer.
No problem, I will continue looking for a good method, if I get, I will back with the good news.

Best regards,
Mik

mikel2004
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Total Posts Today:
1
User Info:
 
Total Users:
10075
Newest User:
rsker57
Members Online:
0
Guests Online:
164

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