Archive

Archive for September, 2008

How to Convert HTML Link Code into BBCode With PHP

September 26th, 2008 No comments

Another short function appears on my blog. If you need to convert your HTML code, containing links only, into BBcode, you need this function:

function make_bbcode($normal)
{
$samurl=str_replace(“<a href=”, “[url=", $normal);
$samurl=str_replace("</a>", "[/url]“, $samurl);
$samurl=str_replace(“>”, “]”, $samurl);
return($samurl);
}

That’s a very simple solution that doesn’t cover all the instances of HTML code. If you need a good converter, I’d suggest you this one. That’s a great service that allows you to deal with different options of forum code, and it’s absolutely free. You’re also welcome to download and run HTML to BBCode converter script . Source code is available there so you can organize your own service of code conversion :) Another simple service that has any design is this one. I don’t think there is any difference as the script is quite simple and free.

How to Use Double Variables in PHP Scripts

September 25th, 2008 No comments

I’m coming with a small piece of code that contains a sample of double variable usage. Let’s take we have a script that transmits lots of parameters, named activ1, activ2, activ3… activn. How should we work with them?

A simple solution is pasted below.

for ($i=0; $i<10; $i++)
{
$varname=”aktiv”.$i;

if (isset($$varname))

{
// Do anything you want here
}
}

You create variable names in a loop and then use double variables. This helps you to check how many parameters were sent, what are their values and anything else related to a big number of parameters that could be transmitted to a script. It is a common practice to use such a variables with checkboxes and this one will be the easiest way to sort them out.

How to Monetize This Blog?

September 24th, 2008 1 comment

Today one more pragmatic question will be discussed. You’re reading a blog that contains my knowledge, my personal experience, and at the moment I am not getting any profit of it. I think that’s a good idea to earn some money for my secrets. :)

The first I tried was Google Adsense. Frankly speaking, it’s my first experience when I got absolutely no clicks after 1,638 impressions. I think that’s because all my blog visitors know what is Adsense and don’t want to bring me some money :) . Maybe I am doing something wrong, maybe I should play with different templates and ad color schemes, but at the moment I can’t monetize my blog using Adsense. If you have any suggestions, you’re welcome to place some comments.

The next thing I tried – a web hosting affiliate program. It’s too early to make any decisions, but I’ve got just a single click on the top banner. I know that banner ad CTR is quite low, but I really have no other idea how to monetize my blog. I’d like that this blog becomes a good site about Linux and I hope to be my main job. But… how can I earn money?

Do you have a similar blog? What are the solutions? I am really waiting for some good ideas.

How to Add a Domain to Your Directadmin Account

September 23rd, 2008 No comments

If your hosting provider has set up the option of adding multiple domains for your account, this information is right for you. I’m going to create a guide with screenshots, that will tell you how to add a domain name to your account.

First of all, we need to log in.

Then let’s go to the Domain Setup section.

Next we need to click Add Another Domain

Now we’re adding anotherdomain.com name we have and changing other parameters if necessary. We’re getting a message that domain was created successfully.Let’s click Home icon in the top left corner.

Now we have both domains active. Click any to manage all other settings. As you can see, adding adomain in DirectAdmin is simple as 1-2-3.