Hey :)
Having issues with creating pages for 1.x? Well, Dr. Deejay comes with a solution: the SSI manager. It is a very simple script that displays custom pages. I'll explain how it works: first of all, create a directory named "pages" in the root of your forum. Then upload the attached file into the root of your forum too. You can create new pages by adding new files, like:
1.php
2.php
3.php
Make sure your file is .php. You can access pages by site.php?page=pagetitle. Make sure too that you add this in every page:
<?php
$context['page_title'] = 'Pagetitle';
$ssi_gzip = false or true;
$ssi_ban = false or true;
$ssi_content = 'Page content';
And change $ssi_gzip = false or true and $ssi_ban = false or true to "false" or "true". Here is an example:
<?php
$context['page_title'] = 'My first page!';
$ssi_gzip = true;
$ssi_ban = false;
$ssi_content = 'Just my first page!';
Enjoy! :)
You should add this to your script for inexperienced users.
if (isset($smcFunc['db_query']))
die ('Sorry, this script is not compatible with SMF 2.0');
Quite an idea, havnt heard of one myself. Have a couple suggestions though. :P
First one, I think the path you have set for inclusion in the script doesnt work the way its supposed to. When I try to access a file by URL the file_exists() function gives me a false result each time. I have a fix here below,
$file = getcwd() . '/' . $_GET['page'] . '.php';
if (file_exists($file))
include($file);
else
die("Undefined page");
The code is also very exploitable. I can include files from previous directories and such other than pages, so might want to fix that.
Quote from: Masterd on June 03, 2011, 02:05:58 PM
You should add this to your script for inexperienced users.
if (isset($smcFunc['db_query']))
die ('Sorry, this script is not compatible with SMF 2.0');
Added, thanks ;D
Quote from: Project Evolution on June 04, 2011, 11:58:04 PM
Quite an idea, havnt heard of one myself. Have a couple suggestions though. :P
First one, I think the path you have set for inclusion in the script doesnt work the way its supposed to. When I try to access a file by URL the file_exists() function gives me a false result each time. I have a fix here below,
$file = getcwd() . '/' . $_GET['page'] . '.php';
if (file_exists($file))
include($file);
else
die("Undefined page");
Danke, added ;D
QuoteI can include files from previous directories and such other than pages, so might want to fix that.
Fixed, thanks for reporting. =)
*uploading new version*
Wtf I cannot add new attachments in this board o_O
Quote from: Dr. Deejay on June 05, 2011, 05:41:04 AM
Wtf I cannot add new attachments in this board o_O
That feature is disabled in this board.
How can I do this in 2.0?