Recent Topics

1 Sep 20, 2007 16:56    

I'm currently looking for a mod (hack or plugin) that will allow for multiple custom skins, one for each blog. This will allow the multiple groups I'm supporting to each have a skin to edit without effecting the other blogs.

I've done searching on here, but I couldn't find anything that mentioned this.

Thanks in advance.

2 Sep 20, 2007 17:32

Just make a folder with some identifying name and copy the contents of the ../blogs/skins/custom/ in this folder.
This creates new individually editable skins based on the custom skin. Next you assign each blog a different version of the skin.

Good luck

3 Sep 21, 2007 16:05

Afwas wrote:

Just make a folder with some identifying name and copy the contents of the ../blogs/skins/custom/ in this folder.
This creates new individually editable skins based on the custom skin. Next you assign each blog a different version of the skin.

Good luck

I want to automate this system. This way groups can edit their own custom files and not require me or someone else to go in and copy what "custom" work they've done to a new folder. This gets complicated further if they want to update it.

Currently we're running 1.10.2, which is the last stable release.

4 Sep 21, 2007 16:36

The [url=http://www.fralenuvol.com/albero/servizi/webmaster/scripts/b2evolution_autoblog_plugin.php#download]Autoblog plugin[/url] is fairly well documented. It reads:

Custom CSS for autobloggers

The plugin has the option Custom CSS for autobloggers to customize own CSS Style. In this case a sample file "style.css" will be automatically created in /media/blogs/username/ folder. The styles defined here will BE ADDED (and not replace) the current chosen default style. This feature is based on b2evolution "blog css" feature. Fore more information see [url=http://manual.b2evolution.net/Blogs_tab#Customized_CSS]Customized CSS[/url] .

Regarding, the automatic "style.css" creation give your autobloggers some basic instructions on how to edit the file, seen that b2evolution 1.8.2 still does not provide the feature to edit/overwrite the css file

Is says the css in the media folder does not overwrite but append the existing css in the skins folder. You want other behaviour: delete (or somehow empty) the .css in the skins folder and copy the complete .css to the media folder for each blogger. He now has full access to the layout.

In the Autoblog there is some code to make the 'empty' .css file in the media folder. We do not want it to be empty, but we like the idea of the automatic creation. So you crack open the file ../blogs/plugins/autoblo_plugin/_autoblog-plugin.php and read from line 480 onward:

		// Copy default style.css file to user media folder if set
		if( $this->Settings->get('blog_allowblogcss')){
			$custom_css_dir = $basepath.'media/blogs/'.$new_blog_shortname.'/';
			
			// Create user media folder 
			if( !is_dir($custom_css_dir) ){
				$oldumask = @umask(0); 
				@mkdir($custom_css_dir, 0777); 
				@umask($oldumask); 
			}
			$custom_css_file = $custom_css_dir.'style.css';
			// Create blank style.css to override default style 
			if (!file_exists($custom_css_file)){ 
				$file_handle = @fopen($custom_css_file,"a");
				// Content of stub file 
				$cssdata = "/* This custom style.css will override the default skin. The styles you define here will be ADDED (not replaced!) to the default styles.
				Example:
				body{
				background-color:#555555;
				}
				*/";
				
				@fwrite($file_handle, $cssdata);
				@fclose($file_handle);     
			}


I leave the coding to you. You want the '$cssdata' to be the original custom.css file.

Good luck


Form is loading...