|
|
|||||||
| Register | FAQ | Calendar | Radio and TV | NP Shop | Search | Today's Posts | Mark Forums Read |
| Tutorials Tutorials and helpful articles made by ponders for ponders |
![]() |
![]() |
![]() |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
WPMU Field Specialist
|
Hi,
when you create a new blog, some actions are taken. Two main files responsible for that are: /wp-include/wpmu-functions.php and /wp-admin/include/schema.php You can edit both of them for your desired effect. schema.php can be overriden by this plugin, if you don't want to edit the core files: WPMUDEV.ORG Let's take a look at schema.php It defines all simple options which a blog will have, so you won't have to do it manually everytime. for example find those lines, i modified them that way: blog description: ...for all your porn needs 100 posts per rss Rest is left default... add_option('siteurl', $guessurl); add_option('blogname', __('My Blog')); add_option('blogdescription', sprintf(__('...for all your porn needs!'), $current_site->site_name ) ); add_option('new_users_can_blog', 0); add_option('users_can_register', 0); add_option('admin_email', 'you@example.com'); add_option('start_of_week', 1); add_option('use_balanceTags', 0); add_option('use_smilies', 1); add_option('require_name_email', 1); add_option('comments_notify', 1); add_option('posts_per_rss', 100); add_option('rss_excerpt_length', 50); add_option('rss_use_excerpt', 0); It is so simple eveyone will figure it out. For example you can add to add_option('ping_sites', ' http://zhuaxia.com/rpc/server.phphtt...om/rpc/../rpc/. http://pinger.blogflux.com/rpc/../rp...m/rpc/../rpc// http://pinger.blogflux.com/rpc/../rp...rpc/../rpc//// http://pinger.blogflux.com/rpc/../rp...c/../rpc////// etc.............. And you dont have to add ping sites manually anymore :P Everything here is simple. Now wpmu-functions is more complicated, but you will figure it out. I will show you an example how to get rid of the annoying hello word post, and about page and how to change the name of uncategorized category by default. Find lines: $cat_name = $wpdb->escape(__('Uncategorized')); $cat_slug = sanitize_title(__('Uncategorized')); And change Uncategorized to for example Biatches!!!. To delete first post, page and default links remove lines: // Default links $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_owner, link_rss) VALUES ('http://wordpress.com/', 'WordPress.com', 1356, '$user_id', 'http://wordpress.com/feed/');"); $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_owner, link_rss) VALUES ('http://wordpress.org/', 'WordPress.org', 1356, '$user_id', 'http://wordpress.org/development/feed/');"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 2)" ); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (2, 2)" ); // First post $now = date('Y-m-d H:i:s'); $now_gmt = gmdate('Y-m-d H:i:s'); $first_post = get_site_option( 'first_post' ); if( $first_post == false ) $first_post = stripslashes( __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ) ); $first_post = str_replace( "SITE_URL", "http://" . $current_site->domain . $current_site->path, $first_post ); $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post ); $first_post = stripslashes( $first_post ); $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_name, post_modified, post_modified_gmt, comment_count) VALUES ('".$user_id."', '$now', '$now_gmt', '".addslashes($first_post)."', '".addslashes(__('Hello world!'))."', '0', '".addslashes(__('hello-world'))."', '$now', '$now_gmt', '1')"); $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 1)" ); update_option( "post_count", 1 ); // First page $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ('$user_id', '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '', '".$wpdb->escape(__('About'))."', '0', '".$wpdb->escape(__('about'))."', '$now', '$now_gmt', 'publish', 'page', '', '', '')"); // Flush rules to pick up the new page. $wp_rewrite->init(); $wp_rewrite->flush_rules(); Hope it gave some basics !!!! |
|
|
|
|
|
#2 (permalink) | |
|
Want some creampie?
|
Quote:
BUT ![]() How are those urls in ping_sites delimited? Comma? Space? __________________
My RSS Feed Sponsors List |
|
|
|
|
|
|
#3 (permalink) |
|
Is Aga really Little Buddha?
|
Thanks a lot, those auto added stuff are boring.
![]() __________________
I can't improve myself without making mistakes, so if you find I'm wrong please clarify me, thanks in advance. ![]() My avatar is my favorite girl, but unluckily I don't know her name... Last edited by jcjc : Tomorrow at 28:93 AM. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
![]() |
![]() |