Ignore:
Timestamp:
Feb 13, 2011, 11:12:58 AM (13 years ago)
Author:
mistic100
Message:

ContestResults :

  • Code revision
  • Add Letton (lv_LV) language, thanks to Aivars Baldone
  • Delete display options
  • Fix languages bugs
  • Improve public appearence
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContestResults/include/cr_comment_picture.php

    r6782 r9200  
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    33
    4 // +-----------------------------------------------------------------------+
    54// Requète simple pour savoir si l'image a participé à des concours
    6 // +-----------------------------------------------------------------------+
    7 $query = "SELECT image_id FROM " . CR_TABLE_2 . " WHERE image_id = " . $page['image_id'] . ";";
    8 $results = pwg_query($query);
     5$participation = pwg_query("SELECT image_id FROM " . CR_TABLE_2 . " WHERE image_id = " . $page['image_id'] . ";");
    96
    10 if(pwg_db_num_rows($results)){
    11         $query = "SELECT
     7if(pwg_db_num_rows($participation)){
     8        $results = pwg_query("SELECT
    129                        i.rank,
    1310                        i.comment,
     
    1815                ON i.contest_id = c.id
    1916                WHERE i.image_id = " . $page['image_id'] . "
    20                 ORDER BY c.date_begin DESC;";
    21         $results = pwg_query($query);
     17                ORDER BY c.date_begin DESC;");
    2218       
    2319        // Gère plusieurs participations
    2420        $comment = null;
    25         while($result = pwg_db_fetch_assoc($results)){
     21        while( $result = pwg_db_fetch_assoc($results)) {
    2622                // Rang amélioré
    27                 if($result['rank'] <= 3) $result['rank'] = l10n('CR_order_'.$result['rank']);
    28                 else $result['rank'] .= l10n('CR_order_sup');
     23                $result['rank'] = ($result['rank'] <= 3) ? l10n('CR_order_'.$result['rank']) : $result['rank'] . l10n('CR_order_sup');
    2924               
    3025                // Lien vers le concours
     
    3328               
    3429                // Ajoute le commentaire après la description
    35                 $comment .= '<div style="border:1px solid #404040;padding:10px;margin:10px 25%">
    36                         <b><a href="' . $result['contest_link'] .'">' . $result['contest_name'] . '</a></b>
    37                         :: <u>' . $result['rank'] . '</u>
     30                $comment .= '<div class="CR_comment">
     31                        <b><a href="' . $result['contest_link'] .'">' . $result['contest_name'] . '</a></b> :: <u>' . $result['rank'] . ' ' . l10n('CR_place') . '</u>
    3832                        <p>' . trigger_event('render_CR_content', $result['comment']) . '</p>
    3933                </div>';
     
    4236                $template->append('related_categories', '<a href="' . CR_PUBLIC . '">' . l10n('Contests') . '</a>' . $conf['level_separator'] . '<a href="' . $result['contest_link'] . '">' . $result['contest_name'] . '</a>');
    4337        }
     38       
     39        // style utilisé pour les blocs des concours
     40        $css = '<style type="text/css">
     41                .CR_comment {
     42                        border:1px solid #404040;
     43                        padding:10px;
     44                        margin:10px 20%;
     45                }
     46        </style>';
    4447
    4548        $template->assign('COMMENT_IMG', $template->get_template_vars('COMMENT_IMG') . $comment);
     49        $template->assign('PLUGIN_PICTURE_BEFORE', $template->get_template_vars('PLUGIN_PICTURE_BEFORE') . $css);
    4650}
    47 
    4851?>
Note: See TracChangeset for help on using the changeset viewer.