Archive for the ‘Programming’ Category

vBulletin word replacement

Saturday, January 31st, 2009

After looking for a simple plugin to replace some words with HTML code for vBulletin I decided to just figure it out and do it on my own. I don’t know a lot about vBulletin, other than how to use it, but I am pretty good with PHP. To start with I looked at the file “showthread.php”. I tried a couple of things in it but nothing worked the way that I wanted it to. I looked around a bit more and started working with the file “class_bbcode.php”. This file does the BB code conversion for vBulletin. After a few tries I found a good spot to insert a snippet of code.

To do this modification open the file class_bbcode.php and find the method “parse”. In my version of vBulletin it is on line 244.  At the end of that method there is a section of code:

if (!empty($parsedtext))
{
if ($parsedhasimages)
{
return $this->handle_bbcode_img($parsedtext, $dobbimagecode, $parsedhasimages);
}
else
{
return $parsedtext;
}
}
else
{
return $this->do_parse($text, $dohtml, $dosmilies, $dobbcode, $dobbimagecode, $donl2br, $cachable);
}

Just after the line “if (!empty($parsedtext)){” add a string replacement function:

$parsedtext = str_ireplace('someword', 'newword', $parsedtext);

Now when you view the post in your vBulletin forum anywhere the word “someword” appears, it will be replaced with “newword”.

A Guide to Website Hosting Server Language

Saturday, January 31st, 2009

Along with the increase in the number of websites on the World Wide Web comes the rise in the number of website hosting server language. ASP, PHP, JSP and other server side languages are just a series of nonsense acronyms for those who are not really into programming and website development. However, if you are interested in knowing more about web development and hosting, you might want to familiarize yourself with some of the most common online hosting server languages available to you.

PYTHON is one of the oldest website hosting server languages. Although PYTHON is not only easy to manipulate and use but also works very well with several available applications, not many people are familiar with this server language. In fact, it seems that the very technical minded guys are the only ones who use this type of language. However, if your site needs a lot of graphics and animation, you might want to consider using PYTHON. Another old but more popular server language is ASP, which means Active Server Pages. This type of language, which already had updated versions, was created by Microsoft. Many think that ASP is a good language to use if you will host a website for business purposes because this language is flexible.

The website hosting server language that is easiest to use, however, is the Hypertext Preprocessor, more commonly known as PHP. If you are just new to web development, then it is advisable that you first study PHP. In fact, this script language is very easy to master such that simply reading books or attending online tutorials on PHP is enough to equip you with necessary skills to manipulate Hypertext Preprocessor. This is also popular because most of the website hosting services that are free or inexpensive include PHP in their packages.

JSP, which is short for Java Server Pages, is also one of the most popular website hosting server languages. What makes JSP a language of choice is the availability of its server-side operation utility and enterprise solutions. JSP Servlet program, which makes creating a website using HTML easy, can also be considered as a reason why programmers are attracted to JSP language. If you are just new to programming, however, JSP is not for you because it is very complicated and hard to master. In fact, only trained JSP experts can take full advantage of its capabilities. It is important to note, however, that the scripting language that you will use in your website is dependent on what operating system your web host is using.