SimplePortal
Customization => Themes and Graphics => Topic started by: rad1701 on July 25, 2010, 04:44:08 PM
-
Is there a way to limit the theme choices that members have to pick from in the standard Theme Choice SP block? Besides of course, deleting the themes entirely?
- Thanks!
-
There is, actually.
However the option is only supported in the SMF 2.0 line.
-
Hmm, well darn. I'm using 1.1.11.
- Thought there might be an easy work around.
-
There is an easy workaround but it requires hardcoding the source file.
Is that acceptable?
-
There is an easy workaround but it requires hardcoding the source file.
Is that acceptable?
Certainly. Love to see the code and what I have to change. Thanks in advance!
-
Open ./Sources/PortalBlocks.php
Find:
if ($ID_THEME == 0)
continue;
Replace with:
$hidden_themes = array();
if ($ID_THEME == 0) || in_array($ID_THEME, $hidden_themes)
continue;
The $hidden_themes array needs to be filled with the IDs of the themes you don't want to show. Example, to hide theme #1,
$hidden_themes = array(1);
To hide multiple themes, like theme #1 and theme #16:
$hidden_themes = array(1, 16);
To find the ID of a theme, try editing it in the admin panel through Current Theme and look at the URL. It should give you a hint.
-
Getting an error message after editing the file and forum wouldn't come up:
Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/treksf/treksinscifi.com/forum/Sources/PortalBlocks.php on line 2348
This is the code I tried to use:
$hidden_themes = array(3, 14, 16, 21, 23, 24);
if ($ID_THEME == 0) || in_array($ID_THEME, $hidden_themes)
continue;
-
Huh, instead of:
if ($ID_THEME == 0) || in_array($ID_THEME, $hidden_themes)
Try;
if ($ID_THEME == 0 || in_array($ID_THEME, $hidden_themes))
-
Nope. That's didn't help. Still got this error.
Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/treksf/treksinscifi.com/forum/Sources/PortalBlocks.php on line 2348
-
Man I'm out of practice.
Try this instead perhaps?
if (($ID_THEME == 0) || (in_array($ID_THEME, $hidden_themes)))
-
Nope - sorry. Back to this error again.
Parse error: syntax error, unexpected T_VARIABLE in /home/treksf/treksinscifi.com/forum/Sources/PortalBlocks.php on line 2307
-
Sorry for the wait.
Please attach the file.
-
Ok - here's my file.
-
This one does not seem to have $hidden_themes in it.
Please attach the one you have been working with.