Thursday, 8 March 2012

Making a Joomla 2.5 Menu with Rounded buttons in CSS


The target here was to make a menu set in Joomla look a bit nicer and have rounded edges. With the minimal amount of image used.


> The first thing to do is make yourself a button and divide this into 3 bit. * left * middle and * right

Note: the middle bit only needs to be 1pix wide as it will vbe repeated on the x axis ( across )


> secondly we need to make a menu display other than default. The way to do this is to download the folder /modules/mod_menu

COPY THESE FILES


modules/mod_menu/tmpl/default.php
modules/mod_menu/tmpl/default_component.php
modules/mod_menu/tmpl/default_seperator.php
modules/mod_menu/tmpl/default_url.php


and rename them - you can change the name 'default' to your preference. In this example I renamed them to 'rounded'

modules/mod_menu/tmpl/rounded.php
modules/mod_menu/tmpl/rounded_component.php
modules/mod_menu/tmpl/rounded_seperator.php
modules/mod_menu/tmpl/rounded_url.php


Now go through all the documents and find all instances of 'default' and change to 'rounded'


NOW OPEN

modules/mod_menu/tmpl/rounded.php

on line 48

CHANGE

echo '<li'.$class.'>';

to

echo '<li'.$class.'><div class="menuleft"></div><div class="menumiddle">';


on line 74

CHANGE

echo '</li>';

TO

echo '</div><div class="menuright"></div></li>';



NOW ADD THIS CSS to your CSS file


div.menuleft{


background-image:url("images/menuleft.jpg");

background-repeat:no-repeat;

width:3px;

height:25px;

float: left;

}


div.menuright{

background-image:url("images/menuright.jpg");

background-repeat:no-repeat;

width:5px;

height:25px;

float: left;


}



div.menumiddle {

background: url("images/buttonbackground.jpg") repeat-x scroll left center transparent;

display: block;


max-width: 150px;

min-width: 150px;

text-align: center;

height: 25px;

float: left;



}

Wednesday, 7 March 2012

A quick guide to SEO

Here's a quick guide to targetting new keywords. The following instructions are the real basics. Search SEO basics on google for more.


1. Create a page targetting a new keyword/phrase or two, but don't try and cram the blog full of keywords it won't work. The article should have at least 300 words.

Use the keyword/phrase in the title , url, meta description and an img tag.


2. Link back to this page internally - using the keywords in the link

3. Link to the page externally using your keywords/phrase too. For example from social media sites like Google+, facebook, twitter and many more. I like ping.fm as you can post to many social media streams in one go. And from blogs like the one you are reading can be good for linking to your main site. Like this -> How writing good blogs will improve your business


Here's some DON'TS

* Don't have too many links in one blog.
* Don't repeat the key word your targetting too many times on the page
* Don't duplicate content

The main thing is to keep going. It may take a while to rank keywords that have a lot of competion.

There is a term in SEO that goes 'Going after the Long Tail or Short Tail. It works like thie

> short tail: "Photography workshops'

The short tail is difficult to rank but number of searches much higher. Long tail searches you can expect to get ranked higher and quicker, the other advantage is the relevance is 'Excellent' so users may well be more inclined to use your services.


My SEO packages start at £25 a month Contact Cornwall SEO for more information on how I can help :)



Monday, 5 March 2012

Frontpage Slideshow v2.9.1 Thumbnails are blurry in JJ-Obs Template


Frontpage Slideshow v2.9.1 Thumbnails are blurry in JJ-Obs Template


If your having the same problem with blurry thumbnails in this older version of Frontpage Slideshow by Joomla Works then here's a quick CSS fix for you.


#navi-outer li a img, #navi-outer li a.navi-active img{

width: 40px !important;
margin: 0 0 0 0 !important;
height: 25px !important;
}

Photography Portfolio - Cornwall

Adding a monthly dropdown to Finacial Report in RentalotPlus

Adding a monthly dropdown to Finacial Report in RentalotPlus


in administrator


> goto 'RentalotPlus'

> 'Reports'

> 'Financial Report'



Here on the drop down that says '2012'  I would like an additional drop down that breaks the Financial Report into months.



OPEN  administrator/components/com_rentalplus/models/report.php


FIND

function &getFinancial()

AND UNDER

$filter_year = $this->_app->getUserStateFromRequest(LA_COMPONENT.'.filter_year','filter_year',0,'int');
    

ADD


$filter_month = $this->_app->getUserStateFromRequest(LA_COMPONENT.'.filter_month','filter_month',0,'int');


UNDER

if ($filter_year > 0)
        $query_where .= " And year(B.date_from) = '$filter_year'";


ADD

    if ($filter_month > 0)
        $query_where .= " And month(B.date_from) = '$filter_month'";




OPEN administrator/components/com_rentalotplus/views/financial/view.html.php


IN function display($tpl = null)

FIND
    $filter_year = $app->getUserStateFromRequest(LA_COMPONENT.'.filter_year','filter_year',0,'int');
   


ADD

    $filter_month = $app->getUserStateFromRequest(LA_COMPONENT.'.filter_month','filter_month',0,'int');


FIND

    $this->lists['year'] = LA_view::make_list('filter_year', $filter_year, $this->year_list, 0, 'onchange="this.form.task.value='."''".';submitform( );"');
 


ADD

    $this->lists['month'] = LA_view::make_list('filter_month', $filter_month, $this->month_list, 0, 'onchange="this.form.task.value='."''".';submitform( );"');



And that's it.






Wednesday, 29 February 2012

Setting up a Multi-page Registration Form in CB

For this I've used the CB Conditional plugin .

After installing

I started by creating the "Personal Info," "Contact Info," and "Work History" tabs in the Community Builder Tab Manager.

Next, we move to the Community Builder Field Manager. In the Field Manager some registration fields are already implemented by default. Open or create the following fields and assign them to the tabs we just created in the order listed below.


Name >> Personal Info (required text field)
Gender >> Personal Info (drop down)
Username >> Personal Info (required text field)
Password >> Personal Info (password field)
Verify Password >> Personal Info (password field)


Email >> Contact Info (required text field)
Phone >> Contact Info (text field)
Address 1 >> Contact Info (required text field)
Address 2 >> Contact Info (text field)
City >> Contact Info (required text field)
Zip >> Contact Info (required text field)
State/Province >> Contact Info (required text field or drop down if you want to list the states as options)


Employment Group >> Work History (text area)
History Notes >> Work History (drop down with morning, afternoon, evening as options)


Then after turning on the CB Conditional Component is automatically puts it into tabs,

Tuesday, 28 February 2012

Changing Rentalotplus so I can a selection of units if wished to the Calendar view.

When creating a menu item for RentalotPlus I get the option to enter 'Unit ID'

If I select '0' then front end I get a calendar with a dropdown that I can select the venue I want.

Or I can enter a unit value - in which case I get a calender for the one unit.

What it doesn't do and what I'd like it to do is for me to enter '1,5,6' etc and be able to choose a selection of units.


OPEN


administrator/components/com_rentalotplus/helpers/view_helper.php

REPLACE the function draw_UC_selectors with the following

[code]

function draw_UC_selectors(&$unit_id, $unit_list, $front_unit_name, $currency_list, $current_currency_code, $controller)
{
$unit_id = trim($unit_id);
$unit_id_list = array();

if ($unit_list === false)
{
$unit_id = -1;
return JText::_('COM_RENTALOTPLUS_ERROR_NO_UNITS');
}

if (!empty($unit_id))
// if a specific unit id is specified, check it exists
//$pos = strpos($unit_id, ',');
//echo $pos;
if(strpos($unit_id, ',') || strpos($unit_id, ',')===true){
$unit_ids = explode(',',$unit_id);
//print_r($unit_ids);
foreach($unit_ids as $uid){
if(!empty($uid) && $uid>0){
if(array_key_exists($uid,$unit_list)){

$unit_id_list[$uid] = $unit_list[$uid];
}
}
}
}
else if (!array_key_exists($unit_id,$unit_list)){
$unit_id = -1;
return JText::_('COM_RENTALOTPLUS_INVALID_UNIT_ID').' ('.$unit_id.')';

}

if ($currency_list === false)
{
$unit_id = -1;
return JText::_('COM_RENTALOTPLUS_ERROR_NO_CURRENCIES');
}

$num_units = count($unit_list);
$num_currencies = count($currency_list);
$unit_html = '';
$html = '';
$draw_form = false;

// if no unit was specified, either select the one and only unit, or draw a select list

if ( empty($unit_id) ) // unit_id can an empty string or zero for automatic selection
{
$unit_id = key($unit_list); // get the first unit id
$unit_html = "\n".'<input type="hidden" name="unit_id" value="'.$unit_id.'" />';
if ($num_units > 1) // if more than one ...
{
$draw_form = true;
$unit_id = JRequest::getVar('unit_id',$unit_id); // get currently selected unit id
$list_html = LA_view::make_list('unit_id', $unit_id, $unit_list, 0 ,'onchange="this.form.submit()"');
$unit_html = "\n".$front_unit_name.' '.$list_html."  ";
}
}


else if(count($unit_id_list)>0){

$unit_id = key($unit_id_list); // get the first unit id
$unit_html = "\n".'<input type="hidden" name="unit_id" value="'.$unit_id.'" />';
if (count($unit_id_list) > 1) // if more than one ...
{
$draw_form = true;
$unit_id = JRequest::getVar('unit_id',$unit_id); // get currently selected unit id
$list_html = LA_view::make_list('unit_id', $unit_id, $unit_id_list, 0 ,'onchange="this.form.submit()"');
$unit_html = "\n".$front_unit_name.' '.$list_html."  ";
}


}
else{ // if unit_id is not empty, pass back the one already selected
$unit_html = "\n".'<input type="hidden" name="unit_id" value="'.$unit_id.'" />';
}
if ($num_currencies > 1)
{
$draw_form = true;
$currency_html = "\n".LA_view::make_list('currency', $current_currency_code, $currency_list, 0, 'onchange="this.form.submit()"');
}
else
$currency_html = '';

if ($draw_form)
{
$html = "\n".'<div class="rentalot_selectors">';
$uri =& JFactory::getURI();
$myuri = $uri->toString();
$html .= "\n".'<form name="selector_form" action="'.$myuri.'" method="post">';
if ($controller != '')
$html .= "\n".'<input type="hidden" name="controller" value="'.$controller.'" />';
$html .= $unit_html;
$html .= $currency_html;

// 4.14.02 - preserve all context

$call_type = JRequest::getVar('call_type', '');
if ($call_type != '')
$html .= "\n".'<input type="hidden" name="call_type" value="'.$call_type.'" />';

$task = JRequest::getVar('task', '');
if ($task != '')
$html .= "\n".'<input type="hidden" name="task" value="'.$task.'" />';

$datefrom = JRequest::getVar('datefrom', '');
if ($datefrom != '')
$html .= "\n".'<input type="hidden" name="datefrom" value="'.$datefrom.'" />';

$dateto = JRequest::getVar('dateto', '');
if ($dateto != '')
$html .= "\n".'<input type="hidden" name="dateto" value="'.$dateto.'" />';

$html .= '</form></div><br /><br />';
}
return $html;

}


function draw_UC_selectors_backup(&$unit_id, $unit_list, $front_unit_name, $currency_list, $current_currency_code, $controller)
{
if ($unit_list === false)
{
$unit_id = -1;
return JText::_('COM_RENTALOTPLUS_ERROR_NO_UNITS');
}

if (!empty($unit_id)) // if a specific unit id is specified, check it exists
if (!array_key_exists($unit_id,$unit_list))
{
$unit_id = -1;
return JText::_('COM_RENTALOTPLUS_INVALID_UNIT_ID').' ('.$unit_id.')';
}

if ($currency_list === false)
{
$unit_id = -1;
return JText::_('COM_RENTALOTPLUS_ERROR_NO_CURRENCIES');
}

$num_units = count($unit_list);
$num_currencies = count($currency_list);
$unit_html = '';
$html = '';
$draw_form = false;

// if no unit was specified, either select the one and only unit, or draw a select list

if (empty($unit_id)) // unit_id can an empty string or zero for automatic selection
{
$unit_id = key($unit_list); // get the first unit id
$unit_html = "\n".'<input type="hidden" name="unit_id" value="'.$unit_id.'" />';
if ($num_units > 1) // if more than one ...
{
$draw_form = true;
$unit_id = JRequest::getVar('unit_id',$unit_id); // get currently selected unit id
$list_html = LA_view::make_list('unit_id', $unit_id, $unit_list, 0 ,'onchange="this.form.submit()"');
$unit_html = "\n".$front_unit_name.' '.$list_html."  ";
}
}
else // if unit_id is not empty, pass back the one already selected
$unit_html = "\n".'<input type="hidden" name="unit_id" value="'.$unit_id.'" />';

if ($num_currencies > 1)
{
$draw_form = true;
$currency_html = "\n".LA_view::make_list('currency', $current_currency_code, $currency_list, 0, 'onchange="this.form.submit()"');
}
else
$currency_html = '';

if ($draw_form)
{
$html = "\n".'<div class="rentalot_selectors">';
$uri =& JFactory::getURI();
$myuri = $uri->toString();
$html .= "\n".'<form name="selector_form" action="'.$myuri.'" method="post">';
if ($controller != '')
$html .= "\n".'<input type="hidden" name="controller" value="'.$controller.'" />';
$html .= $unit_html;
$html .= $currency_html;

// 4.14.02 - preserve all context

$call_type = JRequest::getVar('call_type', '');
if ($call_type != '')
$html .= "\n".'<input type="hidden" name="call_type" value="'.$call_type.'" />';

$task = JRequest::getVar('task', '');
if ($task != '')
$html .= "\n".'<input type="hidden" name="task" value="'.$task.'" />';

$datefrom = JRequest::getVar('datefrom', '');
if ($datefrom != '')
$html .= "\n".'<input type="hidden" name="datefrom" value="'.$datefrom.'" />';

$dateto = JRequest::getVar('dateto', '');
if ($dateto != '')
$html .= "\n".'<input type="hidden" name="dateto" value="'.$dateto.'" />';

$html .= '</form></div><br /><br />';
}
return $html;

}

{[/code]

Add 'How many spaces left' to availability search in Rentalotplus Joomla

after my recent change to the Rentalotplus component Changing Joomla Rentalotplus component to take multiple bookings on each unit I've now made another small change so that after an 'availbility check' is made we can see how many spaces is left.

OPEN administrator/components/com_rentalotplus/models/booking.php

find the function checkForBookingOverlaps

before the closing
[code]
return true;
[/code]

ADD
[code]
$spaces = $maxPeople-$count;
$message = $spaces.JText::_("COM_RENTALOT_BOOKING_SPACES_LEFT");
[/code]

You'll need to add this to language/en-GB.com_rentalotplus.ini too

COM_RENTALOT_BOOKING_SPACES_LEFT=" spaces are left on this course."


and that's it :)