I have written a few programs in PHP and C++ which can be downloaded here. They are all released under the GNU GPL, so can be freely edited by anyone.

MGBS


MGBS is the Mooseguy Blog System. It is co-written by Xyzu and myself. Basically, it is a collection of PHP scripts designed to manage a blog. It uses MySQL for the database. It has a selection of templates, and a web-based control panel. It isn't hosted by mooseguy.com, but is hosted by SourceForge, here.

C++ Pascal's Triangle Generator

This is my first effort at a program in C++. Quite simply, it generates as much of Pascal's triangle as you tell it.

C++: triangle.cpp


//A program to generate Pascal's Triangle

#include <iostream>
#include <vector>
using namespace std;

int var, lines, length, newlength, looplength, numberslength, trianglelength, add1, add2, first, second, q, i, n;

vector<unsigned int> numbers;
vector<unsigned int> triangle;

int main()
{
cout << "Welcome to the Pascal's triangle generator!\n\n\n";
cout << "Please enter the number of lines that you want to generate > ";
cin >> lines;
numberslength = lines + 3;
trianglelength = ++lines;

length = 2;
looplength = 3 ;
newlength = 2;
lines = lines - 2;
numbers.resize(numberslength);
triangle.resize(trianglelength);

cout << 1 << "\n";
numbers[0] = 0;
numbers[1] = 1;
numbers[2] = 0;
n = 1;

for (int n=0; n<lines; n++)

{
first = 0;
second = 1;

for (int i=1; i<looplength; i++)
{

add1 = first;
add2 = second;

add1 = numbers[add1];
add2 = numbers[add2];

triangle[i] = add1 + add2;
cout << triangle[i] << " ";

++first;

++second;

}

cout << "\n";
++length;
++newlength;

numbers[0] = 0;
numbers[length] = 0;

for (int q=1; q<looplength; q++)
{

numbers[q] = triangle[q];
}

++looplength;

}

cin >> var; //To stop it closing straight away...
return 0;
}

If you're running linux, then you'll run this in a terminal anyway. However, on other OSs, unless you run it in a terminal (e.g command prompt), it will close straight away. This is easily fixed, and I have fixed the source above. However, The precompiled version doesn't do this. Basically, just run it in a terminal! For Winduhs users, here is a pre-compiled version. If you use Linux, then you should know how to compile it.


DarkKDE Splash Screen

DarkKDE Splash Screen, is (as you might be able to tell from the name), a dark spash screen for KDE. It is pretty popular (250 downloads in the first 3-4 days, and complements a dark desktop setup nicely. It is hosted by KDE-Look, here.

Mooseguy Feedback Script

This is the script that I use on my comments form. It is very small, but formats it nicely. The PHP script needs putting in a file called 'comments.php' and the HTML can be added to any file that can be called anything, but it must be in the same folder. Obviously, if you know HTML, then you can change the code so that the PHP isn't in the same folder, but I've kept it simple for beginners.

PHP: comments.php


<?php
mail('yourname@yourdomain.com', $_POST['subject'], $_POST
['message'], 'From: '.$_POST['name'].' <'.$_POST['email'].'>');
?>


HTML


<form action="comments.php" method="post">
<p>Name:</p><input type="text" name="name">
<br>
<p>Email:</p><input type="text" name="email">
<br>
<p>Subject:</p><input type="text"name="subject">
<br>
<p>Message:</p><textarea rows="12" columns="50"
name="message">Please type your message here.</textarea> <br>
<input type="submit" value="Send"><input type="reset" value="Clear">
</form>