Installation for Static Jack
About Static Jack
This plugin makes it a snap to add static pages to your site
and have them automagically woven into your existing template
of choice.
You can ftp as complex a directory structure as
your heart desires, and still have the pages show up as
www.yoursite.com/static_page/
or even
www.yoursite.com/real/static_page/
and you can use urls with or without the trailing slash
The best part about this new plugin?
** Infinite Plugins for WordPress **
Now you don’t have to wait for a plugin to be developed for
Word Press. Static Jack gives you the ability to add all sorts
of php, asp, or cgi code to your site without registering a new
plugin through Word Press. For example, you can easily add a
custom contact form to your blog/cms using Static Jack.
Please see notes for more info on adding your own ‘plugins’.
Other features/benefits:
1- Hides the file extension of the static page and gives you
added security because it’s difficult to tell if the page
is static, or stored in the database, or even what language
it’s written in
2- Does NOT use the eval() function, which is a good thing since
some think that using eval() can open up a site to problems
3- You can easily change what template you are using for the
static pages or just use the current theme templates without
changes
4- You can use Static Jack to send headers even if your code
is in the ‘wrong’ order. In basic terms, you normally have
to be careful to set cookies, or use the header() function
at the very start of your code, before output is sent to
the browser, or else you get an ugly error. Output buffering
solves this… AND you can use this feature even if you don’t
have any use for adding static files. For example, you could
write custom code into your sidebar template in the theme and
set a cookie.
Requirements
You MUST have permalinks turned on. It doesn’t really matter
what structure you create for permalinks. (AFAIK)
You MUST have this in your mod_rewrite of the WordPress root:
RewriteRule ^(.+)$ index.php/$1
A neat trick about the above ‘requirement’ is that it actually
accomplishes three things:
1- Makes this plugin work properly
2- Makes it possible to add pages through the WordPress admin
wihout having to constantly revise and update your .htaccess file
or make it world writable! That’s a big bonus.
3- It gives you search engine freindly & people friendly urls
I suggest trying this: Remove WP generated code from .htaccess
and replace with this
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php/$1
(Remember, this is the .htaccess for your WordPress root dir.)
Basic Installation
There is no need to change any of the WordPress source.
1. Extract the plugin & the htmlarea directory into your
WordPress plugins directory.
2. Activate the plugin on the Plugins tab of the WordPress
admin console.
3. Add a directory within wp-content directory called ’static’
Directory structure:
wp/
wp-content/
static/
4. Turn on permalinks (recommended structure: /%post_id%/)
5. Add new mod_rewrite rules (see Requirements above)
6. FTP a static page to wp-content/static directory
7. Navigate to www.yoursite.com/blog/new_static_page_name/
(acceptable to use with or without trailing slash)
Advanced Options
1. Changing the template
Open staticJack.php and change line 12
define(’_Template_’, ‘/page.php’);
Change to a file name in your current theme directory.
Note:
If the template chosen isn’t found, the Static Jack reverts
to index.php in the theme. If that isn’t found, an ugly error
appears on your page.
2. Changing the file extensions
define(’_AllowedSuffixes_’, ‘.php|.htm|.html’);
Note:
File extensions are tried in the order you list. So given
the above code, if foo.php and foo.htm are both in the static
directory then foo.php will be chosen.
3. Changing the name of the static directory
define(’_StaticDirectory_’, $test = dirname(dirname(__FILE__)).’/static’);/*no trailing slash*/
This determines where Static Jack looks for files. There is
no reason to change the name from static to anything else, but
you can if you want.
Notes
Adding ‘plugins’
I put quotes around the word plugins to indicate that Static
Jack greatly increases the kinds of content you can add to
your site/blog without going through the process of adding
a ‘true’ WordPress plugin.
This is my first WordPres plugin and I have to say, it’s not
very hard to do. So if you have php skills, you should try
to write a plugin for WordPress.
Customizing Complex Galleries and Discussion Forums
Anything that keeps track of users sends what’s known as
headers. Shopping carts, some galleries, and most discussion
forums send headers. As such, don’t expect to be able to add
phpBB or Invision Board to your blog without a little hacking.
I will attempt to put together documentation on how to do this.
But in the meantime, please, kindly, do NOT contact me with
requests for assistance on these matters. Please understand
that I’m a freelancer and as such, my time is my most precious
resource… it puts food on the table.
Version History
0.1 Initial release June 3, 2005
0.2 June 6, 2005 - Fixed bug with multiple posts
0.3 June 6, 2005 - Added output buffering!
Syndicate
Categories
- Customer Service (1)
- Entrepreneurs (1)
- Marketing (3)
- Programming (9)
- Web Design (1)
- WordPress (5)



