Jumi - an universal multipurpose module

Discuss the development and implementation of Joomla! modules here.
Locked
Gibbo
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Nov 30, 2006 3:07 pm

Re: Jumi - an universal multipurpose module

Post by Gibbo » Thu Sep 04, 2008 8:01 pm

I would really appreciate if someone could assist me with this excellent plugin as its been driving me mad trying to get it to work how I wish. I should point out that I know this is down to a limitiation of my knowledge rather than the module.

I am currently using Joomla 1.5.6 and the latest Jumi Plugin.

I use flickrviewer ( a variant of simpleviewer) to display galleries of images on Joomla sites. Until now I have only been able to use it with wrappers however I would like to include galleries within content items such as my blog.

The flickrviewer flash component has the following files:

index.html
flickrviewer.php
style.css
swfobject.js
viewer.swf

I have been trying to use the plugin to reference index.html and therefore to display the gallery, however having spent all day changing various things in the html I just cannot get it to work.

There are two things that are changed for each gallery.

1. is the gallery name in the index.html which can be seen in the bottom example (Harvest Time 2007)
2. is the flickr set id in flickrviewer.php in the format

$setid = ‘nnnnnnnnnnnn’;


Currently for each gallery I have a specific directory containing each of the above 5 files which I am sure is very inefficient.

If there is anyway of passing the gallery name and the setid using the argument option in the jumi plugin then I would only need one index.html and flickrviewer.php rather than one for each gallery which would be an enormous saving (being able to quickly add a gallery simply in an article rather than having to edit and upload another php file each time). Not sure if this is possible as jumi is referencing the html file which then calls flickrviewer.php.

Sorry if this seems like an obviously simple question(s) but I just cannot get my head around why things aren't working.

The content of the index.html which I currently use in the wrapper methos is as follows

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>SimpleViewer / Flickr interface in PHP</title>
<link rel="stylesheet" href="style.css" type="text/css" media="all" title="FlickrViewer Styles" charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<script type="text/javascript" src="swfobject.js"></script>
</head>

<body>
<div id="simpleViewer">SimpleViewer requires Macromedia Flash. <a href="http://www.macromedia.com/go/getflashplayer/">Get Macromedia Flash.</a> If you have Flash installed, <a href="index.html?detectflash=false">click to view gallery</a></div>

<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("viewer.swf", "viewer", "100%", "100%", "8", "#CCCCCC");
so.addVariable("xmlDataPath", "flickrViewer.php");
so.addParam("quality", "best");
so.write("simpleViewer");
// ]]>
</script>


<p>Harvest Time 2007</p>

</body>

</html>

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Thu Sep 04, 2008 10:00 pm

Until now I have only been able to use it with wrappers however I would like to include galleries within content items
Hi Gibbo,
I can give you just general direction here. You have to get acquainted with developers details via Joomla documentation yourself. There are plenty of materials there. I hope you will not be angry with me.

So.
First:
remember that you include your files into body of complete page. So get rid of all <head>,<meta>,<title> section and tags.
Second:
You can still inject css and js files into the header of the page. But rather differently. You will find in the Joomla documentation there is a $document object that has some methods. By these methods you do it. You will find examples there too. Just simple example here getting gibbo.css and gibbo.js into the header:
global $mainframe;
$document = &JFactory::getDocument();
$document->addStyleSheet( 'gibbo.css', 'text/css');
$document->addScript( 'gibbo.js' );
Third:
You should probably play with pathnames to the files. When the file is included into Joomla content via Jumi plugin it "thinks" it is in Joomla root although its physical location can be diferent. If there is an reference to any other file in it you have to take it into account. Reference it relatively to Joomla root.

Hope it helps somehow.
MarHaj

User avatar
djemmers
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Thu May 22, 2008 7:09 am

Re: Jumi - an universal multipurpose module

Post by djemmers » Fri Sep 05, 2008 4:11 pm

djemmers wrote: Fatal error: Call to a member function def() on a non-object in /home/tornooi/domains/tornooi.net/public_html/jtornooi/plugins/content/jumi.php on line 63
the new version of jumi fixes my problem!
tnx
One fine day I'll be a Joomla 'expert' !
Tornooi.net : Sports database (tournaments and camps) for Belgium and the Netherlands

cooterbrown
Joomla! Explorer
Joomla! Explorer
Posts: 276
Joined: Tue Jan 09, 2007 9:11 pm

Re: Jumi - an universal multipurpose module

Post by cooterbrown » Sat Sep 06, 2008 5:28 pm

I am confused - what is the difference between the module and the plugin? I have a project a programmer is going to help me with - but dont know if I need to install BOTH or just one?

User avatar
djemmers
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Thu May 22, 2008 7:09 am

Re: Jumi - an universal multipurpose module

Post by djemmers » Sat Sep 06, 2008 8:22 pm

cooterbrown wrote:what is the difference between the module and the plugin?
It is simple (once you know it)
plugin -> for in content items (like artikles)
module -> to include files om module places (never done it myself)

greetz
One fine day I'll be a Joomla 'expert' !
Tornooi.net : Sports database (tournaments and camps) for Belgium and the Netherlands

cimerol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jul 08, 2008 1:26 am

Re: Jumi - an universal multipurpose module

Post by cimerol » Tue Sep 09, 2008 3:26 am

Hi all,

I was wondering if someone could tell me, if Jumi can open content in an iframe?

Thanks,

Norm

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Tue Sep 09, 2008 8:47 am

if Jumi can open content in an iframe?
Yes Norm, definitely.
Your script can contain any html, php, js codes.
MarHaj

cimerol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jul 08, 2008 1:26 am

Re: Jumi - an universal multipurpose module

Post by cimerol » Tue Sep 09, 2008 1:48 pm

Thanks MarHaj.

What i have is an uncategorized article. The only thing in the article is {jumi [my_page.php]}, i'd like Joomla! to open my_page.php in an iframe, the same way the Joomla! Wrapper works.

Question is, is this something that's done on my end in my_page.php or is this something i need to tell Joomla! to do? And the famous next question, how?

Thanks,

Norm

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Tue Sep 09, 2008 5:52 pm

i'd like Joomla! to open my_page.php in an iframe, the same way the Joomla! Wrapper works.
So write test.php
containing

Code: Select all

<?php
defined('_JEXEC') OR defined('_VALID_MOS') OR die( "Direct Access Is Not Allowed" ); //for security purpose
?>
<iframe src ="blabla2/my_page.php" width="100%"></iframe>
and into the article write {jumi [blabla1/test.php]}
Rem1: you have to chage paths blabla1 and blabla1 to actual ones
Rem2: real live demo of jumi with iframe can be seen here
MarHaj

cimerol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jul 08, 2008 1:26 am

Re: Jumi - an universal multipurpose module

Post by cimerol » Tue Sep 09, 2008 11:03 pm

Thank You! Almost seems too simple. I've been programming for many years, but this is my first Joomla! site.

Thanks again!

User avatar
djemmers
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Thu May 22, 2008 7:09 am

Re: Jumi - an universal multipurpose module

Post by djemmers » Wed Sep 10, 2008 12:01 pm

Code: Select all

<?php
defined('_JEXEC') OR defined('_VALID_MOS') OR die( "Direct Access Is Not Allowed" ); //for security purpose
?>
should we put that above all our included files ?
One fine day I'll be a Joomla 'expert' !
Tornooi.net : Sports database (tournaments and camps) for Belgium and the Netherlands

cimerol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jul 08, 2008 1:26 am

Re: Jumi - an universal multipurpose module

Post by cimerol » Wed Sep 10, 2008 2:07 pm

Ok, now i remember why an Iframe wasn't working. The content depends on who's logged into Joomla, and for some reason i cannot get the ID of the logged user in an iframe. I can only get it through Joomla's framework in an article.

I was trying to save a bunch of work. unless there is a way?

gsdpdhillon
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Sep 10, 2008 3:39 pm

Re: Jumi - an universal multipurpose module

Post by gsdpdhillon » Wed Sep 10, 2008 3:51 pm

Anyone have any experience running phpmyedit in Joomla using Jumi? When i do, it brings up the first page of the phpmyedit app but if i attempt to do anything, i get a blank screen. Im an absolute noob so any help is appreciated.

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Wed Sep 10, 2008 5:21 pm

should we put (defined('_JEXEC') ...) that above all our included files ?
It is better to do so.

If not, then users can theoretically run php scripts outside Joomla environment. E.g. they can directly write into their browsers http://www.somesite.com/path/somescript.php and it runs. If the security line is there, it is impossible.

Hackers have knowledge how to try if your script can serve their own purposes and can do that. I do not understand exact details but they can be found at the Joomla forum concerning security.
MarHaj

cimerol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jul 08, 2008 1:26 am

Re: Jumi - an universal multipurpose module

Post by cimerol » Wed Sep 10, 2008 5:29 pm

Does anyone know if there is a way to get the currently logged Joomla user ID through an iframe?

Can only get it to work using articles & Jumi.

Thanks,

Norm

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Wed Sep 10, 2008 5:32 pm

I cannot get the ID of the logged user in an iframe.
It is really impossible.
Unsolvable unless you can fully control the iframe content. Then you can probably make a bridge between Joomla and that application: Joomla reveals user, writes "he is in" somewhere (file, database) and application (iframe content) continuously checks what is there (file, database, ...) and alters its behavior.
I wrote probably. Never have done it. Just seems to me logical.
MarHaj

cimerol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jul 08, 2008 1:26 am

Re: Jumi - an universal multipurpose module

Post by cimerol » Wed Sep 10, 2008 5:40 pm

Thanks for the reply.

I did read a general Joomla book, maybe i'll buy a more advanced one.

h.meijerink
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Aug 16, 2006 8:15 pm

Re: Jumi - an universal multipurpose module

Post by h.meijerink » Wed Sep 10, 2008 7:28 pm

I have one jumi module and that's working with well.
When I install a second module (a complete copy) then de site will not open and I get a with screen.

When I unpublice the first module everything goes well and I get de second module.

What is wrong?

I have Joomla 1.5.6.

emm123
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Sep 10, 2008 9:59 pm

Re: Jumi - an universal multipurpose module

Post by emm123 » Wed Sep 10, 2008 10:06 pm

Hi,

Apologies I am a beginner with Joomla etc. I want to be able to add custom PHP code to my Joomla site that will display tables of data from my own MySQL tables. These tables would be displayed in the usual format (sortable columns by clicking on column headers, pagination, etc).

So can Jumi do this?

Thanks,
Jim.

cimerol
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Tue Jul 08, 2008 1:26 am

Re: Jumi - an universal multipurpose module

Post by cimerol » Wed Sep 10, 2008 10:17 pm

emm123, yes, jumi will do it. You may find it easier just to use Joomla's Wrapper.

emm123
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Sep 10, 2008 9:59 pm

Re: Jumi - an universal multipurpose module

Post by emm123 » Wed Sep 10, 2008 10:37 pm

Thanks for the reply.

That seems like a good idea - just use a wrapper and load in a PHP script stored somewhere on my server. However, there are several Joomla extensions similiar to Jumi out there, so what are the advantages of them over just using a wrapper?

Thanks again,
Jim.

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Thu Sep 11, 2008 8:47 am

I have one jumi module and that's working with well.
When I install a second module (a complete copy) then the site will not open and I get a white screen.
Just for the verification:
Did you install second Jumi module OR did you make a copy of it? Copying - not installing is the right approach.

If you have two Jumi modules published on one page and they cause white screen.
Yes it is possible to write scripts that do that. Really.
So I advice you to check up your script and try to prevent interaction between them. For example using variables that are shared between them.
MarHaj

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Thu Sep 11, 2008 9:05 am

emm123
These tables would be displayed in the usual format (sortable columns by clicking on column headers, pagination, etc)
In this case I advice you using mootools javascript library (built in Joomla 1.5) + moootools "tables" script which do that. Although I cannot give you reference for "mootools tables script" now I perfectly know they exists there (search "mootools sortable tables").
Including mootools effect scripts generally requires a) injecting js file into the Joomla header page, b) initializing some js variables and c) filling the content (in your cas MySQL query). All of this is quite doable via Jumi. I did it myself.
what are the advantages of them (jumi et al) over just using a wrapper?
Wrapper content is not indexed well by Google (and other search machines). Maybe there are another reasons there, but this one is so important to me, that I avoid using wrapper whenever I can.
MarHaj

sahertianr
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Apr 25, 2008 12:57 pm

Re: Jumi - an universal multipurpose module

Post by sahertianr » Thu Sep 11, 2008 10:24 am

Hi MarHaj,

I want to extend the content with the excellent Fabrik script. I am almost there. Almost… there is a small thing I can’t solve.

I use the plugin {fabrik view=table id=xx} within an content item.

I use in that table the elementtype “user” with User Data “id”. In the tableproperties under “data” I made a prefilter where username EQUALS a VALUE (an eval type) of the logged -din user. This works great. The logged-in user sees now only his own records!

But I also want the records belonging to the contentitem only. So I must automatically store the te content-id in the table. (the same as elementtype user for (id) does, but now for article-id)

What I can’t solve is this…
For example:

I am here in a content: http://www.mytestserver.xxx/index.ph...d=44&Itemid=54

When I push ADD (to add a record through the form) it switches from the above url to: http://www.mytestserver.xxx/index.ph...bleid=3&rowid=

So I can’t catch the article-id variable to store in the table. Is there a solution to store the article-id, where I came from?


Thanks,
Ron Sahertian

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Thu Sep 11, 2008 10:59 am

I can’t catch the article-id variable to store in the table. Is there a solution to store the article-id, where I came from?
It depends on what version Joomla, 1.0.x or 1.5.x you are using. There are objects with different names containing article id as a property.

Jomla 1.5:
$article->id
Joomla 1.0:
$row->id

You should call these things within an article.
MarHaj

sahertianr
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Apr 25, 2008 12:57 pm

Re: Jumi - an universal multipurpose module

Post by sahertianr » Thu Sep 11, 2008 11:27 am

thanks,

but my problem is: when I push ADD (see previous entry) I'll move away from the content-item.. How can I temporary store the article-id? Has Jumi a solution for that?

Thanks,
Ron

emm123
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Sep 10, 2008 9:59 pm

Re: Jumi - an universal multipurpose module

Post by emm123 » Thu Sep 11, 2008 11:33 am

Great. Thanks!

MarHaj wrote:emm123
These tables would be displayed in the usual format (sortable columns by clicking on column headers, pagination, etc)
In this case I advice you using mootools javascript library (built in Joomla 1.5) + moootools "tables" script which do that. Although I cannot give you reference for "mootools tables script" now I perfectly know they exists there (search "mootools sortable tables").
Including mootools effect scripts generally requires a) injecting js file into the Joomla header page, b) initializing some js variables and c) filling the content (in your cas MySQL query). All of this is quite doable via Jumi. I did it myself.
what are the advantages of them (jumi et al) over just using a wrapper?
Wrapper content is not indexed well by Google (and other search machines). Maybe there are another reasons there, but this one is so important to me, that I avoid using wrapper whenever I can.

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Thu Sep 11, 2008 12:29 pm

How can I temporary store the article-id?
Ron,
unfortunately I know nothing about Fabrik. So I will give you a general answer.

You can store variables values in a number of ways. In a file, a database or a global variable.
In your case I think the third approach is sufficient.

So how to do it through ADD button and reading it in an another page.
ADD can be o submit button of a form that uses method post.

Code: Select all

$html="<div>";
$html .= "<form action='destination_address' method='post' name='something'>";
$html .= "<input type='hidden' name='article_id' value='$article->id' />";
$html .= "<input value='ADD' class='button' type='submit' />";
$html .= "</form></div>";
echo $html;
This code sends, after pressing button ADD, via method POST the value of $article->id into the destination_address where you can read it. Actually method POST stores variable value into a global php array $_POST[article_id] which can be read anywhere in Joomla. In your destination address as well.

As you can see it is simple, is not it?
MarHaj

h.meijerink
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Aug 16, 2006 8:15 pm

Re: Jumi - an universal multipurpose module

Post by h.meijerink » Thu Sep 11, 2008 7:16 pm

MarHaj wrote:
I have one jumi module and that's working with well.
When I install a second module (a complete copy) then the site will not open and I get a white screen.
Just for the verification:
Did you install second Jumi module OR did you make a copy of it? Copying - not installing is the right approach.

If you have two Jumi modules published on one page and they cause white screen.
Yes it is possible to write scripts that do that. Really.
So I advice you to check up your script and try to prevent interaction between them. For example using variables that are shared between them.
I made a test with very simple 2th script,
<?php print "aap"; ?>
wich I loaded with a copy off jumi (only changed the name) on a differend module (user 2 and user 3).
and I got the same white screen.

When I unpublice the first one I get the second one with no problem.

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

Re: Jumi - an universal multipurpose module

Post by MarHaj » Fri Sep 12, 2008 7:45 am

I made a test with very simple 2th script,
<?php print "aap"; ?>
and I got the same white screen.
I did exactly the same. Two Jumi module copies on one page using the same script file above. Environment: Joomla 1.5.6 and Jumi module 1.2.0 for J 1.5.
I failed to obtain white screen. For me it works as it should.
So I suggest you to reinstall Jumi module from the scratch. Sorry, nothing else comes to my mind.
MarHaj


Locked

Return to “Modules”