• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Gesior AAC 2011 - Needed? Ideas?

I'm not sure how it could work 'like rewrite' without rewrite. Maybe you misunderstood me :p
This is my .htaccess file, but I cannot use it, because it block access to 'static' and 'layouts' folders:
Code:
RewriteEngine on
RewriteRule ^ index.php [L]
This is how I parse 'rewrite mod' in PHP:
PHP:
// DEFINE PARAMS AND PAGE
$_tmp_params = array();
if($configSite->getValue('useRewrite'))
{
	$_uri_params = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/'));
	foreach($_uri_params as $_pi => $_uri_param)
	{
		if(isset($_uri_param) && in_array($_uri_param, $configSite->getValue('pagesEnabled')))
		{
			$page = $_uri_param;
			unset($_uri_params[$_pi]);
			break;
		}
		unset($_uri_params[$_pi]);
	}
	if(count($_uri_params) > 0)
		foreach($uri_params as $_uri_param)
			$_tmp_params[] = $_uri_param;
}
else
{
	if(isset($_REQUEST['page']) && in_array($_REQUEST['page'], $configSite->getValue('pagesEnabled')))
		$page = $_REQUEST['page'];
	if(count($_REQUEST) > 0)
		foreach($_REQUEST as $key => $_tmp_param)
			if(substr($key, 0, 3) == 'amp')
				$_tmp_params[(int) substr($key, 3, 2)] = $_tmp_param;
}

$WEB->setParams($_tmp_params);

if(!isset($page))
	$page = $configSite->getValue('pageDefault');
$pathToPage = './pages/' . $page;

// limit number of folders to 10
for($_pi = 0; $_pi <= 10; $_pi++)
	if(isset($_tmp_params[$_pi]) && Functions::isValidFolderName($_tmp_params[$_pi]) && file_exists($pathToPage . '/' . $_tmp_params[$_pi]))
	{
		$pathToPage .= '/' . $_tmp_params[$_pi];
		unset($_tmp_params[$_pi]);
	}
	else
		break;
$pathToPage .= '/';
$_PARAM = array();
foreach($_tmp_params as $_tmp_param)
	$_PARAM[] = $_tmp_param;
	
define('TITLE', $configSite->getValue('serverName') . " - " . ucwords($page));
define('PATH_LAYOUT', './layouts/' . $configSite->getValue('layoutName') . '/');
define('PATH_PAGE', './pages/' . $page . '/');
define('PATH_SCRIPT', $pathToPage);
define('PAGE', $page);
// DEFINE PARAMS AND PAGE END
- PAGE is of course page, it could be also one of params, but I wanted to make it look nicer when rewrite mod is off
- $_PARAMS is array with params from URI (rewrite on) or from special GET/POST key 'amp'
- in link and form generator you can use custom parameters, that are parameters with keys definied by you, I've added it to make AAC easier to use (add new scripts) for people that don't understand how to use params script, they can use classic $_REQUEST

All is definied in classes and scripts that parse it, so you don't have to understand how it work with/without rewrite mod. Just use classes Link and Form to generate forms and links
 
Aha I see! You already did it using PHP! I thought you did everything using .htaccess and mod_rewrite (using RewriteRules).

This is the .htaccess file I have scrapped together for my own framework. It does not activate the rewrite engine stuff unless the mod_rewrite module has been loaded. It also allows you to access directories/files directly in case they exist (which is what you were looking for, using the RewriteCond).
Code:
ErrorDocument 404 /index.php

<IfModule mod_rewrite.c>
	Options +FollowSymLinks
	
	RewriteEngine On
	RewriteBase /
		RewriteCond %{REQUEST_FILENAME} !-f
		RewriteCond %{REQUEST_FILENAME} !-d
		RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
 
@Gesior.pl:
With rewrite rules you have to use full paths along with http://~ to file.
I wrote this function to get website domain and real folder
PHP:
	public static function getURI()
{
	static $websiteURI;
	if(!isset($websiteURI))
	{
		$_tmp_uri = explode('/', $_SERVER['SCRIPT_NAME']);
		unset($_tmp_uri[count($_tmp_uri) - 1]);
		$websiteURI = 'http://' . $_SERVER['SERVER_NAME'] . '/' . trim(implode('/', $_tmp_uri), '/') . '/';
	}
	return $websiteURI;
}
For example I have new acc. maker in folder 'x' in www folder. It returns:
http://127.0.0.1/x/
You can easy add here SSL :)

EDIT:
This function works with servers that use more then one domain/IP [ex. myserv.hopto.org, myglobaldomain.eu, 127.0.0.1]
 
Last edited:
Gesior what about foot in website?
Can i change it for any other?

And second question:
What is stable version for TFS 0.4 +?
 
@Potar
what do you mean with "what is a stable version for TFS 0.4+"?

@Gesior.pl
Good luck, looking forward to use this ^.^
 
This AAC is really getting good. I believe it can go past Modern(Vapus)AAC.

Keep up the good work Gesior.
 
When will it be released? :/

Your answer is on post #115 in this thread.

@Gesior, I'm surprised by your dedication and your hard work everyday, it seems you're doing all this in a very short span of time.
Do you have PayPal? I'm willing to donate a dollar. You deserve one!
 
Just symbolic amount.

yup.
cash.jpg
 
Dollar to dollar and I will get:
93473139.jpg

;)
If you got some money on Paypal you can send it to (me):
[email protected]
-------------------
I don't want use POT or other classes available in the Internet, because I don't know under what license I will publish AAC.
At start it will be Freeware (not GNU GPL).
If I will get enought donations (~100 $ / month) it will still be freeware and I will publish new version/modifications. If not, I will change license and sell it on my website :thumbup:
 
Last edited:
Back
Top