/* ====================== REPLIES + CONTENT (OPTIMISÉ) ====================== */ private function migrateReplies(){ global $wpdb; // đŸ”č dernier topic WP traitĂ© $last_topic_wp = (int) $this->getLast_Topic(); // ====================== // STEP 1 : batch topics WP // ====================== $topic_rows = $wpdb->get_results($wpdb->prepare(" SELECT p.ID AS wp_topic_id, pm.meta_value AS xoops_topic_id FROM {$wpdb->posts} p JOIN {$wpdb->postmeta} pm ON pm.post_id = p.ID AND pm.meta_key = 'bbex_topic_id' WHERE p.post_type = 'topic' AND p.ID > %d ORDER BY p.ID ASC LIMIT 2000 ", $last_topic_wp)); if(!$topic_rows){ $this->log('🏁 REPLIES DONE → plus aucun topic WP Ă  traiter'); update_option('bbex_replies_done', 1, false); return; } // ====================== // BUILD MAP // ====================== $topic_map = []; $xoops_topic_ids = []; foreach($topic_rows as $t){ $topic_map[(int)$t->xoops_topic_id] = (int)$t->wp_topic_id; $xoops_topic_ids[] = (int)$t->xoops_topic_id; } $ids_sql = implode(',', $xoops_topic_ids); $this->log("🔄 REPLIES BATCH START"); $this->log("WP topics batch: " . count($topic_rows)); $this->log("XOOPS topics batch: " . count($xoops_topic_ids)); $this->log("XOOPS range: " . (min($xoops_topic_ids) ?? 0) . " → " . (max($xoops_topic_ids) ?? 0)); // ====================== // STEP 2 : GET POSTS // ====================== $posts = $wpdb->get_results(" SELECT p.post_id, p.topic_id AS xoops_topic_id, p.uid, p.pid, p.post_time, pt.post_text FROM {$this->getTable('posts')} p JOIN {$this->getTable('posts_text')} pt ON pt.post_id = p.post_id WHERE p.topic_id IN ($ids_sql) ORDER BY p.post_id ASC "); if(!$posts){ $max_wp_topic = max(array_column($topic_rows, 'wp_topic_id')); $this->setLast_Topic($max_wp_topic); $this->log("⚠ Aucun post trouvĂ©"); $this->log("âžĄïž Skip batch → last_topic_wp=$max_wp_topic"); return; } // ====================== // STATS // ====================== $inserted = 0; $skipped = 0; $updated = 0; $total = count($posts); $i = 0; // ====================== // PROCESS // ====================== foreach($posts as $p){ $i++; // đŸ”č progression % if($i % 200 === 0 || $i === $total){ $pct = round(($i / $total) * 100, 2); $this->log("⏳ Progress replies: $i/$total ($pct%) | inserted=$inserted skipped=$skipped updated=$updated"); } // user check if(empty($this->user_map[$p->uid])){ $skipped++; continue; } $wp_tid = $topic_map[(int)$p->xoops_topic_id] ?? 0; if(!$wp_tid){ $skipped++; continue; } // ====================== // MAIN TOPIC POST → CONTENT // ====================== if($p->pid == 0){ $wpdb->query($wpdb->prepare(" UPDATE {$wpdb->posts} SET post_content = IF(post_content = '', %s, post_content) WHERE ID = %d ", $p->post_text, $wp_tid)); $updated++; continue; } // ====================== // ANTI DOUBLON (IMPORTANT FIX) // ====================== $exists = $wpdb->get_var($wpdb->prepare(" SELECT 1 FROM bbex_post_lookup WHERE xoops_post_id = %d AND type = 'reply' LIMIT 1 ", $p->post_id)); if($exists){ $skipped++; continue; } // ====================== // INSERT REPLY // ====================== $wpdb->insert($wpdb->posts, [ 'post_author' => $this->user_map[$p->uid], 'post_date' => date('Y-m-d H:i:s', $p->post_time), 'post_content' => $p->post_text, 'post_status' => 'publish', 'post_type' => 'reply', 'post_parent' => $wp_tid ]); $rid = (int) $wpdb->insert_id; if(!$rid){ $skipped++; continue; } $inserted++; // meta topic $wpdb->insert($wpdb->postmeta,[ 'post_id' => $rid, 'meta_key' => '_bbp_topic_id', 'meta_value' => $wp_tid ]); // forum $forum_id = $wpdb->get_var($wpdb->prepare(" SELECT post_parent FROM {$wpdb->posts} WHERE ID = %d ", $wp_tid)); if($forum_id){ $wpdb->insert($wpdb->postmeta,[ 'post_id' => $rid, 'meta_key' => '_bbp_forum_id', 'meta_value' => $forum_id ]); } // lookup $wpdb->query($wpdb->prepare(" INSERT INTO bbex_post_lookup (xoops_post_id, wp_post_id, type) VALUES (%d, %d, 'reply') ON DUPLICATE KEY UPDATE wp_post_id = wp_post_id ", $p->post_id, $rid)); } // ====================== // SAVE PROGRESSION // ====================== $max_wp_topic = max(array_column($topic_rows, 'wp_topic_id')); $this->setLast_Topic($max_wp_topic); // ====================== // FINAL LOG // ====================== $this->log("===================================="); $this->log("🏁 REPLIES BATCH FINISHED"); $this->log("📊 total=$total | inserted=$inserted | updated=$updated | skipped=$skipped"); $this->log("âžĄïž last_topic_wp=$max_wp_topic"); $this->log("===================================="); } add_action('init', function(){ if(!isset($_GET['bbex_batch_sans_mirror'])) return; if($_GET['bbex_batch_sans_mirror'] !== 'run') return; if(!isset($_GET['key']) || $_GET['key'] !== 'oasis-cron'){ die('clĂ© invalide'); } $migration = new BBExBatchMigration(); $migration->setSource('live'); $migration->run(); echo "Batch LIVE exĂ©cutĂ©"; exit; });private function migrateReplies(){ global $wpdb; // đŸ”č dernier topic WP traitĂ© pour les replies $last_topic_wp = (int) $this->getLast_Topic(); // STEP 1 : batch topics WP $topic_rows = $wpdb->get_results($wpdb->prepare(" SELECT p.ID AS wp_topic_id, pm.meta_value AS xoops_topic_id FROM {$wpdb->posts} p JOIN {$wpdb->postmeta} pm ON pm.post_id = p.ID AND pm.meta_key = 'bbex_topic_id' WHERE p.post_type = 'topic' AND p.ID > %d ORDER BY p.ID ASC LIMIT 2000 ", $last_topic_wp)); if(!$topic_rows){ $this->log('🏁 REPLIES DONE → plus aucun topic WP Ă  traiter'); update_option('bbex_replies_done', 1, false); return; } // BUILD MAP $topic_map = []; $xoops_topic_ids = []; foreach($topic_rows as $t){ $topic_map[(int)$t->xoops_topic_id] = (int)$t->wp_topic_id; $xoops_topic_ids[] = (int)$t->xoops_topic_id; } $ids_sql = implode(',', $xoops_topic_ids); $this->log("🔄 REPLIES BATCH START"); $this->log("WP topics batch: " . count($topic_rows)); $this->log("XOOPS topics batch: " . count($xoops_topic_ids)); $this->log("XOOPS range: " . (min($xoops_topic_ids) ?? 0) . " → " . (max($xoops_topic_ids) ?? 0)); // STEP 2 : GET POSTS (LIVE XOOPSEOL) $posts = $wpdb->get_results(" SELECT p.post_id, p.topic_id AS xoops_topic_id, p.uid, p.pid, p.post_time, pt.post_text FROM {$this->getTable('posts')} p JOIN {$this->getTable('posts_text')} pt ON pt.post_id = p.post_id WHERE p.topic_id IN ($ids_sql) ORDER BY p.post_id ASC "); if(!$posts){ $max_wp_topic = max(array_column($topic_rows, 'wp_topic_id')); $this->setLast_Topic($max_wp_topic); $this->log("⚠ Aucun post trouvĂ©"); $this->log("âžĄïž Skip batch → last_topic_wp=$max_wp_topic"); return; } $inserted = 0; $skipped = 0; $updated = 0; $total = count($posts); $i = 0; foreach($posts as $p){ $i++; if($i % 200 === 0 || $i === $total){ $pct = round(($i / $total) * 100, 2); $this->log("⏳ Progress replies: $i/$total ($pct%) | inserted=$inserted skipped=$skipped updated=$updated"); } // user check if(empty($this->user_map[$p->uid])){ $skipped++; continue; } $wp_tid = $topic_map[(int)$p->xoops_topic_id] ?? 0; if(!$wp_tid){ $skipped++; continue; } // MAIN TOPIC POST → CONTENT if($p->pid == 0){ $wpdb->query($wpdb->prepare(" UPDATE {$wpdb->posts} SET post_content = IF(post_content = '', %s, post_content) WHERE ID = %d ", $p->post_text, $wp_tid)); $updated++; continue; } // ANTI DOUBLON $exists = $wpdb->get_var($wpdb->prepare(" SELECT 1 FROM bbex_post_lookup WHERE xoops_post_id = %d AND type = 'reply' LIMIT 1 ", $p->post_id)); if($exists){ $skipped++; continue; } // INSERT REPLY $wpdb->insert($wpdb->posts, [ 'post_author' => $this->user_map[$p->uid], 'post_date' => date('Y-m-d H:i:s', $p->post_time), 'post_content' => $p->post_text, 'post_status' => 'publish', 'post_type' => 'reply', 'post_parent' => $wp_tid ]); $rid = (int) $wpdb->insert_id; if(!$rid){ $skipped++; continue; } $inserted++; // meta topic $wpdb->insert($wpdb->postmeta,[ 'post_id' => $rid, 'meta_key' => '_bbp_topic_id', 'meta_value' => $wp_tid ]); // forum $forum_id = $wpdb->get_var($wpdb->prepare(" SELECT post_parent FROM {$wpdb->posts} WHERE ID = %d ", $wp_tid)); if($forum_id){ $wpdb->insert($wpdb->postmeta,[ 'post_id' => $rid, 'meta_key' => '_bbp_forum_id', 'meta_value' => $forum_id ]); } // lookup $wpdb->query($wpdb->prepare(" INSERT INTO bbex_post_lookup (xoops_post_id, wp_post_id, type) VALUES (%d, %d, 'reply') ON DUPLICATE KEY UPDATE wp_post_id = wp_post_id ", $p->post_id, $rid)); } $max_wp_topic = max(array_column($topic_rows, 'wp_topic_id')); $this->setLast_Topic($max_wp_topic); $this->log("===================================="); $this->log("🏁 REPLIES BATCH FINISHED"); $this->log("📊 total=$total | inserted=$inserted | updated=$updated | skipped=$skipped"); $this->log("âžĄïž last_topic_wp=$max_wp_topic"); $this->log("===================================="); } if(isset($_GET['source'])){ $migration->setSource($_GET['source']); } VOTRE ATTENTION ! À TOUTES LES MASCOTTES ! - Oasis des Artistes. Le plus beau site de poĂ©sie

Oasis des Artistes. Le plus beau site de poésie

Oasis des artistes: PoĂ©sie en ligne, Concours de poĂšmes en ligne – membres !

VOTRE ATTENTION ! À TOUTES LES MASCOTTES !

  • Ce sujet contient 10 réponses, 4 participants et a Ă©tĂ© mis Ă  jour pour la derniĂšre fois par Avatar photodouceur3, le 20-08-2024 19:06.
  • Créateur
    Sujet
  • #2714182
    Administratrice
    Avatar photoSybilla
    Maßtre des clés
      • Sujet: 17798
      • RĂ©ponses: 198089

      Bonjour ChÚres Amies poétesses et Chers Amis poÚtes,

      Tant que je suis la seule modératrice sur le site, je vais verrouiller ou transférer sur le forum de la modération tous les posts qui font polémiques.

      Je précise bien. TOUS !

      Ce serait bien que chaque membres mettent un peu d’eau dans son vin quels que soient ces arguments ou opinions de part et d’autre tant que la tempĂ©rature n’aura pas baissĂ© entre vous tous…

      Je suis navrĂ©e que vous vous dĂ©chiriez ainsi…
      Cela me fait énormément de peine moi qui suis une pacifiste convaincue.

      Je vous souhaite une trÚs douce journée !

      Et j’espĂšre que le sourire reviendra sur vos lĂšvres.

      Nous sommes sur un site de poĂ©sies, pas sur un ring de boxe, ni sur un lieu oĂč pleuvent des bombes engendrant des personnes dĂ©cĂ©dĂ©es…
      Des gens meurent dans le monde.
      Vous n’allez pas vous battre pour de telles choses…
      RĂ©flĂ©chissez…

      Merci de votre attention !

      Gros bisous Ă  vous toutes et tous sans distinction !

      Sybilla

      Le r?ve est le poumon de ma vie (Citation de Sybilla)
    Vous lisez 9 fils de discussion
    • Auteur
      Réponses
      • #3528811
        Administratrice
        Avatar photoSybilla
        Maßtre des clés
          • Sujet: 17798
          • RĂ©ponses: 198089

          Bonjour ChĂšre Amie Laurence,

          Oui. Tu as raison !
          Et Adeline aurait été trÚs affectée de voir ses poÚtes entrer en conflits.

          Tant de malheureux dans le monde !

          Tentons de nous épanouir en partageant la Poésie qui est notre Passion commune !

          Et que ces rixes cessent.

          Dans la vie, il faut communiquer certes mais dans le plus grand respect fraternel.

          Dieu nous voit, voit nos actes, respectons nous toutes et tous !

          Je suis avec vous tous sans parti pris et n’appartient Ă  aucun clan.
          Ce qui me permet, je le souhaite le mieux possible de rester équitable.

          Je vous aime toutes et tous en tant que PoĂštes bien entendu (lool) et amicalement.

          Je te souhaite une excellente journée Laurence!
          Ainsi qu’Ă  tous les membres d’Oasis !
          Toutes mes amitiés
          Gros bisous
          Sybilla

          Le r?ve est le poumon de ma vie (Citation de Sybilla)
        • #3528881
          Administratrice
          Avatar photoSybilla
          Maßtre des clés
            • Sujet: 17798
            • RĂ©ponses: 198089

            Bonsoir Marie,

            Dans la journĂ©e oui j’Ă©tais toute seule.

            J’ai passĂ© la journĂ©e Ă  surveiller le site.

            J’ai dĂ» faire appel Ă  JoĂ«l.

            Belle soirée !

            Le r?ve est le poumon de ma vie (Citation de Sybilla)
          • #3528883
            Plume de diamant
            ★★★★★★
            Avatar photocyrael
            Membre Oasis
              • Sujet: 14564
              • RĂ©ponses: 136022

              bonsoir

              JE SUIS TRISTE DE VOIR

              que certaines personnes , viennent dans le site
              uniquement pour dĂ©truire le chef d’Oeuvre D’EOLIENNE

              en s’opposant, Ă  tout ce qui est Ă©crit, et
              ne respectant pas la volonté de notre fondatrice
              et son REGLEMENT ,

              ainsi que le message
              posté PAR _ son Epoux _ MONSIEUR _JOEL_

              il me semble qu’il y a eu ce jour, quelques Ă©vĂ©nements
              graves, suite Ă  des actes inadmissibles, volontaires
              et incontrolables..

              ce qui a fait du tort
              a

              MARIE LUZ DEL SOL
              NADINE EVELYNE
              MISSI

              Je me retire des —mascottes —-puisque , EOLIENNE voulait qu’on
              signale les manquements , je l’ai fait, et on me traite de
              rapporteuse.. on me demande de faire mon devoir de mascotte
              qui est de veiller sur les dérapages..

              je préfÚre___ vous laisser entre mascottes et modératrices
              modérateurs,

              je vous prie d’ accepter ma dĂ©mission des__ mascottes__

              maryjo est triste pour toutes ses amies, Ă  qui, cette personne
              a laissé des__ messages déplacés.__

              Bonsoir , mon coeur est bien lourd..

              l'Amour rayonne quand l'Ame s'?l?ve, citation maryjo
            • #3528884
              Webmaster
              joel
              Maßtre des clés
                • Sujet: 198
                • RĂ©ponses: 4013

                Bonsoir
                Heureusement que SYBILLA était la parce que il y a eu la pagaille toute la journée
                Elle m a téléphonée en urgence et nous avons réglé les problÚmes tous les deux
                Tous les posts ont étés vérouilliés provissoirement avec mon accord

                Cordialement

                JOEL

                ( j ai envoyé un MP à LEFEVRE??)

              • #3528886
                Plume de diamant
                ★★★★★★
                Avatar photocyrael
                Membre Oasis
                  • Sujet: 14564
                  • RĂ©ponses: 136022

                  MERCI MERCI A VOUS

                  MONSIEUR JOEL

                  en effet, j’ai signalĂ© Ă  SYBILLA

                  les *mots déplacés sous les poÚmes

                  De trois de nos amies fidĂšles du site OASIS

                  Mais, une telle * attaque * qui vise le rĂšglement doit

                  etre sanctionnée

                  MERCI POUR AVOIR fait le nécessaire

                  pardon Ă  tous, mais, je fais tout ce qui est possible

                  pour APPLIQUER a la lettre LE REGLEMENT

                  DE NOTRE AMIE FEUE EOLIENNE

                  merci MONSIEUR JOEL merci MONSIEUR STEVE

                  MERCI SYBILLA merci FRANIE et toutes les mascottes

                  l'Amour rayonne quand l'Ame s'?l?ve, citation maryjo
                • #3528888
                  Webmaster
                  joel
                  Maßtre des clés
                    • Sujet: 198
                    • RĂ©ponses: 4013

                    Bonsoir MARYJO

                    Ma femme vous aimait beaucoup . et pour ADELINE et pour moi je souhaite que vous restiez Mascotte

                    Cordialement

                    JOEL

                    Gros bisous

                  • #3528897
                    Plume de diamant
                    ★★★★★★
                    Avatar photocyrael
                    Membre Oasis
                      • Sujet: 14564
                      • RĂ©ponses: 136022

                      merci MONSIEUR JOEL * JE RESTE * POUR EOLIENNE

                      POUR VOUS ET POUR VOTRE FAMILLE

                      ____________________________________________

                      et je vous fais la promesse Ă  toutes Ă  tous

                      D’ etre mascotte qui toujours dĂ©fendra

                      *OASIS DES ARTISTES*

                      car__ j’aime *FEUE EOLIENNE * notre chĂšre ADELINE

                      COMME vous tous, j’ai du mal Ă  ressentir ce vide sans elle

                      mais , puisqu’elle a voulu rejoindre Le PARADIS

                      laissons_____ L’ETOILE D ‘EOLIENNE

                      ce soir, ___ECLAIRER.. NOTRE OASIS ..____

                      le vent se fait plus doux, j’Ă©coute , le solo d’un rossignol
                      Comme pour apaiser nos coeurs lourds de chagrin

                      car EOLIENNE NOTRE ___BIEN AIMEE____

                      nous a tant aimé !

                      MERCI MONSIEUR JOEL je vous apporte mon soutien

                      car je sais , je devine combien votre coeur souffre en silence

                      l'Amour rayonne quand l'Ame s'?l?ve, citation maryjo
                    • #3529003
                      Webmaster
                      joel
                      Maßtre des clés
                        • Sujet: 198
                        • RĂ©ponses: 4013

                        Bonjour

                        MERCI BEAUCOUP DE RESTER AVEC NOUS
                        ADELINE EGALEMENT

                        BON COURAGE

                      • #3529055
                        Plume de diamant
                        ★★★★★★
                        Avatar photocyrael
                        Membre Oasis
                          • Sujet: 14564
                          • RĂ©ponses: 136022

                          Je vous REMERCIE Monsieur JOEL et madame FEUE ADELINE

                          bisous fraternels, respectueuses salutations

                          l'Amour rayonne quand l'Ame s'?l?ve, citation maryjo
                        • #3529582
                          Mascotte d'Oasis
                          Avatar photodouceur3
                          Membre Oasis
                            • Sujet: 1828
                            • RĂ©ponses: 21965

                            que la paix revienne sur notre forum
                            tout ce que Mme Éolienne voulait!

                            Lire, c?est rencontrer du monde, au plus profond de soi.
                        Vous lisez 9 fils de discussion
                        • Vous devez être connecté pour répondre à ce sujet.