1

Banners fixed - and lesson learnt

 2 years ago
source link: https://www.codeabbey.com/index/forum_topic/2b5c15485744e51c02d90c24dce39517
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Banners fixed - and lesson learnt

Back to General discussions forum

TestUser     2021-12-28 22:47:15
User avatar

posted this from testing account in confusion, it's still me, Rodion (admin) here

Sorry for having banners broken for so long (perhaps, almost a year?) - but at last they are working again.

Behind the scene - I again and again learn the lesson that things may be easier than imagined!

Telling this story now mainly out of exultation - and perhaps as advice to others and myself.

Initially when banners were proposed - I thought for some irrational reason that it's hard or impossible to do in php. I'm not well acquainted with php (this site being the only significant project I ever did in it - mainly because of availability of suitable hostings).

So I suggested banners to be created as separate web-application and hosted separately (using google appengine, which looked as sound as eternity). Some of our colleagues did this single-handedly with just few additions for integration on my part. This was done in Python and sources are available in github.

However times changed, google changed and appengine changed to the worse, and after one of the latest changes I decided I'm too tired to figure out how to register cards here and deploy things in new way etc. I hoped banners application could be slightly modified to suit CGI (this hosting is able of serving some old Python 3 version).

I never found moral powers to try it - and no one wanted too. But while banners were hidden, I've seen in logs some requests are still made to them (ending with errors) - seemingly some people embedded them somewhere on other sites or forums.

So I decided to have a look - how difficult it is in PHP really?

Surprise - it is under 30 lines of code (as PHP has more than one image library enabled usually) - just couple hours to figure out, read examples, docs and adjust coordinates etc.

This could had been done aeons ago! Silly me. But good lesson again :)

P.S. please tell if somewhere they don't work - perhaps there could be bugs of not finding the country for flag or something like this.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK