A little bit of everything…
RSS icon Home icon
  • AJAXifying your site’s navigation

    AJAXThis post is inspired in Refreshing DIV content with AJAX. However this code does not actually automatically refresh the contents of a DIV but it refreshes them when the user clicks a link. The implementation of the code below allows to refresh the contents as mentioned, but the content retrieved can be different every time. This is very useful to make a website work in a similar way as with frames, but with more advantages and without the disadvantages of frames.

    I provide the code necessary to achieve this purpose but I don’t present it like a step-to-step tutorial. This is because I guess that for anyone with minimal knowledge of HTML and JavaScript is totally self-explanatory and because I would prefer you to make your website look like you want it to rather than like my post tells you to.

    You can see a demo page with AJAX navigation here.

    Read the rest of this entry »

  • Retrieving custom data into EventList

    This is the second part of the post Adding custom fields to EventList, where I explained how custom data fields can be added to EventList Joomla Component by Schlu. In this post I will cover how to take full advantage from those custom fields by making EventList RC1.0 for Joomla 1.5 retrieve the information submitted through them.

    As I mentioned in the first part, EventList does not allow (yet) a user-friendly system for adding custom fields, therefore there’s no user-friendly system either to retrieve custom data into EventList. Some modifications to the core files of the component are required for this purpose. The good news is, that it is not as complicate as it might seem at first.

    Read the rest of this entry »

  • Automatically query MySQL and output results with AJAX

    AJAXThis is an extension of the post Refreshing DIV content with AJAX. I recommend you read it at first because you will understand better what the script below is about.

    What this script does is the following: without having to press any refresh button, and not even reloading the whole page (but a DIV), it retrieves every X seconds the specified data from a MySQL database and displays in the DIV the refreshed contents of it. In other words, it queries the database regularly and updates the output. Read the rest of this entry »

  • Populating a dynamic drop down menu from a MySQL database

    This PHP code snippet retrieves the data in a specific column of each row in a MySQL table. The retrieved data is echoed to the DOM and displayed as options of a drop down menu. The options of the drop down menu are dynamic, as they will change automatically every time the information in the database is modified.

    Read the rest of this entry »

  • Refreshing DIV content with AJAX

    AJAXAJAX (Asynchronous JavaScript And XML) is a keystone of Web 2.0 and is very useful in many aspects, because it offers the possibility to change the structure of the page (DOM). For instance, it makes possible refreshing a part of a website instead of having to use the classic page reload, which requests again the whole page from the server even when the updated parts are minimal (much slower and of course consumes more bandwidth; therefore making the visitor experience worse).

    If you know what a HTML <div> tag is and how to use it, with the help of AJAX refreshing a section of your website is possible. The section which will be refreshed is within a DIV; the rest of the HTML outside the DIV will not be refreshed.

    To show you how to do so, I prepared an example with the code required for this purpose. But if you’re new to AJAX and would like to know how the code works, I recommend you to take a look at first at w3schools AJAX tutorial.

    Read the rest of this entry »

  • Showing registered users in EventList module

    When using EventList module in conjunction with EventList 1.0RC component for Joomla 1.5, I missed the possibility of displaying in the module the number of registered attendees to each event, together with the already showing date, time, event name, etc.

    My approach to the issue was to add some extra PHP code to the EventList Mod template; concretely the code below. But before you attempt to try the same in your website, remember to backup the affected file.

    Read the rest of this entry »

  • PHP: converting string into formatted date

    While coding I came across the following situation: a date which was showed with the format YYYY-MM-DD, but I wanted its format to be DD-MM-YYYY.

    Obviously there’s the PHP Date function, you will think, but the point here is that the initial date was a variable as string. Therefore using directly the date function did not work…luckily it is not difficult to find out how to get the desired results.

    Read the rest of this entry »

  • Adding custom fields to EventList

    One of the sites I was recently building uses EventList Joomla Component by Schlu. Despite it being a great tool, it does not allow (yet) a user-friendly system for adding custom fields, for instance in the venue submission screen or in the user signup page. It is possible however, according to their official forums, that a future release will have the option to add custom fields in easily from the backend.

    But right now, from the backend it is not possible.

    Read the rest of this entry »