[phpBB 3.0.x] Ajouter de nouvelles options dans le sujet
Posté : sam. 2 juil. 2011 16:56
» Ajouter de nouvelles options dans le sujet
Vous souhaitez ajouter de nouvelles icônes dans le sujet afin de pouvoir effectuer de nouvelles actions telles que imprimer le sujet, télécharger le sujet au format HTML ou encore avoir le sujet au format PDF, dans ce cas, il suffit de suivre cette documentation.
Avant tout, téléchargez ce pack:
Ouvrez le fichier « language/fr/common.php ».
Cherchez:
Après, ajoutez:
Ouvrez le fichier « viewtopic.php ».
Cherchez:
Après, ajoutez:
Cherchez:
Avant, ajoutez:
Cherchez:
Avant, ajoutez:
Cherchez:
Remplacez par:
Ouvrez le fichier « styles/prosilver/template/viewtopic_body.html ».
Cherchez:
Remplacez par:
Ouvrez le fichier « styles/prosilver/theme/buttons.css ».
Cherchez:
Après, ajoutez:
Ouvrez le fichier « styles/prosilver/theme/colours.css ».
Cherchez:
Après, ajoutez:
N'oubliez pas de rafraîchir le fichier template, thème et le pack image (onglet Styles) ainsi que de vider le cache (onglet Général).
Ce qui donne le résultat suivant:
Vous souhaitez ajouter de nouvelles icônes dans le sujet afin de pouvoir effectuer de nouvelles actions telles que imprimer le sujet, télécharger le sujet au format HTML ou encore avoir le sujet au format PDF, dans ce cas, il suffit de suivre cette documentation.
Avant tout, téléchargez ce pack:
Ouvrez le fichier « language/fr/common.php ».
Cherchez:
Code : Tout sélectionner
'default_dateformat' => 'D j M Y H:i', // Lun 10 Jan 2007 13:37
Code : Tout sélectionner
'DOWNLOAD_TOPIC' => 'Télécharger le sujet',
Cherchez:
Code : Tout sélectionner
$update = request_var('update', false);
Code : Tout sélectionner
$action = request_var('action', '');
Code : Tout sélectionner
// Send vars to template
$template->assign_vars(array(
Code : Tout sélectionner
if ($action == 'download')
{
// Send file headers
header('Content-type: text/html');
header('Content-Disposition: attachment;filename=' . $topic_data['topic_title']);
header('Pragma: no-cache');
header('Expires: 0');
}
Code : Tout sélectionner
'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id",
Code : Tout sélectionner
'U_DOWNLOAD_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id&action=download"),
Code : Tout sélectionner
'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
Code : Tout sélectionner
'body' => ($view == 'print') ? 'viewtopic_print.html' : ($action == 'download') ? 'viewtopic_download.html' : 'viewtopic_body.html')
Cherchez:
Code : Tout sélectionner
<!-- IF PAGINATION or TOTAL_POSTS -->
<div class="pagination">
<!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --><a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a> • <!-- ENDIF -->{TOTAL_POSTS}
<!-- IF PAGE_NUMBER --><!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
</div>
<!-- ENDIF -->
Code : Tout sélectionner
<div style="float: right; margin-top: 5px;">
<div class="buttons">
<div class="download-topic"><a href="{U_DOWNLOAD_TOPIC}" title="{L_DOWNLOAD_TOPIC}" accesskey="d"><span></span>{L_DOWNLOAD_TOPIC}</a></div>
<!-- IF U_PRINT_TOPIC --><div class="print-topic"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p"><span></span>{L_PRINT_TOPIC}</a></div><!-- ENDIF -->
<!-- <div class="pdf-topic"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p"><span></span>{L_PRINT_TOPIC}</a></div> -->
</div>
</div>
Cherchez:
Code : Tout sélectionner
.forwardpm-icon span { background: none 0 0 no-repeat; }
Code : Tout sélectionner
/* Nouvelles icones de sujet */
.download-topic span { background: none 0 0 no-repeat; }
.print-topic span { background: none 0 0 no-repeat; }
.pdf-topic span { background: none 0 0 no-repeat; }
.buttons div.download-topic { width: 16px; height: 16px; }
.buttons div.print-topic { width: 16px; height: 16px; }
.buttons div.pdf-topic { width: 16px; height: 16px; }
Cherchez:
Code : Tout sélectionner
.forwardpm-icon span { background-image: url("{IMG_BUTTON_PM_FORWARD_SRC}") ;}
Code : Tout sélectionner
.print-topic span { background-image: url("{T_THEME_PATH}/images/icon_print.png"); }
.download-topic span { background-image: url("{T_THEME_PATH}/images/icon_download.png"); }
.pdf-topic span { background-image: url("{T_THEME_PATH}/images/icon_pdf.gif"); }
Ce qui donne le résultat suivant: