Support ⇒ Modules & Blocks ⇒ Hack to Restrict default & dragonfly themes ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Hack to Restrict default & dragonfly themes Reply to topic


Here's a simple hack to prevent registered users from selecting either dragonfly or default themes.

As I'm introducing a new theme, I want to give my users a choice, but didn't want to support the 2 original themes. Nor did I want to remove default and dragonfly entirely as they are useful to me for debugging issues, etc.

Hack is very straightforward, but finding the place in the code where it belongs is not, so I thought I'd share ... Hack was developed for '9.4.0.0 CVS', but will probably apply to all recent versions.

In modules/Your_Account/functions.php find the line
			if (false===strpos($file,'.') && $file != 'CVS' && file_exists("themes/$file/theme.php")) { $themelist[] = "$file"; }
and replace with
			if (false===strpos($file,'.') && $file != 'CVS' && file_exists("themes/$file/theme.php") && !(($file == 'default' || $file == 'dragonfly') && !is_admin())) { $themelist[] = "$file"; }

As always YMMV Wink

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4

All times are UTC


Jump to: