David Scotson tarafından yapılan gönderiler

Note that the external results, as seen here on Moodle.org's Google search, can be modified to look like your own site to some degree by logging into Google and providing a header, footer and color options (these details from memory) despite the results actually being hosted on google.com.

However, the result is not anywhere near as seamless as the Google API approach shown above.

Moodle in English -> Themes -> User image borders

yazan David Scotson -
I was changing the user image code so that it outputted a 16x16 image (because you can't resize images used as backgrounds) and while I was looking at the code I experimented with a different technique for adding the border to the image.

before

f1.jpgf2.jpgf2.jpg

In these a one pixel border is added to the two larger images, and the smallest image is created by allowing the browser to resize the image.

after

f1.jpgf2.jpgf3.jpg

Here all three images are created by GD, but the second and third are bicubicly resized from the first after the border is added, rather than from the original image. This double resize adds a generational quality loss but it also allows a sub-pixel border: 0.35 pixels for the middle one and 0.16 for the smallest. I think I prefer it but it's obviously an aesthetic call. (I might experiment by doubling the width of the border on the original before it is resized to give 0.75 and 0.32 pixel borders.) Does anyone else think this is an improvement?

I've rewritten some of the block code to make it easier to create flexible styles with CSS. This code is useful if your theme supports it, but breaks older themes badly.

What is the best way to switch between two bodies of code in this case. I'm thinking that a $css_blocks flag in the compatible theme's config.php file that defaults to false if not present is a good start. But then how do you select an entire directory of code based on this flag, and how does that affect things when you change between a theme with this flag set and another without it?

I'm new to PHP and I have no idea how to go about such a thing and what the possible problems are, has anyone else done something like this before?

Moodle in English -> Themes -> CSS Blocks -> Re: CSS Blocks

yazan David Scotson -

I've attached a file with just the block related .css declarations in case anyone wants to try customising their current theme to work with these types of blocks (You'll still have to change all the colours etc. and note that I've moved all the relevant images into the theme directory, you can copy these images from the theme.zip attached above).

You can also check out our test site to see it in action, unless we're mucking around with other things at the time, though most of the interesting changes are invisible until you view source.

Moodle in English -> Themes -> CSS Blocks -> Re: CSS Blocks

yazan David Scotson -

Of course those new CSS blocks will look rather odd without the corresponding CSS files. I've attached the theme I've been using to develop them.

The aim of this theme was to maintain the look and feel of standard xhtml to a great degree. I did however adjust the sideblock link lists to take advantage of the new CSS styling and provide some accessability benefits, following instructions found on Dunstan 's weblog at 1976design.com

It's a work in progress so comments on this theme are also welcome (I've not yet begun to tackle IE-related problems, e.g. the Calendar block breaking at larger text sizes). Also, ignore any purple patches you see, that's an unrelated experiment.