Menu

Readme Log in to Edit

Public Hub

Author: Ty Clifford snick@isnick.net

License: Creative Commons Share-Alike
(Follow other respective licenses that are in here, too)

A minimalistic site. Its aim is to use a SQL database as little as possible.
This was hacked together for me by me. Don't expect it to be user-friendly - Not
intended to be user-friendly.

See [Credits] for detailed info.

Required tools

HTTPD (Pref. one that supports URL rewriting if you wish to use it)
PHP (5+)
MySQL(i)
FTP, SSH, or some other method of uploading files
Mail Server (Required to send out emails if you want activation/forgot password)

INSTRUCTIONS

Uploading / Configuring

Step 1:
You should've already downloaded publichub.*.tar.gz. Where * is the version number.

Unpack it into a directory such as: /var/www/html
Assuming Public Hub is the only site that'll exist on the server.

You should end up with a tree like /var/www/html/:

css/
images/
models/
upload/
player/
javascript/
install/

And of course, all the other PHP files should exist too.

SIDE-NOTE: **upload/** should have a permission of 777 or 755. This means, it wouldn't 
be a good idea to allow uploading of any "website-like" executables, such as PHP.

Step 2:
Open up models/settings.php and enter your database/siteinfo information.

$dbtype = "mysql";
$db_host = "localhost";
$db_user = "";
$db_pass = "";
$db_name = "";
$db_port = "3306";
$db_table_prefix = "publicHub_";

Change $db_table_prefix to something else if you want. It's actually recommended.

Next:

$websiteName = "Public Hub";
$websiteUrl = "http://pub.isnick.net/"; //including trailing slash
$coralUrl = "http://pub.isnick.net"; # doesn't need slash

$coralUrl will generally be the same as the $websiteUrl, however if you have another 
domain you'd like Coral to access, input it there. (recommended leaving it the same)

Then:

if(CORAL == ON){
$globalNetName = "$coralUrl.nyud.net";
} else {
$globalNetName = "$coralUrl";
}

You can leave this like it is, but if you have Public Hub running on a "sub-URL" rather 
than a sub domain or top domain, then you will have to append where the site is as so:

$globalNetName = "$coralUrl.nyud.net/site";
} else {
$globalNetName = "$coralUrl/site";

This is so when activated, it'll point to the URL, and not just the domain.
(itss basically the same as $websiteUrl, only without the trailing slash)

Finish Install

Step 1:
Hopefully you've configured everything correctly, so now you should go to:

http://example.com/install/

The script will ask to install. If all goes well, you can then remove the
install directory install/ when finished.

Step 2:
Once installed, and the site appears to work. Head to:

http://example.com/?area=register
Register your Username.

Finished!

Settings

Coral CDN

By default CoralCDN is turned off. To enable it open:

index.php

define("CORAL","OFF");
Is what you should see at the top. Change "OFF" to "ON"
The website should start using the Coral network.

Website Template
X3non is the default website template included. To edit the files you'll
need to open up:

header.php
footer.php
These are the 2 main files that hold the most about the template, other than
the other files, such as pub.php, and uf.php.

I recommend leaving the header.php and footer.php alone, and creating your own 
template files. Giving them a name like, **header2.php** and **footer2.php**. Once 
you have did that, open up:

fpub.php
You should see:

function sHeader($s_header)
{ switch ($s_header) {
default: print 'Header error. '; break;
case 'class1':
include "header.php";
break;
}
}

Simply make an extra case, and name it whatever you want, but I recommend **class2**.
It should look something like this when finished:

function sHeader($s_header)
{ switch ($s_header) {
default: print 'Header error. '; break;
case 'class1':
include "header.php";
break;
case 'class2':
include "header2.php";
break;
}
}

Do the same thing for "**_function sFooter_**."

Enabling the second created theme, open:

index.php
Look for:

$SP_HEADER = "class1"; # sHeader();
$SP_FOOTER = "class1"; # sFooter();

Change the **class1**s to **2**s. Don't forget to put your style sheets in **css/** or some 
other place that's easy for you.

You'll need to edit the rest of the files if your style sheet does not fit your added template.

URLs
By default URLs are set as ?area. If you want to make them like /account/upload you'll have
to create a rewrite rule native to your HTTPD. See your HTTPD's Manual for instructions or:

http://pub.isnick.net/

To edit them open up /var/www/html/:

urlwrite.php

This file holds the URL variables in array to be used widely around the website. Change them 
to something suitable. Recommended to test off-site first.

Example: $links['account'] will return the switch ?area=account. Combined with $globalNetName 
you can do things like:

$globalNetName/$links['account'] or just $links['account']

**Go to _Mail_ to see more about URLs in emails**

Mail
If you do not have a mail server such as Postfix, or some other already-configured SMTP
Pubhub will not be able to send out emails to visitors.

To change the mail messages go to the directory:

/var/www/html/models/mail-templates/
You'll see everything here in text files.

If you decide to use URL writing, or just simply want to change your URLs in the mail messages 
you'll need to open up /var/www/html/models/lang/:

en.php

You'll need to carefully skim through and see what to change.

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB