Category: how to

How to subtitle in After Effects

To subtitle in After effects, use the script linked below.

// Subtitle generator by !Rocky
// modified by Colin Harman ( ) to work on a Mac
// modified by Oliver to work with CS5
// Save this code as
// "subtitles.jsx"
// Create a text file with your subtitles.
// Each line of text is one on-screen line.
// To have several lines on-screen at the same time,
// simply separate them with a pipe ( | ) character.
// eg "Character 1 talks|Character 2 interrupts"
// Create a new text layer in your comp, adjust its position,
// make sure the text’s centered, so it looks nice
// Add markers (Numpad *) where each subtitle line must be shown/hidden.
// With the text layer selected, run the script, and select the subtitles file.
// Enjoy!

function makeSubs() {
var layer = app.project.activeItem.selectedLayers[0];

if ("sourceText") != null) {
var textFile = File.openDialog("Select a text file to open.", "");
if (textFile != null) {
var textLines = new Array();"r", "TEXT", "????");

while (!textFile.eof)
textLines[textLines.length] = textFile.readln();


var sourceText ="sourceText");
var markers ="marker");

for (var i = sourceText.numKeys; i >= 1; i–)

var line = 0;
var subTime, subText;
for (var i = 1; i <= markers.numKeys; i++) {
subTime = markers.keyTime(i);
sourceText.setValueAtTime(0, " ");

if ((i % 2) == 0) {
subText = " ";
else {
subText = textLines[line].replace("|", "\x0d\x0a");
sourceText.setValueAtTime(subTime, new TextDocument(subText));

PHP, handling forms

HTML form, which calls a seperate php file, called action.php:

[html collapse=”false”]
<form action="action.php" method="post">
<p>Your name: <input type="text" name="name" /></p>
<p>Your age: <input type="text" name="age" /></p>
<p><input type="submit" /></p>

The contents of action.php:

[php collapse=”false”]
Hi <?php echo htmlspecialchars($_POST[‘name’]); ?>.
You are <?php echo (int)$_POST[‘age’]; ?> years old.

Your name:

Your age:


From: A simple tutorial

How to create a mouse-over image for a wordpress post

This comes from a nice tutorial that you can find here at: More Than A Maths Teacher.

You will need to add a javascript file to the root folder of your current wordpress theme. Code is below. Note the the images I used for the mouse-over are named image.png and image_over.png. For this particular script to work, your images must be names image.png and image_over.png ( “image” stands for whatever you want, and can be replaced). If you want to use another file format, than png, you must edit the code.

jQuery(function($) {
$(document).ready(function() {

// Preload all rollovers
$(".hoverlink img").each(function() {
// Set the original src
rollsrc = $(this).attr("src");
rollON = rollsrc.replace(/.png$/ig,"_over.png");
$("<img>").attr("src", rollON);

// Navigation rollovers
$(".hoverlink a").mouseover(function(){
imgsrc = $(this).children("img").attr("src");
matches = imgsrc.match(/_over/);

// don’t do the rollover if state is already ON
if (!matches) {
imgsrcON = imgsrc.replace(/.png$/ig,"_over.png"); // strip off extension
$(this).children("img").attr("src", imgsrcON);

$(".hoverlink a").mouseout(function(){
$(this).children("img").attr("src", imgsrc);


Nextyou will need to add the following code to your head.php file, somewhere between the tags.

wp_enqueue_script(‘hoverlink’, get_bloginfo(‘template_directory’).’/rollover.js’);

Finally use this format to the post to add the images:


<div class="hoverlink">
<a href=""><img src="" border="0" alt="mouse-over" width="200" height="100" /></a></div>

How to learn PHP

1. Download and install XAMPP (free). You will need to run this software (or similar) to enable an Apache web server on your computer. In other words you need this to run PHP scripts.
2. Download and install Eclipse PDT All In Ones / Eclipse PHP Package (free). This is a development environment, a text editor and other tools, with which to create your PHP scripts.
3. Launch XAMPP. Start Apache, and MySQL.
4. Launch Eclipse. You will need to choose the “workspace”. The workspace is where you will save your php files. Generally you will want to use XAMPP’s htdocs folder. Found in the application folder where XAMPP resides. While XAMPP is running you will be able to launch your php scripts in a web browser by navigating to http://localhost/myScript.php
4. Find a book or tutorials. Start learning.