[Résolu] configurer le blog type.. (Créer un compte)

  • Statut : non résolu
8 sujets de 1 à 8 (sur un total de 8)
  • Auteur
    Messages
  • #450290
    yumiam
    Membre
    Padawan WordPress
    98 contributions

    Bonjour,

    Ma configuration WP actuelle
    – Version de WordPress :WPMU
    – Thème utilisé :
    – Plugins en place :
    – Nom de l’hebergeur :

    Problème(s) rencontré(s) :

    j’aimerai configurer le blog type lors de la création de celui-ci.
    (actuellement, il y a le fameux post « hello World » – 1 commentaire, une page…)

    mais si je veux démarrer avec plusieurs page préconfigurées, un thème défini… comment faire ?

    L’idéal serait que je configure un blog type, et que je le définisse en tant que gabarit standard… mais a mon avis ce n’est pas si simple…

    Vous avez des recos à ce sujet ?

    #590275
    xavier
    Participant
    Maître WordPress
    2124 contributions

    Il faut modifier directement le script d’installation, qui se charge de remplir la base de données…

    #590276
    yumiam
    Membre
    Padawan WordPress
    98 contributions

    ok… merci Xavier…
    et ce script.. il est centralisé dans un fichier ? (si oui , c’est lequel stp)

    #590277
    xavier
    Participant
    Maître WordPress
    2124 contributions

    Dans /wp-admin/upgrade-functions.php.

    if ( !function_exists(‘wp_install_defaults’) ) :
    function wp_install_defaults($user_id) {
    global $wpdb;

    // Default category
    $wpdb->query(« INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_count, category_description) VALUES (‘0’, ‘ ».$wpdb->escape(__(‘Uncategorized’)). »‘, ‘ ».sanitize_title(__(‘Uncategorized’)). »‘, ‘1’,  ») »);

    // Default link category
    $wpdb->query(« INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, link_count, category_description) VALUES (‘0’, ‘ ».$wpdb->escape(__(‘Blogroll’)). »‘, ‘ ».sanitize_title(__(‘Blogroll’)). »‘, ‘7’,  ») »);

    // Now drop in some default links
    $wpdb->query(« INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES (‘http://inphotos.org/’, ‘Donncha’, 0, ‘http://inphotos.org/feed/’,  »); »);
    $wpdb->query( « INSERT INTO $wpdb->link2cat (`link_id`, `category_id`) VALUES (1, 2) » );

    $wpdb->query(« INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES (‘http://zengun.org/weblog/’, ‘Michel’, 0, ‘http://zengun.org/weblog/feed/’,  »); »);
    $wpdb->query( « INSERT INTO $wpdb->link2cat (`link_id`, `category_id`) VALUES (2, 2) » );

    $wpdb->query(« INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES (‘http://boren.nu/’, ‘Ryan’, 0, ‘http://boren.nu/feed/’,  »); »);
    $wpdb->query( « INSERT INTO $wpdb->link2cat (`link_id`, `category_id`) VALUES (3, 2) » );

    $wpdb->query(« INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES (‘http://photomatt.net/’, ‘Matt’, 0, ‘http://xml.photomatt.net/feed/’,  »); »);
    $wpdb->query( « INSERT INTO $wpdb->link2cat (`link_id`, `category_id`) VALUES (4, 2) » );

    $wpdb->query(« INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES (‘http://zed1.com/journalized/’, ‘Mike’, 0, ‘http://zed1.com/journalized/feed/’,  »); »);
    $wpdb->query( « INSERT INTO $wpdb->link2cat (`link_id`, `category_id`) VALUES (5, 2) » );

    $wpdb->query(« INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES (‘http://www.alexking.org/’, ‘Alex’, 0, ‘http://www.alexking.org/blog/wp-rss2.php’,  »); »);
    $wpdb->query( « INSERT INTO $wpdb->link2cat (`link_id`, `category_id`) VALUES (6, 2) » );

    $wpdb->query(« INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES (‘http://dougal.gunters.org/’, ‘Dougal’, 0, ‘http://dougal.gunters.org/feed/’,  »); »);
    $wpdb->query( « INSERT INTO $wpdb->link2cat (`link_id`, `category_id`) VALUES (7, 2) » );

    // First post
    $now = date(‘Y-m-d H:i:s’);
    $now_gmt = gmdate(‘Y-m-d H:i:s’);
    $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, comment_count, to_ping, pinged, post_content_filtered) VALUES ($user_id, ‘$now’, ‘$now_gmt’, ‘ ».$wpdb->escape(__(‘Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!’)). »‘,  », ‘ ».$wpdb->escape(__(‘Hello world!’)). »‘, ‘0’, ‘ ».$wpdb->escape(__(‘hello-world’)). »‘, ‘$now’, ‘$now_gmt’, ‘1’,  »,  »,  ») »);

    $wpdb->query( « INSERT INTO $wpdb->post2cat (`rel_id`, `post_id`, `category_id`) VALUES (1, 1, 1) » );

    // Default comment
    $wpdb->query(« INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES (‘1’, ‘ ».$wpdb->escape(__(‘Mr WordPress’)). »‘,  », ‘http://wordpress.org/’, ‘$now’, ‘$now_gmt’, ‘ ».$wpdb->escape(__(‘Hi, this is a comment.<br />To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.’)). »‘) »);

    // 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’,  »,  »,  ») »);
    }
    endif;

    #590278
    yumiam
    Membre
    Padawan WordPress
    98 contributions

    ok … j’ai plus qu’a me pencher sur la question …. merci !!!

    #590279
    yumiam
    Membre
    Padawan WordPress
    98 contributions

    Excuse moi Xavier, mais…
    …j’ai effectué les modification dans dans /wp-admin/upgrade-functions.php,
    le code me semble limpide ( meme pour moi qui ne suis pas dévelopeur) mais lorsque je crée un nouveau blog, ces paramètres ne sont pas mis à jour… il me sort toujours le blog par défaut standard

    n’y a t il pas autre chose a changer pour que ceux-ci soir pris en compte ?

    Merci de ton aide

    #590280
    yumiam
    Membre
    Padawan WordPress
    98 contributions

    j’ai trouvé…
    En fait c’est dans :
    wp-includes > wpmu-functions.php
    et non pas dans
    /wp-admin/upgrade-functions.php.

    #590281
    xavier
    Participant
    Maître WordPress
    2124 contributions

    Ah bin voui, j’avions point qu’ça causait d’MU.

8 sujets de 1 à 8 (sur un total de 8)
  • Vous devez être connecté pour répondre à ce sujet.