We are currently working on a Wordpress MU theme that requires logos to be generated on the fly.
Fortunately the logos will just make use of a simple script font, but we still need some means of auto-generating them. We started with a great tutorial at Vision Master Designs and tweaked it slightly to fit in with Wordpress and the specification of the client.
Firstly, and fortunately, the name of each of the WPMU blogs would be the name required in the logo. This meant that we could pass "bloginfo('name')" in the text variable:
" />
Secondly, all the site names would be two words and these needed to be spread over two lines. This required a small addition to the code that simply replaces the whitespace between the two words with a PHP_EOL (end of line) call.
if (isset($_GET)):
$helloworld = $_GET;
$helloworld = str_replace(' ', PHP_EOL.' ', $helloworld);
else :
$helloworld = "Lifetime
Experiences";
endif;
With those two additions, we now have a theme that automatically generates logos on the fly. Perfect for a client who needs to be able to publish sites quickly and easily.
Mostrando entradas con la etiqueta Wordpress Multi User. Mostrar todas las entradas
Mostrando entradas con la etiqueta Wordpress Multi User. Mostrar todas las entradas
martes, 1 de diciembre de 2009
Convert Text into PNG Image using PHP
martes, 17 de noviembre de 2009
List all blogs in a Wordpress MU installation
The African Travel Experts site has two dropdown lists of all the blogs on their WPMU installation sorted into two different categories. Here's how.
The way the site is set up is to have the African Travel Experts site as the main 'umbrella site' with sub-sites for each African country, which act as parent sites to sub-sites relating to the country. For example:
Master site: African Travel Experts
Country sub-site: South Africa
Child-site: Cape Town
Seeing as the standard WPMU installation doesn't provide for classifying blogs/sites in this way, a plugin and a bit of lateral thinking was required. I opted for the Blog Types plugin, which allows you to define your own categories for a blog. Once installed, I defined my categories in the config as follows:
// Blog types
// name and nicename are required
$blog_types = 'South Africa';
$blog_types = 'south_africa';
$blog_types = '';
$blog_types = 'no';
$blog_types = 'Botswana';
$blog_types = 'botswana';
$blog_types = '';
$blog_types = 'no';
//.... etc until all countries are defined
$blog_subtypes = 'Cape Town';
$blog_subtypes = 'cape_town';
$blog_subtypes = 'south_africa';
$blog_subtypes = '';
$blog_subtypes = 'Eastern Cape';
$blog_subtypes = 'eastern_cape';
$blog_subtypes = 'south_africa';
$blog_subtypes = '';
//.... etc until all areas are defined
// Allow users to select one or multiple blog types
// Note: If you allow users to select multiple blog types, they cannot select a subtype
$blog_types_selection = 'single'; //Options: 'single' or 'multiple'
// Allow users to select one or multiple blog subtypes
$blog_subtypes_selection = 'single'; //Options: 'single' or 'multiple'
// Branding singular
$blog_types_branding_singular = __('Country');
$blog_subtypes_branding_singular = __('Area');
// Branding plural
$blog_types_branding_plural = __('Countries');
$blog_subtypes_branding_plural = __('Areas');
// Display admin panel blog types page
$blog_types_display_admin_page = 'yes'; //Options: 'yes' or 'no'
// Display signup form blog types selection
$blog_types_display_signup_form = 'yes'; //Options: 'yes' or 'no'
// Enable subtypes
$blog_types_enable_subtypes = 'yes'; //Options: 'yes' or 'no'
The way the site is set up is to have the African Travel Experts site as the main 'umbrella site' with sub-sites for each African country, which act as parent sites to sub-sites relating to the country. For example:
Master site: African Travel Experts
Country sub-site: South Africa
Child-site: Cape Town
Seeing as the standard WPMU installation doesn't provide for classifying blogs/sites in this way, a plugin and a bit of lateral thinking was required. I opted for the Blog Types plugin, which allows you to define your own categories for a blog. Once installed, I defined my categories in the config as follows:
// Blog types
// name and nicename are required
$blog_types = 'South Africa';
$blog_types = 'south_africa';
$blog_types = '';
$blog_types = 'no';
$blog_types = 'Botswana';
$blog_types = 'botswana';
$blog_types = '';
$blog_types = 'no';
//.... etc until all countries are defined
$blog_subtypes = 'Cape Town';
$blog_subtypes = 'cape_town';
$blog_subtypes = 'south_africa';
$blog_subtypes = '';
$blog_subtypes = 'Eastern Cape';
$blog_subtypes = 'eastern_cape';
$blog_subtypes = 'south_africa';
$blog_subtypes = '';
//.... etc until all areas are defined
// Allow users to select one or multiple blog types
// Note: If you allow users to select multiple blog types, they cannot select a subtype
$blog_types_selection = 'single'; //Options: 'single' or 'multiple'
// Allow users to select one or multiple blog subtypes
$blog_subtypes_selection = 'single'; //Options: 'single' or 'multiple'
// Branding singular
$blog_types_branding_singular = __('Country');
$blog_subtypes_branding_singular = __('Area');
// Branding plural
$blog_types_branding_plural = __('Countries');
$blog_subtypes_branding_plural = __('Areas');
// Display admin panel blog types page
$blog_types_display_admin_page = 'yes'; //Options: 'yes' or 'no'
// Display signup form blog types selection
$blog_types_display_signup_form = 'yes'; //Options: 'yes' or 'no'
// Enable subtypes
$blog_types_enable_subtypes = 'yes'; //Options: 'yes' or 'no'
Etiquetas:
African Travel Experts,
Content Management System (CMS),
mySQL,
php,
Wordpress Multi User
Suscribirse a:
Entradas (Atom)