Tuesday 1 December 2009

joomla finding out if someone is logged in

I was just hardcoding a quick bit into my Joomla template. Which I'll hopefully make into a component when I have a little more time. What i needed was a bit of script that showed something if the user is logged in


$user =& JFactory::getUser();

if ($user->guest) {
echo 'message for guest';
} else {


$username = $user->get('username');

echo 'message for member';
}

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


joomla finding out if someone is logged in

joomla hard coded check for registration

joomla is user logged in

Wednesday 18 November 2009

Joomla - Using MooTicker with Photoslide GK2 component

I'm was having a problem with running these two Joomla components at the same time.

Here's the solution:


> Go to your MooTicker module


> under 'parameters' change 'simple mooticker mootools library' to disabled.


> I then needed to change the browser speeds as well.

Sunday 25 October 2009

Book Review: Working Effectively With Legacy Code by M Feathers

Although this book's code examples are in C++ and othe languages that are not PHP, which is the code that I mainly work in, it is an excellent book that provides a lot of food for thought in how to deal with 'Legacy Code' and how to make improvements and add features to old code in a way that can be tested and not send a trail of destruction through out your code.
I actually even recommend this book if you aren't working on a Legacy system but your starting a fresh project of a decent size and haven't got much experience then this book will save you a lot of time and money as you are likely to see what mistakes to avoid before you make them.

Sunday 18 October 2009

Anyone want a Booking Availability Calender for their website

I've recently been having quite a bit of interest in the PHP booking calendar that i put together. However I'm not 100% happy with the back end code. The functionality of it is fine but some is written in procedural code and I'd like it to be fully written in OOP. It would then be better for other programmers who'd like to use the code and add their own features.

Anyway to cut a long story short if their's anyone who would like to add a booking calender to their website I'd do the next one at half price.


Here are the features of the Booking Availability Calender.

* Able to Add/Edit and Delete rooms.

* Each Room to have a couple of images

* Each room has a title and description

* Check Availabily button that then provides a price information chart and calender for the current month.


* the ability to add and delete days from the calender.


If you would like to see some screen shots and more infromation on the booking calender then have a look at this article 'Availability Calender' Or to download the code I have wrote so far take a look at this site 'PHP Booking Availability Calender'

Wednesday 14 October 2009

Setting up restricted file content for your users in Joomla

What I want to do is have a more personalised experience on my www.littleripples.com website. So that customers can log into there accounts and see quotes, invoices, timesheets, use helpdesk and have special messages for them only.

I searched through a large amount of extentions that would do what I was looking for, most of them were based around the highly recommended Community Builder - Joomla Extension , although CB itself is free the add ons to do what I wanted are not.

After some searching - here are some of the key phrases I searched.
joomla article permissions free
JomSocial Profile
joomla community builder article restriction

I found this one http://extensions.joomla.org/extensions/access-a-security/backend-a-full-access-control/7010





Follow the instructions here ->
http://blueflyingfish.no-ip.biz/joomla15/noixacl_v206_install_2.htm

One thing I did find though was that I was having problems finding the relevan files to download. I found using this technique to be useful and that was to type the file name and search the site from google ie 'mod_mainmenu_noix.zip site:http://joomlacode.org'


Once set up you'll find that you can't access any of your articles. You'll need to open up the permissions in the 'Manage Groups' section.
Here's how to do it.

> goto 'components' on the main menu
> scroll down to 'Access Control'
> click on 'Manage Groups'
> go to the group that your in ie 'Super Administrator'
> on the left hand side theres a menu named 'Adapters' click on content
> then you'll need go through all the 'sections' and open up all the catergories so you have permissions to make changes, edit, add etc

Thursday 1 October 2009

Increase Session Times

One customer has recentlty complained that it some cases they do not get long enough to complete an order. This is down to the default settings, what needs to be done is the session time needs to be increased. to this you can either increase the session time out in the session call itself -

ini_set('session.gc_maxlifetime', '28800');


or a better way would be to include it in your php.ini file .

session.gc_maxlifetime = 1440

Note: session.gc_maxlifetime timescale is 3600 = 1 hour


If you're on a shared server you may think you haven't got access to your php.ini file. But what you need to do is open notepad - write the above line in it and save it as 'php.ini' in your 'public_html' folder. Once saved this will add this line to your php settings.

Friday 25 September 2009

Blank Admin links in Magento

On the website Rock Marine Services Ltd I noticed a couple of problems in the admin area - firstly the link 'CMS/Manage Pages' was blank and 'system/configuration/Catalog' was blank also.

>> take a look at this forum http://www.magentocommerce.com/boards/viewthread/44474/


SSH is really the only way to be doing this work, its much much quicker than ftp. For SSH instructions that will cover all you need for this job see my instructions at
Transfer a website using ssh . It should be in the top five links there.

Wednesday 23 September 2009

Receiving the error 'Warning: simplexml_load_file() [function.simplexml-load-file]: (null)(null)*/lib/Zend/Locale/Data/tr.xml:2104: parser error : out

These seems to be a problem that's effect installation on Heart Interntet shared hosting accounts.
I found the solution for this on this forum thread http://www.magentocommerce.com/boards/viewthread/44409/P15/

you need to open your .htaccess file in your magento folder and add the following


RLimitMEM 1280000000
RLimitCPU 150 200
RLimitNPROC 25 30

Monday 21 September 2009

Joomla intermittently diplaying broken or blank page in Internet Explorer 8 -

This problem was highly strange as it does not appear in all IE 8 all the time. Infact I had done extensive tests on IE 8 on my home computer and NEVER encountered the problem. However my colleague could see it on his, but intermittently. Here is a list of key phrases that kind of sum up this problem, it gives you an idea of what a bizarre error it was.

* Joomla blank page in ie 8
* joomla blank page in internet explorer 8
* joomla only left menu blank page in ie 8
* joomla only left menu blank page in internet explorer 8
* joomla htmlmap ie 8 problem
* joomla htmlmap internet explorer 8 problem
* Joomla blank page in some ie 8
* Joomla blank page in some internet explorer 8
* joomla sometimes displays blank page in ie 8
* joomla sometimes displays blank page in internet explorer 8
* joomla sometimes displays broken page in ier 8


I had to go around to his to fix the problem as otherwise the 'lag time' would be too much. ie I would have to run a test - then call him to find out the effect!
Once at his place the problem had disappeared, on multiple refreshes the problem re-arose. After turning each module on and off and then multiple refreshing I found the problem coming from this component
'html maps' that can be found here 'http://extensions.joomla.org/extensions/style-a-design/design/7332'
The solution for me here was to move all items that I had in image maps to 'Flexbanner' - where you can just paste all your code in if you wish. Flexbanner can be found at http://extensions.joomla.org/extensions/search/flexbanner

I hope this item helps others. Yet again another reason to hate internet explorer.

I found this comment on IE 8 that really sums it up for me "I hate internet explorer. It is an absolute nightmare and the newest edition not being fully standards compliant without the need to go diging around in settings is ridiculous.

That said, the average computer user plugs in the address on whatever default browser and settings are included with the PC and complains when it doesn't look right. Whos fault is it? Mine of course. "

Check out the IE 8 Incompatibilty list is you still don't believe how bad IE is! Even microsofts own website is on it!!!!!
http://www.cmswire.com/cms/web-cms/popular-websites-incompatible-in-internet-explorer-8-003992.php

Friday 18 September 2009

Transfer a Magento website using ssh

BEFORE YOU START BACKUP EVERYTHING - for commands on doing that you can check this blog Transferring a Website using SSH

> first of all we need to zip the website

tar -czvf fileName.tar.gz folderName/

Secondly backup your mysql. The easiest way to do this is to use the 'Export' feature in myMysqlAdmin

> next ssh into the website that your transferring to.

>if you need to delete a folder here you can use
rm -r public_html/

> now its time to go and get the zip file


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

!note - you may need to move this file to somewhere you can see it if it's in a directory deeper that public_html/

> to unzip the file

tar -zxvf fileName.tar.gz


> make a mysql backup
mysqldump -h hostname -u dbUsername -p dbName > db_backup.sql

note! like myself you may prefer to use phpMyAdmin

> set permissions -
either by using ssh. - first of all be in the public_html/ folder

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

or use this file chmod.php to sort my chmod settings.
You can fin this here ->
http://www.magentocommerce.com/boards/viewthread/17682/


> Open the file local.xml under the "/home/username/public_html/magento_dir/app/etc/" directory in your text editor. Locate the and make the necessary changes.
< default_setup >
< connection >
< host >< ![CDATA[localhost]] >< /host >
< username >< ![CDATA[dbUsername]] >< /username >
< password >< ![CDATA[dbPassword]] >< /password >
< dbname >< ![CDATA[dbName]] >< /dbname >
< active >1< /active >
< /connection >
< /default_setup >



> empty the cache under var/cache

Monday 14 September 2009

Keyword and Key Phrase Ranking Success on Google

This is just a quick blog to brag about some recent success I've been having getting Hillside Glastonbury B&B - Self Catering - Guesthouse listed on google.

If you search for Glasonbury B&B on Google, we come up 2nd - Click here for a Google Search on Glastonbury B&B and make sure you click on the "Hillside Glastonbury" link to see the page we're linking to.

And for the keyphrase Glasonbury Self Catering we come top :). Click here for a Google Search on Glastonbury B&B Again make sure you click on the "Hillside Glastonbury" link to see the page we're linking to.

These are the most important key phrases to us but we also rank highly in many others.

If you want to get your website rank highly on Google or many other websites then please contact us through Little Ripples Website for a prices and a plan to increase your web traffic.

Tuesday 1 September 2009

joomla section ex category view ie8 problem

jommla ie8 table render problem

joomla section ex ie8 render problem.

IE 8 table rendering problem

I have to agree with these comments about IE 8 form this post -

"hate internet explorer. It is an absolute nightmare and the newest edition not being fully standards compliant without the need to go diging around in settings is ridiculous.

That said, the average computer user plugs in the address on whatever default browser and settings are included with the PC and complains when it doesn't look right. Whos fault is it? Mine of course."


It's cost me so much time on jobs aswell. Anyway if you're using section ex and are having this problem also then here's what you need to do.


>> open the file -> \components\com_sectionex\views\category\tmpl\default.php

search for 'colspan="2"'

and DELETE it.

at the time of writing I have not noticed any negative side effect of deleting this, but now tables display in IE 8 displays fine.



I found the solution for this here (which is for a normal cat view, but the fix is the same) ->

http://forum.joomla.org/viewtopic.php?f=541&t=409310

Monday 17 August 2009

Joomla vs Magento vs Oscommerce - for an online catalogue / store

Joomla vs Magento vs Oscommerce - for an online catalogue / store


On pricing up a current job I have the above dliemma. There are other solutions to providing an online store no doubt such as Zen Cart ( i've not used Zen Cart but it's likely to be an apporvement on Oscommerce as it was a break away group that
created it ), making one inhouse (not sure why you'd want to put yourself through the pain of this, I wouldn't reccomend such a large task on your own) and doing a search on a script database like hotscripts.com gives you a whole list http://www.hotscripts.com/search/php/online+store.

However the 3 above are ones I've used before so am familiar with them.



The Website criteria.
_______________________


Design is a big issue. the customer has a precise view of how they want the site to look.
An online Catalogue of products with easy navigation.


The solutions discussed.

Magento -> This is one of the most advanced php open sourced shopping cart solutions around. Using a Zend library and a sound MVC (Model View Control) principles. It certainly appeals to me, the only thing is getting my head around making templates->
This post indicates that design shouldn't be a problem
http://www.magentocommerce.com/boards/viewthread/28875/ .

Another thing that also makes me lean away from Magento is that it does at present seem to have issues when upgrading that can cause serious headaches. I'm sure this will be less of an issue in the near future though.


Oscommerce -> The old trustworthy one!
The Plus Points.
1. Because I've been using this one for quite a while then I am fully confident about manipulating the design to fit my needs.
2. Again with familiarity the coding is easy to understand making applications that need to be made easier.

The Minus Points.
1. As Oscommerce is an old Open Sourced project then the framework itself could now do with an overhall in my opinion. V3 beta has now been realeased so some issues may have been sorted.
2. A lot more applications now seem to be being made for the other solutions here, therefore this may cause more work in the long run.
3. I spent an eternity getting Google Merchant to work on Oscommerce without a fully succesful outcome in the end.


Joomla ->
Joomla's answer is a CMS ( Content Mangement Sysytem ) - After basic installation you can then add extensions, which are easy to install. Most of the time taken in setting up configurations to suit you're site. Some of these Extensions cost but most are free ( although a small donation should be made ).
The last job I did included a reskin for Joomla. Please visit www.littleripples.com for previous work updates. And I am now confident the template can be changed to fit any design needs. And if need components can be changed to fit the needs of the design.


So in conclusion...


Joomla wins this battel for me, however Magento experts would probably favour Magento as it is more focused on the shopping cart side of things. I believe that in using Joomla I will be able to provide future developments for the customer at a much better price.

Friday 14 August 2009

Making Additional Landing Pages for Google

I'd used this tool a few months ago and then on returning to Google Webmasters Tools I couuldn't find it. Thus the reason for this blog.

it's google 'Website Optimiser' that we need to use.

You can find this through the Google webmaster page -> http://www.google.co.uk/webmasters/
Sign into webmaster tooks and search for 'Website Optimiser'


It's these keywords stay in glastonbury, glastonbury bnb that i am trying to get listed on http://www.hillsideglastonbury.co.uk/

and to strengthen 'glastonbury b&b'

Monday 10 August 2009

Transferring Large Databases

The following is a blog from 3 years ago.

I still refer to it on occasion, it's definitely still relevant if your using your own server.  However I do have a quicker method for when I'm doing this on Heart Internet - and thats to

> go to your control panel
> find and click on 'MySQL Databases' 
> find the text 'To restore a database which you've previously backed up, click'   -
> just locate the file and off it goes to install it for you.

Anyway here's the SSH way to do a large MySQL database

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

One thing that has been slowing me down recently when transferring a website is transferring large databases. On searching it looks like being able to do this by SSH ( shell access ) should speed the process up greatly.

This article lists how to do this by mysqldump.

http://patchlog.com/databases/three-methods-to-transfer-a-mysql-database/

However after several attempts I could not get my SQL to save in the file properly and due to the old 'time is money' syndrome I ended up saving the file in the good old phpMy Admin panel. Saving the document was never my problem anyway it was always importing where it would crash on me or I'd spend time splitting the tables up!!
However if anyones got any tips on the export side of the above article it'd be good to know.

Anyway so here's the method I am now using which works for me.

1. Use the 'Export' feature in mysql and tick 'save as file' - compression 'none'
2. Upload the file to the server of the website you want your database to go to.
3. Use this statement in SSH ->
mysql -u "your username" -p "your_database" < filename.sql


If it's a really large file you may want to zip it up and then unzip it using SSH as well. My blog on 'transferring a site using SSH' at the end of July may help.

Transferring mysql database
Transferring mysql using SSH
Importing mysql database
Importing large mysql database

Monday 3 August 2009

Flash Movie keeps looping in Explorer.

the Problem: All other browsers are fine but in Explorer ( checked in 7 & 8) the flash movie does not stop eventhough there is stop action placed in the movie. The problem is with Macromedia flash MX not generating the correct embed code.


The solultion:

the Flash MX generated code looks like this

< PARAM NAME=movie VALUE="images/flash/movie.swf" > < PARAM NAME=quality VALUE=high > < PARAM NAME=bgcolor VALUE=#FFFFFF >
< EMBED src="images/flash/movie.swf" loop=false quality="high" bgcolor=#FFFFFF WIDTH="150" HEIGHT="200" NAME="Movie" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" >< /EMBED >



I found that if I added this code before the < EMBED

< PARAM NAME=loop VALUE=false >

then the loop would also stop in Explorer

Wednesday 29 July 2009

Adding a class suffix to a module that doesn't have one.

They are moments when you just have to love Joomla, and this was definatly one of those moments as this was very very easy to fix.

I had downloaded the extendsion Simple Tags http://extensions.joomla.org/extensions/search-&-indexing/tags-&-clouds/5422/details#action .

The only problem with it was the box wasn't displayed as I wished. What I wanted was to make it inline with my other menus that had the class name module_menu. On installation of the extension it was only 'module' and there was no input area in admin to add a class suffix.

THE SOLUTION: all I had to do was add this line to the file mod_simpletags.xml above the final < / params > tag.

< param name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="PARAMMODULECLASSSUFFIX" / >

and that was it Joomla did the rest for me :)))

Thursday 16 July 2009

css - margin-top not working safari

This was my problem.

I had a table that was using the command 'margin-top' to position itself inside a < div >
It displayed fine in Internet Explorer and Firefox but not in Safari.


my original code was

.module div div div table{
margin-top:45px;
}


I found the solution for this by trial and error.

While testing though I found it helpful to activate the Safari developer tools. You do this by going to ->
Edit->preferences-> then clicking on the tick box for 'Show Develp menu in menubar' at the bottom of the pop-up box.

The solution was to leave the class above blank and target the tbody that lies below the table - ie ->
.module div div div table tbody{
display: block;
margin-top:45px;
}


Please note in your code you may find it easier to just put a class in the table and access it from there, rather than using the tree of < div >s that I have.

css - show full background image on hover link

I found it quite difficult to find the solution to this one.

So I thought I'd blog it so the solution may be easier to find. Here's some search terms i tried.

css show full background image hover link
css background on hover link problem
css background image show full
css hover background stretch

The solution for this I found through this link.

http://www.daniweb.com/forums/thread109916.html

Basically it's the css on the :link and not the :hover that you need to change. This is where I was going wrong.

the solution then for me was


a.link:link, a.link:visited {
text-decoration: none;
color: #fff;
font-size: 14px;
display:block; /*This Cover Full TD */
width:100%; /*This Will Make Fixes Size Link (Use Image width)*/
text-align:left;

}

.link:hover {
background:#000 url(../images/menu_bg1.gif) center center fixed;

}


you will then need to stick the class name in you link html, ie

Example

Wednesday 15 July 2009

Adding a feature to a Joomla Component

This is a small change I made to a ccboard ( which is an excellent Joomla forum addon by the way ) .
You will need to have the module for ccboard latest_posts.

Before I go on I found two documents online that were very helpful in understanding how to make changes to a Joomla Component
http://docs.joomla.org/Creating_custom_template_parameter_types
http://help.joomla.org/content/view/777/125/

Basically allows you to show recent posts from a specific catergory. The default '0' will show all cats.
Before you start BACKUP.



OPEN modules/mod_ccboard_latest_posts/helper.php

FIND:

function getItems($numposts)


REPLACE WITH:


function getItems($numposts, $forumid)

FIND:

if ( $numposts < 1) {
return;
}

UNDERNEATH ADD:

if ($forumid == '0' || $forumid == NULL){
$forumid = '%';
}


FIND:

$query = 'SELECT p.id, p.forum_id, p.topic_id, p.post_time, ' .
'p.post_subject, u.username, p.post_user, p.post_username ' .
'FROM #__ccb_posts AS p ' .
'INNER JOIN #__ccb_forums AS f ON f.id = p.forum_id ' .
'INNER JOIN #__users AS u ON u.id = p.post_user ' .
'WHERE f.published=1 AND f.view_for <= ' . $user->get('gid') . ' ' .
'ORDER BY p.post_time DESC';


REPLACE WITH:

$query = 'SELECT p.id, p.forum_id, p.topic_id, p.post_time, ' .
'p.post_subject, u.username, p.post_user, p.post_username ' .
'FROM #__ccb_posts AS p ' .
'INNER JOIN #__ccb_forums AS f ON f.id = p.forum_id ' .
'INNER JOIN #__users AS u ON u.id = p.post_user ' .
'WHERE f.published=1 AND f.view_for <= ' . $user->get('gid') . ' AND p.forum_id LIKE \''.$forumid.'\' ' .
'ORDER BY p.post_time DESC';


-> SAVE


OPEN modules/mod_ccboard_latest_posts/mod_ccboard_latest_posts.php

FIND:

$numposts = $params->get('numposts');

ADD UNDERNEATH:

$forumid = $params->get('ForumID');


FIND:
$items = ccboardLatestPostsHelper::getItems($numposts);

REPLACE WITH:

$items = ccboardLatestPostsHelper::getItems($numposts, $forumid);


-> SAVE

OPEN modules/mod_ccboard_latest_posts/mod_ccboard_latest_posts.xml


FIND:

ccBoard
Joomla


ADD UNDERNEATH:




-> SAVE

-> UPLOAD FILES

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.

Tuesday 31 March 2009

Magento 'shipping Invalid Country' - Setting up Shipping details in Magento

The section to make changes to shipping can be found at:

Magento Admin > System > Configuration > Shipping Methods(left hand menu)


At least this is the section where you can enable the methods that you'd

like to allow for shipping.
If you want to make changes to the table rate then you need to go to the

'store view' - This is in the dropdown list on the left hand side at the

top - and is labelled 'Current Configuration Scope:' - and move to your

main store view.
>> After that navigate back to shipping methods on the left hand menu. THis

time you will see and export button and a input field you can browse for the

document you wish to upload.
>> Simple export the file - make you changes and then import here again.


On doing this I got a 'Invalid Country ' message on all my countries. To see

the values you need to enter here visit

http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3

Monday 30 March 2009

VBulletin : Front page message that only displays if logged in

On a job to update vBulletin here is a code snippet that so you can display a personalised message for your logged in users. Or display another message if their not.

This is just an example as this text is already include by default, howwever you may want to change it to something else.

<!-- welcome msg start DJ -->
<if condition="THIS_SCRIPT == 'index'">
<if condition="$bbuserinfo['userid'] == 0">
<br>
<table class="tborder" cellpadding="6" cellspacing="1" border="1" width="100%" align="center">
<thead>
<tr align="left">
<td class="tcat"> Welcome to the Forum.
</td>
</tr>
<tr align="center">
<td class="alt1"> If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. tst
</td>
</tr>
</thead>
</table>
<br>
<else />
<br>
<table class="tborder" cellpadding="6" cellspacing="1" border="1" width="100%" align="center">
<thead>
<tr align="left">
<td class="tcat">
Welcome back, $bbuserinfo[username].
</td>
</tr>
<tr align="center">
<td class="alt1"> <a href="search.php?do=getnew">Click here to view new posts</a>.</td>
</tr>
</thead>
</table>
<br>

There's a really handy list of conditional commands for vBulletin at this address
http://forum.vbulletinsetup.com/f18/vbulletin-template-conditionals-list-2185.html


</if>
</if>

<!-- welcome msg end DJ -->

Saturday 28 March 2009

Firebug Tool - edit, debug, and monitor CSS, HTML, and JavaScript

If you work in Internet Development then I highly recommend the use of firebug (https://addons.mozilla.org/en-US/firefox/addon/1843) which is tool where you can examine all the elements of the webpage that you are viewing. Firebug is specifically for use with Firefox however there is a Internet Explorer version if you're that way inclined which is called 'Internet Explorer Developer Toolbar'. With Firebug you can ->edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
If you're involved in css changes it's a must have tool and it's completely free.
For example on the left hand side view you could select the HTML tag. This would give you a list tags that may look something like this.
+ < div class="1" >+

Clicking on the'+' sign to the left of these tags would display all the contents of that < div >. for example
+ < div class="1" > < div class="2" > + < div class="" >

It's the same principle if we were to replace the div tags with table tag etc.
On selecting the tag of your choice on the right hand of the screen we could choose to view the css for this item. And not only that we can edit the style from here and view the changes immediatley. Thus saving time consuming testing. Also on the right hand side you could move that item around the screen by selecting the layout tag. When you make changes here 'Firebug' shows you the css you need to write to make the changes.
There's even a tab so you can change Javascript DOM . Not something I've used yet though.
This is a must have tool for any other internet developer.

Wednesday 18 March 2009

Basic CodeIgnitor Notes

If you write code then you may be familiar with this situation.

You have a small project that you write in the quickest possible way to meet a deadline and maximise profit.

It then grows and grows. At this point you are seeing the error of your ways and you should be using Object Oriented Programming and a bettter 'Framework'. Now have streams of spaghetti code, made from many copy and paste moments. The main problem with this is that changes to one bit of code and many other pieces may need to be changed or the knock on effects considered.

It's time to switch to a MVC framework and using someone elses rather than you're own will save time.

For the project I'm about to start helping on soon they use code ignitor, so it'd seem like a good time to have a look at their framework.

Here's some of the Basic pointers I picked out;

>> classes will extend Controller to use all the properties of this masterclass.

>> class names should be the same page names and can be called up from URL
/CodeIgniter/index.php/blog/
-> this will load the function 'index' in the blog class
->-> we could call up the function 'do_this' with the uri /index.php/blog/do_this/

NOTE: we could get rid of index.php through the .htaccess file to make cleaner URL's

>> if we're making a constructer ( same names as it's class ) remember that it will overwrite any constructer in the parent class. so we must call the parents constructor first . ie parent::Controller();

Using IRC - Internet Relay Chat

IRC stands for ' internet relay chat '

Which is useful if you need to chat within a group over the internet. You could use SSH and command line to do this or there are many clients that will give you an easier viewing experience.

It was recommended to me that I should use something like mirc.com/ . However on checking this one is only free for a limited period.
Checking on wiki will get you a comprehensive list of IRC clients - check here http://en.wikipedia.org/wiki/List_of_IRC_clients

As I use firefox for my Internet Browser I opted for ChatZilla http://en.wikipedia.org/wiki/ChatZilla and this one seems pretty easy to use.

To start a session with a group it's as easy as

entering:

/server theserver.your.connecting.to

the enter:

/join #thegroupnameyouarejoining

Tuesday 10 March 2009

Adding a new Manufacturer Field to Magento store

you can find this article and other helpdesk items at
http://www.littleripples.com/helpdesk/knowledgebase.php


Manufacturer is an attribute setting, so the following procedure is the same for adding any extra fields to other attributes.

>> In the Admin panel

>> hover over the 'catalog' button on the menu bar.

>> go to 'attributes' >> 'Manage Attributes'

>> find 'Manafcturers' and click on the attribute name

>> on the left hand side click on the 'Manage Label/Options' tab

>> underneather Manage Options on the main part of the screen click on 'Add option'

>> enter the text of the new manufacturer you want to add.

Thursday 5 March 2009

Help Desk Software

Unfortunately software bugs are part and parcel of writing code. The bigger the project the more likely it is there are going to be bugs of some sort. I have recently fallen into the mistake of starting a fairly small project recently that has grown and grown on request of the customer. If the size of the project was apparent from the start then it would have been much more obvious that a decent design environment should have been set up from the start. Here are some that I recommend
  • Version Control Programme ( Subversion )
  • Documentation (PHPDocumentor)
  • Bugzilla

and finally no matter what the size of the project a ticketing system is well worth the investment.


Especially when the investment is only a hour or so of your time. This is how long it took to set up the excellent Help Desk Software that can be found at PHP Junkyard. The programme itself is completly free

Here are some of the main features

* unlimited personalized accounts for staff

* unlimited categories

* canned responses

* file attachments

* fully-featured knowledge base (articles, categories, search,...)

* custom fields in the "Submit a ticket" form

* anti-SPAM checks when submitting a ticket

* powerful ticket search functions

* e-mail notifications of new tickets and replies

* rating of staff replies and knowledge base articles

* auto close tickets after X days

* easy-to-use web interface

* easy to translate to any language

* and many more!



On the way to finding this program I'd also tried osticket.com and troubleticketexpress.com.


osticket.com - seems like a project at a very early stage. Installing this would mean getting your hands dirty and doing lots of code writing to get it to all the things it should do.


troubleticketexpress.com - has a basic version and then seems to want to channel you to purchase addons to get to the programme to do every thing you want it to.


I'd found this programme through www.hotscripts.com.


Thursday 26 February 2009

Installing Subversion on Heart Internet Shared Server

I spent a good day of my life trying to install subversion on my one of our accounts that is hosted with Heart Internet.

Just to find out that it is not possible

"It is not possible to install or run subversion on our servers as doing so would put you in breach of our terms and conditions.

15.1.2 you do not use the Hosting Service as a backup of, or repository for, your Material;"

This is unfortunate as they're are many reasons why having a version control program is paramount to solid base for web development. If you are installing on shared host though and it's not with Heart Internet then this post

http://joemaller.com/2008/01/29/how-to-install-subversion-on-a-shared-host/

explains the process much clearer than anything else that I came across.

Sunday 22 February 2009

Adding Translation to your website to increase keywords and hits

The mission: To Increase hits and bookings for Hillside Glastonbury B&B & selfcatering accommodation.

www.hillsideglastonbury.co.uk

As we are currently in the middle of the 'credit crunch' and due to the fact that the British Pound is doing so badly against the Euro at the moment that bookings from abroad may well be a opportunist market at the present time.
To tap into this market we have decided to provide a translation of the website, albeit with Yahoo's translation tool Babel Fish. The problem with this of course is that some words may be undesired and the grammar will also be incorrect in places. On the plus side though it's cheap and free - you can target a few keywords that will at least get the hits in from abroad. Hopefully once we receive a few bookings through this new channel we will then invest in a proffessional translations.


On out home page we have placed links to an introduction pages for 6 languages - German (GlastonburyAnpassung), French (GlastonburyLogement), Dutch (GlastonburyAanpassing), Spanish (GlastonburyComodidad), Italian (GlastonburySistemazione) and Portuguese (GlastonburyAcomodacao).
This page has a brief introduction and apologieses for any grammatical errors and then targets three key phrases for each language. Each link from this page to others on our website transfer the user to the BabelFish website. So all the links are this format

http://babelfish.yahoo.com/translate_url?doit=done&fr=bf-badge&trurl=http://www.YOURWEBSITELINKHERE.co.uk/&lp=en_pt

At the end the code -> 'en_pt'

The changes the language from English to Portuguese - Here is a list of the other language changes used.

'en_de' = English to German
'en_fr'= English to French
'en_nl'= English to Dutch
'en_es'= English to Spanish
'en_it'= English to Italian


Since these changes we have noticed a 50% increase in hits in the first month. The bottom line though will be to see if these increases in hits translate in to B&B and Self Catering bookings. We will have to see.