Page 1 of 1

Skins

Posted: Wed Jan 02, 2019 12:51 pm
by 1islandguy
im trying to create a new skin but i cant create a new directory in the skins folder
i get this error
Unsupported directory name:Cleantest is there a work around or is this intentional

Re: Skins

Posted: Wed Jan 02, 2019 5:15 pm
by wbartels
Hello 1islandguy,

The skin directory must at least contain these files: style.css, template_footer.php and template_header.php
And the directory name is limited to the following characters: a-z, A-Z, 0-9, - and _
This means that you also get an error message with an empty directory.

Code: Select all

//  +------------------------------------------------------------------------+
//  | Validate skin                                                          |
//  +------------------------------------------------------------------------+
function validateSkin($skin) {
	$dir = NJB_HOME_DIR . 'skin/' . $skin . '/';

	if (file_exists($dir . 'style.css') &&
		file_exists($dir . 'template_footer.php') &&
		file_exists($dir . 'template_header.php') &&
		preg_match('#^[a-zA-Z0-9-_]+$#', $skin)
		)
		return true;
	else
		return false;
}

Re: Skins

Posted: Wed Jan 02, 2019 5:46 pm
by 1islandguy
thank you for your prompt reply
i had named the files wrong using a . instead of _ its all fine now
btw awesome script

Re: Skins

Posted: Thu Jan 03, 2019 8:49 pm
by wbartels
1islandguy wrote: Wed Jan 02, 2019 5:46 pm btw awesome script
Always nice to hear!