Joomla Module Success
I finally got my first Joomla module working. After getting stuck on the install process, I gave up using the zip file technique. Joomla lets you install from a directory, so I just uploaded my files and using that method, everything installed properly. Go figure.
Finally able to test the module, the MySql result didn’t display at all. So I opened up another module I’d been using (Hit Counter) and found a few lines to tweak, namely those responsible for converting the query result into a format suitable for ouput by pHp. Success. The total number of bottle caps… 457. Oops, off by 2.
This slightly off result was likely due to old bottle caps that I deleted or unpublished from the system. After a bit of poking around with pHpMyAdmin, it seems a published content item has a value of 1 in its state column. So I updated my query to count content items matching two categories:
SELECT COUNT(*) FROM jos_content WHERE sectionid = ‘4′ AND state = ‘1′
The result: 495, the exact number of bottle caps currently displaying on the site. Now every time I add a new bottle cap, I’ll get a minute of my life back.
Front Page