So I know it's quite a long title but I'm not sure what I'll be searching next time. It has taken me a lot longer than I thought it would mostly out of frustration and the inability to know exactly what I'm looking for... always difficult. After a cup of tea the solution was glaringly obvious, just do a primary school mathematics table and it all makes sense (see my 10 mod table below).

This article is a quick note (so I never spend as long again) in PHP on how to determine when looping through a loop, which entry was first and which was last. This is incredibly useful for pagination.


If you're not an IT person, you may want to avoid reading the rest of this article in case you're easily offended. It's just an amusing stab at customers computer issues. Note that most of the below were remote support jobs so we weren't there in person and could only see the users screen.


Three Webdevelopers phone in to say their computers can't view a website properly

"Can someone have a look at our computers because we recently received the new corporate template for our website and it's not displaying properly on my colleague's computers". [Priority 1]

What's a web guru?
Well this might be obvious to some but these are self-proclaimed highly qualified web-gurus in the marketing department. They'd paid around £150,000 for a template designed by a 3rd-party company. Received the zip and uploaded it to their homepage. The 3rd-party company had obviously designed the template to work in one browser only: Internet Explorer version 7. The marketing web-gurus were simply using different browsers. The project leader was on IE7, while their designer was on an Apple Mac using Safari, and a third was using Mozilla Firefox. We told them to go back to the template providers and report the same problem to them...???


Staff member requiring access to a secure application

"So that's all installed for you. I just need you to restart your computer now and tell me when that's done.".

"I've done what you said but it's still not working".

"From my logs, you haven't restarted this machine in a while.".

"No I definitely log off every evening and then back on again".

"You mean you log back on in the morning?"

"No it takes so long in the morning, this is quicker".

Explained how logoff is not the same thing as restart and reminded on both IT and environmental policies. Tech Notes: For PCs: Run a command prompt and type systeminfo: Look for "System Up Time".


A staff member in a partner institution:

"By the way my printer has stopped working, in fact it hasn't been working for ages, could you also look at that".

"Is there a power light on when you switch it on?".

"Yes it's definitely plugged in if that's what you're asking.".

"Is it a networked printer, I mean is there a cable that directly connects the printer to your computer or does the printer plug into the wall? Ok could you please follow the cable from the computer to the printer and tell me.".

"Hang on its on the other side of the room.".

This was a remote support job over the phone. The discussion above was after installing drivers and setting up the workstation with updates etc. as per our standard image. The printer was connected via three usb extension cables. The middle one wasn't connected to anything on either end.


What not to say to IT

"Hi could you find <staff_name> and tell them to unlock the record they are viewing".

"Oh that person isn't at work today".

"Well someone on that computer has locked a database record.".

"Well my colleague who's using that computer is in a meeting but I can login and do this for you".

IT Policy: Do not share passwords. It defeats the whole purpose!


A media student:

"My computer has swallowed my CD-Rom, I put in the disk but when I eject the CD there's nothing in there!".

I can't really have a go at customers as it took 4 IT technicians deliberating over 30 minutes (remote support so we weren't there in person): The computer had two CD-Roms. The user put the disc in one of the drives but was pressing eject on the second drive.


Like these? Share your experiences as comments below :)


Spent enough time trying different methods across the web but only 1 article worked for me using the "push" div layer. Loosely based on Ryanfait: Make a Footer Stick to the Bottom of the Page

Aim:
Header

Left


Right

Footer
copyraw
<div id="container">
     <div id="header"></div>
     <div id="content">
          <div id="left"></div>
          <div id="right"></div>
          <div class="push"></div>
     </div>
     <div id="footer"></div>
</div>
  1.  <div id="container"> 
  2.       <div id="header"></div> 
  3.       <div id="content"> 
  4.            <div id="left"></div> 
  5.            <div id="right"></div> 
  6.            <div class="push"></div> 
  7.       </div> 
  8.       <div id="footer"></div> 
  9.  </div> 
Situation
The header displayed fine. The left and right columns finally got them side by side. But the footer that has a background image was under the left and right columns... The main content layer was overlapping the footer. I tried various z-index's bearing in mind that the footer has to be behind because the main content had a semi-transparent layer that overlapped it half-way.

I managed to fix this by including a div push layer which clears both (even though i had clear:both on the css for my #right div layer). For some reason, it has a more forceful effect in its own separate layer.

Category: Cascading Stylesheets :: Article: 350

Add horizontal space between label and fieldset
copyraw
fieldset label.inline { display: inline-block; margin-left: 2em; }
  1.  fieldset label.inline { display: inline-block; margin-left: 2em} 


Change color of fieldset grouping line
copyraw
fieldset { border: 2px ridge #7abcff; }
  1.  fieldset { border: 2px ridge #7abcff; } 
Category: Cascading Stylesheets :: Article: 349

Quick note in case I spend as long as I did again.

A Client had some clouds on the background of his photoshop file for his website. They were to be positioned in the top right corner with the leftmost tip aligned to the right of a central content section. I separated off the clouds as another div layer, specified the width and height and specified it's left. It caused the horizontal scrollbar which is a bit annoying because you scroll to the right and theres nothing but some background image. Also the footer was at 100% so it got cut off if you scrolled horizontally.

Aim / Objective
To have a background of sky and grass with a centered content section (white semi-transparent layer) of 900 pixels width as shown in the following picture:
background of sky and grass with a centered content section (no clouds)

And I want the clouds as another layer ontop aligned to the top right:
background of sky and grass with a centered content section (with clouds)


To be honest I saw this on some Joomlaworks Blog who appropriately title it "A must see for professional webdesigners". If you're a developer relying on clients for your income, then at least watch some of this.

March 2011 San Francisco, CreativeMornings (creativemornings.com) was Mike Monteiro, Design Director, and co-founder of Mule Design Studio (muledesign.com). This event took place on March 25, 2011 and was sponsored by Happy Cog and Typekit (who also hosted the event at their office in the Mission).

2011/03 Mike Monteiro | F*ck You. Pay Me. from SanFrancisco/CreativeMornings on Vimeo.


I might already have something similar to this but this deserves its own article. Why? Well try to search the web for a PHP/MySQL solution which suggests on how to count the hours between two times on the same date, when one of the hours is on the other side of the midnight hour...

Now bear in mind the below is in European date format

Consider the following:
copyraw
Date       Customer        Time From       Time To          Hours
---------- --------------- --------------- ---------------- --------------
04/03/2011 Tweedle Dee     10:00           12:00            2.00
08/03/2011 Tweedle Dum     23:30           00:30            -23.00
  1.  Date       Customer        Time From       Time To          Hours 
  2.  ---------- --------------- --------------- ---------------- -------------- 
  3.  04/03/2011 Tweedle Dee     10:00           12:00            2.00 
  4.  08/03/2011 Tweedle Dum     23:30           00:30            -23.00 
Note the last row is obviously incorrect. This is because the script is not changing the date at the stroke of midnight. Take the last row as an example, the equation that's happening is:
copyraw
$thisDateSQL=date("Y-m-d", strtotime($sub_row['DateSession']));

$this_time_from1 = date("H:i", strtotime($sub_row['TimeFromSession']));
$this_time_to1 = date("H:i", strtotime($sub_row['TimeToSession']));

$this_time_from_sql=$thisDateSQL." ".$this_time_from1.":00";
$this_time_to_sql=$thisDateSQL." ".$this_time_to1.":00";

$sum_hours = number_format(((strtotime($this_time_from_sql)-strtotime($this_time_from_sql))/60)/60, 2);

// Using the examples above this is doing the following:
2011-03-04 12:00:00 - 2011-03-04 10:00:00 = 2.00
2011-03-08 00:30:00 - 2011-03-08 23:30:00 = -23.00
  1.  $thisDateSQL=date("Y-m-d", strtotime($sub_row['DateSession']))
  2.   
  3.  $this_time_from1 = date("H:i", strtotime($sub_row['TimeFromSession']))
  4.  $this_time_to1 = date("H:i", strtotime($sub_row['TimeToSession']))
  5.   
  6.  $this_time_from_sql=$thisDateSQL." ".$this_time_from1.":00"
  7.  $this_time_to_sql=$thisDateSQL." ".$this_time_to1.":00"
  8.   
  9.  $sum_hours = number_format(((strtotime($this_time_from_sql)-strtotime($this_time_from_sql))/60)/60, 2)
  10.   
  11.  // Using the examples above this is doing the following: 
  12.  2011-03-04 12:00:00 - 2011-03-04 10:00:00 = 2.00 
  13.  2011-03-08 00:30:00 - 2011-03-08 23:30:00 = -23.00 
This is great for everything during that date as long as the "To Date" never goes past midnight into the next day... But what system doesn't do this (no Microsoft jokes please)?
Category: Web-Development :: Article: 339

Hi Everybody!

My name is Joe.  I like to think of myself as a web-developer but then I like to get involved with anything related to computers.  I've been writing websites and scripts commercially since 1997 and I'm using this website to store notes as I go along.

I specialise in taking over incomplete and/or bespoke systems which have little or no documentation. I like workarounds and solutions and persist in the knowledge that anything is possible, I only have to believe. I tend to write about issues that the rest of the crowd so easily give up on.

I am usually available for consultation and short term projects. If you think I can help you and your website then feel free to get in touch using my contact form.

Thanks for visiting!  I hope this website is, as always, of some use to you!


Do you hate sites that do not have a search feature? I do. I think it defeats the purpose of cramming information endlessly in cyberspace.

So we want to give a search engine to our users. This sounds really simple, we could try:
copyraw
$search_term_esc = AddSlashes($search_term);
$sql = "SELECT * FROM Content WHERE content_body LIKE '%$search_term_esc%'";
  1.  $search_term_esc = AddSlashes($search_term)
  2.  $sql = "SELECT * FROM Content WHERE content_body LIKE '%$search_term_esc%'"
Great! Few problems though, multiple terms are not supported; quotation marks and apostrophes may be an issue;
Category: Personal Home Page :: Article: 328

So I'm starting to get the impression that I no longer tender for brand new projects competing with time and cost in order to win the bids. Recently, more and more people have been asking if I can take over a project that has been abandoned by its developer.

I've started writing this article because I find myself forgetting to ask something that could have saved an infinite number of man-hours (I exaggerate a little); but seriously, I needed a checklist that works for me.


Most Difficult?
My hardest project was (still is) one created by a PhD student who graduated and left the institution. It was a custom-built site written from scratch, and it's purpose was to manage Staff and Students within the Additional Learning Needs group. These are staff who take lecture notes for people of all disabilities and assist the students for the duration of their course. It had to allow for synchronizing with the official student record system and timetabling system (done via file upload). It included it's own timesheet / session management / invoicing system.

The website was held on a virtual host running PHP and MySQL. There was no documentation, logs, notes, and any code comments were in Hungarian (later found out it was slang or a dialect not understood by most Hungarians). Fellow students and system administrators could not accurately describe what the system was for and what it does. The developer had created the system to only last during one academic year, and the system itself only just about understood academic years (required tweaking twice a year). Then there were the error logs... some 20000 errors per use of a feature over 4 seconds. Do some developers never check the errors log?

By the time, I started maintaining the project, a revamp had been agreed with another web team. This has been delayed somewhat and still after 2 years there is no new site (blamed on the customer for not knowing what their application did in the first place... tut tut. How long have you been a developer? And this is new?).


This is a note to myself but also to anyone out there who's spent as long as I did looking for a solution to this. Maybe it's just me but this is the scenario:
  1. Joomla works fine with international characters
  2. A Module Extension I wrote for Joomla! displayed funny characters.
  3. The Joomla! articles were displaying the correct characters for that language set.
  4. I needed to make my extension read data from a MySQL database and display the caracters as intended with UTF8.

I tried enough extensions and forum solutions, and although these changes would have an effect on the module (such as take away accents and convert to ASCII), they weren't what we were looking for.

The quick solution was to make the script run a MySQL command at the start:
copyraw
SET NAMES 'utf8'
  1.  SET NAMES 'utf8' 
Now I need to run this command from within a Joomla! extension using the mysql Joomla! classes, here's how I've used in this script pulling IDs and titles from the a sample table:
Category: Personal Home Page :: Article: 303

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

RSS Feed

Related Articles

Joes Revolver Map

Joes Word Cloud

version   report   work   first   joomla   parameter   using   user   where   function   deluge   website   mysql   uploaded   windows   database   create   table   order   would   code   system   creator   name   need   following   added   source   files   file   form   used   client   license   note   data   server   google   value   script   field   error   list   find   zoho   display   time   page   case   date   JoelLipman.Com

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.