Wednesday, November 21, 2007

 

Prevent robot spams using CAPTCHA IMAGE

I heard lot of complaints related to the relaxed registration rules of PHPMotion compared to Vbullettin and PHPBB etc.
I myself ran into a serious robot spamming on my website CONTACT page.
Here is a free, elegant solution I found from http://captchas.net

Here is how it works.

1) Register at http://captchas.net/ and get a userid and secret key for yourself.
2) Download the following 3 files from http://captchas.net/ for PHP solution.
They have solutions for ASP, Perl, Python and JSP also.

2.1) query.php (The code you want to put in the page you want to protect against robot spam)
2.2) check.php (The code you want to put in the page you process the data submitted by the form)
2.3) CaptchasDotNet.php (you don't need to change this).

3) Use the userid and key to customize the following invocation (files 1 and 2):
$captchas = new CaptchasDotNet ('userid','secret_key',
'file_loc','3600',
'abcdefghkmnopqrstuvwxyz','6',
'240','80');

file_loc is a path to a directory on your server with write access.

See the code in action on my site

We can use the same to protect the registration page of PHPM as well.

Hope this helps!

Saturday, October 13, 2007

 

Category Counter (Part 2)

Part 1 showed you how to add number of videos to the Category list on the left side menu in PHPmotion.

This explains how to add the counter on the second page you see when you select videos from a specific category.

See PHPmotion forum for more background.

See a live demo !

Caution:This assumes that you have some experience modifying PHP code even though I made it as simple as I can.

Basically you will be adding code to the following files. Make a copy of these files first.

1) category_home.php (step 1)
2) templates/inner_category_home.htm (step 2)

View code

Labels:


Wednesday, October 10, 2007

 

Category Counter (Part 1)

This explains the step by step procedure to add number of videos to the Category list on the left side menu in PHPmotion. You access this by selecting CATEGORY tab.

See PHPmotion forum for more background.

View live demo !

Caution:This assumes that you have some experience modifying PHP code even though I made it as simple as I can.

Basically you will be adding code to the following files. Make a copy of these files first.

1) category.php (step 1)
2) templates/inner_category.htm (step 2)

View code

Labels:


 

EDIT button for UPLOAD

This explains the step by step procedure to add EDIT on the second upload page in PHPmotion where you select the file.

See PHPmotion forum for more background.

The UPLOAD page has RESET and UPLOAD buttons now. We will be adding a new EDIT button so that you can go back to the previous page
without loosing the details you entered. Please do not use the browser back button any more and use EDIT button instead.

Caution:This assumes that you have some experience modifying PHP code even though I made it as simple as I can. I have identified the new lines (total three places) using BEGIN/END boundary lines.

Let me know if you need any help.

Basically you will be adding code to the following files. Make a copy of these files first (for later restoration) in case you mess up.

1)uploader.php (step 1, two places)
2)templates/templates/inner_upload_video.htm (step 2, one place)



View code

Labels:


Tuesday, October 9, 2007

 

TinyButStrong (TBS) - PHP Template Engine of PHPmotion

PHPmotion uses a Template Engine for PHP called
TinyButStrong (TBS).
If you want to customize PHPmotion, you may have to edit the php code and the associated HTML template files.

This is what you see in the php files of PHPmotion code.

$TBS = new clsTinyButStrong;
$TBS->LoadTemplate("template_name");
$TBS->Render = TBS_OUTPUT;
$TBS->Show();

Inside the HTML template you will see TBS specific tags like
[blk1;block=begin][blk1.val][blk1;block=end]

More details

Labels:


Sunday, October 7, 2007

 

Import YouTube videos into PHPmotion

I took the code to import You Tube videos
posted on the PHPmotion forum sometime back and worked on the issues (database insert, thumb nail image generation etc.)
they mentioned and got it to work.

Here is the end result http://video.victorc21.com

This downloads the video (flv file) to your server, performs the DB insert into PHP motion database (makes think PHP motion that this was uploaded by a user) and creates a thumb nail image you see on the home page, using ffmpeg utility .

Give it a try and let me know your thoughts.

Did this due to the huge demand for this feature. PHPmotion sells a mod for this and I haven't seen it yet.
Please let me know your feedback if you have used it. I don't want to re-invent the wheel.

I am already looking at the Youtube APIs to get various reports (like top rated videos, comedy videos, most recent videos etc.) which can be used to automatically download to your PHPmotion site. Possibilities are plenty I guess ? Not sure what makes sense (if at all).

This can be enhanced to:
1) import videos to the members only area after login instead of importing to the public area without login or registration.

2) Import 10 top rated comedy videos from YT within the last 24 hrs (members only).

3)List video titles from YT and do selective import

4) Anything interesting ?

If there is sufficient demand, I will be more than happy to work on these features ....

Looking forward to the feedback from the pros.

Labels:


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]