Advertisement

Jumi - the set of custom code extensions

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
mxgs
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Tue May 26, 2009 9:58 am

Re: Jumi - the set of custom code extensions

Post by mxgs » Thu Jun 11, 2009 10:56 am

Code: Select all

But do not expect too much: there are probably reasons why it is there...[/quote]

i'm sure there's, but i can't see how malicious a <br /> tag can be, to be honest.
and anyway, i strongly feel it'd be great for Joomla administrators to have a list of allowed/disallowed tags, say, in admin config, and have the flexibility to decide by themselves.
one of those quirks, imho...

thanks for the tip, i was actually looking where J! kept the banned tags list: will i find there other tags too, or does it depend on which editor i use? i'd like to be able to remove demoted <font> tags users always paste from their blinking Word - just in case you know...

Advertisement
ghardin
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Sun Feb 10, 2008 3:40 am

Re: Jumi - the set of custom code extensions

Post by ghardin » Thu Jun 11, 2009 12:49 pm

HMMM.
I might try just "including" the working scripts in the jumi files. Then they would only be called and executed and not revealed.
Will get back on that.

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Thu Jun 11, 2009 3:14 pm

i'd like to be able to remove demoted <font> tags users always paste from their blinking Word - just in case you know...
Banned tags can be set in blacklist/whitelist. Available from J 1.5.8.
See here:
http://docs.joomla.org/Why_does_some_HT ... n_1.5.8%3F
MarHaj

PhatJack
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Thu May 03, 2007 10:32 pm

Re: Jumi - the set of custom code extensions

Post by PhatJack » Sat Jun 13, 2009 2:22 am

I called to custom code from a content item. Works great but it wont publish my code until AFTER my footer. So my footer is at the top of the page just under my header logo and all of my custom php is being displayed underneath my footer.

Anyone else had this problem? I've attached an image so you can see what I'm going through.
screen.JPG
Joomla 1.5.11, Rockettheme Template "Solar Sentinel".

Thanks.
You do not have the required permissions to view the files attached to this post.

PhatJack
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Thu May 03, 2007 10:32 pm

Re: Jumi - the set of custom code extensions

Post by PhatJack » Sat Jun 13, 2009 11:22 pm

Um. Never mind. I had a few unclosed tags. I feel sheepish!
Let that be a lesson to all of you to check your code!

That is all. Move along... Move along.

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Sun Jun 14, 2009 5:18 am

Never mind. I had a few unclosed tags. I feel sheepish!
Oh, good experience. You will encounter it, I think, hundreds of times again. :-)
MarHaj

culwelljase
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Jun 14, 2009 5:20 am

Re: Jumi - the set of custom code extensions

Post by culwelljase » Sun Jun 14, 2009 5:23 am

Hi,

I am having an issue with Jumi 2.1 beta 2 on a Joomla 1.5.8 installation using a YOOtheme template.

Basically, Jumi works fine for the most part, i.e. {jumi *3}{/jumi} works great and also processes scripts from the included document. However, the article editor keeps removing any code from within the jumi brackets. ex: {jumi *3}<?php $productName = "blahblahblah"; ?>{/jumi} does not work. The php gets removed every single time when I apply or save changes.

I have read every document on your website and most posts in this forum thread and I am afraid that I have exhausted every attempt to get it work. The plugin is enabled and the settings are properly set. I have used the encoder with and without the wysiwyg editor. Would you have any ideas as to why its not working?

While I am here I would also like to say that Jumi is an excellent extension, infact, probably the best extension every made for Joomla. It really does open a plethora of options for customization. I hope I can get it working properly, I was really looking forward to using it! Surely it is something simple that I have overlooked.

Thanks for your time and hard work on this great extension.

Jason Culwell
Micro.Dot Productions

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Sun Jun 14, 2009 5:49 am

However, the article editor keeps removing any code from within the jumi brackets. ex: {jumi *3}<?php $productName = "blahblahblah"; ?>{/jumi} does not work. The php gets removed every single time when I apply or save changes.

... I have used the encoder with and without the wysiwyg editor. Would you have any ideas as to why its not working?
That's interesting.
Please verify (once again and with a little help of video ttp://jumi.vedeme.cz/index.php?option=com_content&view=article&id=34&Itemid=54&limitstart=1) you are using Jumi coder button properly.
You know: encoder changes < (and other stuffs) to < that must not be cleared out editor. So try it, please, once again.
MarHaj

leejayd
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Jul 13, 2008 3:33 pm

Security issue

Post by leejayd » Sun Jun 14, 2009 9:47 am

I posted in the Extensions group instead of this topic, duh. I'd appreciate if a moderator can remove the topic from the Extensions board.

Here's my issue:

I'm running with Jumi 2.1 with Joomla 1.5.10 it works fine except I have security problem.

I created an article with PHP code loaded that interacts with a database. It works great except the Joomla search facility is indexing the PHP code.

This means if a user seaches for a term such as "Database" then they are given the mysql connection string with password etc...

As you can tell I'm new to PHP with Joomla - what's the best way to protect myself?

Just now I tried loading my PHP code to the Jumi component and then referencing this in the article with {jumi *5}{/jumi}. This works and the PHP is not shown in the Search - although, can you tell me that the PHP is code is secure in this way?

This is all getting me concerned with security i.e. I feel I'm opening myself to all sorts of problems.

What steps can I take to protect myself.

Thanks in advance.

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Sun Jun 14, 2009 9:09 pm

This means if a user seaches for a term such as "Database" then they are given the mysql connection string with password etc...
Hmmm, I think I understand.
What about to hide (remove) the plugin as a whole from the search results?

Here is how to:
in administrator/components/com_search/helpers/search.php
before line 124

Code: Select all

$text = preg_replace( '/{.+?}/', '', $text);
include this line

Code: Select all

$text = preg_replace( '%\{jumi\b[^}]?(\S*?)\}([\S\s]*?)\{/jumi\}%', '', $text);
I know it is not a good practice. But this is the only one I have in hands at this moment. I even asked Joomla! developers at their forum. Nothing.

Nevertheless I hope, really hope, this will help to solve the problem.
MarHaj

culwelljase
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Jun 14, 2009 5:20 am

Re: Jumi - the set of custom code extensions

Post by culwelljase » Mon Jun 15, 2009 3:45 am

I watched the videos again and did another read through the documentation. I can assure you that I am doing the proper procedure. So, I assumed there had to be something in my Joomla installation that was causing the problem.

I discovered a setting in the TinyMCE plugin, "Code cleanup on save." I tested "front only" and "never" and manage to get desirable results. However, even though I am using a wysiwig editor, I have to encode it with the option "no wysiwig" and upon saving or applying the encoded code gets converted back to non-encoded. But it works, as long as I re-encode before applying or saving changes again. Is this intended behavior? It seems to differ from the examples in the video, but none the less I can use Jumi for what I intended to use it for. Which is good news!

I appreciate your time in helping with the matter. When I start generating a cash flow with my website I will be sure to remember to give you a donation to help with the continued development and support of Jumi.

Thanks again!
Jason Culwell
Micro.Dot Productions

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Mon Jun 15, 2009 7:05 am

However, even though I am using a wysiwig editor, I have to encode it with the option "no wysiwig" and upon saving or applying the encoded code gets converted back to non-encoded. But it works, as long as I re-encode before applying or saving changes again. Is this intended behavior?
Strange, strange, strange!
Encoding via "no wysiwyg" and pasting the it into wysiwyg editor will provide, at the frontend, the code in the browser and no code rendering.
Coder must work

I tested Jumi coder with TinyMCE, JCE and Joomla!FCK and it behaved consistently.

As to the setting of TinyMCE, I am using this one:

Code: Select all

Code Cleanup on Startup 	  Off
Code cleanup on save 	Never
Do not clean HTML entities. 	Yes
Jason, try this setup. If it does not work, I am afraid there could be something with Jumi installation.

Will you be so kind and let me know if something changes?
Thanks!
MarHaj

an613
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Nov 18, 2008 1:10 am

Re: Jumi - the set of custom code extensions

Post by an613 » Tue Jun 16, 2009 6:25 am

hey all,

Just noticed the strangest thing in the world. I wrote up a bunch of custom forms and inserted them using jumi. for some strange reason, on two of my forms, whenever i click on the submit button, which is supposed to take me to a new article, and used to do that, all of sudden it just logs me out of joomla. It only happens in 2 of the 5 forms that i have, and only when the login module is published.

Any ideas as to what could be causing this conflict between my form and the login module??

Thanks

magnamagna
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Jun 14, 2009 2:21 pm

Re: Jumi - the set of custom code extensions

Post by magnamagna » Tue Jun 16, 2009 9:31 am

Hello,

excuse me if I ask for a dumb question, but I'm newbie to Jumi; just wanted to know if its possible (and how to do it) to insert weblinks and contacts form in some articles (or category description) using Jumi...

tnanx

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Tue Jun 16, 2009 11:38 am

Just noticed the strangest thing in the world...
on two of my forms, whenever i click on the submit button, which is supposed to take me to a new article, and used to do that, all of sudden it just logs me out of joomla...
Oh, that's really interesting!
Thanks for sharing your mythical experience with us. :-)

And how to give the world into the rut again?
Just an idea: the most strangest things I have encountered with respect with Jumi ocures when one forgets that he/she operates in a shared environment. When user defied variables overwrites Joomla! or third party ones.
Could not it be that case?
Review your global variables names (names of variables defined outside functions or classes) and if they seem they have rather descriptive names, rename them to more exotic ones (e.g. prepend to them your initials).

I am sorry that nothing else comes to my mind right know. Miracles solving should be done in its special way. My favorite method is dreaming. I will try to do it tonight - concentrating on your unusual, supernatural case too :-)
MarHaj

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Tue Jun 16, 2009 12:03 pm

just wanted to know if its possible (and how to do it) to insert weblinks and contacts form in some articles (or category description) using Jumi...
a) weblinks
Weblinks from a Joomla! component or just some links? I will suppose the first case.
In that case you have to write a php script that withdraw the required info from Joomla database.
Although you can do it using php functions and commands only I greatly recommend you to read some Joomla! documentation first - Joomla! has its own libraries and API which make developer's life easier.
Then the script has to be included into an article. For that purpose there is a Jumi plugin.
There are three approaches how to include the script into an article via this plugin. The most easiest way is saving the script as a php file. Upload it onto your server and in article just write
{jumi [pathnameof the script.php]} .... for Jumi v. < 2.1, or
{jumi pathnameofthescript.php}{/jumi}

b) a form
The general approach - developing the script + its inclusion - is the same as above.
I fell an obligation to express some warning.
a) Forms are very easy to design. And very easy to include. Very difficult (at the least for me) to protect them from internet bots: mindless machines they are living in the internet, searching for forms, filling them and pressing submit buttons. Before the form try to realize how you will protect the form. There are numerous ways: some of them are easy, some difficult, some working and the others for nothing.
b) the forms should be submitted somewhere. To database or by e-mail.

All of that rather complicate the fact the forms are very easy to develop themselves.
So be prepared on it before you begin.
MarHaj

magnamagna
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Jun 14, 2009 2:21 pm

Re: Jumi - the set of custom code extensions

Post by magnamagna » Tue Jun 16, 2009 1:14 pm

Thank you for the quick response, Martin...
MarHaj wrote:
a) weblinks
Weblinks from a Joomla! component or just some links? I will suppose the first case.
yes, that's right... just want to include some weblinks categories (from the joomla core) inside some articles
MarHaj wrote:
In that case you have to write a php script that withdraw the required info from Joomla database.
Although you can do it using php functions and commands only I greatly recommend you to read some Joomla! documentation first - Joomla! has its own libraries and API which make developer's life easier.
Then the script has to be included into an article. For that purpose there is a Jumi plugin.
There are three approaches how to include the script into an article via this plugin. The most easiest way is saving the script as a php file. Upload it onto your server and in article just write
{jumi [pathnameof the script.php]} .... for Jumi v. < 2.1, or
{jumi pathnameofthescript.php}{/jumi}
so, in my case, I have to do this:
{jumi [components/com_weblinks/weblinks.php}{/jumi}? (sorry, I'm on a netbook, and I can't do that until I'll be at home...)


one more time, thank you!!

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Tue Jun 16, 2009 6:34 pm

so, in my case, I have to do this:
{jumi [components/com_weblinks/weblinks.php}{/jumi}?
I am affraid it wont't work.
weblinks.php is designed to be run from another "master" (component) and colaborate with its "siblings".
You have to write your own script. Newertheles, and this is the beauty of the opensource, you can get inspiterd by (and/or) similar extensions. The most primitive ones are modules. Try to find a module in Joomla! extensions directory, that provides weblinks list. And, with slight accomodation, write your own code.

BTW: An alternative comes to my mind: if you find that module you can show its content (weblinks) in an article by {mosloadposition pos} at once. Without any coding (and without jumi too :-( ).
MarHaj

magnamagna
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Jun 14, 2009 2:21 pm

Re: Jumi - the set of custom code extensions

Post by magnamagna » Wed Jun 17, 2009 5:32 am

Ok, now everything is more clear... btw, I don't want to give up, and try to get some weblinks via Jumi... I think it's a great extension, and a little training will be useful for future sites

thank you!

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Wed Jun 17, 2009 10:34 am

The security vulnerability was found on June 15th in all Jumi 2.xx versions
up to 2.0.d (for J!1.0), 2.0.3 and 2.1.beta2 (for J!1.5).
It concerns Jumi component only.

The new versions fixing this risk were released today:
- 2.0.e stable for Joomla! 1.0
- 2.0.4 stable for Joomla! 1.5
- 2.1.beta3 for Joomla! 1.5 containing other improvements too.

We greatly recommend to download the new version and make an upgrade or make yourself the following manual fix at the least:

Manual fix:
a) find file components/com_jumi/jumi.php
b) make in jumi.php following changes:

For Joomla! 1.5
change line 11 from

Code: Select all

$fileid    = JRequest::getVar('fileid');
to

Code: Select all

$fileid    = JRequest::getInt('fileid');
For Joomla! 1.0
change line 13 from

Code: Select all

$fileid = mosGetParam($_REQUEST, 'fileid', ''); 
to

Code: Select all

$fileid = (int)mosGetParam($_REQUEST, 'fileid', '');
We, developers, are expressing many thanks to Markus who announced that vulnerability to us yesterday.
MarHaj

bleustreak1
Joomla! Explorer
Joomla! Explorer
Posts: 401
Joined: Sat Feb 07, 2009 6:06 am

Re: Jumi - the set of custom code extensions

Post by bleustreak1 » Thu Jun 18, 2009 11:10 am

i cannot implement captcha in a feedback form which i have created using jumi.

has anybody implemented it somewhere or seen it implemented or a tutorial for it .

Can somebody please help me ??

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Thu Jun 18, 2009 6:38 pm

i cannot implement captcha in a feedback form which i have created using jumi.
has anybody implemented it somewhere or seen it implemented or a tutorial for it .
Well, there is a great deal of captcha solutions.
Have you got some special one in your mind?
What's the problem?

Rem: if you have no concrete solution in your mind recaptcha.net is my favourite one. Highly secure, well documented, easy to implement.
MarHaj

S55Q
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri Jun 05, 2009 4:53 am

Re: Jumi - the set of custom code extensions

Post by S55Q » Fri Jun 19, 2009 2:06 am

Hello
I was searching for loong time and haven't found info to solve my problem...

joomla 1.5 installed on localhost
jumi 2.0.4 installed
all models + plugins enabled
successfully created an application that can be accessed via browser at:
"http://localhost/joomla/index.php?optio ... i&fileid=4"

Problem is when using the module to insert the application into a module position
there is a path error for every method found in this forum.

I get this kind of error :
"File C:\xampp\htdocs\joomla\index.php?option=com_jumi&fileid=4 does not exist or is not readable!"

When adding the following path : "http://localhost/joomla" to the jumi default path
it shows the following error:

"File http://localhost/joomla\index.php?optio ... i&fileid=4 does not exist or is not readable!"

why it shows that backslash ?
how to solve it ?

Thank you very much.

--EDIT--
Installed jumi_pack_2.1.0_beta3_for_J1.5 it still has the same behavior.
adding a backslash to destroy the path.

and for another issue now with the Jumi 2.1.0 beta3 there is a coder button, but seems like it was design only for 20" screens ;) me and my laptop just cannot see the whole shadow window and so cannot use it.

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Fri Jun 19, 2009 6:44 am

When adding the following path : "http://localhost/joomla" to the jumi default path
it shows the following error:
Hi 555,
the path should not be URL. The path there means a physical location.
Problem is when using the module to insert the application into a module position
there is a path error for every method found in this forum.
Inserting an application item into a module is done not by a path but by inclusion of application item ID. In a module, there is a parameter "Source of code". Write there e.g. *1. It means the module will include application item No 1.
If you want to include a file, then write the path to it there. E.g. images/stories/scripts/mytest.php
MarHaj

bleustreak1
Joomla! Explorer
Joomla! Explorer
Posts: 401
Joined: Sat Feb 07, 2009 6:06 am

Re: Jumi - the set of custom code extensions

Post by bleustreak1 » Fri Jun 19, 2009 6:51 am

MarHaj wrote:
i cannot implement captcha in a feedback form which i have created using jumi.
has anybody implemented it somewhere or seen it implemented or a tutorial for it .
Well, there is a great deal of captcha solutions.
Have you got some special one in your mind?
What's the problem?

Rem: if you have no concrete solution in your mind recaptcha.net is my favourite one. Highly secure, well documented, easy to implement.
well is there a tutorial for implementing captcha in jumi for joomla because last time i tried it i was not successful

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Fri Jun 19, 2009 3:47 pm

well is there a tutorial for implementing captcha in jumi?
No, there is not.
There is an implementation of antispam with jumi here: http://www.tornooi.net/toevoegen
Simple and, as the author swears, save and functional. He is an Jumi extensive user and I am persuaded he will lend you a hand.
MarHaj

S55Q
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri Jun 05, 2009 4:53 am

Re: Jumi - the set of custom code extensions

Post by S55Q » Sat Jun 20, 2009 1:50 pm

Hey,

So i changed the path to the physical path and it works.
But can't get it to work in the article.
I use JCE (but tried others as well mini and without editor)

I add : {jumi [*3]}
it only shows "{jumi [*3]}"
tried: {jumi [phpfiles\GetRateResponse.php]}
and it doesn't run the application.
the plugin is enabled.
Please help me, how to make it to work ?

User avatar
MarHaj
Joomla! Ace
Joomla! Ace
Posts: 1168
Joined: Fri Jun 30, 2006 5:24 pm
Location: CZ
Contact:

Re: Jumi - the set of custom code extensions

Post by MarHaj » Sat Jun 20, 2009 6:18 pm

But can't get it to work in the article.
It depends on the Jumi version you use (sorry for this inconvenience):
For version 2.1 you have to use {jumi *3}{/jumi}

As for Jumicoder size and your laptop: you can accomodate the size of the coder in
plugins/editor-xtd/jumicoder.php line 30

Code: Select all

$button->set('options', "{handler: 'iframe', size: {x: 570, y: 675}}");
and
plugins/editor-xtd/jumicoder/jumicoder_form.php line 20 and 21

Code: Select all

$cols = 60;
$rows = 15;
MarHaj

madallig
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Jun 22, 2009 10:12 am

Re: Jumi - not working

Post by madallig » Mon Jun 22, 2009 10:24 am

Hi,
I'm struggling with Jumi - cannot get Jumi to work inside the article page ...
I have installed the Jumi 2.1 and the other parts work OK ie if i use via module manager ..

Any help would be very helpful ....
2009-06-22_180926.jpg
2009-06-22_180749.jpg
Thanks!
Adam

Here is my web site using many times Jumi module manager:
http://www.asiasourcing.net (not finished of course!)
You do not have the required permissions to view the files attached to this post.

basbult
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jan 04, 2006 9:36 am

Re: Jumi - the set of custom code extensions

Post by basbult » Mon Jun 22, 2009 2:15 pm

Hi,

I'm not sure if this is the right place but earlier this Post there was a thing about popup/lightbox in an external php file by jumi (by HandP):

http://forum.joomla.org/viewtopic.php?f ... x#p1536525

It lookslike i have the same kind of trouble and I think i have an idea what's the bottleneck, but still i don't have a sollution (even after reading the post linked here before)

This is the code in the jumi module(is just get some information from a form en pass it to the external php page:

Code: Select all

<script language="javascript" type="text/javascript">
<!-- 
//Browser Support Code
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('ajaxDiv');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
					
		}
	}
	
	var pakket = document.getElementById('pakket').value;
	var meters = document.getElementById('meters').value;
	var verwarming = document.getElementById('verwarming').value;
	var queryString = "?pakket=" + pakket + "&meters=" + meters + "&verwarming=" + verwarming;
	ajaxRequest.open("GET", "http://www.a1-vloerverwarming.nl/offerte/standaard_offerte.php" + queryString, true);
	ajaxRequest.send(null);
 
}

//-->
</script>
<form name='myForm'>
<input type="hidden" id="pakket" value="430"/> 
<table>
<tr>
<td>Aantal meters</td>
<td><select id="meters">
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
</select>
</td>
</tr>
<tr>
<td>Soort verwarming</td>
<td><select id='verwarming'>
<option value='10'>hoh10</option>
<option value='15'>hoh15</option>
<option value='20'>hoh20</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input type='button' onclick='ajaxFunction()' value='Get price' />
</td>
</tr>
</table>
</form>
<div id='ajaxDiv'>The Ajax code here</div>

The external php page does a query on the mysql db en gives it back to the jumi code. It also makes a (lightbox)link ($hyperlink) with some variables and the rel="lightbox attribute. But when this is back in the browser the link works but not the lightbox. The external php file:

Code: Select all

<?php
$dbhost = "**";
$dbuser = "**";
$dbpass = "**";
$dbname = "**";
	//Connect to MySQL Server
mysql_connect($dbhost, $dbuser, $dbpass);
	//Select Database
mysql_select_db($dbname) or die(mysql_error());
	// Retrieve data from Query String
$pakket = $_GET['pakket'];
$verwarming = $_GET['verwarming'];
$meters = $_GET['meters'];
	// Escape User Input to help prevent SQL Injection
$pakket = mysql_real_escape_string($pakket);
$verwarming = mysql_real_escape_string($verwarming);
$meters = mysql_real_escape_string($meters);
$hyperlink = "<a href=\"http://www.a1-vloerverwarming.nl/offerte/standaard_mail.php?p$pakket?v$verwarming?m$meters\" rel=\"lightbox;width=640;heigth=480\" title=\"Offerte aanvraag\">Om op basis van deze prijs direct een offici&euml;le offerte in uw mailbox te krijgen klik hier</a>";

	//build query
$query = "SELECT * FROM jos_offerte WHERE pakket = '$pakket'";

if(is_numeric($meters))
	$query .= " AND m = $meters";
if(is_numeric($verwarming))
	$query .= " AND hoh = $verwarming";
	
	//Execute query
$qry_result = mysql_query($query) or die(mysql_error());

	//Build Result String	
$display_string = "<table>";
$display_string .= "<tr>";
$display_string .= "<th>pakket</th>";
$display_string .= "<th>verwarming hoh</th>";
$display_string .= "<th>Meters</th>";
$display_string .= "<th>Prijs</th>";
$display_string .= "</tr>";

	// Insert a new row in the table for each person returned
while($row = mysql_fetch_array($qry_result)){
	$display_string .= "<tr>";
	$display_string .= "<td>$row[pakket]</td>";
	$display_string .= "<td>$row[hoh]</td>";
	$display_string .= "<td>$row[m]</td>";
	$display_string .= "<td>$row[prijs]</td>";
	$display_string .= "</tr>";
	
}
echo "Query: " . $query . "<br />";
$display_string .= "</table>";
echo $display_string;
echo "<u>$hyperlink</u>";

?>
So it looks that there is no link with the lightbox javascript or something like that, does anybody has any idea how to get that lightbox working?

Advertisement

Locked

Return to “Extensions for Joomla! 1.5”