Of course, the form is designated only for those who're not realy familiar with coding, if you're coding expert you might want to create your own form, mine is sucks, and i know that.
How To Create Daily Page Views / Post Views Counter Widget
Like the previous widgets, definitely it is, the daily page views widget that i'm going to give here is made of php script, but the widget doesn't need database and table, however the widget requires you to upload a .txt file to your root for it to saving some temporary numbers, something like that.Here is what you're gonna do:
1. Create a new text file (example.txt) and fill it with date of the last week (year/month/day), or just let it empty is fine.
2. Go to control panel > File manager > Upload the file to your root folder.
Do not upload the file to directory public_html, instead upload the file in the same place with, it's your root directory.
3. After you uploaded the file, on file manager, click or check the check box for the file then click chmood. Just check all "read" and the first "write", then the most important thing: Chmood the file to 777.
4. Finally, copypass the following script and make it .php file, then upload it to your public_html directory.
<?php
$save = "daily-counter.txt";
$open = fopen($save, "a+");
$file = filesize($save);
$today = date("d/m/y");
if ($file==0)
{
$counter = 1;
fwrite($open, $today."-".$counter);
}
else {
$read = fread($open, $file); $cdata = explode("-", $read); ftruncate($open, 0); if($today == $cdata[0])
{ $counter = $cdata[1]+1; fwrite($open, $today."-".$counter); }
else { $counter = 1; fwrite($open, $today."-".$counter); }
}
fclose($open);
echo "document.write($counter);";
?>
Here to copy
Note! change the line in red using the .txt file's name that you uploaded to your root.
Well done! Now you have one more page views counter on your blogger blog. For weekly and monthly page views, maybe you want to keep an eye on my blog. :)
0 comments:
Post a Comment