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
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 22, 2009 6:46 pm

I'm struggling with Jumi - cannot get Jumi to work inside the article page ...
Madallig,
I hope the video could help you:
http://jumi.vedeme.cz/index.php?option= ... mitstart=1

If not please state a nature of your struggle.
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 » Mon Jun 22, 2009 7:02 pm

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
Basbult,

As for me I am using phatpusion.net multibox as a standard.
First with jumi and later I incorporated it into the template.
Why I choose that? Not only for multiple options I need but because I know very little about mootools and javascript. Multibox is so easy that I implemented it within minutes.

I know I know ... it does not answer your question.
If only I had known ...

But maybe --- knock knock! Does somebody know? Please help Basbult!
MarHaj

User avatar
pchatel
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Sun May 24, 2009 12:03 am
Location: France, Normandie

Re: Jumi - the set of custom code extensions

Post by pchatel » Mon Jun 22, 2009 8:04 pm

I'm sorry Basbult, I can't help you, I don't know the solution !
And you MarHaj, you are too incredible !
Regards,
Philippe
joomla! 1.5.14

lukekelly
Joomla! Intern
Joomla! Intern
Posts: 97
Joined: Fri Jan 30, 2009 4:41 pm
Location: England

Re: Jumi - the set of custom code extensions

Post by lukekelly » Tue Jun 23, 2009 11:23 am

Hi All/MarHaj/Ed

Ive been using Jumi for about 6 months now for some custom php scripts; and it has a been a god send! I <3 Jumi... anyway :)

I have a problem with some code that is a very simple sorting script:

Code: Select all

<style type="text/css">
.client_report
{
 border:2px solid #ccc;
 background:#333;
 width:600px;
 padding:10px;
 text-align:center;
 overflow:auto;
 table-cell:2px solid #ccc;
 margin-left: auto;
 margin-right: auto;
 }
td {
 position: relative;
 width: 74px;
 height: 10%;
 margin: 0;
 border-width: 1px 1px 1px 1px;
 border-style: solid;
 border-color: #ccc;
 padding-top: 1em;
 vertical-align: center;
}
</style>

<div class="client_report">
<?php
 
error_reporting(E_ALL);
if (!isset($_POST['Submit'])) {
// form not submitted
?>
 
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<?php

require_once ('connect.php');
 
$res=mysql_query("SELECT DISTINCT client FROM jos_ay_client_activity order by client") or die(mysql_error());
echo "<select name=dropdown>";
while($row=mysql_fetch_assoc($res)) {
 
echo "<option value='$row[client]'>$row[client]</a></option>";
}
echo "</select>";
?>
 
<input type="Submit" value="Submit" name="Submit">
</form>
 
<?php
}
 
else {

// set server access variables
require_once ('connect.php');
$dropdown = empty($_POST['dropdown'])? die ("ERROR: Select from dropdown") : mysql_escape_string($_POST['dropdown']);
 
//Query
 
   $query = "SELECT * FROM jos_ay_client_activity WHERE client='$dropdown'";
    $result = mysql_query($query) or die (mysql_error());
$num=mysql_numrows($result);
 
 
echo "<b><center>Database Output</center></b><br><br>";
?>
<table>
<tr><td><b>Month</b></td>
&nbsp;<td><b>Year</b></td>
&nbsp;<td><b>Client</b></td>
&nbsp;<td><b>Surveys</b></td>
&nbsp;<td><b>Air Tests</b></td>
&nbsp;<td><b>Projects</b></td>
&nbsp;<td><b>Bulks</b></td>
&nbsp;<td><b>Entered</b></td>
</tr></table>
<?
$i=0;
while ($i < $num) {
 
$month=mysql_result($result,$i,"month");
$year=mysql_result($result,$i,"year");
$client=mysql_result($result,$i,"client");
$surveys=mysql_result($result,$i,"surveys");
$airtests=mysql_result($result,$i,"airtests");
$project=mysql_result($result,$i,"project");
$bulks=mysql_result($result,$i,"bulks");
$datetime=mysql_result($result,$i,"datetime");

echo "<table>"; // check width 
echo "<tr><td>$month</td>"; 
echo "<td>$year</td>";
echo "<td>$client</td>";
echo "<td>$surveys</td>";
echo "<td>$airtests</td>";
echo "<td>$project</td>";
echo "<td>$bulks</td>";
echo "<td>$datetime</td></tr>";
echo "</table>";
?><?
 
$i++;
 
}
}
?></div>
Sorry for long code but i think posting it would help. Basically i get the first part of the code up, but then when the filter is selected and submitted i get index page :( . I have tried the script standalone and it works fine.. to be honest i wasnt sure if this would work, but surely there must be a way to write it a bit differently so jumi can handle it? Any pointers greatly appreciated.

Thanks in advance!

Luke

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 23, 2009 2:49 pm

Basically i get the first part of the code up, but then when the filter is selected and submitted i get index page...I have tried the script standalone and it works fine
Lukekelly,
if it works as a standalone script and does not work within Joomla! I bet (well almost) that it is due to global variables interaction.

You know. When including a script into Joomla you include something into the environment where certain variables are defined. If your variables have the same names unintentionally the result of this interaction is almost always very, very, very unpredictable.

I greatly suspect these names in the script: $row, $query, $result
These are too common names. But there could be another ones too ...

Fix:
either wrap the whole script into the function and then call it or rename variables to something less predictable. E.G. prepend your initials (instead of $row write $luk_row).

Yes, I do think it is as simple as this. :)
MarHaj

lukekelly
Joomla! Intern
Joomla! Intern
Posts: 97
Joined: Fri Jan 30, 2009 4:41 pm
Location: England

Re: Jumi - the set of custom code extensions

Post by lukekelly » Tue Jun 23, 2009 4:29 pm

That simple huh! :)

I shall give that a try in the morning then, there's so much to Jumi I don't know! I also wasn't aware that you could rename variables in such a manor. While im here actually, where on old sites i would do a query on the page like ?orderby=datetime&dir=ASC, i obviously cant put that on the end of a Jumi link (im not using sef urls - and tried and doesnt work anyway :P), so for example:

http://192.168.0.1/Intranet/index.php?o ... me&dir=ASC

Is there any other way of doing this???

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 » Wed Jun 24, 2009 8:03 am

and tried and doesnt work anyway :P), so for example:
http://192.168.0.1/Intranet/index.php?o ... me&dir=ASC
Is there any other way of doing this???
Actually it must be somewhere else.
It should work.
The important thing is the first parameter fileid only.

I tried

Code: Select all

index.php?option=com_jumi&fileid=1&luke=kelly
and it worked perfectly. Sorry.

My set up was
- ALL three SEO Joomla stuffs in global parameters OFF
- standard Joomla htaccess ON (just to be sure)

Still does not work for you?
MarHaj

jroswald
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue May 19, 2009 11:32 am

Re: Jumi - the set of custom code extensions

Post by jroswald » Wed Jun 24, 2009 12:45 pm

I used Jumi to prepare a set of custom made articles that basically contained form fields for entering data into MYSQL database tables. All the queries worked fine to start off with, but now i have installed German as a language on my system (Joomla 1.5, I want the front-end to be bilingual) and the Joomfish translation component, everytime I run my jumi pages I am thrown an error such as..

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /homepages/2/d144643160/htdocs/joomla/components/com_jumi/jumi.php(25) : eval()'d code on line 8

And of course everything else fails, all other database queries on my joomla site work, but the jumi pages just dont (I also have another that does the same thing).

lukekelly
Joomla! Intern
Joomla! Intern
Posts: 97
Joined: Fri Jan 30, 2009 4:41 pm
Location: England

Re: Jumi - the set of custom code extensions

Post by lukekelly » Wed Jun 24, 2009 3:25 pm

Hi MarHaj

I tried what you suggested with the variables without any luck so far - should i change any more?

Code: Select all

<?php
 
error_reporting(E_ALL);
if (!isset($_POST['Submit'])) {
// form not submitted
?>
 
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<?php
 
$res=mysql_query("SELECT DISTINCT client FROM jos_ay_client_activity order by client") or die(mysql_error());
echo "<select name=dropdown>";
while($luk_row=mysql_fetch_assoc($res)) {
 
echo "<option value='$luk_row[client]'>$luk_row[client]</a></option>";
}
echo "</select>";
?>
 
<input type="Submit" value="Submit" name="Submit">
</form>
 
<?php
}
 
else {
 
// form submitted
// set server access variables
$dropdown = empty($_POST['dropdown'])? die ("ERROR: Select from dropdown") : mysql_escape_string($_POST['dropdown']); 
 
//Query
 
    $luk_query = "SELECT * FROM jos_ay_client_activity WHERE client='$dropdown'";
    $luk_result = mysql_query($luk_query) or die (mysql_error());
$num=mysql_numrows($luk_result);
 
 
echo "<b><center>Database Output</center></b><br><br>";
?>
<table>
<tr><td><b>Month</b></td>
&nbsp;<td><b>Year</b></td>
&nbsp;<td><b>Client</b></td>
&nbsp;<td><b>Surveys</b></td>
&nbsp;<td><b>Air Tests</b></td>
&nbsp;<td><b>Projects</b></td>
&nbsp;<td><b>Bulks</b></td>
&nbsp;<td><b>Entered</b></td>
</tr></table>
<?
$i=0;
while ($i < $num) {
 
$month=mysql_result($luk_result,$i,"month");
$year=mysql_result($luk_result,$i,"year");
$client=mysql_result($luk_result,$i,"client");
$surveys=mysql_result($luk_result,$i,"surveys");
$airtests=mysql_result($luk_result,$i,"airtests");
$project=mysql_result($luk_result,$i,"project");
$bulks=mysql_result($luk_result,$i,"bulks");
$datetime=mysql_result($luk_result,$i,"datetime");

echo "<table>"; // check width 
echo "<tr><td>$month</td>"; 
echo "<td>$year</td>";
echo "<td>$client</td>";
echo "<td>$surveys</td>";
echo "<td>$airtests</td>";
echo "<td>$project</td>";
echo "<td>$bulks</td>";
echo "<td>$datetime</td></tr>";
echo "</table>";
?><?
 
$i++;
 
}
}
?>
I didnt change $res, $dropdown and $num - well i changed $res but i no longer had anything to select in my dropdown box.

thought i would stick with luk_ prefix in your example :)

Also your example for sorting:

Code: Select all

index.php?option=com_jumi&fileid=1&luke=kelly
so say if my column name was 'month' i would just have the sort link as?:

Code: Select all

index.php?option=com_jumi&fileid=1&month
If so i cant make sense of how it would sort? I probably didn't understand too well :)

Apologies if so, and thanks in advance

Luke

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 25, 2009 8:21 am

...Joomfish translation component, everytime I run my jumi pages I am thrown an error such as..

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /homepages/2/d144643160/htdocs/joomla/components/com_jumi/jumi.php(25) : eval()'d code on line
Interesting.
By this report Jumi announces that included script has problems and cannot be evaluated.
Since the only thing that has change is adding Joomfish that means it influences Joomla in a way the script you wrote does not run in this changed Joomla environment.

So that's my hypothesis. And it could be wrong. What about jumi_demo.php (in the distribution package) or another simple "Hello world"? Does it fails too?
MarHaj

jroswald
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue May 19, 2009 11:32 am

Re: Jumi - the set of custom code extensions

Post by jroswald » Thu Jun 25, 2009 1:04 pm

Im getting close to finding a solution.

It seems that in the jumi.php body there is no problem whatsoever in making database queries, otherwise my custom page would not display.

The problem seems to be queries made inside the

Code: Select all

eval("?>".$appl->custom_script);
statement (i.e. in my jumi page).

Is there some kind of security setting that prevents queries inside eval strings from being executed ?

I cant remember setting anything to that effect, maybe its due to an update of the php version my server isusing..

jroswald
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue May 19, 2009 11:32 am

Re: Jumi - the set of custom code extensions

Post by jroswald » Thu Jun 25, 2009 2:40 pm

This is the code (within the custom_script) that is throwing the socket error,

Code: Select all

<?php
//defined('_JEXEC') OR defined('_VALID_MOS') OR die( "Direct Access Is Not Allowed" );



if(isset($_POST["submit"])) {datawrite(); buskeywrite(); datkeywrite(); netkeywrite(); buykeywrite(); datsecretwrite(); privacywrite(); $counter = 2;}

else {$user =& JFactory::getUser();$usr_id1 = $user->get('id');

$db = &JFactory::getDBO();

mysql_select_db("db285256637");
$getdataset="SELECT * FROM jos_comprofiler WHERE user_id LIKE $usr_id1";
$result=mysql_query($getdataset);
$gotdataset=mysql_fetch_object($result);
mysql_free_result($result);

$gotlat=$gotdataset->cb_latitude;$gotlong=$gotdataset->cb_longitude;

It throws first error at mysql_select line

It worked before, cant understand why it doesnt work now, unless as I said a php setting has been changed, but which one ?

P.S. all the rest of the HTML code parse without any problems and you can see the rest of the page.

I really need an answer to this as its been driving me nuts for two days, i cant find anything on the internet about settings regarding the eval function. Safe mode is off, and there are no disabled functions.

jroswald
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue May 19, 2009 11:32 am

Re: Jumi - the set of custom code extensions

Post by jroswald » Thu Jun 25, 2009 6:54 pm

Well would you believe it, I think I found the answer.

Its nothing to do with any flags and php settings, it has everything to do with the way MYSQL queries are written.

It would appear that code formulated as;

Code: Select all

mysql_select_db("db285256637");
$getdataset="SELECT cb_latitude, cb_longitude FROM jos_comprofiler WHERE user_id LIKE $usr_id1";
$result=mysql_query($getdataset);
$gotdataset=mysql_fetch_object($result);
mysql_free_result($result);
now has to be written something like

Code: Select all

$db2    = &JFactory::getDBO();
$db2->setQuery("SELECT cb_latitude, cb_longitude FROM jos_comprofiler WHERE user_id LIKE $usr_id1");
$gotdataset = $db2->loadObject();
Overnight the system ceased recognizing the former formulation and threw up error, oh well you live and learn.

Is there any way of getting the system to recognize the former formulation again?

I cant believe i'm the only one to have come across this problem

jroswald
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue May 19, 2009 11:32 am

Re: Jumi - the set of custom code extensions

Post by jroswald » Thu Jun 25, 2009 8:18 pm

As a backup to last post, I really would prefer a situation where I didnt have to rewrite all my jumi files. I just spent hours trying to rewrite them but that throws up a bunch of bugs too.

If there is anyway to get my jumi to recognise my old traditional mysql queries again...please tell me. I am also posting my experiences for the benefit of others, because this has taken literally days to sort out, so i hope someone out there can 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 » Mon Jun 29, 2009 8:17 am

jroswald,
I have noticed you had very busy days. I apologize I was not here were you need a hand (I was just out for a few days).
Overnight the system ceased recognizing the former formulation and threw up error, oh well you live and learn.
jroswald,
I thought it had not be due to night but after the installation of Joomfish translation component. Right?

So it seems Joomfish prevents your script to use ordinary php manipulation of MySQL.
I know nothing about Joom!fish. Absolutely nothing. But it seems to me reasonable there is something inside Joomafish that catches your queries and changes them to something else.

I think that contacting Joomfish developer and asking him could shed some light on the mystery.
MarHaj

jroswald
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue May 19, 2009 11:32 am

Re: Jumi - the set of custom code extensions

Post by jroswald » Mon Jun 29, 2009 2:32 pm

QED

Joomfish has a plugin called Jfdatabase which is for enabling translation of database queries.

I simply disabled this plugin and the problem went away,

Apart from an annoying printout saying "Joomfish system plugin not enabled"

I could do without that...

man, that took aaaages........ :'(

it was an interesting experience finding out more about how the Jumi plugin works, so it wasnt all wasted time. The funny thing is I started using joomla because I wanted to find a website solution which didn't involve so much programming knowledge...but ive ended up learning it anyway.

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4439
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Jumi - the set of custom code extensions

Post by Leftfield » Mon Jun 29, 2009 5:35 pm

Hi MarHaj, first i must to say great work!

I use Joomla! 1.5.11; Jumi 2.0.4.

I have a very strange problem. Implemented script is working but after submit button it throw me on default Joomla template rhuk_milkyway. I have mine template and dont have another assigned template or anything strange.

Switched off all SEF features but nothing. Had tried to wrap script and it is working normally. But if i use Jumi i had the problem with template.

Regards.
SEO & SEM Manager https://vujosevic.com/

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 30, 2009 7:38 am

Jroswald,
great, Great, GREAT!!!

Just tip: althought you can "do without translating" of the content of the script right now, you can go inside Jfdatabase plugin and check it up and accommodate it. There has to be (I firmly believe because most plugins do that) a regular expression that searches for some text in Joomla pages (in this case queries), takes it and change it to translated variant. So you can include into it just few lines - exception that if queries concerns Your own tables skip the rest of Jfdatabes functionality. That means: if my query then do nothing else continue.
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 30, 2009 7:47 am

I have a very strange problem. Implemented script is working but after submit button it throw me on default Joomla template rhuk_milkyway. I have mine template and don't have another assigned template or anything strange. Switched off all SEF features but nothing. Had tried to wrap script and it is working normally. But if i use Jumi i had the problem with template.
Leftfield,
this is the first time I have been reported of the behavior like this. So I have no explanation and ready made solution in hands right now.

Can you, please, show us here your form and a submit button tags with their attributes and describe it shortly? Thanks!
MarHaj

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4439
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Jumi - the set of custom code extensions

Post by Leftfield » Tue Jun 30, 2009 8:11 am

Test page is (hit Proces CSS button): http://www.joomlamontenegro.com/ekstenz ... /103-test1
It is Csstidy script. It is script for parsing and optimizing CSS.

Code: Select all

<input type="submit" value="<?php echo $lang[$l][35]; ?>" id="submit" />
For any case i upload complete file.
You do not have the required permissions to view the files attached to this post.
SEO & SEM Manager https://vujosevic.com/

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 30, 2009 3:10 pm

Leftfield,
thanks, I've got the point.
The script is the complete html page. Including header, html and body tags and global variables.
When included into Joomla! page via Jumi it will be a miracle if it works.
a) Joomla page has its own header, html, body. When creating ontehr ones within body section means creating The problems.
b) There are defined variables outside any function. They become global variables. If they hace common names as they really do, there is a high probability they will interract with Joomla! ones.
The result of both kinds of interraction is highly unpredictable. In your case calling another template.

Cure:
a) get rid of header. There are some javascript and css there - you have to inject them into Joomla header. You can find in docs.joomla.org how. It's suprisingly simple.
b) get rid of html and ody tags
c) as a precaution wrap current body into function or class or, at the leas, give global varibales rather unusual names - to prevent interaction.
d) Prey, prey, prey!

Well, there is really quite many things to do.
Maybe the tested approach, i.e. wrapping all the code into the iframe tag, will be sufficient solution? It's a matter of a minute and will definitely work. While rewriting the almost the whole code and testing it could take (for me) from a day or several days. Difficult to say.
MarHaj

User avatar
Soul Reaver
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Mon Mar 24, 2008 10:27 pm
Location: Oz

Re: Jumi - the set of custom code extensions

Post by Soul Reaver » Wed Jul 01, 2009 6:55 am

Hi All,

I'm sorry if this has been brought up and solved before but i have done a quick search and cannot find any references to it.

I am able to load up an external php file via the below line just fine:

Code: Select all

{jumi Site_Feedback_Form.php}{/jumi}
It loads the Site_Feedback_Form.php without any issues as all :)

However if I add an application via the Jumi Applications Manager and have the pathname set to Site_Feedback_Form.php and insert the following into an article:

Code: Select all

{jumi *1}{/jumi}
I get the error:

Code: Select all

Record ID:1 does not exist or is not published, or you have got insufficient rights to read it!
I have confirmed file permissions are ok and the path appears correct so i have no idea whats going on!

Environment:
Joomla 1.5.11
PHP 5
SQL 5
Jumi 2.1.0 Beta 3 (Same issue with Beta 2 as well).

Thank you.
I'm new be gentle :O

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 Jul 01, 2009 7:41 am

Record ID:1 does not exist or is not published, or you have got insufficient rights to read it!
Soul,
first you are welcome in this thread!

Second, the issue:
Please verify that Jumi application item 1 is published (in the Jumi application list).
If so, is it accessible via URL index.php?option=com_jumi&fileid=1 statement in the browser address line?
You have your file Site_Feedback_Form.php placed somewhere under Jumi root folder. Haven't you? Have you got read access to this folder as well?

I am sorry I have so many question. I am persuaded we will find the solution at the last and solved it once and forever.
MarHaj

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4439
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Jumi - the set of custom code extensions

Post by Leftfield » Wed Jul 01, 2009 8:53 am

Hi MarHaj,

Thanks for the hints, i already removed html and body but the main thing, as you sad, is the time. I will do the wrap.

Regards, thanks for helping me and congratz on good work!
SEO & SEM Manager https://vujosevic.com/

User avatar
Soul Reaver
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Mon Mar 24, 2008 10:27 pm
Location: Oz

Re: Jumi - the set of custom code extensions

Post by Soul Reaver » Thu Jul 02, 2009 3:45 am

Hi MarHaj,

Thank you for your continued support and extremely quick responses,

To answer your questions:
1. Yes the Jumi application (ID 1) is published with Access Level set to public (logged in as Super Admin anyway).
2. I have the Site_Feedback_Forum.php file within site/jumi_scripts/Site_Feedback_Forum.php and i have the Jumi System Plugin Jumi root set to site/jumi_script.
3. If i enter index.php?option=com_jumi&fileid=1 into the browser it loads the form fine.
4. Permissions have been checked (windows 2003 environment anyway) with the service running web having full access to the file.

Also some other things, if i place some custom script code into the Jumi Application it loads the custom_script fine but still no form (also no error shown even with Jumi Debug enabled if custom script present).

I have also checked with another php script file and get the exact same response.

I'm sure im doing something wrong i just don't know what yet!


Note: I wonder if it has something to do with the Windows 2003 environment?
I'm new be gentle :O

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 Jul 02, 2009 8:05 am

I'm sure im doing something wrong i just don't know what yet!
Soul,
thanks for your responce. I was able to figure out what's going well.
And i checked jumi source to find the reason.
Well and now ... how to say it ... well, I am feeling quite ashamed, stupid, idiotic, foolish, mindless, insane.
Jumi plugin does not include file the whole record from a component record, it includes just a written script not a file.
I really do not know now why I did it. It was either intentionally or unintentionally. Probably intentionally because Jumi cheatsheet states this explicitly.
I GREATLY apologize I did not realize it when answering you question and for all the troubles you had. Can you forgive me?

Quick fix:
in the "Custom Sript" area of the component write

Code: Select all

<?php include($_JUMI_ROOT.DS."Site_Feedback_Forum.php"); ?>
or you can use include_once, require, require_once as well.

Well.
I can make an option to include files form component too. For example with double asterrisk like
**ID. What do you think?
MarHaj

User avatar
bigspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Wed Apr 15, 2009 1:02 pm
Location: Nottingham, UK
Contact:

Re: Jumi - the set of custom code extensions

Post by bigspring » Thu Jul 02, 2009 11:02 am

Hi MarHarj,

Firstly I want to say thanks for one of the best extensions that is available for Joomla! It opens it up into a whole new world once you get to grips. I WILL be making a donation when I'm able to. Your work has not gone un-noticed!

Anyway - down to the problem that I've spent a couple of days struggling with!

I have an external script that I call in. This php script was written in Dreamweaver and copied in verbatim into Jumi, barring the usual "No direct access allowed script" and modifying the js & css script calls within this php script to use the Joomla method. Script as follows:

Code: Select all

<?php
defined('_JEXEC') OR defined('_VALID_MOS') OR die( "Direct Access Is Not Allowed" );
global $mainframe;
$document = &JFactory::getDocument();
$document->addStyleSheet('components/com_jumi/files/SpryAssets/SpryValidationTextarea.css');
$document->addStyleSheet('components/com_jumi/files/SpryAssets/SpryValidationTextField.css');
$document->addScript('components/com_jumi/files/SpryAssets/SpryValidationTextarea.js');
$document->addScript('components/com_jumi/files/SpryAssets/SpryValidationTextField.js');
?>

<form>
...
</form>

<script type="text/javascript">
<!--
var sprytextarea1 = new Spry.Widget.ValidationTextarea("spry_message", {hint:"Write us a message... something nice.  Why should we book your band?"});
var sprytextfield1 = new Spry.Widget.ValidationTextField("spryBandName");
var sprytextfield2 = new Spry.Widget.ValidationTextField("spryLocation", "none", {hint:"e.g. Royston Vasey"});
var sprytextfield3 = new Spry.Widget.ValidationTextField("spryGenre", "none", {hint:"e.g. \"Rock, Metal, Alternative\""});
var sprytextfield4 = new Spry.Widget.ValidationTextField("spryMySpace", "none");
var sprytextfield5 = new Spry.Widget.ValidationTextField("spryWebsite", "url");
var sprytextfield6 = new Spry.Widget.ValidationTextField("spryContact", "none");
var sprytextfield7 = new Spry.Widget.ValidationTextField("spryPhone", "integer");
var sprytextfield8 = new Spry.Widget.ValidationTextField("spryEmail", "email");
//-->
</script>
The problem is this: it calls in the scripts fine, but form validation is not happening as expected. What I would expect to see is that if the user clicks submit without correctly filling out the form, an error will be shown next to the appropriate input showing what is required (like almost all forms). However, it submits the form regardless of any errors and does not warn the user.

I know the CSS and JS files are being called correctly otherwise I would not see the relevant hints on the form.

Do you have any idea why it's behaving like this?

Many thanks,


Jon

User avatar
bigspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Wed Apr 15, 2009 1:02 pm
Location: Nottingham, UK
Contact:

Re: Jumi - the set of custom code extensions

Post by bigspring » Thu Jul 02, 2009 11:19 am

One final point - the form works absolutely fine when it's not called through Jumi so I know all the scripts are working correctly from that point of view.

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 Jul 02, 2009 11:34 am

...one of the best extensions...
Bigspring, thanks to your appreciation! I will hand it to Ed, the other Jumi developer as well.
What I would expect to see is that if the user clicks submit without correctly filling out the form, an error will be shown next to the appropriate input showing what is required (like almost all forms). However, it submits the form regardless of any errors and does not warn the user.
Bigspring, have you tried to make it running outside Joomla? If no I think you should try to do it first (with slight accommodations).
As for myself my javascript knowledge is too far to even guess why the hell the form is submitted. But if it occurs in Joomla! environment only I would bet some interaction between Joomla and the script global php or javascript variables (except of enabling javasript in the browser :-) ).

Sorry Bigspring. But maybe another user of this thread will know. We'll see.
If no, try forum/thread dedicated to development: http://forum.joomla.org/viewforum.php?f=509
MarHaj

User avatar
bigspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Wed Apr 15, 2009 1:02 pm
Location: Nottingham, UK
Contact:

Re: Jumi - the set of custom code extensions

Post by bigspring » Thu Jul 02, 2009 11:39 am

MarHaj wrote:Bigspring, have you tried to make it running outside Joomla? If no I think you should try to do it first (with slight accommodations).
I guess you'd already posted by the time you saw my last post, it does indeed work absolutely fine outside of the Joomla/Jumi environment. That's why I'm so confused!


Locked

Return to “Extensions for Joomla! 1.5”