Преглед изворни кода

revision pret et mis a jour

philippelin пре 9 месеци
родитељ
комит
6f8f5453f9
2 измењених фајлова са 23 додато и 29 уклоњено
  1. 1 2
      functions.php
  2. 22 27
      resources/views/index.blade.php

+ 1 - 2
functions.php

@@ -99,8 +99,7 @@ collect(['setup', 'filters'])
      
     }
     add_action('admin_footer', 'cacher_bloc_foot_admin');
-    
-    
+
    
     
 

+ 22 - 27
resources/views/index.blade.php

@@ -27,6 +27,7 @@
     </thead>
     <tbody class="w-full lg:w-2/3 block bg-jlg-dark-blue">
       <?php
+          
         $args = array(
           'post_type' => 'post',
           'posts_per_page' => -1,
@@ -37,37 +38,31 @@
         );
         $query = new WP_Query($args);
         if ($query->have_posts()) :
-         if(is_user_logged_in()){ // verifier si l'utilisateur est connecté 
-          while ($query->have_posts()) : $query->the_post();
-            $edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
-      ?> 
-          <tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
-            <td class="block text-sm pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Minutage', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Images', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'VoixOffIn', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'BandeSon', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Ecrits', true) }}</td>
-            <td class="block text-sm pl-0 pr-6"><?php echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';?></td>
-          </tr>
-       <?php
-          endwhile;
-         }
 
-         elseif (!is_user_logged_in()) { // si l'utilsateur n'est pas connecté alors le bouton edit a un shortcode qui appelle le plugin user Login
           while ($query->have_posts()) : $query->the_post();
-            $edit_link = $edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
+              $contenu = get_the_content();
+              $infosArray = explode("---", $contenu); // Divise le contenu en fonction des séparateurs
+
+              // Initialisez des variables pour stocker les informations
+              $images = isset($infosArray[0]) ? $infosArray[0] : '';
+              $voixOffIn = isset($infosArray[1]) ? $infosArray[1] : '';
+              $bandeson = isset($infosArray[2]) ? $infosArray[2] : '';
+              $ecrits = isset($infosArray[3]) ? $infosArray[3] : '';
+          
+              //lien pour le crayon
+              $edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
       ?> 
-          <tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
-            <td class="block text-sm pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Minutage', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Images', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'VoixOffIn', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'BandeSon', true) }}</td>
-            <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Ecrits', true) }}</td>
-            <td class="block text-sm pl-0 pr-6"><?php echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';?></td>
-          </tr>
-       <?php
+            <tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
+              <td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
+              <td class="block pl-0 pr-6"><?php echo $images; ?></td>
+              <td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
+              <td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
+              <td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
+              <td class="block text-sm pl-0 pr-6"><?php if(is_user_logged_in()){ echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';} elseif (!is_user_logged_in()) { echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';}?></td>
+            </tr>
+      <?php
           endwhile;
-         }
+        
         endif;
         wp_reset_postdata();
       ?>