Coldfusion DateFormat

The Coldfusion dateformat works in the same sort of fashion as the ASP.NET and the PHP date time function. As our team mainly works in Coldfusion we can expand alot more on this function that ASP.NET / PHP.

The code: (Use this code within a <cfoutput></cfoutput> tag)

#DateFormat(Now(), "YYYY")#

About the code:

As you can see all we start with DateFormat which states will want to have a date format (You can use TimeFormat to work with times). Next we are getting the current date with the Now() and then we have the formatting of the date, as we only want the year we are using ‘YYYY’ (Displays: 2009) or you can use ‘YY’ (Displays: 09)

Enjoy!

Posted in ColdFusion/Railo & MySQL | Tagged , , | Leave a reply

ASP.NET DateTime

As you might have seen we posted a small post about PHP date formatting to help keeping your websites copyright year up to date.

Well as our development team has started working with ASP.NET we will be starting to add ASP.NET tutorials and articles for you to read. We do offer custom Windows hosting with both Coldfusion and ASP.NET. If you are interested please contact us.

Now for the code!

ASP.NET is easy to pick up as some of the basics are like PHP in some ways but sorry to say not at all like the Coldfusion coding.

Date and Time:

<%= DateTime.Now %>

The year for copyright:

<%= DateTime.Now.Year %>

Enjoy!

Posted in ASP.NET using C# | Tagged , , , , , , | Leave a reply

PHP Date

We have had a few emails asking about simple PHP dates for copyright footers and having the date as part of a navigation so we thought we would post a little info pack about PHP dates.

Adding the year as part of the copyright is a great idea as it makes one less thing you have to change each year of your website. 1 more thing of the “To do List”

The simple way of getting the date and outputing it to the screen is using the example provided from PHP.NET shown below:

Source PHP.NET

<?php
$today
=

getdate();
print_r($today);
?>

To do a year only for copyright footers like we have on our website you can use:
<?php echo date(‘Y’); ?>
Hope you find this tiny bit of code handy for your website.
Posted in PHP & MySQL | Tagged , , , , | 1 Reply

Detecting iPhone, Blackberry etc using ColdFusion

Many of our clients have been asking about detecting if a user is using a blackberry or iPhone etc to view their website and redirect to a mobile version of their websites. Well we have put together a little bit of code to do this:

Code example:

<cfif findNoCase('blackberry', CGI.HTTP_USER_AGENT)>
<cflocation url="http://blackberry.yourdomain.com" addtoken="no">
<cfelseif findNoCase('iphone', CGI.HTTP_USER_AGENT)>
<cflocation url="http://iphone.yourdomain.com" addtoken="no">
<cfelseif CGI.HTTP_ACCEPT CONTAINS "text/vnd.wap.wml">
<cflocation url="http://wap.yourdomain.com" addtoken="no">
</cfif>

Hope you enjoy this code snippet.

Posted in ColdFusion/Railo & MySQL | Tagged , , , , , , , , | Leave a reply

PHP_MING Hosting

Over the past week we have had php_ming on our Linux cPanel servers to work with and many of our customers have already found this feature as a great use.

We offer PHP_MING with all our cPanel Linux hosting, see below for a list of hosting packages:

What is PHP_MING (Taken from PHP.net)

First of all: Ming is not an acronym. Ming is an open-source (LGPL) library which allows you to create SWF (“Flash”) format movies. Ming supports almost all of Flash 4′s features, including: shapes, gradients, bitmaps (pngs and jpegs), morphs (“shape tweens”), text, buttons, actions, sprites (“movie clips”), streaming mp3, and color transforms –the only thing that’s missing is sound events.

Note that all values specifying length, distance, size, etc. are in “twips”, twenty units per pixel. That’s pretty much arbitrary, though, since the player scales the movie to whatever pixel size is specified in the embed/object tag, or the entire frame if not embedded.

Ming offers a number of advantages over the existing PHP/libswf module. You can use Ming anywhere you can compile the code, whereas libswf is closed-source and only available for a few platforms, Windows not one of them. Ming provides some insulation from the mundane details of the SWF file format, wrapping the movie elements in PHP objects.

Ming was added in PHP 4.0.5.

To view the module is supported on our cPanel servers please use the following URL:

http://www.hostmediauk.com/info.php#ming

Learn more about PHP Ming

We have created a small example demo of PHP Ming and put together some information at:

http://www.hostmediauk.com/web-hosting/php-ming-hosting.php

Posted in General, PHP & MySQL, Server Scripting, Technology | Tagged , , , , , , , , , | Leave a reply

Using Coldfusion tag: CFFEED

Using the ‘cffeed’ allows you to read any websites RSS feed and display it within your coldfusion page. The ‘cffeed’ tag is a very easy tag to use and can be very handy when building a RSS display website.

Code to be placed at the top of .cfm page:

<cffeed action=”read” source=”http://www.hostmediauk.com/blog/?feed=rss2″ name=”myRSSFeed”>

Code to be placed within the <body> tags:

<cfloop from=”1″ to=”#ArrayLen(myRSSFeed.item)#” index=”i”>

<cfoutput>
#myRSSFeed.item[i].description.value#<br />
</cfoutput>

</cfloop>

You can view this working on our Coldfusion 8 servers in the UK at:
http://www.hostcoldfusion.co.uk/

Enjoy using RSS feeds on your website.

Posted in Server Scripting | Tagged , , , , , , , | Leave a reply

Our Website Grader Score

We have been working on improving elements of our websites so we can be found easier and allow our users better access to the site.

Using Website Grader we have scored 85/100 which is great news, and we hope to improve this to the 90′s mark.

A website grade of 85/100

for www.hostmediauk.com means that of the hundreds of thousands of websites that have previously been evaluated, our algorithm has calculated that this site scores higher than 85% of them in terms of its marketing effectiveness. The algorithm uses a proprietary blend of over 50 different variables, including search engine data, website structure, approximate traffic, site performance, and others.

Posted in General, SEO | Tagged , , , , | Leave a reply

FFmpeg Hosting

We have now setup FFmpeg hosting on our servers which is a great tool for adding videos to your website.

I wanted to add a blog post to give you some links to find out more about this as FFmpeg is very much under used unless you know what it is and what it does.

View our FFmpeg details page

Using FFmpeg on your hosting account with Host Media UK:

Within many pre-made scripts or your own scripts you will need the FFmpeg install path which is:

/usr/bin/ffmpeg

Hope you find FFmpeg useful and a new feature to add to your current website.

Posted in General, Server Scripting, Technology | Tagged , , , , , , , , | Leave a reply