February 2012

  • strict warning: Non-static method view::load() should not be called statically in /home1/nate01/public_html/sites/all/modules/views/views.module on line 1113.
  • strict warning: Declaration of views_handler_argument::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_argument.inc on line 917.
  • strict warning: Declaration of views_handler_argument::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_argument.inc on line 917.
  • strict warning: Declaration of views_handler_sort::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_sort.inc on line 165.
  • strict warning: Declaration of views_handler_sort::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_sort.inc on line 165.
  • strict warning: Declaration of views_handler_sort::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_sort.inc on line 165.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 587.
  • strict warning: Declaration of views_handler_filter::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 587.
  • strict warning: Declaration of views_plugin_pager_none::post_execute() should be compatible with views_plugin_pager::post_execute(&$result) in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_pager_none.inc on line 69.
  • strict warning: Declaration of views_plugin_query::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_query.inc on line 169.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_style_default.inc on line 24.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home1/nate01/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 136.
  • strict warning: Non-static method view::load() should not be called statically in /home1/nate01/public_html/sites/all/modules/views/views.module on line 1113.
  • strict warning: Declaration of views_handler_field::query() should be compatible with views_handler::query($group_by = false) in /home1/nate01/public_html/sites/all/modules/views/handlers/views_handler_field.inc on line 1147.
  • strict warning: Non-static method view::load() should not be called statically in /home1/nate01/public_html/sites/all/modules/views/views.module on line 1113.

jQuery animate() Example with Callback Function

Use a callback function to display a message once the animation is completed. This snippet will animate every

html element and then replace the html with the message when the #link-id element is clicked.

$("#link-id").click(function() {
    $("p.animate").animate(
            {"height": "100px", "width": "250px"},
            "slow", function(){
                $(this).html("Animation Completed");
            });
});

Drupal Views Title from Argument - Use Views Argument as Page Title

<?php
    $view = views_get_current_view();
 
    $args = $view->args;
 
    drupal_set_title($args[0]);
 
 
    // if argument is taxonomy
    // $termObject = taxonomy_get_term($args[0]);
    // drupal_set_title($termObject->name);
?>

How to Uninstall a Module in Magento - Reinstall Magento Module and Run Install Script

If you want Magento to reinstall the module and re-run any database setup, take a look at the core_resource table. Delete your module from this table and DROP any tables that the module had created. Clear Magento’s cache and the module will re-install. The mysql4-install-X.X.X.php files will only be run once by Magento. By changing the version value in your XML config (Namespace/Module/etc/config.xml), you’re telling Magento which install file it should use:

Vertically Align an Element with jQuery - Vertical Align an Anchor or Div

//align text vertically
var i = 1; // for debugging
$('div.view-home-colored-circles div.view-content ul li a').each(function(){
 
		var ah = $(this).height();
 
                // insert the element/id/class to center within
		var ph = $(this).parents('li').height();
 
		var mh = Math.ceil((ph-ah) / 2);
 
                // may choose to use margin-top - depends on your case
                $(this).css({'padding-top':mh});
 
                // for debugging
                console.log('a position: ' + i + 
					'a height: ' + ah + 
					'li height:' + ph +
					'p

Add a Link to Admin Menu or Sub-menu in Magento Module

<?xml version="1.0"?>
<config>
  <menu>
    <tutorial_menu translate="title" module="custompricing">
      <title>Custom Pricing Reports</title>
      <sort_order>9999</sort_order>
      <children>
        <first_page module="custompricing">
          <title>Our First Page</title>
          <action>custompricing/index/index</action>
        </first_page>
      </children>
    </tutorial_menu>
    <system>
      <children>
        <another_menu_from_us>
          <title>Here Too!</title>
          <sort_order>9999</sort_order>
          <action>custompricing/index/ind