How to view your WHMCS Template before you upload it
WHMCS uses Smarty templates which can be setup on your PC to view your changes before you upload them.
Of course there are some linits as the variables must be set for each page which make it a bit of a task.
But if all you want to do is edit the header and footer then I have done the work for you.
Create a index.php file and add the following to it.
<?php
// put full path to Smarty.class.php
require('libs/Smarty.class.php');
$smarty = new Smarty();
$smarty->assign('companyname',your title here'); //<<-- Your Company Title
$smarty->assign('systemurl','http://localhost/'); //<<-- place the url here
$smarty->setTemplateDir('templates/default'); //<<-- this and the next two must match exact your folder names.
$smarty->setCompileDir('templates_c');
$smarty->setCacheDir('cache');
$smarty->assign('template','default'); //<<- Set it to template folder name and do not change anything below this.
$smarty->assign('charset','utf-8');
$smarty->assign('LANG' , array('hometitle'=>'Home','announcementstitle'=>'Announcements',
'knowledgebasetitle'=>'Knowledgebase',
'networkstatustitle'=>'Network Status',
'affiliatestitle' => 'affiliatestitle','contactus'=>'Contact Us',
'account'=>'Account','login' =>'Login', 'register'=> 'Register',
'forgotpw'=> 'Forgot Password?'));
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 120;
$smarty->display('header.tpl');
$smarty->display('footer.tpl');
?>
That's all you need - now download Smarty 3.x1.7 and copy your WHMCS template folder including all files in it and the includes/jscript folder to your PC
create a directory structure under your web folder as follows
/lib
/includes/jscript
/cache
/templates
/templates_c
That's it - you should be able to view the header and footer as it will look on your site in WHMCS.
There was one problem I had which was the menu didn't work under this proper. For some reason the background color didn't show on the default template and the drop down menu didn't work. This could be due to WHMCS using an older version of Smarty. ( ver 2.6.26)
But you really don't need those to work since they should be changed.
You can set the debug or the cache on if you wish but it's best to leave the cache off for development since you will need to view changes. Having the cache on will require you to erase the cache files in order to see changes made.
Have fun
You bet it is as I can see no good coming from it.
This came to my attention just recently as a website ( clean-mx.de ) emailed my server company and the us-cert.gov website because a hacker defaced a clients website.
Dear abuse team,
please help to close these offending portals sites(1) so far.
This goes on to show reports from their site and also showing reports from www.bfk.de .
Notice they say close down the offending website. Not repair - not fix - no they want it gone.
In this case Wordpress made a mistake and fixed it so a simple update was required along with restoring the database from backup and deleting any files that did not belong.
Now I ask you this. Why is the government interested in matters that they can not do anything to change. Why would they want a list of websites that were hacked?
I'll tell you why. This is to create reports for analysis. They will break it down and sooner or later make a recommendation as to how to solve this problem.
Their solution will be to create a new law or regulatory branch of government to impose high license fees to website owners. What other possible thing can they do?
This of course will be supported by large companies which will benefit by this as it will make it harder for small startup companies.
There is no reason to track these events other than to compile information which will be the core info of a report used for a recommendation of a new government agency.
Yes I said no reason to track these events as there is nothing they can do about it.
They will not and can not track down the hacker therefore this is a waste of time.
That is my opinion and I don't like what I see.
Seems that some browsers do not support group objects.
Google Chrome for instance has problems with multiple check boxes with the same name.
This has caused problems with E-Classifieds when a person adds a new Classified Ad.
If you have version 2.X and you set the max categories to allow multiple subcategories then it will error.
The error will be a required item was not filled in.
The fix to this is to replece the check boxes with a Select.
The file that we need to edit is under the folder /html/
File name is post_item_form.pl
Line 173 on down to line 178 in this file needs to be replaced with
print qq~<select name="subcategory" multiple=true>~;
foreach $subcategory (@subcategories) {
print qq~ <option>$subcategory</option>~;
}
print qq~</select></td></tr>~;
}
This should fix it.
Windows XP was the peak and as we go forward Microsoft will slowly destroy it's OS.
The first blow came when Microsoft clearly disregarded it's main source of income.
When it put out Vista, which had no backward compatibility to XP, this was a major mistake.
It took years to develop it's strong hold in the corporate market.
Yet Microsoft is determined to now cater to new technology rather than paying clients.
Windows 7 although it solves much of the Vista problems it offers no upgrade path from XP.
Windows 8 maybe a really nifty looking OS but it is a complete departure from the basic roots.
My guess is Linux will become the main stay for office work as Microsoft can no longer be trusted.
When it comes to who the OS maker will support, the trendy fades or the main stay corporate clients, Microsoft has clearly shown they will jump on the quick money band wagon.
I suspect that Windows 8 will be the beginning of Microsoft's downfall.
Having placed an Ad in a popular Classifieds website, which I will not mention, I have gotten so many responses that are either phishing attempts, Scams, Spam or ones that are trying to spread a virus by giving links to infected websites.
The numbers of this type of Ad response is up 1000% over just a few years ago.
One response I got was a popular Nigerian type of Scam.
They will send me a check and 10 PC's but the check will be more than what is needed and I should use the balance to pay for the other 10 PC's.
Really big Classified websites may well be forced to change the way they run their website due to this if it continues to become a growing problem. I can see that a login will be required for those that wish to view the ads as a way to combat this. It may also be a problem for Auction sites as well.
At this point do not assume that the person responding to your Ad is a honest person!
Do not click on any links given in an email.
Do not assume that a email sent you came from the auction or classifieds website.
A popular phishing attempt is to send you a email that looks like it came from the website you placed your ad in but it's really trying to get you to click on the link to get your login details.
Best never to use a link in a email!!!! Go to the site in your web browser and login as this is the best way to protect yourself.
Do not accept any offer that will pay you in a check larger than what you are expecting to get.
One type of scam is they can withdraw money from your account if they have a check from you and the info of a check deposited into your account that they sent you. This has taken place before and you can look it up as it happened to a few non-profits.
A person sent a non-profit a check larger than was told they would send. They then convinced the non-profit it was a mistake and to send them a check back for the difference and this a few weeks later left the non-profit with a empty checking account.
The problems in the world are growing and I fear they are growing faster with each passing day.
The internet is also reflecting the growing troubles in the world.
Online Backup is growing in popularity but unless you have a very high speed internet connection it will take many hours or even days to backup a full PC
If you decide to use this type of backup then you will need to limit your backup to only important documents stored on your PC unless you can afford to go to a very high speed internet connection. Costs of such a connection will be about 140.00 per month and it's still limited to 20 Mbs which is around 150 Megabyte per minute.
I prefer the use of External Backup as it's less costly and portable. The old Tape backups in today's world are obsolete so the only choice is hard drive backup. The lowest cost units are simple USB external drives which can do a complete system backup. For those that need something better Netgear and a few other companies have units that cover any backup need a person or small company will require. Backups for a complete hard drive, depending on the amount of data, can be as fast as 20 mins.
Software choice for backup is a big factor in speed, ease of use and ease of restoring data.
The backup that comes with Windows is not very good as it was designed when drives were only 50 Megabytes in size and was designed to work with tape drives. It's been tweaked over time but is not something I would bank on and it can not restore your OS as it's not an image backup.
It's very slow and not easy to use.
I recommend Acronis backup as it's very easy and it creates a image backup which is the best type of backup.
Should your boot drive fail you only need to place a new drive in your PC and boot to the Acronis restore disk.
From there choose the backup and when it's done your PC is working exactly as it was before the old drive failed.
You can also restore your backup to a new PC and it has drive copy ability which is another big plus.
A big plus feature is the ability to open a backup in Windows Explorer using the mount feature in Acronis.
When a backup is mounted it will appear as a new drive letter in Windows Explorer and there you can access all your files at hard drive speed.
This allows you to go back and view files or copy backed up files should some files have been damaged or erased.
If you have data that is important then you can setup backups that take place weekly and incremental backups that take place daily. If you drive has enough room for multiple backups then you can do multiple sets of backups spaced apart by a week or two or more. This allows you to go back in time as if the latest backup was also containing files that were damaged the one two weeks ago may have a good version of that document.
For one of my clients I have setup 4 full backups and 4 incremental backups that take place in sequential order so as to have 4 weeks of complete backups. This allows up to a one month period to discover a problem and be able to recover the files which may not be up to date but is at least better then nothing.
Admin
CW3 Web Hosting
How to remove send to friend
To upload files with php is pretty simple.
We first start with a basic form and add enctype plus method = post.
<form action="index.php" enctype="multipart/form-data" method="post">
<input type="file" name="upload" size="40">
<input type="submit" name="start_upload" value="Start Load">
</form>
You can place this form on any page but will need to change the action= to match the name of the php script you create. In our example we named it index.php but it can be any name as long as the extension is .php.
We now add the PHP code which is as follows:
<?php
$tst = isset($_POST['start_upload']) ? $_POST['start_upload'] : '';
if (!empty($tst)){
// Where the file is going to be placed
$target_path = "/home/yoursite/public_html/uploads/";
/* Add the original filename to our target path. */
$target_path = $target_path . basename( $_FILES['upload']['name']);
if(move_uploaded_file($_FILES['upload']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['upload']['name']).
" has been uploaded<br>";
}else{
echo "The uplaod failed!";
}
?>
It's that easy and the only other thing you can do is add a filter to only allow certian file types.
To do this we can add these lines:
$filetype = $_FILES['upload']['type'];
if($filetype=="application/pdf" or $filetype=="application/zip" or $filetype=="application/x-zip"){
Put your code here to upload file!!
}
You can add or remove file types to the above sample.
To change the status page you need to edit the template file serverstatus.tpl.
This is located under templates/default.
The lines as follows that come as the default can be changed.
<tr class="clientareatableheading">
<td>{$LANG.servername}</td>
<td>HTTP</td>
<td>FTP</td>
<td>POP3</td>
<td>{$LANG.serverstatusphpinfo}</td>
<td>{$LANG.serverstatusserverload}</td>
<td>{$LANG.serverstatusuptime}</td>
</tr>
{foreach key=num item=server from=$servers}
<tr class="clientareatableactive">
<td>{$server.name}</td>
<td>{get_port_status num="$num" port="80"}</td>
<td>{get_port_status num="$num" port="21"}</td>
<td>{get_port_status num="$num" port="110"}</td>
<td><a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}</a></td>
<td>{$server.serverload}</td>
<td>{$server.uptime}</td>
</tr>
As we can see the function get_port_status is passed a port number.
So to add additional checking you only need to add another line with the port you wish to display.
I would suggest right off to remove the PHP info link as it can cause you problems with hackers.
For my servers I put
<tr class="clientareatableheading">
<td>{$LANG.servername} / Info</td>
<td>CPANEL</td>
<td>HTTP</td>
<td>FTP</td>
<td>POP3</td>
<td>MYSQL</td>
<td>WEBMAIL</td>
<td>WHM</td>
<td>PHP Ver</td>
<td>MYSQL Ver</td>
<td>{$LANG.serverstatusserverload}</td>
<td>{$LANG.serverstatusuptime}</td>
</tr>
{foreach key=num item=server from=$servers}
<td>{get_port_status num="$num" port="2082"}</td>
<td>{get_port_status num="$num" port="80"}</td>
<td>{get_port_status num="$num" port="21"}</td>
<td>{get_port_status num="$num" port="110"}</td>
<td>{get_port_status num="$num" port="3306"}</td>
<td>{get_port_status num="$num" port="2095"}</td>
<td>{get_port_status num="$num" port="2086"}</td>
<td>{$server.phpver}</td>
<td>{$server.mysqlver}</td>
<td>{$server.serverload}</td>
<td>{$server.uptime}</td>
{foreachelse}
<tr class="clientareatableactive">
<td colspan="12"><hr></td</tr>
<td colspan="7">{$LANG.serverstatusnoservers}</td>
</tr>
{/foreach}
This shows the info we would like to see but I also added a link, on my hosting site ( cw3host.com ), to view the server info via the script PHPSysinfo
The templates allow conditional processing which is really a great help to make you page do what you want.
Putting {if $server.name eq "Server1"} will control how a single server is processed in your page.
For version 5.13 it has changed.
-------------------------------------------------------------------------------------------
We now have to add lines to the javascript functions.
For instance if we want phpver we add the following to the function getStats(num)
jQuery("#phpver"+num).html(data.phpver);
Add your table header
<th class="textcenter">PHP Ver</th>
Then the table col
<td class="textcenter" id="phpver{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td>
And that's it.
You can add ports but would need to add a line for each after the <script> at end of table ( last col )
As you can see for port 21 thay have checkPort({$num},21);
Just add a Table heading <th> and column for each port plus the checkPort function call.
How to setup Remote Desktop