Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 6:39 am (All times are UTC )

 




Post new topic Reply to topic  [ 1 post ] 
Author Message
Posted: Thu Jul 06, 2006 11:33 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Fri Aug 26, 2005 10:13 pm
Posts: 408
Location: Spain
Hi developers,

I just published the second version of my "tell a friend" package (component+module) called JM-Recommend. Its aim is to allow visitors to recommend the site and current page to other people. 
More info and the zip files can be found in this topic.

To recommend the current page the module is needed. It opens a pop window and calls the component, which writes the form according to the requests.
I originally used
Code:
if (!isset($act) or $act == 1) {
      HTML_recommend_plus::emailForm( $mosConfig_live_site,$mosConfig_sitename,$template );
      } else {
      $url = sefRelToAbs($_SERVER['HTTP_REFERER']);
      HTML_recommend_plus::emailForm( $url,$ttl,$template );
      }

but IE warned Notice: Undefined index: HTTP_REFERER in c:\mysite\components\com_recommend_plus\recommend_plus.php on line 69"  (on my local installation - standalone LAMP on Win-XP).
So now I use a JavaScript script which captures the current URL and posts the variables:
Code:
function displayLink(linkType, pageUrl, pageTitle, linkText, windowWidth, windowHeight) { 
  if (linkType == 2)
  { 
       document.write("<a href=\"javascript:openForm('"+linkType+"','"+pageTitle+"',top.location.href,'"+windowWidth+"','"+windowHeight+"');\" title=\"" + pageTitle + "\" >" + linkText + "</a>");
  } else
  {
      document.write("<a href=\"javascript:openForm('"+linkType+"','"+pageTitle+"','"+pageUrl+"','"+windowWidth+"','"+windowHeight+"');\" title=\"" + pageTitle + "\" >" + linkText + "</a>");
  }
}

function openForm(type,title,url,width,height) {
window.open("index2.php?option=com_jm-recommend&task=form&act="+type+"&url="+escape(url)+"&ttl="+title+"","mywin","status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width="+width+",height="+height+",directories=no,location=no");
}


Everything goes OK on my local installation, whichever browser I use (FF 1.5, Opera 9.0 and IE 6.0, all for Win-XP).
However IE fails to work properly on my remote server (Apache+Linux):

When using IE the module works only if the location is http://www.mysite.tld/ not for other URL's of the home page, i.e. http://www.mysite.tld/component/option, ... /Itemid,1/ and the like, nor with inner pages.

In the URL of the pop-up window, IE 6.0 appends the URL stated in the window.open() command to the parent page's one. As a result, the referrer page is opened again in the new window.  ???

I have tried almost anything without results. I guess it's not a template-related issued as I have tested several of them on both servers. It is always the same story - both the component and the module work locally when used with either FF, IE or Opera. But remotely MSIE doesn't act as expected when it comes to the module.  :'(

Apparently my local and remote server have nearly the same settings, so I must be overlooking something.
The package has been tested by another webmaster with similar results on a live server (see here).

I've searched the forums for an answer, but found none.
What could I do to make MSIE work as if it was a normal browser?

Any help would be appreciated. Thanks :)

_________________
My Extensions: JM-Recommend, JM-Credits, JM-Link Us (for J! 1.0.x). Find them in the 3rd Party Extensions Forum.
Joomla test installation: www.poraqui.net/joomla  User: test  Password: test


Last edited by elmoch on Tue Aug 22, 2006 11:58 am, edited 1 time in total.

Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group