There are many ways to get the file extension of a file. Here is an example of a php function I found to do just that.
<?php
function file_extension
($fname)
{
$path_info = pathinfo($fname);
return $path_info[‘extension’];
}
?>
Another way would be to check the actual string and use what’s after the last slash. I picked this up on a forum I visit.
One of the many questions I get asked by other website developers is how do I post news on the main page with icons. My method was to build a mysql table with the information for the icons I wanted. As you will see in the News Icons control panel, I have the ability to add news icons. The form allows me to not only upload the image I want to use but it also sets an entry into my database. I use the thread’s Topic Description as a way of deciding what icon to use. So if the description was TechGear News it would know to use the TechGear News icon that I set in the database. Here is a picture of the news icon control panel.

Now to make the process of posting news and making sure I set the right text for the icon, I built a small form. The form includes a dropdown list of all the different identifiers to use in the topic description. The dropdown list pulls the info from the database table I created so when a new one is added it is automatically included in the list. The form is a popup that you can access from techgear’s main page if you have the proper rights. This is a picture of the form.

Here you enter the topic, text, source, and icon to use. It also includes some basic bbcode functions if needed. The form also uses a bit of IPB SDK in order to easily create the post. Once you have filled out the form you click submit and the popup will close and the site will refresh to show the latest article.
I hope that helps out other users that are looking to do something similar.
As you may have noticed I have decided to use WordPress as the backend for the development blog. I can’t say enough good things about wordpress. I have used it on several sites and I must say if you are looking to build a simple site you can’t go wrong with wordpress. As you can see you can easily implement a custom theme. There are literally hundreds of themes and addons available for wordpress. For all you portal users, you should seriously think of giving a wordpress a try.
Hope everyone enjoys the new dev blog.
Hello and welcome to the new TG007 development blog. Here we will share information about the continuing development of techgear. We plan to give you a look inside the world of design as well as information we have learned along the way. Here you will learn about the coding and tools we use to keep techgear growing.
Note: This is not a help resource. This is simply a dev blog about the site. If you need help please use our forums.