Skins

General discussion about netjukebox
Post Reply
1islandguy
User
Posts: 7
Joined: Wed Jan 02, 2019 12:46 pm

Skins

Post 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
User avatar
wbartels
netjukebox developer
Posts: 849
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Skins

Post 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;
}
1islandguy
User
Posts: 7
Joined: Wed Jan 02, 2019 12:46 pm

Re: Skins

Post 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
User avatar
wbartels
netjukebox developer
Posts: 849
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Skins

Post by wbartels »

1islandguy wrote: Wed Jan 02, 2019 5:46 pm btw awesome script
Always nice to hear!
Post Reply