Placing dynamic images generated by php into Joomla templates

apps

#1

Recently, I was involved when another branch in my agency set up a site with a contractor who used Drupal. This got me interested in CMS. Previously I’ve been using Dreamweaver and php scripting with MySQL to create the site for my branch of the agency. I’ve been wondering if I’m doing it the hard way. Those CMS templates and menus look so attractive and easy. I don’t have an art department, and my designs really show it. I got started doing this back in 1991, and everyone was amazed and delighted I could do it, but now the site is getting dated. Doesn’t amaze anyone anymore.

I saw that Dreamhost makes it easy to install Joomla with a one-click install. So I started investigating Joomla this week. I started a Joomla test site on CloudAccess.net and went through Tutorials 1-9. But I still haven’t figured out how I can insert dynamic images and tables generated by php into a Joomla template. Here’s an example: http://ykfp.org/php/BOR/prodbflowtempchart.php The last lines of the script write the output to png: header(“Content-type: image/png”);
print($c->makeChart2(PNG));
With Dreamweaver, I insert an image into a page of html with Dreamweaver’s WYSIWYG, and set the img src to that url. But Joomla (and Drupal) expects the image files to end in a common image extension like jpg, png, ect.

I also have some php that display results of MySQL queries in a table like: http://ykfp.org/php/lyletrap/tabletotalscss2012.php I hoped that Joomla could help me display data like this, because just when I got them working perfectly, IE8 was released, the results from my tables don’t look very good in the new browser. When can’t Microsoft just accept standard html?

I attended a Joomla webinar yesterday, but the presenter was stumped by my questions. I asked the question in the forum area of CloudAccess (http://forum.joomla.org/viewtopic.php?f=706&t=799353&p=3020469#p3020469), but haven’t received any answers. I had asked the contractor that set up the Drupal site for our other division, and I may have stumped them too because I didn’t hear back. Maybe using php scripting for dynamic content is not something usually done in CMS so nobody gets what I’m asking.


#2

My first thought would be to jump directly into PHP at the dynamic image output stage (CMS’s often have a PHP module that allows you to add raw code mid-page).


#3

Hey, it works. Joomla has an advanced editor, JCE. When I tried insert an image into an article, there’s a form for image properties, and one of the fields is url. This field accepted a complete url to one of my php scripts and inserted it like an image, so the image is drawn new with current data when the page is viewed, much like editing a page with Dreamweaver.

It’s strange to me that this answer was so hard to find. It’s like people in CMS are using a whole different language from an old html editor and php coder like me.


#4

As odd as it sounds, the concept of dynamic generation is probably foreign and scary to much of the CMS community. The meaning of “dynamic” in CMS is mostly reduced to dynamic display as opposed to the realtime data generation that your scripts accomplish.

If you’ve recently installed via One-Click it might be a good idea to check the version that was installed and update manually to the latest 2.5.9 if it’s not already current.


#5

Yeah, I submitted my question on a Joomla Forum, but no response. Last week, I was on two Joomla Webinars, and the moderators had no idea what I was talking about. The Joomla moderators wondered why I don’t have a directory of these images ready to go to insert into these Joomla templates. I explained that the charts are pulling data from three different MySQL databases that all get updated at different and irregular times. I suppose I could run a cron to generate a new chart image file several times a day, as the moderators suggested, but generating the chart at display time works, both in my current pages and in the Joolma templates. The moderators seemed surprised that an image insert in a Joomla template could be a url to a php script.

The other area where we were unable to understand each other was my question of “frames”. I never want to get involved with frames again. I’ve only had to trouble shoot other colleague’s pages with frames, never authored one myself, but they drive me nuts. The Joomla templates have these module maps (http://joomla30.gavick.com/index.php/module-positions https://www.cloudaccess.net/joomla-1-5/39-module-manager/148-module-maps.html ) that suggest they are using frames. However, when I look at Joomla pages source with Firefox tools, I don’t see any frames. All I can find are CSS tricks. But when I ask the moderators if there are frames involved, they have no idea what I’m talking about. They’ll say stuff like “sure, module maps are like a framework showing you where to hang your modules.” And then I say “Yes, but are they using frames” but they don’t know the distinction. Maybe frames are so last decade that everyone has forgotten them.

It seems to me that Joomla and CMS are deceptively and alluringly simple. The templates are attractive. But it takes a whole new skill set to use them. Like anything that starts simple, when you need to add in more power and flexibility, you can’t preserve the ease of use. It seems like the CMS skill set is finding the right templates and modules online and learning how to use them, and that’s no small task. My current skill set of html and css editing with Dreamweaver, and a little php scripting, and finding the right php libraries is no help to me in this CMS world.