Friday, 3 July 2009

Transferring a website using SSH

The following is a list of SSH commands to move a website from one location to another.

Once you SSh'd in then change directories to one higher than the directory you want to zip

>> example - if you're in the directory you want to zip already

cd ..

>> otherwise

cd public_html/


>> now to zip the website


tar -czvf fileName.tar.gz folderName/




- Now you need to SSH into the website you
're transferring to.


!!! when doing this on the project in had I first needed to delete what was on there.

> to do this I deleted the directory in question

rm -r public_html/

> and recreated that directory

mkdir public_html/

////////////////////////////////

now get yourself in the folder you want...

and use the following commands to to unzip your website

>>

wget http://www.siteyourzipisat.co.uk/fileName.tar.gz

tar -zxvf fileName.tar.gz


//////////////////////////////////////

hopefully it'll be as easy as that for you as well :)




possible search terms used to find this article.

ssh unzip tar.gz
ssh zip website
ssh unzip website
ssh compress site
ssh compress website
ssh transfer website
ssh transfer joomla website

Tuesday, 2 June 2009

How to show Module Positions in Joomla

I found this tip on a forum on Joomla.org. After having not booking marking the forum I found it very hard to find again. Hopefully this blog might help someone find this information quicker.

To see Module Positions you do not need to add any extensions, it's as easy as adding ?tp=1 at the end of your URL.
For example www.wavelengthmag.net?tp=1

Search terms that may be tried to find this information.

joomla show developer details
joomla display developer details
joomla display developer information
joomla display developer info
joomla show item details
joomla show module details
joomla display module details
joomla display module information
joomla display module info
joomla show path info
joomla show path infomation
joomla display path info
joomla display path infomation

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.

Wednesday, 22 April 2009

Inserting a table into Magento store description creating line space.

Here's a quick one.

The Problem: When inserting a table into the descriptions field inside the admin area of a Magento store the output creates line spaces - resulting in 'br' tags on your page.


The solution: you need to take the spaces out of your code

for example you may have

<tr>
<td>hello</td>
</tr>
<tr>
<td>world</td>
</tr>


you'll need to change this to

<tr><td>hello</td></tr><tr><td>world</td></tr>

Then you will not have any spaces in the output. Just a very confusing view of spaghetti code to work though in descriptions tho.