[SOLVED] [Send to a friend] conflicting with...

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

[SOLVED] [Send to a friend] conflicting with...

Post by StudioZ » Wed 27. Aug 2008, 18:00

I managed to grab a dhtml script from http://www.dhtmlgoodies.com
that helped me to integrate on every pages the "Send to a friend" (Envoyez cette page à un ami ») function on my iRoutier.com site 8)

Although, the script stops working only on pages where I have other content parts that create and make calls to a "window.onload"
Found out that that I can't use my "Send to a friend" on a page where I have a "Plugin: GoogleMaps" Content Part, like at:
http://www.iroutier.com/site/fiche-entr ... demo.phtml

Samething for my Directories sections (Powered by ExData Mod) like at:
http://www.iroutier.com/site/fr_reperto ... eurs.phtml
(Took the script out for the Directories)

I wonder if there would be a way to make both work together ... ?

Here's the code part where I suspect the problem is:

Code: Select all


...
  		        answer.id = 'dhtmlgoodies_a'+divCounter;	
			contentDiv = answer.getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
			contentDiv.className='dhtmlgoodies_answer_content';
			contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
			answer.style.display='none';
			answer.style.height='1px';
			divCounter++;
		}		
	}	
}
window.onload = initShowHideDivs;
</script>
<script language="javascript" type="text/javascript">
  <!-- 
  window.onload = function () {
    googlemap();
  }
  window.onunload = function() {
    GUnload();
  }    
  //-->
  </script>
	<script src="template/inc_js/mootools/mootools.js" type="text/javascript"></script>
  <link href="template/inc_css/specific/frontend_edit.css" rel="stylesheet" type="text/css" />
  <link href="template/slimbox/css/slimbox.css" rel="stylesheet" type="text/css" media="screen" />
  <script src="template/slimbox/js/slimbox.js" type="text/javascript"></script>
  <!--[if lt IE 7]>
  <style type="text/css">
    body { behavior: url("template/inc_css/specific/csshover2.htc"); }
    img { behavior: url("template/inc_css/specific/iepngfix.htc"); }
  </style>
  <![endif]-->

</head>
...
If anyone has a solution to this...? :?
I would really appreciate. 8)

Kind Regards,

Yves
Last edited by StudioZ on Mon 23. Nov 2009, 09:39, edited 1 time in total.
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!

User avatar
Cipolla
Posts: 451
Joined: Sat 16. Feb 2008, 20:39
Location: Muppet Show

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by Cipolla » Wed 27. Aug 2008, 20:21

Yves,

what version are you using? i mean in the newer versions > 1.3.5 you could simply use the cp e-mail form to build a tell a friend form.

When you put this form in an invisible article you may use show_content e.g. in your template to show this box on every page.
...

User avatar
Oliver Georgi
Site Admin
Posts: 9560
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by Oliver Georgi » Wed 27. Aug 2008, 20:25

window.onload is no good solution anymore.

Init MooTools and use

Code: Select all

window.addEvent('domready', function() {
   // run all here which should start when DOM is ready
});
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

User avatar
Jensensen
Posts: 2995
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by Jensensen » Wed 27. Aug 2008, 23:45

[x]
Last edited by Jensensen on Sat 20. Sep 2008, 01:01, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.

User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by StudioZ » Thu 28. Aug 2008, 01:01

Thank you guys for your replies and help 8)

@ Oliver:
Oliver Georgi wrote:window.onload is no good solution anymore.

Init MooTools and use

Code: Select all

window.addEvent('domready', function() {
   // run all here which should start when DOM is ready
});
Oliver
I played a bit with trying to get TABS working but... with no success. :(
Most of the information is in German, which I can't understand or can hardly get translated. This is too technical :wink:
The idea is to have the "Send to a friend" form hidden on each page but... ready to be pulled down (Accordeon) when needed.
This would be the most elegant way to do it, instaed of having a permanent form on each page. :wink:

Question to Oliver:
How do you "Init MooTools" and use ?
What do you want me to do exactly to get it working ? :roll:

Thanks in advance,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!

User avatar
Oliver Georgi
Site Admin
Posts: 9560
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by Oliver Georgi » Thu 28. Aug 2008, 06:39

Just try:

1) frontend_render

Code: Select all

<?php
initMootools();
?>
2) inline PHP

Code: Select all

[PHP]
initMootools();
[/PHP]
And then put this inside your code/template.

Code: Select all

<script type="text/javascript">
window.addEvent('domready', function() {
   alert('Hey, wow - MooTools DOMready works as expected!');
});
</script>
You can study the source of www.iba-stadtumbau.de if you like. I use MooTools scripts there ... as with in most of my projects.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by StudioZ » Thu 28. Aug 2008, 16:57

Thanks Oliver for the ref. :D
This is the most elegant way to use the "Send to a Friend" function :wink:
Working like a charm on your site :D
I studied your page, copied some css and .js and... still can't figure. :(
I'm on the edge to give up on this feature :?

Whish I could see a step by step procedure to follow...
with the good files to download.

Kind Regards,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!

User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by flip-flop » Mon 31. Aug 2009, 14:18

>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )

User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by StudioZ » Tue 1. Sep 2009, 15:03

Thank you Knut :D
I followed the details on your wiki and all is working fine now 8)
Only wish I could hide it at page loading. This is only a small detail.

Cheers,

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!

User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by flip-flop » Tue 1. Sep 2009, 15:21

Hi Yves,

It opened during side load and remains open?
Or is it poped up only a short time?

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )

User avatar
StudioZ
Posts: 802
Joined: Fri 28. May 2004, 19:57
Location: Québec, Canada
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by StudioZ » Tue 1. Sep 2009, 16:14

Hi Knut :wink:
It only pops up only a short time.
Just until the page finish it's loading.
This short page here: http://www.iroutier.com/site/fr_bulletin.phtml
should show you what I mean...

Yves
Image
PhpWCMS Evangelist, -- iRoutier.com Running phpWCMS 1.4.2, r354 -> Great Version!!!!

User avatar
Oliver Georgi
Site Admin
Posts: 9560
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by Oliver Georgi » Tue 1. Sep 2009, 16:21

You need a link that switch the display state. Set display: none by default and via CSS - then it wil not "blink".

You can try to study the JS and link part here:
http://www.iba-stadtumbau.de/index.php?iba-compact

[Update] Found the french text link :)

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

User avatar
update
Moderator
Posts: 6394
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by update » Tue 1. Sep 2009, 20:45

I can see the whole page flashing - do you mean this one?
It's mostly all about webdesign, logo design, new and old pages refresh, print BUT slowly switching to be supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.

User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by flip-flop » Wed 2. Sep 2009, 08:09

wiki: Send a friend == http://www.iba-stadtumbau.de/index.php?iba-compact

Exactly the same behavior. A short form pop up during side load.
Scroll down in browser and reload.
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )

User avatar
Oliver Georgi
Site Admin
Posts: 9560
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: [Send to a friend] conflicting with [Plug-in: GoogleMaps] CP

Post by Oliver Georgi » Wed 2. Sep 2009, 13:08

yes, it would be possible to enhance the JS by 1 single line - and set display:none by default.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон

Post Reply