Step-by-Step Guide to Validing the Module's Code - 2008/06/17 19:39 I did this with Acajoom Plus 2.0.7 in Joomla! 1.5 with Legacy mode enabled.
Please note this is an Acajoom Hack, and will need to be re-applied at each upgrade.

Step One: Remove stylesheet link.
Here, we have to add one line to our template, and then apply an acajoom hack.
1a: Open up your template's index.php file, located at templates/your_template_name/index.php
BETWEEN the <head> and </head> tags, place this line:
Code:

 <link rel="stylesheet" href="components/com_acajoom/css/acajoom.css" type="text/css" />


1b: Now we need to remove this line from the module so it will not be called when the module loads.
open up the file: administrator/components/com_acajoom/classes/class.module.php

On line 111, you will fine the function 'create'. This is where we'll be doing all our acajoom hacks.
Remove this line (line 167) completely:
Code:

 $h .= '<link rel="stylesheet" href="' $GLOBALS['mosConfig_live_site']. '/components/com_acajoom/css/acajoom.css" type="text/css" >';



Now you have a valid css link.
Step 1b will have to be repeated every time you upgrade acajoom.

Step Two: Getting the javascript into a separate file.
The second part is a bit more tricky, but it's doable. (I think perhaps I may have lost a bit of functionality, but I can't figure out what I lost, if anything. Any admins know what downsides there are to this?)

The second set of validation errors is caused due to javascript being written directly into the html page code. To make this work, we need to create an external javascript page and then call this file from the module.

To do this:
2a. Create a new js document.
Here is the contents of the document:
Code:

 function submitacajoommod(formname) {     var form = eval('document.'+formname);var place form.email.value.indexOf("@",1);var point form.email.value.indexOf(".",place+1);         if (form.name.value == "" || form.name.value == "Name") {             alert"Please enter your name." );return false;         } else             if (form.email.value == "" || form.email.value == "E-mail") {alert"Please enter a valid e-mail address." );return false;             } else {if ((place > -1)&&(form.email.value.length >2)&&(point 1)){form.submit();return true;         } else {alert"Please enter a valid e-mail address." );return false;}}         };


I saved my js file in my template files so I wouldn't have to re-create this every time I upgraded acajoom. I named the file acajoom.js and saved it at: templates/your_template_name/js/acajoom.js (you will likely have to create a new folder named 'js' in your template directory)

2b. Now, we need to remove the javascript from the module, and call the new javascript file we created in step 2a.
In the file administrator/components/com_acajoom/classes/class.module.php
Find Line 133:
Code:

 if (!$loggedin AND $GLOBALS[ACA.'allow_unregistered'] AND $this->num == 1) {


Just underneath this line, we are going to remove lines 134-163. (This is everything to and including the line '</script>'; )
We replace these lines with this single line:
Code:

 $h .= '<script type="text/javascript" src="http://www.yoursite.com/templates/ your_template_name/js/acajoom.js"></script>';


(Do NOT forget to change this line with your domain AND your template's name!)

Now the entire acajoom module should be validating. Step 2b will have to be repeated every time you upgrade acajoom.

I'd love to hear comments! Any admins know of any issues with this method?

Post edited by: nathandiehl, at: 2008/06/17 19:40
  | | To post on the forum you need to sign in.
Re:Step-by-Step Guide to Validing the Module's Code - 2008/07/20 04:20 I love u!!

Only one error now,

Validation Output: 1 Error

Line 557, Column 36: there is no attribute "onClick" .
<span class="aca_list_name" onClick='return false;' ><span class="editlinktip ha.....

Any suggestions?
  | | To post on the forum you need to sign in.
Re:Step-by-Step Guide to Validing the Module's Code - 2008/07/20 04:22 Solved!

It was the uppcase on :

onClick = should be onclick


Best wishes / Z
  | | To post on the forum you need to sign in.
Acajoom Acajoom
- - - - - - - - - - - - - - - - - -
Content Statistics
Google Adsense Search
News
Acajoom PRO
Acajoom PRO
€79.95
Add to Cart






Lost Password?
No account yet? Register

Last Posts

Breathtakers