How pass variables to script in a module mod_jumi

A multipurpose module, plugin and component

How pass variables to script in a module mod_jumi

New postby ofranquesa » Mon Dec 20, 2010 3:02 pm

Hello!

First, congratulations for this fantastic component! ^.^

I have one question that googling I can't resolve. I've created a module, a mod_jumi module. This module includes a script: "topOffers.php". I don't know how pass specific parameters to this script. Because I've seen that this kind of sentence {jumi [plugins/content/jumi/jumi_demo.php][first][second]} only works to include the script inside articles, but in a mod_jumi module?

Thank you!

Oriol.
ofranquesa
 
Posts: 3
Joined: Mon Dec 20, 2010 2:50 pm

Re: How pass variables to script in a module mod_jumi

New postby Edvard » Mon Dec 20, 2010 6:06 pm

You can use JRequest joomla class to access the GET, POST variables. You can also use $_GET, $_POST.
Regards,

Edvard Ananyan - 2GLux Team

Please post a review at the Joomla Extensions Directory. It is very important for us!
Edvard
Site Admin
 
Posts: 1836
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: How pass variables to script in a module mod_jumi

New postby ofranquesa » Mon Dec 20, 2010 6:52 pm

Thanks for your response, but the problem is this:

I have various modules mod_jumi, that all can use the same script, but I want to pass a param depending of module mod_jumi. This script print some offers readed in XML, so the script is topOfFers.php, but when I'm christmas section, for example, I want to pass to topOffers.php an indicator that I only want show christmas offers... The same as Weekend, etc ...

Thank you! :D
ofranquesa
 
Posts: 3
Joined: Mon Dec 20, 2010 2:50 pm

Re: How pass variables to script in a module mod_jumi

New postby ofranquesa » Wed Dec 22, 2010 4:47 pm

Solved!

I thought to use both "Code Written" and "Source Code" inputs and works.

On Code written I've defined the params and "Source Code" i've included the script...

Expect that this can help someone.
ofranquesa
 
Posts: 3
Joined: Mon Dec 20, 2010 2:50 pm

Re: How pass variables to script in a module mod_jumi

New postby [email protected] » Sat Dec 25, 2010 10:24 am

ofranquesa wrote:I thought to use both "Code Written" and "Source Code" inputs and works.
On Code written I've defined the params and "Source Code" i've included the script...


Hello Oriol,

Can you be more specific, please? I tried this, but the value I put
in the "Code Written" field (a short string) simply appears at the beginning
of the content of the module, and the php script cannot find it in $jumi[0],
so I can't use it in my script.

Or, Edvard, could you please provide a little more detail about passing
arguments to a jumi module? Maybe a short tutorial? Thanks!

Thanks!
Dan
[email protected]
 
Posts: 2
Joined: Sat Dec 25, 2010 10:18 am

Re: How pass variables to script in a module mod_jumi

New postby [email protected] » Sat Dec 25, 2010 10:34 am

It's OK. I figured it out too. :D

I want to pass a product code "CX1" to my script. All I had to do was to put the following in the "Code Written" field:

Code: Select all
<?php
$myproductcode = "CX1";
?>


Then, I added
Code: Select all
echo $myproductcode;

to my script, and it echoes "CX1".

I'm happy. :D

Merry Christmas!

Dan
[email protected]
 
Posts: 2
Joined: Sat Dec 25, 2010 10:18 am


Return to Jumi

Who is online

Users browsing this forum: No registered users and 2 guests