Changeset 6669
- Timestamp:
- Jul 6, 2010, 10:11:06 PM (14 years ago)
- Location:
- branches/2.1
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/include/functions.inc.php
r6384 r6669 33 33 34 34 //----------------------------------------------------------- generic functions 35 function get_extra_fields($order_by_fields)36 {37 $fields = str_ireplace(array(' order by ', ' desc', ' asc'),38 array('', '', ''),39 $order_by_fields40 );41 if (!empty($fields))42 {43 $fields = ','.$fields;44 }45 return $fields;46 }47 35 48 36 // The function get_moment returns a float value coresponding to the number … … 584 572 global $user, $template, $lang_info, $conf, $lang, $t2, $page, $debug; 585 573 586 if (!isset($lang_info) )574 if (!isset($lang_info) || !isset($template) ) 587 575 { 588 576 $user = build_user( $conf['guest_id'], true); … … 591 579 load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true) ); 592 580 $template = new Template(PHPWG_ROOT_PATH.'themes', get_default_theme()); 593 }594 else595 {596 $template = new Template(PHPWG_ROOT_PATH.'themes', $user['theme']);597 581 } 598 582 -
branches/2.1/include/functions_calendar.inc.php
r6364 r6669 259 259 if ($must_show_list) 260 260 { 261 $query = 'SELECT DISTINCT id ' .get_extra_fields($conf['order_by']);261 $query = 'SELECT DISTINCT id '; 262 262 $query .= ','.$calendar->date_field; 263 263 $query .= $calendar->inner_sql.' -
branches/2.1/include/functions_notification.inc.php
r6663 r6669 80 80 if (!empty($end)) 81 81 { 82 $query .= ' 82 $query .= ' 83 83 AND c.validation_date <= \''.$end.'\''; 84 84 } … … 95 95 } 96 96 if (!empty($end)) 97 { 97 { 98 98 $query .= ' AND date <= \''.$end.'\''; 99 99 } … … 620 620 621 621 $title = l10n_dec('%d new image', '%d new images', $date_detail['nb_elements']); 622 $title .= ' ('.$lang['month'][ (int)$exploded_date['tm_mon']].' '.$exploded_date['tm_mday'].')';622 $title .= ' ('.$lang['month'][1+$exploded_date['tm_mon']].' '.$exploded_date['tm_mday'].')'; 623 623 624 624 return $title; 625 625 } 626 626 627 if(!function_exists("strptime")) 628 { 629 function strptime($date, $fmt) 630 { 631 if ($fmt != '%Y-%m-%d %H:%M:%S') 632 die('Invalid strptime format '.$fmt); 633 list($y,$m,$d,$H,$M,$S) = preg_split('/[-: ]/', $date); 634 $res = localtime( mktime($H,$M,$S,$m,$d,$y), true ); 635 return $res; 636 } 637 } 627 638 ?> -
branches/2.1/include/section_init.inc.php
r6665 r6669 290 290 // Main query 291 291 $query = ' 292 SELECT DISTINCT(image_id) '.get_extra_fields($conf['order_by']).'292 SELECT DISTINCT(image_id) 293 293 FROM '.IMAGE_CATEGORY_TABLE.' 294 294 INNER JOIN '.IMAGES_TABLE.' ON id = image_id … … 324 324 { 325 325 $query = ' 326 SELECT DISTINCT image_id '.get_extra_fields($conf['order_by']).'326 SELECT DISTINCT image_id 327 327 FROM '.IMAGE_CATEGORY_TABLE.' INNER JOIN '.IMAGES_TABLE.' ON image_id=id 328 328 WHERE image_id IN ('.implode(',', $items).') … … 441 441 442 442 $query = ' 443 SELECT DISTINCT(id) '.get_extra_fields($conf['order_by']).'443 SELECT DISTINCT(id) 444 444 FROM '.IMAGES_TABLE.' 445 445 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id … … 529 529 { 530 530 $query =' 531 SELECT DISTINCT(id) '.get_extra_fields($conf['order_by']).'531 SELECT DISTINCT(id) 532 532 FROM '.IMAGES_TABLE.' 533 533 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id -
branches/2.1/themes/default/template/comments.tpl
r5164 r6669 3 3 <div class="titrePage"> 4 4 <ul class="categoryActions"> 5 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li>5 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li> 6 6 </ul> 7 7 <h2>{'User comments'|@translate}</h2> -
branches/2.1/themes/default/template/notification.tpl
r5164 r6669 7 7 <div class="titrePage"> 8 8 <ul class="categoryActions"> 9 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li>9 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li> 10 10 </ul> 11 11 <h2>{'Notification'|@translate}</h2> -
branches/2.1/themes/default/template/password.tpl
r5559 r6669 3 3 <div class="titrePage"> 4 4 <ul class="categoryActions"> 5 <li><a href="{$U_HOME}" title="{'Go through the gallery as a visitor'|@translate}"><img src="{$ themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li>5 <li><a href="{$U_HOME}" title="{'Go through the gallery as a visitor'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li> 6 6 </ul> 7 7 <h2>{'Password forgotten'|@translate}</h2> -
branches/2.1/themes/default/template/tags.tpl
r5709 r6669 4 4 <ul class="categoryActions"> 5 5 {if $display_mode == 'letters'} 6 <li><a href="{$U_CLOUD}" title="{'show tag cloud'|@translate}" rel="nofollow"><img src="{$ themeconf.icon_dir}/tag_cloud.png" class="button" alt="{'cloud'|@translate}"></a></li>6 <li><a href="{$U_CLOUD}" title="{'show tag cloud'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/tag_cloud.png" class="button" alt="{'cloud'|@translate}"></a></li> 7 7 {/if} 8 8 9 9 {if $display_mode == 'cloud'} 10 <li><a href="{$U_LETTERS}" title="{'group by letters'|@translate}" rel="nofollow"><img src="{$ themeconf.icon_dir}/tag_letters.png" class="button" alt="{'letters'|@translate}"></a></li>10 <li><a href="{$U_LETTERS}" title="{'group by letters'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/tag_letters.png" class="button" alt="{'letters'|@translate}"></a></li> 11 11 {/if} 12 12 13 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li>13 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li> 14 14 </ul> 15 15 <h2>{'Tags'|@translate}</h2> -
branches/2.1/themes/default/template/upload.tpl
r5164 r6669 9 9 <div class="titrePage"> 10 10 <ul class="categoryActions"> 11 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li>11 <li><a href="{$U_HOME}" title="{'Home'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/home.png" class="button" alt="{'Home'|@translate}"></a></li> 12 12 </ul> 13 13 <h2>{'Upload a picture'|@translate}</h2>
Note: See TracChangeset
for help on using the changeset viewer.