- Statut : non résolu
- Ce sujet contient 0 réponse, 1 participant et a été mis à jour pour la dernière fois par
foubouh, le il y a 9 années et 2 mois.
-
AuteurMessages
-
2 décembre 2013 à 13 h 48 min #531364
WordPress 3.6
Duotive Fortune :Dupliquer une barre de défilement de logos déjà implantés dans le thème :
Bonjour à tous,
je souhaite dupliquer une barre de défilement de logos déjà présent sur mon thème. Lors de la duplication, un deuxième champ identique au premier s’affiche bien en back-end, ce champ dupliqué s’affiche aussi en front-end mais prend automatiquement les valeurs du champ d’origine quand je tente de le remplir.
J’ai bien cherché à changer les expressions dans le php, mais comme je ne suis pas un expert de ce langage, je n’arrive pas à faire fonctionner ma deuxième bannière.
Voici le code pour le fichier qui affiche en front-end :
/* PARTNERS */
if ( $frontpage_row == ‘row-partners’ ):
$dt_FrontPagePartners = get_option(‘dt_FrontPagePartners_’.$dt_FrontPageID, ‘no’);
if ( $dt_FrontPagePartners == ‘yes’ ):
$dt_FrontPagePartnersTitle = get_option(‘dt_FrontPagePartnersTitle_’.$dt_FrontPageID, »);
$dt_FrontPagePartnersDetails = get_option(‘dt_FrontPagePartnersDetails_’.$dt_FrontPageID, »);
$frontpageOutput .= ‘<div class="front-page-row clearfix front-page-partners">‘. »n »;
if ( $dt_FrontPagePartnersTitle != » ):
$frontpageOutput .= ‘<h4>‘.$dt_FrontPagePartnersTitle.’</h4>‘. »n »;
endif;
$dt_FrontPagePartnersDetails = explode(« n », $dt_FrontPagePartnersDetails);
$frontpageOutput .= ‘<div class="front-page-partners-wrapper">‘;
$frontpageOutput .= ‘<ul class="rs-carousel-runner">‘;
foreach ($dt_FrontPagePartnersDetails as $dt_FrontPagePartnersDetail):
$dt_FrontPagePartnersDetailLenght = strlen($dt_FrontPagePartnersDetail);
$dt_FrontPagePartnersDetailSep = strpos($dt_FrontPagePartnersDetail,’|’);
$dt_FrontPagePartnersDetailImage = trim(substr($dt_FrontPagePartnersDetail,0,$dt_FrontPagePartnersDetailSep));
$dt_FrontPagePartnersDetailUrl = trim(substr($dt_FrontPagePartnersDetail,$dt_FrontPagePartnersDetailSep+1,$dt_FrontPagePartnersDetailLenght));
$frontpageOutput .= ‘<li class="rs-carousel-item">‘;
$frontpageOutput .= ‘<a rel="no-follow" target="_blank" href="'.$dt_FrontPagePartnersDetailUrl.'">‘;
$frontpageOutput .= ‘<img src="'.$dt_FrontPagePartnersDetailImage.'">‘;
$frontpageOutput .= ‘</a>‘;
$frontpageOutput .= ‘</li>‘;
endforeach;
$frontpageOutput .= ‘</ul>‘;
$frontpageOutput .= ‘</div>‘. »n »;
$frontpageOutput .= ‘</div>‘. »n »;
$separatorValidator = $separatorValidator + 1;
endif;
endif;
/* END OF PARTNERS */
/* La partie que j’ai dupliquée */
if ( $frontpage_row == ‘row-partners1’ ):
$dt_FrontPagePartners = get_option(‘dt_FrontPagePartners_’.$dt_FrontPageID, ‘no’);
if ( $dt_FrontPagePartners == ‘yes’ ):
$dt_FrontPagePartnersTitle = get_option(‘dt_FrontPagePartnersTitle_’.$dt_FrontPageID, »);
$dt_FrontPagePartnersDetails = get_option(‘dt_FrontPagePartnersDetails_’.$dt_FrontPageID, »);
$frontpageOutput .= ‘<div class="front-page-row clearfix front-page-partners">‘. »n »;
if ( $dt_FrontPagePartnersTitle != » ):
$frontpageOutput .= ‘<h4>‘.$dt_FrontPagePartnersTitle.’</h4>‘. »n »;
endif;
$dt_FrontPagePartnersDetails = explode(« n », $dt_FrontPagePartnersDetails);
$frontpageOutput .= ‘<div class="front-page-partners-wrapper">‘;
$frontpageOutput .= ‘<ul class="rs-carousel-runner">‘;
foreach ($dt_FrontPagePartnersDetails as $dt_FrontPagePartnersDetail):
$dt_FrontPagePartnersDetailLenght = strlen($dt_FrontPagePartnersDetail);
$dt_FrontPagePartnersDetailSep = strpos($dt_FrontPagePartnersDetail,’|’);
$dt_FrontPagePartnersDetailImage = trim(substr($dt_FrontPagePartnersDetail,0,$dt_FrontPagePartnersDetailSep));
$dt_FrontPagePartnersDetailUrl = trim(substr($dt_FrontPagePartnersDetail,$dt_FrontPagePartnersDetailSep+1,$dt_FrontPagePartnersDetailLenght));
$frontpageOutput .= ‘<li class="rs-carousel-item">‘;
$frontpageOutput .= ‘<a rel="no-follow" target="_blank" href="'.$dt_FrontPagePartnersDetailUrl.'">‘;
$frontpageOutput .= ‘<img src="'.$dt_FrontPagePartnersDetailImage.'">‘;
$frontpageOutput .= ‘</a>‘;
$frontpageOutput .= ‘</li>‘;
endforeach;
$frontpageOutput .= ‘</ul>‘;
$frontpageOutput .= ‘</div>‘. »n »;
$frontpageOutput .= ‘</div>‘. »n »;
$separatorValidator = $separatorValidator + 1;
endif;
endif;
/* END OF PARTNERS1 */Et voici la partie du code pour afficher en front-end.
<?php if ( $frontpage_row == 'row-partners' ) : ?>
<li id="row-partners" class="frontpage-box">
<div class="row-header">Partner scroller<span class="front-page-row-handle"></span><span class="front-page-row-icon">Settings</span></div>
<div class="row-content">
<div class="table-row clearfix">
<label for="dt_FrontPagePartners_<?php echo $id; ?>« >Status:</label>
<select name="dt_FrontPagePartners_<?php echo $id; ?>« >
<?php $dt_FrontPagePartners = get_option('dt_FrontPagePartners_'.$id, 'no');?>
<option value="yes" <?php if ($dt_FrontPagePartners=='yes') { echo 'selected'; } ?> >Enabled</option>
<option value="no" <?php if ($dt_FrontPagePartners=='no') { echo 'selected'; } ?>>Disabled</option>
</select>
</div>
<div class="table-row clearfix">
<label for="dt_FrontPagePartnersTitle_<?php echo $id; ?>« >Title:</label>
<input type="text" size="50" name="dt_FrontPagePartnersTitle_<?php echo $id; ?> » id= »dt_FrontPagePartnersTitle_<?php echo $id; ?> » value= »<?php echo get_option('dt_FrontPagePartnersTitle_'.$id); ?> » />
</div>
<div class="table-row clearfix">
<label for="dt_FrontPagePartnersDetails_<?php echo $id; ?>_<?php echo $k; ?>« >Partners:</label>
<textarea rows="8" cols="90" name="dt_FrontPagePartnersDetails_<?php echo $id; ?>« ><?php echo get_option('dt_FrontPagePartnersDetails_'.$id); ?></textarea>
<img class="hint-icon" title="Please enter the logo images and the link like shown in the example: imageURL|partnerURL" src="<?php echo get_template_directory_uri(); ?>/includes/duotive-admin-skin/images/hint-icon.png » />
</div>
<div class="table-row table-row-last clearfix">
<input type="submit" name="search" value="Save changes" class="button" />
</div>
</div>
</li>
<?php endif; ?>
<?php if ( $frontpage_row == 'row-partners1' ) : ?>
<li id="row-partners" class="frontpage-box">
<div class="row-header">Partner scroller<span class="front-page-row-handle"></span><span class="front-page-row-icon">Settings</span></div>
<div class="row-content">
<div class="table-row clearfix">
<label for="dt_FrontPagePartners_<?php echo $id; ?>« >Status:</label>
<select name="dt_FrontPagePartners_<?php echo $id; ?>« >
<?php $dt_FrontPagePartners = get_option('dt_FrontPagePartners_'.$id, 'no');?>
<option value="yes" <?php if ($dt_FrontPagePartners=='yes') { echo 'selected'; } ?> >Enabled</option>
<option value="no" <?php if ($dt_FrontPagePartners=='no') { echo 'selected'; } ?>>Disabled</option>
</select>
</div>
<div class="table-row clearfix">
<label for="dt_FrontPagePartnersTitle_<?php echo $id; ?>« >Title:</label>
<input type="text" size="50" name="dt_FrontPagePartnersTitle_<?php echo $id; ?> » id= »dt_FrontPagePartnersTitle_<?php echo $id; ?> » value= »<?php echo get_option('dt_FrontPagePartnersTitle_'.$id); ?> » />
</div>
<div class="table-row clearfix">
<label for="dt_FrontPagePartnersDetails_<?php echo $id; ?>_<?php echo $k; ?>« >Partners:</label>
<textarea rows="8" cols="90" name="dt_FrontPagePartnersDetails_<?php echo $id; ?>« ><?php echo get_option('dt_FrontPagePartnersDetails_'.$id); ?></textarea>
<img class="hint-icon" title="Please enter the logo images and the link like shown in the example: imageURL|partnerURL" src="<?php echo get_template_directory_uri(); ?>/includes/duotive-admin-skin/images/hint-icon.png » />
</div>
<div class="table-row table-row-last clearfix">
<input type="submit" name="search" value="Save changes" class="button" />
</div>
</div>
</li>
<?php endif; ?>Alors je pense bien qu’il faille changer quelques déclarations pour justement ne pas avoir deux bannières dupliquées mais bien deux bannières indépendantes et fonctionnelles sur le site.
J’ai essayé de remplacé un peu tous les termes sans succès…Merci d’avance pour votre aide,
-
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.