Tuesday 30 October 2012

Where to stick a function in your MVC Joomla Module

The situation was this:  I had some code copied from a website that I want to put in the output of the module.

Even if I wanted to ( which I don't ) I wouldn't be able to copy and paste it into the tmpl/default.php file; as some of the code is built into function. 

Here's what you can do with the functions; so that you can use them from this file or anywhere else in the module. 

OPEN your helper.php  or controller.php file and put the function before the closing }


you can then call up this function with something like.

TheNameOfHelperControllerClass::functionName($value1)



Monday 29 October 2012

Renewal for SSL Certificate hasn't worked

If your SSL certificate renewal hasn't been automatically done then it's probably because you haven't replied to the email that has been sent to you at admin@yourwebsite.com.   look for it and reply. 



Friday 19 October 2012

Wordpress - Add a Widget space to a template and add a widget to it.

This is a simple task that any developer making changes to a Wordpress template will need to know.


It's pretty simple; theres two elements to it. Firstly to make sure it's picked up in your admin then edit function.php  - and add it to the template itself.

in function.php ( in your template folder )

the code here for me was


if 

( function_exists('register_sidebars') )
    register_sidebar();



?>


and the call up in the template is




to use multiple widget areas I changed function.php to


if ( function_exists('register_sidebars') ){
    register_sidebar(array(
    'name' => 'Right Sidebar',
    ));
    register_sidebar(array(
    'name' => 'Top Middle',
    ));
}
?>

and the call up needs to be changed to - if you get the gist.

                                       if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Top Middle') ) : endif;                    ?>






Adding a Twitter Feed to your Blogga Wordpress Theme

Phew !  Well this ended up being a real struggle in the end. 

My simple aim was to get the Twitter feed working in my Blogga theme. 

At first my issue was to get the Plugin to work at all.  I thought it may well to with the Twitter RSS Feed API changes

After making the changes in TwitterBundle in the theme folder, I could still not get it to work.  So I then installed a whole heap of other Twitter plugins to see if I could get them to work.  To no avial.

After reading comments about Twitter Widget Pro and seeing that others have it working since these changes I loaded the plugin on a clean installation of the same version of Wordpress.  It worked ! 

Telling me that it must be a conflict. ! 

I then tried turning off all other Widgets - which didn't effect anything.

The solution was to go into my theme; through the left hand side menu in wp-admin/

> click on 'twitter & RSS'   and change 'Enable Twitter' to NO.



 This gets the plugin working - but it doesn't look so great .


Check out Customise Twitter Widget Pro but BACKUP first as these changes blew up on me a couple of times.

However in the end I got it to look like this




I've included my CSS underneath  and I also made this change to code added to display a twitter bird instead of the customers image.

OPEN wp-content/plugins/twitter-widget-pro/wp-twitter-widget.php

comment out

$img = $this->_api_url . 'users/profile_image';
        $img = add_query_arg( array( 'screen_name' => $user->screen_name ), $img );
        $img = add_query_arg( array( 'size' => $args['avatar'] ), $img );

and replace with

$img = 'http://www.hardycarpets.net/images/chirpChirp.jpg';

or whatever your image is .

Wednesday 17 October 2012

Twitter feeds not working in Wordpress anymore - October 2012

wickett twitter Error: Twitter did not respond. Please wait a few minutes and refresh this page.

And other Wordpress Twitter Plugins seem to have the same issue.  

I found this post Fix for twitter feed error

For the plugin Wickett Twitter Widget  -  I fixed it by changing this line of code.

OPEN
wp-content/plugins/wickett-twitter-widget/wickett-twitter-widget.php

find ( around line 200 )

$instance['account'] = str_replace('http://www.twitter.com/', '', $instance['account']);


REPLACE WITH

$instance['account'] = str_replace('http://api.twitter.com/1/', '', $instance['account']);

What adds the Page content to the page in a Wordpress theme - Developer level

Ok here's the issue.  On the Wordpress theme I'm using ( Blogga ) they have a page which calls up dynamic code to display team members .  However I'd also like to use text underneath to this page.

Here's what you need to do .  At the top of the page add


the_post();

?>

and where you want to show the page content add



you can take a look at this page at Team Page Modified.

Sunday 14 October 2012

A blogger .com andriod app test

If youve found this blog then I wonder why!  as its my most pointless post I've written to date.  If you are reading this then it at least shows that the Blogger Android App works.  i've attached a random picture too, to see if that works.

Check my website little ripples for a blog later tonight.

This is blogged from Newquay but the picture is from the camel trail,


Thursday 11 October 2012

Changing the layout of the Content page in Blogga Theme for Wordpress

This is another hack to the theme 'Blogga' on the contact page.  The original Contact page wasn't good enough for what I need to do as the company the website is for has 2 addresses.

To display the map I used the Google maps embed code but I also needed to do a bit of deleting and swapping over of sections of the page. 

The page you need to edit for this is

themes/blogga/template_parts/contact-sidebar_right.php

Here's how I got out page to look



Wednesday 10 October 2012

Changing the font sizes and layout of Wordpress Plugin Ebay Feeds

After installing the Wordpress Plugin Ebay Feeds I wanted to make a few changes to the look of the widget.


Some things I could change through the CSS; some I found it harder to get to the CSS of the value.   So made some changes in the display.  Of which was a bit of a hack; as follows.

OPEN wp-content/plugins/ebay-feeds-for-wordpress/ebay-feeds-for-wordpress.php

 FIND

$newdescription = str_replace('target="_blank"', '', $item->get_description());

ADD UNDERNEATH

    $newdescription = str_replace('
Buy it now', '
Buy it now', $newdescription);
    $newdescription = str_replace('BST', '', $newdescription);
    $newdescription = str_replace('', '
', $newdescription);
    $newdescription = str_replace('Buy it now', '
Buy Now
', $newdescription);
   



Here's the CSS changes I used as well.


li.widget_ebay_feeds_for_wordpress_widget h2{
display: none;
}

.widget_ebay_feeds_for_wordpress_widget{
padding-left: 20px;
}

.ebayfeed {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #F7E89C;
    border-color: #F5DF8C #F5DF8C -moz-use-text-color;
    border-image: none;
    border-style: solid solid none;
    border-width: 1px 1px 0;
    position: relative;
    width: 240px;
    text-replace: "£" "£";
}

h4.ebayfeedtitle a {
 color: #002398;;
    text-decoration: none;
    font-size: 80%;
}

h4.ebayfeedtitle a:hover {

    text-decoration: underline;
    font-size: 80%;
}

h4.ebayfeedtitle a:visited {
 color: #663399;;
    text-decoration: none;
    font-size: 80%;
}

.ebayprice{

}

div.ebayfeed table tr td div span strong{
font-size: 200% !important;
}

div.ebayfeed table tr td div{
font-size: 80%;
}
h4.ebayfeedtitle{
text-align: center;
}

div.widget-acx-social-icons-widget-3-widget {
padding-top: 15px;
padding-bottom: 15px;
}

div.ebayfeed table tr td div div div{
display: none;
}

div.buyprice {
display: none;
}

Friday 5 October 2012

Adding 'Find Out More' Here text to the Info button in Folio Two Wordpress Theme

In the Folio Two theme it was mentioned by some that the Info button in the Project slides wasn't very easy to find.  So what we need was some text showing us the way.

The solution to this wasn't that straight forward; as the page moves dynamically when enlarged or decreased ( mean a static CSS placement would be useless )  and also as the info button is created in Javascript many changes would need to be made to the css to accommodate this.  The following code uses a '-' value may not work in every browser; however as far as I've tested it works in every browser supported by Folio Two.


Here's what our image looks like now on www.wisemonkeymedia.co.uk



OPEN  wp-content/themes/folio-two/js/fulldivgal-v2.js


on line 23

var fdgInfo = $('Info')


CHANGE TO

var fdgInfo = $('
Info')



SAVE 



OPEN  wp-content/themes/folio-two/style.css 

ADD 


div.clickhere{
    background: url("images/skins-items/Find-out-more.png") no-repeat scroll 0 0 transparent;
    height: 34px;
    margin-left: -185px;
    margin-top: 20px;
    position: fixed;
    width:  199px;
}


SAVE



Feel free to make your own PNG and change the CSS values as needed.

Tuesday 2 October 2012

Developer Notes on my Joomla Payroll system.


I have now blogged about the features and have made the code I have written this far in, available at


Problems and issues.

Firstly the component works in conjuction with Community Builder. 

To add shifts you'll need at least this mysql table from CB .



CREATE TABLE IF NOT EXISTS `#__comprofiler` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `firstname` varchar(100) DEFAULT NULL,
  `middlename` varchar(100) DEFAULT NULL,
  `lastname` varchar(100) DEFAULT NULL,
  `hits` int(11) NOT NULL DEFAULT '0',
  `message_last_sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `message_number_sent` int(11) NOT NULL DEFAULT '0',
  `avatar` varchar(255) DEFAULT NULL,
  `avatarapproved` tinyint(4) NOT NULL DEFAULT '1',
  `approved` tinyint(4) NOT NULL DEFAULT '1',
  `confirmed` tinyint(4) NOT NULL DEFAULT '1',
  `lastupdatedate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `registeripaddr` varchar(50) NOT NULL DEFAULT '',
  `cbactivation` varchar(50) NOT NULL DEFAULT '',
  `banned` tinyint(4) NOT NULL DEFAULT '0',
  `banneddate` datetime DEFAULT NULL,
  `unbanneddate` datetime DEFAULT NULL,
  `bannedby` int(11) DEFAULT NULL,
  `unbannedby` int(11) DEFAULT NULL,
  `bannedreason` mediumtext,
  `acceptedterms` tinyint(1) NOT NULL DEFAULT '0',
  `cb_employmentlevel` mediumtext,
  `cb_gender` mediumtext,
  `cb_telephone` varchar(255) DEFAULT NULL,
  `cb_mobile` varchar(255) DEFAULT NULL,
  `cb_address` mediumtext,
  `cb_postcode` varchar(255) DEFAULT NULL,
  `cb_mystrengths` mediumtext,
  `cb_traveldistance` varchar(255) DEFAULT NULL,
  `cb_usertype` mediumtext NOT NULL,
  `cb_employmentstatus` mediumtext NOT NULL,
  `cb_nameofemployer` varchar(255) DEFAULT NULL,
  `cb_addressline1` varchar(255) DEFAULT NULL,
  `cb_addressline2` varchar(255) DEFAULT NULL,
  `cb_addressline3` varchar(255) DEFAULT NULL,
  `cb_addressline4` varchar(255) DEFAULT NULL,
  `cb_resume` varchar(255) DEFAULT NULL,
  `cb_bankname` varchar(255) DEFAULT NULL,
  `cb_payeename` varchar(255) DEFAULT NULL,
  `cb_PayType` int(1) NOT NULL,
  `cb_bankaccountnumber` int(11) DEFAULT NULL,
  `cb_sortcode` varchar(255) DEFAULT NULL,
  `cb_riscemployeeno` int(11) DEFAULT NULL,
  `cb_insurancerate` decimal(10,2) DEFAULT NULL,
  `cb_accountancyFees` decimal(10,2) NOT NULL,
  `cb_loan` decimal(10,2) NOT NULL,
  `cb_loanRepaymentWeeks` int(5) NOT NULL,
  `cb_loanWeekAmount` decimal(10,2) NOT NULL,
  `bumber` varchar(50) NOT NULL,
  `cb_accountfeeslstdte` int(12) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `apprconfbanid` (`approved`,`confirmed`,`banned`,`id`),
  KEY `avatappr_apr_conf_ban_avatar` (`avatarapproved`,`approved`,`confirmed`,`banned`,`avatar`),
  KEY `lastupdatedate` (`lastupdatedate`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;


If you haven't got Community Builder then a solution for dealing with Employee information will need to be create. 

If you do have CB then I heavily changed CB core file to get that component to do what I wanted it to.

Here's that file to download Comprofiler changes for my Payroll System

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


Secondly the front end is the backend; if you get my drift !  I made the system to look like the customers previous software solution.  As the system is on a intranet; then I see no issue with this .  However if it we're to be connect to the internet I would think I would have made this component part of 'Administrator' instead.

The component was originally an adaption of 'com_projectfork' - and in that regards is not as clean as it should be.  There's a lot of unnecesary code in this component.  However it works, and a lot of effort has gone into to it to get it to this point !  Feedback and thoughts are welcome.

Feature List of my Joomla Payroll System

I'm just writing down a few notes for my official blog on this; that will appear on my main website later today.

Here' s the feature list for the Joomla 2.5 Payroll System that I have made. 


Customer Front End Admin Area

> View Current Employees

* Views a list of all Current Employees
* Allows editing of
First Name   
Middle Name   
Last Name   
TelePhone   
Mobile NO   
Post Code   
Addressline1   
Addressline2   
Addressline3   
Addressline4   
Bank Name   
Account Number   
Sort Code   
Insurance Rate   
Accountancy Fees   
Loan   
Loan Repayment Weeks   
Weekly Amount (the last week will be the remaining amount)   
PAYE
* Employees can also be sent to 'Archive' and will then not appear on the

major drop down.

> Create Staff Invoices.
* select a start date, end date and invoice date.
* creates Excel document with all Employee addresses - shifts - deductions

and calculations.

> View Current Locations -  Edit details and check the history of of your

Locations.  These details are available to edit.

Venue Name* :   
Venue Location* :   
Company* :    
Address Line 1* :   
Address Line 2:   
Address Line 3:   
Address Line 4:   
Post Code* :   
Telephone No* :   
Account Reference* :   

> Add new venue.  Adding the details above.

> Print location list.  Get a list of all Venues.

> Create Location Invoicing. 

* select a start date, end date and invoice date.
* Create invoices for each loaction. 
* Listing times and shifts for all work there between dates selected.
* Prints out Excel pages and does calculations on the page.

> Edit Company

* As well as Employee and Locations.  You can then also group by Company. 

For example 'X' company may control a handful of 'locations'  which then has

'x' amount of staff working there.

> Print cover sheets


* this function is retrieve data for previous invoice dates that may be

requested by the 'Company'

> Compile BACS report

* this is run first for any date period of shifts.
* enter start date and end date
* the results will then print out a list of Employee, BACS number and the total

they need to be paid.  With all deductions taken off.
* HTML and Excel version is produced.
* the BACS run for any date can only be added once.

> View Timesheets.

* select by employee and/or date and/or location.
* select by employee and between selected dates.
* show and edit the following information.
Staff Member
Venue
Shift Date
Start Time
End Time
Pay Rate
inv Rate
Post Date Shift
Post Date Shift Expire Date
Hours
Pay Total


> Add Timesheets

* add this information

Staff Member :    
Venue :    
Task :    
Shift Date :    
Start Time :    
End Time :    
Or Hours :    
Hourly Rate :   
Invoice Rate :   
Post Date Shift:

> Latest timesheets -
* view and edit the last 20 shifts.

> Add Multiple Timesheets

> Add Alterations -

* add or minus amounts
* state a reason
* Bacs and invoices will all include this calculation.

* Add upto 10 shifts.
* For any location where the shifts are done on the same date.