Script:
Content Injector

Version:
1.3

__________________

index.html
Last Revision:
10 Mar 04

 

Content Injector - Version 1.3 Manual - (C) Andrew Pemberton 2004. All Rights Reserved

This manual contains instructions on what you need to do to get Content Injector up and running on your site, and basic usage information and a simple walkthrough of the functions.

At the end I have also included some Frequently Asked Questions and answers, it is advised you read the readme.txt as well as this document.

Please visit the Faq & support section at my site www.p3mbo.com before emailing for support.


Contents:
1.0 Installation - Step By Step
---- 1.1 Requirements
---- 1.2 config.php
---- 1.3 Uploading
---- 1.4 Extracting the Tables

2.0 Setting Content Injector Up
---- 2.1 Logging In
---- 2.2 Changing Your Password
---- 2.3 System Setup

3.0 FAQ



1.0 Installation - Step By Step

1.1 Requirements
Okay, first of all what you need to do is check with your host whether you have support for both PHP & MYSQL, if you don't have both of these, then there's a big problem, and I'm afraid you won't be able to use this script (unless you find somewhere else to host your site that is ;) )

If your site supports PHP and MYSQL, thats great - but you'll need some more settings before you can continue, firstly you'll need your database host name (usually localhost), you'll also need the username and password too.

And, if you haven't already, unzip the contents of the zip file you downloaded being sure to maintain the directory structure of it

Once you've done all the above, we can get started.


1.2 config.php
Locate config.php (it should be in the base directory  of the script), and should begin something like this: (open with notepad.exe)

<?php
/***************************************************************************
* config.php
* -------------------
* Creation Date : 06 September 2003
* Last Modified : 20:27 26/11/2003
* Copyright : (C) Andrew Pemberton 2003
*
* Contact Info :
* Email: pembo@neonerve.com
* ICQ : 31466226
* MSN : p3mbo@hotmail.com
*
*
*************************************************************************

If what you have opened doesn't look like the above, then look around until you find something that does. Now that we've got that file open, scroll down till you find something like the below:

// Hostname: this can usually be left as localhost, depending on whether or not
// the database your connecting to resides on the server the script is being run
// from - if your unsure, ask your host.

$host = "localhost";

Change the text after $host = to reflect the hostname of your site (being sure to keep the "'s in and the ; at the end of the line) for example $host = "62.104.19.10"; would be valid.

Then scroll down further, and look out for
$user = "root"; $pass = "password"; and be sure to change them to reflect the settings on your server.

The next thing to look out for is further down the page:

// Database Name: This can be pretty much anything you want, by default it is set as
// content_inj, although you can name it after your cat, dog whatever, sensible names
// that mean something and relate to the content are usually better though :)

$dbname = "content_inj";

This is your database name, and be called anything you want really. To create a database you'll need a database administration tool (unless you already have one created for you). If you need to a database admin tool, I recommend phpMyAdmin (http://www.phpmyadmin.net/) note: I will not provide support on how to use this.

Another option you might have to configure is the $URL_ROOT variable, find the following in the config.php file

// URL ROOT: This is the URL of your site in relation to the script
// (NOTE: URL, not absoloute), for example If your site is 'http://www.thisismysite.com'
// and the script is located in the base directory, the $URL_ROOT should be left as '/'
// If the script is located at 'http://www.mysite.com/php/scripts/content/' the url
// root would be /php/scripts/content/ (note the / at the start and end) - if your
// having trouble, just play around with the setting, your bound to get it right :D
//
$URL_ROOT = '/';

If the URL to your script is www.sitename.com/content/injector/yey/here/ then your $URL_ROOT should be set too $URL_ROOT = '/content/injector/yey/here/'; if your site is located at www.thisismyhost.com/mysite/ your url root would be /mysite/ if your site is located at www.mysite.com your url root should be left as / . Again, ensure you keep all the 's and ;s in the correct place.

And that should be it for your config.php!


1.3 Uploading
Now, fire up your ftp client, if you don't have one, try and find a good one with CHMOD capabilities, such as cuteFTP (http://www.globalscape.com) again, I will not provide support on how to use these.
Connect to your site, and upload the files from the zip file, maintaining the directory structure, I recommend uploading to the root of your directory, although it is not necessary.

Your uploaded structure should look something like the following:

/admin/*.* (where *.* means all files within it)
/lang/
/addins/
/files/*.*
/config.php
/function.php
/generate.php
/index.php
/menu.php
/news.php
/pagemap.php
/readme.txt

What we now need to do is CHMOD the /files/ directory and the /admin/. If you are unsure how to do this, consult your FTP manual. - CHMOD 777 (rwxrwxrwx) the files directory.
And thats the uploading step complete!


1.4 Extracting the tables
This is probably the trickiest step of the install (for the beginner anyway) what we now need to do is create the database that you referenced earlier ($dbname = "content_inj";) . Again, I cannot tell you how to do this as everyone uses different tools for it. the sql would be:

CREATE DATABASE content__inj

Or, using PHP My Admin, goto the first page (or click home) and fill in the "Create database" text box and press Create. Once the table is created, open the table and look for the SQL import section, on different version of PHP my Admin it differs, but I'm sure you'll be able to find it, once you have click Browse (to select a file) and locate tables.sql (from the zip file you extracted) then press Go, and if it returns a successful command, we're all ready, if you get a failed command or other problem, consult the appropriate manual.

If all the above went smoothly, you can go onto the next step! Otherwise, try it again and then and only then email support@p3mbo.com or post on the support section of http://www.p3mbo.com for help :).


2.0 Setting Content Injector Up:
2.1 Logging In
Goto your site to the location you uploaded the content injector too, and affix /admin/ on the end of it ie. http://www.mysite.com/contentinj/admin/. You should see a login screen similar to the one below:

If you see the above, then enter the details: (all in lower case)

username: admin
password:
admin

You should now (hopefully) be logged in. If there are any errors on the page, it's likely a file path is wrong or a file is missing, take a look at the error message and try and decrypt it, ie if it says "Cannot find file x.php in xxx" it **could** (and does) mean that the file x.php can't be found :) If there are no errors, then you've done everything right.


2.2 Changing your password
If everything looks okay, click the Edit Users button:


Then click Edit, (next to admin)


You should then be displayed with some basic user information, you can change the admin username, email address and password here. It is recommended you change your admin password right away!


2.3 System Setup
Next, click System Setup. And fill in the basic options in here. Note: Upload path should be an absolute directory (look at the
Absolute Root Dir text for an idea of how this should look). Edit the necessary templates (extra information is provided besides them for the allowed (Case sensitive) fields you can use in them.

The system setup area should look like the following:


Once you've filled in your settings and hit submit! Thats it! Away we go!


3.0 FAQ
Question:
The Date and Time Settings I want aren't allowed in the System Setup - how do I add a new one?

Answer:
To add a new date or time format, you'll first need to know the PHP standard date & time formatting options, there is a list of them all on the php site (http://www.php.net/manual/en/function.date.php).

What you then need to do, is open
/admin/setup.php and goto the $date_formats array (line 437) or $time_formats (line 490). And add a new format on the end in a similar style, be sure to put a , on the end of each line (apart from the last).

An Example, if I wanted to add a new date format to match this "03 Nov, 03" the format would be d M, y so therefore i would add
'd M, y'
below, making sure to add a , on the previous element

.....
'n/j/Y',
'Y-m-d', ## Note the added ,
'd M, y' 


And thats it!! - Easy! - the Same format goes for time and file extensions (see upload.php)


Question:
The script says it has a news archive feature in it? Yet I cannot find it?

Answer:
From your main page, simply use
index.php?action=news_archive and that's your archive.

 
Question:
I don't want the news displayed on the main page like it defaults too? Is there anything I can do?


Answer:
Of course there is, we just need to edit some files (you knew i was going to say that).

Open
/generate.php and find the line $ptitle="News"; (around line 72) change this to whatever you want your default page title to be for example $ptitle="Welcome to my site";

Then in
/function.php fine the line include('news.php'); (around line 364) and change news.php to point to the default page you want to show, ie mainpage.php.

Then in your
/index.php template use <? include ('news.php');?> wherever you want the news to appear and content() wherever you want your content to appear. (SO you could have it appearing down the site like on this site)



Question:
What are tags to call the content in index.php?

Answer:
 USABLE FIELDS:
<? include ('menu.php'); ?> --> includes the menu into the page
<?content(); ?> --> includes the content
<? print "$ptitle"; ?> --> includes the page title as appears in the menu
<? print "$mtitle"; ?> --> includes the title of the menu the page belongs too
<? print "$prevnext"; ?> --> includes a previous and next link in the page (when needed)


ADD-INS FIELDS: (you may not have these depending on the version you downloaded) visit www.p3mbo.com for more of these.


MY ADD-INS:
<? headlines(x);?> --> includes news headlines, where x is the amount you want, ie <? headlines(5);?>
<? lastX(x);?> --> includes the last x page links in your page, where x is the amount you want, ie <? lastX(5);?>
<? pageTrace(); ?> --> provides the menu path to the current page ie Menu 1 > Sub Menu 1 > Submenu 1.1 > Sub Menu 1.1.2




THIRD PARY ADD-INS: No support will be given for THIRD PARTY add-ons.
<? printMe(); ?> --> includes a "print this page" link in your page (THIRD PARTY ADD-ON)


Question:
Content injector is winging saying it cannot redeclare function parseCode? Help!

Answer:
If you upgraded from v1.2, or downloaded the BB Code addon then this problem is caused, that is due to the BB Parser being moved into the core of the script. To fix the problem, simple delete BBCode.cinj from the /addins/ directory



Question:
Content Injector is saying it cannot find the files directory?

Answer:
This problem is caused when content injector can't find your files directory :), firstly ensure it is CHMOD 777'ed and then check the path to it in System Setup, if it still continues to moan, then kick it and try again - hopefully this should fix it.



Question:
Can you add feature x into the script?

Answer:
Ever since the initial release of the script, the only things I've been changing are the user requested ones, so so long as it isn't something stupid like "can you add a gardening program to your script?" then I'll probably add it, so let me know! andy@p3mbo.com



Question:
Why have you done 'feature x' like that? Wouldn't it be better to do it like this?

Answer:
Probably would be, but you have to remember one thing... I'm lazy, and if using a cheap and nasty way that works will save me 12 hours, then the cheap / nasty way wins hands down. Feel free to modify if yourself if it really bothers you that much.



Question:
The admin panel won't let me login at all? Any ideas?

Answer:
Firstly, check your
/admin/cinj_info.php if everything looks okay (which I'm sure it does) then check your not using a stupid browser, by stupid I mean anything not past version 4 yet (sorry to all those IE 3 users who thing plain text websites are the way forward). If your using a sensible browser (IE6 ;) ) then check cookies are enabled, if they're not - enable them - they don't bite. If this still doesn't fix it, then I guess you could email me and I'll take a look at it for you.



Question:
What kind of licence the script released under?

Answer:
Basically, the script is free and will remain free unless I say otherwise, you may edit, burn, destroy, drown or admire whatever you wish within the script, so long as my copyright tags and documentation remain intact. You may NOT sell this script and or claim it to be of your own work, anyone found to be doing so will suffer my wrath! If you wish to use bits of my code in your script, then feel free to do so, but a nice note saying "thanks to the good man from p3mbo.com" wouldn't hurt now would it?



Question:
I want to make an addin - how do I do this?

Answer:
Visit my brilliant site at www.p3mbo.com and look at the developers information in the add-ins section. There and only there shall you find the information you seek.



Question:
I love you! - Will you marry me?

Answer:
If your rich... ;)



Got a Question you really want answered? Email it to help@p3mbo.com.