Thursday 28 May 2009

Can't get Squeezebox in your Joomla! 1.5 Website

If you want a cool lightbox effect to be able to open up external links in an iframe then Squeezebox is the tool for you. And the good news is that it's already installed in Joomla 1.5. The only thing you have to do is activate it.

Instructions on how to do this are here. http://www.scribd.com/doc/2299973/Joomla-v-15-Squeezebox-in-your-Joomla-Website

BUT in the code in this tutorial they use '? >' if you copy this like for like then this will crash your website. you'll need to change this to '?>'

Heres the code that you need to enter in the 'TEMPLATE HTML EDITOR'

#################################################

<script type="text/javascript" src="<?php echo $this->baseurl ? >
/media/system/js/modal.js"> </script>
<link rel="stylesheet" href="<?php echo $this->baseurl ?

>/media/system/css/modal.css" type="text/css" />
<script type="text/javascript">
// <!--
window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: 'false'}); });
// -->

</script>
<script type="text/javascript">
// <!-
window.addEvent('domready', function() {
SqueezeBox.initialize({});
$$('a.modal').each(function(el) {
el.addEvent('click', function(e) {
new Event(e).stop();
SqueezeBox.fromElement(el);
});
});
});
// -->

</script>

################################################################


and in the article you want to call this effect up


<a rel="{handler: 'iframe', size: {x: width, y: height}}" href="address" class="modal">link name</a>

Thursday 14 May 2009

Pimp your Firefox with free Internet Development tools

Thanks to the Classes.org email newsletter I received the following list of Internet Development tools that can be added to Mozilla Firefox.

Mozilla Firebug is one that I've been using for a couple of months now and have raved about it in my blog before. It's excellent for working with CSS and you can even change things live. Here are a few more tools that I will be checking over the next couple of weeks. And best of all its all FREE - thank you FireFox.

FirePHP

Extension of the Firebug add-on to show PHP debug information on Firebug console.
https://addons.mozilla.org/en-US/firefox/addon/6149

- YSlow

Currently another extension of the Firebug add-on to measure page loading times and identify problems that make your pages load slower.
https://addons.mozilla.org/en-US/firefox/addon/5369


- Web Developer

Several tools like disabling Java-script, CSS, redirection, clearing browser caches, resizing the browser window to test pages with different sizes, etc..
https://addons.mozilla.org/en-US/firefox/addon/60

- User Agent Switcher

Switch the browser identification to test how sites respond to different browsers.
https://addons.mozilla.org/en-US/firefox/addon/59

- HTML Validator

Validate page HTML to help finding page generation errors cause by eventual bugs in the PHP scripts.
https://addons.mozilla.org/en-US/firefox/addon/249

- Java-Script debugger

Run page Java-script code with single step support and ability to show Java-script variable values during debugging.
https://addons.mozilla.org/en-US/firefox/addon/216

- LiveHTTPHeaders

Show page request and response headers.
https://addons.mozilla.org/en-US/firefox/addon/3829

Wednesday 6 May 2009

Recreating the Joomla 1.5 password from an outside application

The Problem: What I need to do is recreate the procedure that arrives me at the hashed password that is stored in my user table on our mysql database. that has been created by joomla.


_> this post http://forum.joomla.org/viewtopic.php?f=432&t=207689

has the following tip.

###############################

Joomla! 1.5 uses md5 to hash the passwords. When the passwords are created, they are hashed with a 32 character salt that is appended to the end of the password string. The password is stored as {TOTAL HASH}:{ORIGINAL SALT}.

To see how this is tested for authentication take a look at plugins/authentication/joomla.php lines 80-116.

###################################

so here's the solution .

-> we do a mysql search on the username and get the password.

-> split it at : and the second part is the Salt.

-> $pwd_partone = md5($pwd.$salt);
$pwd = $pwd_partone.':'.$salt;

and we should be able to get in.

Here's the code I have that works ->

// let's find out what the passwrod in the database is for this user
$sql1 = "SELECT * FROM jos_users WHERE username = '$uid'";

$rst1 = mysql_query($sql1);
$row1 = mysql_fetch_array($rst1);
$full_password = $row1['password'];
// now we have the password we'll need to split it into 2 at the ':' mark
$password_array = explode(':', $full_password);
// let's name those two elements to make it clear what's going on
list($full_hashed_password,$salt) = $password_array ;
// the next bit adds the salt to the pwd we have entered from our form
$pwd_partone = md5($pwd.$salt);
// let's rebuild the new password so we can check it against the one we have in the database
$pwd_revised = $pwd_partone.':'.$salt;
// all good to check now
if ( $pwd_revised == $full_hashed_password){
echo 'the password matches';
$login_success = TRUE;
} else {
echo 'the password doesn't match :(';
$login_success = FALSE;
}

?>


BE WARNED THOUGH

it's not over yet though the next stage is to make sure you check the privlages. at present all users will have access - unless that's what you want of course.

Friday 1 May 2009

joomla 1.0.15 Cookies must be enabled. login problem

The Problem;
Using login on our home page ( not admin - that works fine ) on the first attempt I get the message 'Cookies must be enabled!' - on the second sometimes third attempt it goes blank but has accepted as when returning to the screen I'm logged in. This is the same for me on FF and IE but Safari doesn't allow at all.


The solution:

I found the solution in this post http://forum.joomla.org/viewtopic.php?f=36&t=268622&start=60

there are many things to try, this is what worked for me.

edit configuration.php. Change the $mosConfig_live_site to have the "www". For Example - http://yourdomain.com becomes http://www.yourdomain.com.