Posts Tagged ‘technology’

Superfish Menu Fix for Joomla 1.5

Friday, July 2nd, 2010

So after moving some menu items around on a website, a client calls up noting issues with the ordering of items in the menu. This site is not using the usual mainmenu module from Joomla, but another module called “Superfish Dropdown Menus“. Apparently this is a pretty common issue and only affects people that have moved or removed anything in their menu. So, after much head scratching and trying things out, I finally came up with a fix for the menu ordering issue:

First, add the following functions to the “superfish_modMainMenuHelper” class in the “helper.php” file:

function sortParent($x, $y){
  if($x->parent==$y->parent){
    return 0;
  }else if($x->parent < $y->parent){
    return -1;
  }else{
    return 1;
  }
}

function sortByOrdering($x, $y){
  if($x->ordering==$y->ordering){
     if($x->parent==$y->parent){
        return 0;
     }else if($x->parent < $y->parent){
       return -1;
     }else{
       return 1;
     }
   }else if($x->ordering < $y->ordering){
      if($x->parent==$y->parent){
         return 0;
      }else if($x->parent < $y->parent){
         return -1;
      }else{
        return 1;
      }
   }else{
      return 1;
   }
}

Next, just above the line “$user =& JFactory::getUser();” in the buildXML function, insert the following lines of code:

usort($rows, array("superfish_modMainMenuHelper", "sortParent"));
usort($rows, array("superfish_modMainMenuHelper", "sortByOrdering"));

This will sort the items by what their parent is and then sorts by the ordering, taking into account the ordering of the parent items. After that, the buildXML function will take care of putting the menu together.

A really strange issue and really frustrating fix.

I also make no warranty on the above fixes. I’ll answer questions, but don’t expect me to repair your site for you (backups are your friend).

To You “Hackers”

Tuesday, November 10th, 2009

Those of you that believe that you’re a hacker just because you downloaded a tool and used it to get into someone’s computer or website or knock your ‘enemy’ off / get your enemy banned from the internet/video game/website, please read the following:

http://www.catb.org/~esr/faqs/hacker-howto.html

For the rest of you creative god minds, carry on.

That is all.

ZipIt…ZipIt good

Saturday, October 3rd, 2009

Managed to jump on the bandwagon with the ZipIt hackers. Purchased a ZipIt Z2 from E-Bay and flashed it with a new linux kernel. Now I can boot the thing from a microSD [in a miniSD adapter] and run Debian! :D

In fact, I’m posting this from the device itself. WEP works ok…just have to get WPA working better and I’m set.

Thanks to HunterDavis.com for coverage of Z2 hacking and the ZipIt Forge for their work.

More info to follow!