Page 35 of 39

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 12, 2008 4:30 pm
by dionysian1
Hi, quick question -

I have a PHP script which works correctly on its own, however, when I integrate it with Jumi, I get:
Warning: Attempt to assign property of non-object in /home/boapubli/public_html/mambots/content/plugin_jumi.php on line 71
I have successfully integrated .js files using Jumi on this same site, so I don't think it is an installation problem.

Here is the code on the page:
Page Text

{jumi [showmovies.php]}

{jumi [map.js]}
Using this code, I receive the above warning twice, and none of the page content displays.

If I remove showmovies.php, and just leave map.js, everything loads fine.

Any thoughts are appreciated. :)

Here is the content of showmovies.php, if it is helpful:
<?php
//$theater_name=$_REQUEST['theater_name'];
$theater_name="Country Club Reel Theatres";

//$dlink = mysql_connect ---- removed for security reasons, public upload


if (!$dlink) {
die('Could not connect: ' . mysql_error());
}

mysql_select_db("boapubli_bmt", $dlink);


$query = "select * from theaters where Theater='$theater_name'";
//echo $query;
$rs=mysql_query($query) or die(mysql_error());
$aff=mysql_num_rows($rs);
echo "Number of movies : $aff <BR>";

?>
<table border="1" width=100%>
<tr>
<th> Movie</th><th>Timings</th>
</tr>
<?
for($t=0;$t<$aff;$t++)
{

$row = mysql_fetch_array($rs);
//$Theater = $row['Theater'];
$Address = $row['Address'];
$Telephone = $row['Telephone'];
$Movie = $row['Movie'];
$Times = $row['Times'];

echo "<tr><td> $Movie </td><td> $Times </td></tr";
}

?>

Re: Jumi - an universal multipurpose module

Posted: Sat Sep 13, 2008 6:20 am
by MarHaj
I have a PHP script which works correctly on its own, however, when I integrate it with Jumi, I get ... warning
I suppose you are using Joomla 1.0.x.
In the attached script showmovies.php you are using $row as a global variable. You must not.

Joomla 1.0.x uses $row as an object containing all article properties. As a result both variables (having the same name) interact.

So either rename $row to a more exotic name (that Joomla does not use) or make this variable local (wrap all your script into the function and call it once).

Re: Jumi - an universal multipurpose module

Posted: Sat Sep 13, 2008 5:47 pm
by dionysian1
Thanks so much - I renamed them to row1 and everything is working fine. :)

If I can trouble you again... I know very little about PHP, and from reading the documentation of Jumi I am unsure.

When I call the showmovies.php script, I would like to pass a variable, theater_name. If I were just linking directly to the script, for instance, the URL would be:

site.com/showmovies.php?theater_name=Some%20Movie%20Theater

In Jumi, can I accomplish this by {jumi [showmovies.php] theater_name[Some%20Movie%Theater]} ?

Thanks.

Re: Jumi - an universal multipurpose module

Posted: Sat Sep 13, 2008 8:54 pm
by MarHaj
I would like to pass a variable, theater_name. In Jumi, can I accomplish this by {jumi [showmovies.php] theater_name[Some%20Movie%Theater]} ?
Yes, you can. And bear in mind that this is not a php variable in its exact meaning as it is in function but a string value.

Re: Jumi - an universal multipurpose module

Posted: Sat Sep 13, 2008 9:22 pm
by dionysian1
Thanks for your answer. Unfortunately I cannot get this syntax to work:
{jumi [showmovies.php] theater_name[Some%20Movie%Theater]}
I've also tried:
{jumi [showmovies.php] theater_name[Some Movie Theater]}
In either instance the script is inserted into the page, but the string is not passed and the data is not displayed. Is my syntax wrong?

Re: Jumi - an universal multipurpose module

Posted: Sun Sep 14, 2008 7:42 am
by MarHaj
{jumi [showmovies.php] theater_name[Some Movie Theater]}
the string is not passed
Jumi argument values (strings) are can be accessed in your script showmovies.php via $jumi[] array.

For example insert into showmovies.php

Code: Select all

echo $jumi[0];
and you''ll see Some Movie Theater surely

Re: Jumi - an universal multipurpose module

Posted: Sun Sep 14, 2008 4:47 pm
by dionysian1
Thanks again, it is working now. :)

Re: Jumi - an universal multipurpose module

Posted: Mon Sep 15, 2008 8:06 am
by djemmers
Hi,

I've installed the module also now to post for example google adsense in module positions.
But how do I make a second jumi module?

I read something about copying the module ?
Can you please explain? I don't seem to find an explanation about that on the site.

I have joomla 1.5 plugin and module installed, would like to use jumi on a new module place.

Re: Jumi - an universal multipurpose module

Posted: Mon Sep 15, 2008 2:46 pm
by MarHaj
But how do I make a second jumi module?
The following procedure, copying a module, can be done with any Joomla module:
1. Go to the administrator backend
2. Choose extensions -> module manager
3. From the list select module to be copied. Check mark.
4. Click Copy (top right image)

Then you rename copy, give it another content, another position, etc....
Done!

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 19, 2008 10:42 am
by stuarta
I'm trying to include this code

Code: Select all

<?php 
include("http://www.tsviewer.com/ts_viewer_pur.php?ID=11552&bg=&type=&type_size=100&type_family=1&info=1&channels=1&users=1&type_s_weight=normal&type_s_style=normal&type_s_variant=normal&type_s_decoration=

none&type_s_weight_h=normal&type_s_style_h=normal&type_s_variant_h=normal&type_s_decoration_h=none&type_i_weight=normal&type_i_style=normal&type_i_varian

t=normal&type_i_decoration=none&type_i_weight_h=normal&type_i_style_h=normal&type_i_variant_h=normal&type_i_decoration_h=none&type_c_weight=normal&type_c

_style=normal&type_c_variant=normal&type_c_decoration=none&type_c_weight_h=normal&type_c_style_h=normal&type_c_variant_h=normal&type_c_decoration_h=none&

type_u_weight=normal&type_u_style=normal&type_u_variant=normal&type_u_decoration=none&type_u_weight_h=normal&type_u_style_h=normal&type_u_variant_h=norma

l&type_u_decoration_h=none"); 
?>
but I just get the messages back saying Warning: main(): URL file-access is disabled in the server configuration........

Can someone advise please

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 19, 2008 12:11 pm
by MarHaj
I just get the messages back saying Warning: main(): URL file-access is disabled in the server configuration...
Well, your code contains file inclusion from another server

Code: Select all

include "http://www.tsviewer...."); 
what is generally impossible due to the server restrictions.
More on this topic see http://cz2.php.net/manual/en/function.include.php

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 19, 2008 12:50 pm
by stuarta
That's the php code that was generated via that site. How can I go about using that then please. I've included it in a standard php page ok.

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 19, 2008 2:46 pm
by kbcountry
I have this code <script language="javascript" src="http://www.securitytraq.com/portal/secu ... "></script> that I am trying to install on my site. I have tried just adding html then changed to jumi both with no luck. Any advice to how I can add this code using joomla or jumi?

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 19, 2008 3:37 pm
by MarHaj
Try this

Code: Select all

<script src="http://www.securitytraq.com/portal/securityalert.js" type="text/javascript"></script>
You need not have jumi for it. You can place it directly into your template, into Joomla footer, or Joomla custom module or just to write the code into the article...It much depends on your taste...

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 19, 2008 3:43 pm
by MarHaj
That's the php code that was generated via that site.
I understand...
You have to have ts_viewer_pur.php file. At the least. Maybe there are another files to be used too...

Then upload it (them) into your server and use it (them) like this
include("your_path/ts_viewer_pur.php......");

Re: Jumi - an universal multipurpose module

Posted: Mon Sep 22, 2008 8:04 am
by stuarta
no panic now, I've found another extension to do the job.

thanks

Re: Jumi - an universal multipurpose module

Posted: Tue Sep 23, 2008 2:20 pm
by axksolar
Hi, I'm new to this board and apologize if the question has already been asked. I am using the jumi plugin and have no issues creating phps and referencing them in articles. What I want to do is having multiple articles calling jumi php pages and to have those php pages link to each other with php arguments.

So for instance, if i have a php page and it takes in some values from the user, I want to call another home-made php page and pass those values as arguments to the second php page. I'm not sure how to do that in the context of each of the php pages being within an article and what not. Does anybody know how to do this? Thanks in advance.

Re: Jumi - an universal multipurpose module

Posted: Tue Sep 23, 2008 3:32 pm
by MarHaj
I want to do is having multiple articles calling jumi php pages and to have those php pages link to each other with php arguments
You can use $_POST php global varible (array) for this purpose.
You will find in every php cookbook under "forms, method post".

The form - your php code in Joomla page - saves data into the $_POST array and opens recipient address (another Joomla page) that contains the code that reads these $_POST.

Rem1: Joomla 1.0 and 1.5 as well have good tools (see API at the developers.joomla.org) how to read $_POST rather easily and effectively then pure php.
Rem2: Or you can utilize another php global variables for this purpose or you can define your own global variables.

Re: Jumi - an universal multipurpose module

Posted: Wed Sep 24, 2008 6:47 pm
by kbcountry
MarHaj wrote:Try this

Code: Select all

<script src="http://www.securitytraq.com/portal/securityalert.js" type="text/javascript"></script>
You need not have jumi for it. You can place it directly into your template, into Joomla footer, or Joomla custom module or just to write the code into the article...It much depends on your taste...
Not having any luck getting my code updated, additional help would be appreciated.

Encoding bug in Jumi 1.2.0 for J!1.5

Posted: Thu Sep 25, 2008 9:11 am
by gillou95
Hello everybody !

I'm french user of J!1.5 and Jumi 1.2.0.
I found a bug :
When jumi include file with french accent, the browsers (FF and IE7) show bad caracters in rendering...

The fix for that :
Convert the file : plugins/content/jumi.php into UTF8 encoding. :D

Best regards,

Re: Jumi - an universal multipurpose module

Posted: Thu Sep 25, 2008 5:08 pm
by stephen77
Hi
I'm really pleased to have found Jumi. I am using it in articles on my Joomla site to show product lists. I use this in the article and it works great !

Code: Select all

{jumi [diy_shop/productlist.php]}
However, I would like to be able to work out how to pass a variable as well. I have read through the forum posts but am still stuck.
My apologies but I am new to this.
Checking the direct URLs of my joomla pages I see they look like this:
mysite.co.uk/index.php/shop/93-category/137-product-list?rb=4-424
so I presume the variable is
?rb=4-424
If I put

Code: Select all

{jumi [diy_shop/productlist.php] rb[4-424]} 
in my article, I then need to place code in my productlist.php file to process this variable. But I’m not sure how to do this.
I tried simply putting

Code: Select all

echo $jumi[0]; 
at the beginning of the code but that didn’t work.
I then tried

Code: Select all

foreach ($jumi as $key => $value)
{
       echo $jumi['.$key.'] = '.$value.';
     }
followed by

Code: Select all

foreach ($jumi as $key => $value)
{
       echo $jumi[0];
     }
but still no luck
Can you help at all ?
The code for the productlist.php looks like this:

Code: Select all

<?php
require_once('constants.inc.php');
require_once('classes'.DIRECTORY_SEPARATOR.'class.smarty_sw.php');
$oSmarty = new smarty_sw();
$oSmarty->cache_lifetime = 600;
if ( $oSmarty->is_cached('search.tpl', SMARTY_CACHE_ID) === true ) {
	$oSmarty->display('search.tpl', SMARTY_CACHE_ID);
	die();
}
include_once('elements'.DIRECTORY_SEPARATOR.'search_box.php');
include_once('elements'.DIRECTORY_SEPARATOR.'category_tree.php');
include_once('elements'.DIRECTORY_SEPARATOR.'merchant_list.php');
include_once('elements'.DIRECTORY_SEPARATOR.'query_list.php');
if ( count($aProducts) < 1 ) {
	# include_once('elements'.DIRECTORY_SEPARATOR.'hot_picks.php');
}
include_once('elements'.DIRECTORY_SEPARATOR.'product_display_list.php');
include_once('elements'.DIRECTORY_SEPARATOR.'nav_product_list.php');
include_once('elements'.DIRECTORY_SEPARATOR.'refineby.php');
$oSmarty->display('productlist.tpl', SMARTY_CACHE_ID);
?>
Any help on this would be great
Thank you

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 26, 2008 10:47 am
by MarHaj
{jumi [diy_shop/productlist.php] rb[4-424]}
echo $jumi[0]; at the beginning of the code but that didn’t work.
Please tell me what "didn’t work" means exactly? No output?
Rather try this:

Code: Select all

var_dump($jumi);
You will get info about type and content of a variable. Something has to be shown in this case.

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 26, 2008 2:44 pm
by stephen77
Thank you very much for your help. I'm sorry I didn't give you enough information. When I said "that didn't work" I meant "I can't get it to produce what I want" Jumi clearly works well !

With var_dump($jumi); at the beginning of the code in productlist.php it produces this at the top of the page:
array(1) { [0]=> string(5) "4-424" }

With echo $jumi[0]; at the beginning of the code in productlist.php it produces this at the top of the page:
4-424

So, I can see that it is working and the variable is being passed.

The problem I'm having though is that I'm trying to use this variable to modify the results of the productlist.php file.
The variable tells productlist.php which category of products to return.

If I put

Code: Select all

jumi [diy_shop/productlist.php]}
in an article I get the same as I get from typing the full URL to the file like this
mysite.co.uk/index.php/shop/93-category/137-product-list
So that works great

But, if I put

Code: Select all

{jumi [diy_shop/productlist.php] rb[4-424]} 
in an article, and

Code: Select all

foreach ($jumi as $key => $value)
{
       echo $jumi[0];
     }
at the top of productlist.php
I still get the same as but just with the
4-424
written at the top of the page

What I'm trying to get is the same result as I get typing this URL in the address bar
mysite.co.uk/index.php/shop/93-category/137-product-list?rb=4-424

I think what I'm trying to do is possible but I can't seem to figure it out.

Thank you very much for helping with this.

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 26, 2008 3:29 pm
by stephen77
I now know this was completely wrong but I thought it might help to show what I'm trying to do.
In my ignorance I thought I could just put this in an article
{jumi [diy_shop/productlist.php?rb=4-424]}
but of course that file doesn't actually exist.
Thanks again
Stephen

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 26, 2008 3:41 pm
by MarHaj

Code: Select all

mysite.co.uk/index.php/shop/93-category/137-product-list?rb=4-424
So I understand you have some application that starts with productlist.php code and shows some kind of information that is base on url address that changes. And you want it running in a Joomla article. Is it righ?

You should use <iframe> for this.
Try this test.php that contains
<iframe src ="somepath/productlist.php" width="100%"></iframe>
and include test.php into the article via jumi.

For an explanation and other possibility look here.

Re: Jumi - an universal multipurpose module

Posted: Fri Sep 26, 2008 4:57 pm
by stephen77
Yes that's right, but I'm not sure I can use iframes as this will result in a static URL in the address bar as people navigate the framed pages and that causes real issues with links etc.
Is it not possible to get Jumi to add the variable to productlist.php so I get productlist.php?rb=4-424
Thanks
Stephen

Re: Jumi - an universal multipurpose module

Posted: Sat Sep 27, 2008 8:11 am
by MarHaj
this will result in a static URL in the address bar as people navigate the framed pages and that causes real issues with links etc.
Exactly. And it prevents jumping your application from Joomla (article) too.
If you need dynamics addresses in Joomla you have to change your application into Joomla component.
Another way of doing this is to rewrite your application to the so called self calling forms: the application does not change its url address but stills sends data between its various parts via method post. Then you can really have your application in a module or an article (via plugin). It does not work when cache is on so often it should be done using Ajax technology. When application is rather complex another problems arise.

So my advice: either iframe (via Jumi or Joomla wrapper) without rewriting the code or creating Joomla component.

Re: Jumi - an universal multipurpose module

Posted: Sun Sep 28, 2008 1:31 am
by kimse78
Hello
I hope someone can help me, getting my jumi installation to work, as im close to giving up.
After several hours of testing i have narrowed down the issue, and i can get a "hole" through, to php files if i meddle with the jumi.php file - but it isn't a solution.

Heres what i have done so far

1) Installed jumi, set default path to "/mounted-storage/home61a/sub002/sc38654-YLBB/mysite.com/includes/customcode", and thereafter made a jumi call from an article "{jumi[hello.php]}"
I then got the folowing error:
The file /mounted-storage/home61a/sub002/sc38654-YLBB/mysite.com/includes/customcode/hello.php cannot be included!
It does not exist or is not readable.
I double checked the path, it was correct!

2) After reading the forum i thought it was a permission problem, so i tried both setting 777 rights on the customcode folder (incl. files) and on the plugin folder - still didn't work

3) No matter what i tried i got the same error, so after reading the site i tried changing line 64 in jumi.php

Code: Select all

from:
 if (is_readable($incl_file)) { 	
to:
if (1==1) 
4) Now i instead i got the following error
Warning: plgContentJumi::include(/mounted-storage/home61a/sub002/sc38654-YLBB/mysite.com/<span style="color: #484848; font-family: Arial; font-size: 13px; line-height: 19px" class="Apple-style-span"><span style="color: #333333; font-family: Tahoma; font-size: 12px; line-height: 15px" class="Apple-style-span"><span style="color: #484848; font-family: Arial; font-size: 13px; line-height: 19px" class="Apple-style-span"><span style="color: #333333; font-family: Tahoma; font-size: 12px; line-height: 15px" class="Apple-style-span">includes/customcode/hello.php<span style="color: #484848; font-family: Arial; font-size: 13px; line-height: 19px" class="Apple-style-span">) [function.plgContentJumi-include]: failed to open stream: File name too long in /mounted-storage/home61a/sub002/sc38654-YLBB/mysite.com/plugins/content/jumi.php on line 66
5) Out of desparation i tried hardcoding the path to the php file in jumi.php, and suddenly it worked

Code: Select all

i changed line 66 from:
   include($incl_file);
to:
include('/mounted-storage/home61a/sub002/sc38654-YLBB/mysite.com/includes/customcode/hello.php');
6) I then tried manually setting the $incl_file variable to hold the above string and, then call include, but got the same error as in 4. >:(

I don't get it, why can't include be called with a variable? - Can anybody help, with a solution?

Re: Jumi - an universal multipurpose module

Posted: Sun Sep 28, 2008 7:48 pm
by MarHaj
failed to open stream: File name too long in
Oh, interesting!
Seems Internet is full of this error message. Just try Google.
I did not find the definite answer. The most reasonable one I have found is
Since the error would appear to still be that the filename is too long even before identifying it as an http URL, and since (outside the data: scheme) I've never seen a URL that long before (RFC2616 doesn't impose a limit, but mutters about older systems not coping with URLs longer than 255 bytes), it's possible that there is some limitation in PHP's stream-handling that doesn't like such long names.
The problem is not the problem of Jumi or Joomla but it lies somewhere deeper... And do not know where.

Re: Jumi - an universal multipurpose module

Posted: Tue Sep 30, 2008 8:56 pm
by bluemountain78
Hi I am new to Joomla and i have a little experience with php just lik to put in my two cents i have got jumi working just need to figure out how to get the other php scripts to work thanks for the tutorial you showed me how to add a table to the database which was great !! ;D