Jump to content


[Hack]different default skin for portal and forum


  • You cannot reply to this topic
No replies to this topic

#1 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 04 May 2006 - 11:01 AM

This sets a different default skin for portal and forum. If a member chooses a skin using the skin selector block the skin will display globally. The separate skins will display for guests though.

FIND:
	function import_css()
	{
		global $mkportals, $DB, $mklib;
		if ($mkportals->member['theme']) {
			$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_skin_set_id = '{$mkportals->member['theme']}'");
		}
		else {
			$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_default = '1'");
		}
REPLACE WITH:
	function import_css()
	{
		global $mkportals, $DB, $mklib;
		//if ($mkportals->member['theme']) {

		//skin hack
		if ($mkportals->member['id'] && $mkportals->member['theme']) {
		//end skin hack
			
			$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_skin_set_id = '{$mkportals->member['theme']}'");
		}
		else {
			//$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_default = '1'");

			//skin hack
			if (stristr($_SERVER['PHP_SELF'], $mklib->forumpath)) {
				$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_default = '1'");
			
			}
			else {
				$DB->query("SELECT set_image_dir, set_cache_css from ibf_skin_sets where set_skin_set_id = '4'");			
			}
			//end skin hack

		}
The forum will display your default forum skin. You will need to change the "4" in the query code set_skin_set_id = '4' to the skin id that you want to use for the Portal.

If you do not want to allow members to select skins and you want the 2 different skins to display for everyone the code will be a little different. And I think you will need to run a simple database query to reset all member skins to your default. You will also need to set the IPB preferences so that members cannot choose skins. And of course you will deactivate the skin selector block.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users