Jumi - an universal multipurpose module

Discuss the development and implementation of Joomla! modules here.

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
FreyaSu
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Nov 11, 2008 1:00 pm

Re: Jumi - an universal multipurpose module

Post by FreyaSu » Tue Nov 11, 2008 1:28 pm

Hi!

I hope you can help me! It's after midnight!

I have Jumi installed as a plugin on J1.5.

I have an article with {jumi [file.php]} - no args. The paths are specified and it all works. That is until I connect to a database - my menu disappears (left module). I am using the extended menu module for the menu.

This is the file:

Code: Select all

<?php

defined('_JEXEC') OR defined('_VALID_MOS')OR die( "Direct Access Is Not Allowed" );

$dbhost = 'localhost';
$dbuser = 'aaa';
$dbpassword = 'bbb';
$dbname = 'ccc';

//debug echo "jelly";

$conn = mysql_connect($dbhost, $dbuser, $dbpassword) or die ('Error connecting to database, please try again later.');
mysql_select_db($dbname);

//debug echo "bean";	

//vars
$self = $_SERVER['PHP_SELF'];
$searchkey = $_POST['searchKey'];
$submitted = $_POST['submitted'];
?>
<H3>ROLL OF MEMBERS</H3><br/><br/>
<?php
if ($submitted == '1'){
	//do query... and list
	//debug echo $searchkey;
}else{
?>
<form name="search_form" action="<?$self?>" method="post">
		Find Member:
		<input type="text" name="searchKey" value="" />&nbsp;&nbsp;&nbsp;<INPUT type="submit" value="SEARCH">  
		<input type="hidden" name="submitted" value="1" />
</form>
<?
}
?>
NOTE: I have replaced the sensitive information.

Any ideas?

Waiting in anticipation!

Freya

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 Nov 11, 2008 8:43 pm

That is until I connect to a database - my menu disappears (left module).
Freya,
I bet this is because all your variables are (implicitly) global ones. That means they can rewrite or be rewritten other global variables (Joomla or 3rd parties) in given context.

How to avoid it?
Try, as a validation experiment, this:

Code: Select all

<?php
function test()
{
... all your code ...
}
test();
?>
I think you will see menu again. And, maybe, your working script too.

Rem: by the way try to use mighty Joomla API (docs.joomla.org) at the least for database manipulation: no need to connect, no need to set passwords etc. into the scripts. Speed and safety!
MarHaj

FreyaSu
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Nov 11, 2008 1:00 pm

Re: Jumi - an universal multipurpose module

Post by FreyaSu » Tue Nov 11, 2008 11:06 pm

I though of my var names too, in the mean time I had changed the vars to unique ones by adding a suffix to all of them. It did not work...

I tried creating the function, but the menu does not come back. The search still works.

The database I am querying is a non joomla database, it's a separate member's roll - so I have to connect to a different db. I could be sneaky and put the db into the joomla db, I will try that now.

Freya

FreyaSu
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Nov 11, 2008 1:00 pm

Re: Jumi - an universal multipurpose module

Post by FreyaSu » Tue Nov 11, 2008 11:15 pm

OK that worked!

So it was mysql_select_db that did it! mysql_connect did not affect the menu.

Thanks for your help.

Freya

jobielou
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 07, 2008 4:30 am

Re: Jumi - an universal multipurpose module

Post by jobielou » Wed Nov 12, 2008 8:39 am

Hi there,

For some reason I can't get a form that I've coded with php, html and javascript to recognise any javascript functions to work.
I've tried including the .js files with the addScript method as well as the addCustomTag($script) method.

global $mainframe;
$jDc= &JFactory::getDocument();
$jDc->addScript('/jumi/formValidation.js');

It seems when I view the source of the resultant page, it shows that the javascript file is included appropriately underneath other script inclusions in the head of the file.

ie. <script type="text/javascript" src="/media/system/js/caption.js"></script>
<script type="text/javascript" src="/jumi/formValidation.js"></script>

However none of the functions seem to execute properly.
In the form I have the following
<form name="regForm" method="POST" action="register.php" onsubmit="checkForm()">
where the checkForm function is located in the external formValidation.js file

When I click submit however, it immediately tries to find register.php bypassing the validation function altogether.

If I put a simple javascript alert function as the onsubmit value, the alert works fine.
So it seems that it is only external javascript functions that aren't being found.

Any suggestions as to what I might be doing wrong or what alternatives I could try testing?

Thanks.

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 Nov 12, 2008 9:06 am

So it seems that it is only external javascript functions that aren't being found
Hm,...
Try to reference external js file by its full pathname

Code: Select all

$document->addScript( JURI::base().'jumi/formValidation.js' );  
MarHaj

jobielou
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 07, 2008 4:30 am

Re: Jumi - an universal multipurpose module

Post by jobielou » Wed Nov 12, 2008 11:12 am

I tried as you suggested,
$document->addScript( JURI::base().'jumi/formValidation.js' );

but same result unfortunately, the script reference in the head tags looks fine but the form still submits and goes straight to register.php without validating

thanks for replying so quickly

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 Nov 12, 2008 9:10 pm

but same result unfortunately
Did you try another content of formValidation.js. E.g. alert? To verify it is not really included?
MarHaj

jobielou
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 07, 2008 4:30 am

Re: Jumi - an universal multipurpose module

Post by jobielou » Wed Nov 12, 2008 10:23 pm

MarHaj wrote:Did you try another content of formValidation.js. E.g. alert? To verify it is not really included?
I thought I did, as the whole time I was testing I had an alert statement as the first line of the checkForm() function...for some reason when I took all other code out of the file and left the alert statement on it's own it worked.

Thank you for making me go back to complete basics...!

So what is happening it seems is that as soon as it hits an error in the javascript code, rather than returning false or the error, it seems to stop processing, essentially return true and the form submits...?
i would have thought i'd get a javascript error ...am i being completely naive?... how is the best way to handle that? is it the jumi environment that prevents the error from displaying or is it something else that i need to do? i can't recall ever having to do anything special in the past with error capture for javascript...?

thanks so much MarHaj for you input, you are a saviour...sorry it wasn't more challenging for you!

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 Nov 13, 2008 8:55 am

i would have thought i'd get a javascript error ... how is the best way to handle that?
I do not know.
Just speculations: There is a server error reporting at global site configuration at Joomla backend. You can set up several levels there: from none to all. But javascript is more client matter then server one. So probably the Joomla settings will not have the effect on your task.
Really do not know. Sorry.
MarHaj

jobielou
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 07, 2008 4:30 am

Re: Jumi - an universal multipurpose module

Post by jobielou » Thu Nov 13, 2008 9:20 am

MarHaj wrote:Just speculations: There is a server error reporting at global site configuration at Joomla backend. You can set up several levels there: from none to all. But javascript is more client matter then server one. So probably the Joomla settings will not have the effect on your task.
Nevermind, I just went through testing the code manually until it all executed properly, sorry to be a bother with such a trivial issue after all. In the future maybe I'll look into proper error handling with javascript.

Can you tell me whether the jumi plugin can somehow handle POST variable retreival? I've used a workaround because I couldn't figure out how to do it. but if it can, I'd love to know how.
{jumi [filename.php] [$_POST]}
something like that, so that the php file can receive the POST vars through the jumi plugin statement?

Example usage may be when you have a return url specified with a payment gateway like paymate or paypal and they send back POST parameters regarding the transaction that has just taken place. Is that possible?

This forum has been immensely helpful and what a great feature jumi is! Thanks for all your help and suggestions MarHaj.

Prachi
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Nov 13, 2008 10:39 am

Re: Jumi - an universal multipurpose module

Post by Prachi » Thu Nov 13, 2008 10:47 am

I use Joomla 1.5. Jumi worked fine for me until I discovered that my members login that was created using mod_login is not working. It gives "Invalid Token" error. I have tried this with both jumi module and plugin. The error exits for both. Please help on this asap.

Cheers!!
Prachi

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 Nov 13, 2008 4:28 pm

{jumi [filename.php] [$_POST]}
something like that, so that the php file can receive the POST vars through the jumi plugin statement?
You can directly use $_POST variables (and all other global variables) in a fileneme.php. Jumi includes the filename.php as it was written line by line exactly at the place where {jumi blabla} is.
So no need to use Jumi arguments for that.
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 Nov 13, 2008 4:38 pm

I discovered that my members login that was created using mod_login is not working. It gives "Invalid Token" error. Please help on this asap.
Prachi,
I would like to if I knew how. mod_login and its modifications is not within my knowledge. Try developers forum instead please.
MarHaj

User avatar
KernelPaniq
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon May 19, 2008 10:19 am

Re: Jumi - an universal multipurpose module

Post by KernelPaniq » Mon Nov 17, 2008 1:22 pm

Cant get jumi to work in my Joomla 1.5.8 Instalation!

Only seeing {jumi [templates/xxxx/header.php]} instead of added htm code.
It worked inversion 1.5.7

Note: http://www.joomla.org/announcements/rel ... eased.html

and especialy http://developer.joomla.org/security/ne ... ility.html
and
http://developer.joomla.org/security/ne ... ility.html

I hope an solution is there. I try to find one for our problem now. Hope U guys find a way to let Jumi work again. Jumi Rocks, it makes joomla (almost) complete !
kernelpaniq.com -- in progress...

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 » Mon Nov 17, 2008 2:57 pm

Cant get jumi to work in my Joomla 1.5.8 Installation! Only seeing {jumi [templates/xxxx/header.php]} instead of added htm code.
Thanks for your announcement.

I am affraid that mine J 1.5.8 + Jumi 1.2 works.
Probably (i have not tested yet) it is because new 1.5.8 filtering options that can be set in article parameters:
general info:
http://docs.joomla.org/Why_does_some_HT ... n_1.5.8%3F
details:
http://docs.joomla.org/Screen.content.1 ... .28HTML.29

Mine filters are not set. And yours?
MarHaj

User avatar
KernelPaniq
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon May 19, 2008 10:19 am

Re: Jumi - an universal multipurpose module

Post by KernelPaniq » Mon Nov 17, 2008 3:34 pm

No, theyr notset.
But My Pictures apeared after Whitelisting SuperAdministrator
now changed to blacklist all but SuperAdmin. It still works.
:D tHX
kernelpaniq.com -- in progress...

bcancel
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sun Nov 02, 2008 1:15 pm

Re: Jumi - an universal multipurpose module

Post by bcancel » Thu Nov 20, 2008 11:14 am

Dear Martin,

I have a problem with accented characters from an included php file that are not rendered properly.

To isolate the problem I have created an article with the following content:

ACCENTED CHARATERS òàùèì
{jumi [/test.php]}

In test.php I have the following content:
ACCENTED CHARATERS òàùèì

This is what I get in my preview:

ACCENTED CHARATERS òàùèì
ACCENTED CHARATERS �����

What can I do to see the accented characters from the included php file?

Thanks
Bruno

bcancel
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sun Nov 02, 2008 1:15 pm

Re: Jumi - an universal multipurpose module

Post by bcancel » Thu Nov 20, 2008 3:46 pm

About my problem with accented characters from an included php file that were not rendered properly, I have found the solution: I have saved the php file in unicode format and the accented characters have magically appeared.
Cheers
Bruno

MrG
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Nov 21, 2008 5:02 am

Re: Jumi - an universal multipurpose module

Post by MrG » Fri Nov 21, 2008 5:16 am

Hi,

I have Joomla 1.5 and have installed the jumi module. Then realised I want the plugin instead. The module installed fine and works but the plugin will not install, the error says:

It was not possible to copy the selected file.
JInstaller::install: Failed to copy file: /var/www/vhosts/example.com/httpdocs/tmp/install_492641d326a90/jumi.php to /var/www/vhosts/example.com/httpdocs/plugins/content/jumi.php

Install Plugin Error

I have checked the write permissions on the tmp directory and thay're fine, and the module installed so what's going on???

I have tried searching for help on installation problems and one forum said to try unzipping and zipping the files separately, then upload them separately, that didn't work either as it seems to need all the files in one go.

rgmcgi
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Aug 03, 2008 11:51 pm

Re: Jumi - an universal multipurpose module

Post by rgmcgi » Sun Nov 23, 2008 8:20 pm

Hi,
I'm new to Jumi, but I think it seems to be perfect for what I need to do. Like another person on this thread, I'm trying to get a script to run to show an expedia "smartlink" which basically allows the visitor to enter flight info and dates before getting forwarded over to expedia.

I created a PHP file with the script plus the text "from file" called expedia.php. You can see the results of the file here: http://www.sanmigueldeallendemexico.com/expedia.php

The problem is that when I load that file into a Jumi module on the left side of my home page All I get is the title of the module "Test" and the text I included in the php file "from file". You can see that here: http://www.sanmigueldeallendemexico.com/

Does anyone have any ideas?

Thanks!
Rich

JasonShoulet
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Apr 14, 2007 10:32 pm

Re: Jumi - an universal multipurpose module

Post by JasonShoulet » Mon Nov 24, 2008 6:39 pm

MarHaj,

I love your plugin and have encountered the following issue. I have written an archive class to grab content from the db and output paginated results. All works fine except one thing, content mambot processing. I use the following code for that:

//load content bots hack part 1
global $_MAMBOTS;
$_MAMBOTS->loadBotGroup( 'content' );
$tmp_row = new stdClass();
$tmp_params = new mosParameters('');
//end load content bots hack part 1

//load content bots hack part 2, this goes within foreach loop to echo introtext
$tmp_row->text = $value->introtext;
$_MAMBOTS->trigger( 'onPrepareContent', array( &$tmp_row, &$tmp_params ), true );
$value->introtext = $tmp_row->text;
//end load content bots hack part 2

I get really weird results on my page when I try to integrate the content bots. For example, the {mosimage} tag disappears as if the content bot processed the data but no image is inserted (checked the html output and no img tag at all) Any ideas.

Thanks in advance!
Jason

JasonShoulet
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Apr 14, 2007 10:32 pm

Re: Jumi - an universal multipurpose module

Post by JasonShoulet » Mon Nov 24, 2008 10:03 pm

Through additional testing I found that the mosimage bot is the only one with problems as other mambots are processing fine. So it looks like there is no issue with processing mambots in the code included via jumi.

Thanks for such a great plugin!

Here's the revised code to get the mosImage bot to process correctly.

REVISED MAMBOT PROCESSING SECTION 2
//load content bots hack part 2, this goes within the display output function
$tmp_row->text = $value->introtext;
$tmp_row->attribs = $value->attribs;
$tmp_row->images = $value->images;
$tmp_params->def( 'image', 1 );
$_MAMBOTS->trigger( 'onPrepareContent', array( &$tmp_row, &$tmp_params ), true );
$value->introtext = $tmp_row->text;
//end load content bots hack part 2

Jason

jayjerome
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Mon Sep 15, 2008 3:23 pm

Re: Jumi - an universal multipurpose module

Post by jayjerome » Tue Nov 25, 2008 5:44 pm

Hello, from sunny, hazy Los Angeles!

I tried to post this here before, but it ended up somewhere else on the forum; hopefully I got it right this time!!!!

I downloaded your wonderful utility, and tested it with 'hello.php' and with a simple 'html' file -- both worked!! ;D

But I can not get satisfactory results with a more complicated 'html' program I downloaded to test on my local host joomla set-up.

The downloaded program is called 'FlippingBook - HTML Version' (at: http://www.page-flip.com/). It visually simulates a magazine or book, with individual pages you can drag and turn with your mouse. But when I try to run it inside a Joomla content article, using {jumi [images/flipbookhtml/index.html] I get an error message, requesting I 'Download Adobe Flash Player' with a link to the Adobe download page.

But Adobe is already installed on my computer. And if I click on 'index.html' in the 'images/flipbookhtml' sub-directory, the flipping page program launches properly in a browser window, outside of Joomla.

Is there a way to fix this, so the program launches inside my content article? I'm a writer (unfortunately, not a programmer :'( ) and I would like to use the flipping-page effect to graphically enhance parts of a novel I want to publish on my site -- and therefore simple, uncomplicated instructions to get it running (if feasible) would be sincerely appreciated!!!!

decbuck
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Fri Nov 07, 2008 1:02 pm

Getting started?

Post by decbuck » Wed Nov 26, 2008 10:04 am

Hi,

I have installed jumi plugin and module. I tried to embed a call to my php script in my article but on the web it just prints out the exact call.

I know it is probably something stupid. Any ideas? I think my paths are right. I hav no default path set.

I have dec.php in my public_html which is my joomla root.

clampert
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Oct 25, 2008 6:40 pm

Re: Jumi - an universal multipurpose module

Post by clampert » Thu Nov 27, 2008 3:47 am

Hi Martin!
I have upgraded to Joomla 1.5.8 from an earlier version, and the jumi plugin stopped working for me. My articles now only display {jumi ...}

I tried the solution that worked for KernelPaniq above, blacklisting all users but the superamin. It didn't work for me. I tried it without filters too, but still nothing.
I am using jumi 1.2.

It worked beautifully before, I love this plugin, and I am relying heavily on it.
Please help!!

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 Nov 27, 2008 7:56 pm

Sorru for the delay I was awaz for a few days.
Install Plugin Error?
There is no trick in it. Jumi plugin installs standardly.
Really I have no idea why it is not in your case.

But....
You can have problems with extensions installation if you did your text files (xml, php, ini, js) incl. Joomla core ones haven't proper end of lines corresponding to your server.
Try to fix it with EOL converter (freeware). I hope it helps.
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 Nov 27, 2008 8:04 pm

rgmcgi wrote:Hi,
I created a PHP file with the script plus the text "from file" called expedia.php. You can see the results of the file here: http://www.sanmigueldeallendemexico.com/expedia.php

The problem is that when I load that file into a Jumi module on the left side of my home page All I get is the title of the module "Test" and the text I included in the php file "from file". You can see that here: http://www.sanmigueldeallendemexico.com/

Rich
Rich,
In both cases
a) direct php: http://www.sanmigueldeallendemexico.com/expedia.php
b) module: http://www.sanmigueldeallendemexico.com
I have got the same result. I can see "from file" only.
That means there is no jumi problem. If you expect something else you should check up expedia.php: get expected results there first and then load it by Jumi. Should be the same again.
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 Nov 27, 2008 8:11 pm

JasonShoulet wrote: All works fine except one thing, content mambot processing.

I get really weird results on my page when I try to integrate the content bots. For example, the {mosimage} tag disappears as if the content bot processed the data but no image is inserted (checked the html output and no img tag at all) Any ideas.
Jason,
Loading mambots by mambots is too advanced problem for me.
So just an idea: it really depend on order of content mambots processing. This order can be arrange in a list of mambts in Joomla backend. Try to move change the order of mambots including Jumi.
Maybe it helps.
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 Nov 27, 2008 8:23 pm

Is there a way to fix this, so the program launches inside my content article? I'm a writer (unfortunately, not a programmer :'( ) and I would like to use the flipping-page effect to graphically enhance parts of a novel I want to publish on my site -- and therefore simple, uncomplicated instructions to get it running (if feasible) would be sincerely appreciated!!!!
Jayjerome,
Quick (and simple) solution:
Lets say all your flippin-page files and directories are copied into your Joomla site under book directory (that is index.html is under book, and there is css, img, pgaes, etc directories as well).

Write book.php that contains

Code: Select all

<?php
defined( '_JEXEC' ) or die( 'Restricted access' ); //for Joomla 1.5
?>
<iframe src="book/index.html" width="100%" height="600px"/></iframe>
and save this file somewhere e.g. unded book directory again.
Then write into article
{jumi [book/book.php]}
Save it, publish it, go to the Joomla frontend and enjoy it!
Last edited by MarHaj on Thu Nov 27, 2008 10:19 pm, edited 1 time in total.
MarHaj


Locked

Return to “Modules”