Changeset 1071


Ignore:
Timestamp:
12/13/09 12:14:06 (2 years ago)
Author:
bogdan2412
Message:

Merge changes from live.

  • Added a better date format for the roundparam macro.
  • Fixed check-attachments script.
  • Reverted some bad changes from update-ratings script.
  • Fixed recursive-move script.
  • Fixed attachment methods failing because of missing mem cache functions.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/db/attachment.php

    r997 r1071  
    33require_once(IA_ROOT_DIR."common/db/db.php"); 
    44require_once(IA_ROOT_DIR."common/attachment.php"); 
     5require_once(IA_ROOT_DIR."common/cache.php"); 
    56 
    67// Add $attachment to cache if not null and return $attachment. 
  • trunk/scripts/check-attachments

    r884 r1071  
    5757        if (read_bool("Want to delete them?", false)) { 
    5858            foreach ($extra_atts as $att) { 
    59                 attachment_delete($att['id']); 
     59                attachment_delete_by_id($att['id']); 
    6060            } 
    6161        } 
  • trunk/scripts/recursive-move

    r852 r1071  
    66 
    77log_print("Recursive page move, for huge changes."); 
     8db_connect(); 
    89 
    910$src = read_line("Source root?", 'task'); 
     
    2324foreach ($page_list as $page) { 
    2425    $old_name = $page['name']; 
    25     $new_name = preg_replace("/^".preg_quote($src, '/').'/si', preg_quote($dst, '/'), $old_name); 
     26    $new_name = preg_replace("/^".preg_quote($src, '/').'/si', $dst, $old_name); 
    2627    textblock_move($old_name, $new_name); 
    2728} 
  • trunk/scripts/update-ratings

    r1017 r1071  
    7474log_print(count($round_users) . " users registered for this round."); 
    7575foreach ($round_users as $row) { 
    76     if (!isset($row['username'])) { 
    77         continue; 
    78     } 
    79  
    8076    log_assert(isset($row['username'])); 
    8177    $scores[$row['username']] = 0; 
     
    8783log_print(count($round_rows) . " users were scored in this round."); 
    8884foreach ($round_rows as $row) { 
    89     if (!isset($row['user_name'])) { 
    90         continue; 
    91     } 
    92  
    9385    log_assert(isset($row['user_name']) && isset($row['score'])); 
    9486    if (isset($scores[$row['user_name']])) { 
     
    10395log_print("Updating database..."); 
    10496foreach ($round_users as $row) { 
    105     if (!isset($row['username'])) { 
    106         continue; 
    107     } 
    108  
    10997    $username = $row['username']; 
    11098    $user_id = $row['user_id']; 
  • trunk/www/config.php

    r1020 r1071  
    4141// Date formatting for the user is done in www/format/format.php 
    4242define('IA_DATE_DEFAULT_TIMEZONE', 'Europe/Bucharest'); 
    43 define('IA_DATE_DEFAULT_FORMAT', '%A %e %B %Y %H:%M:%S'); 
     43define('IA_DATE_DEFAULT_FORMAT', '%e %B %Y %H:%M:%S'); 
    4444 
    4545// mail sender 
  • trunk/www/macros/macro_roundparam.php

    r1045 r1071  
    22 
    33require_once(IA_ROOT_DIR . "common/db/round.php"); 
     4require_once(IA_ROOT_DIR . "www/format/format.php"); 
    45 
    56// Displays a round field, be it a hard-coded field such as round title or a grader parameter such as `type`. 
     
    6061                $html .= "data necunoscuta"; 
    6162            } else { 
    62                 $html .= format_date($round['start_time']); 
     63                $html .= format_date($round['start_time'], 
     64                    '%A %e %B %Y, la ora %H:%M:%S'); 
    6365            } 
    6466            break; 
  • trunk/www/views/header.php

    r1055 r1071  
    4040    <meta name="verify-v1" content="PQDTb5Advw297iADXVUYuxh0z+iQKfq1wtYWnfHCb1Y=" /> 
    4141    <meta name="verify-v1" content="GUKPcDm0TzwAR7r5xbagq576p/YWH9su/Ca4o8YlYBg=" /> <!--bogdan2412--> 
     42    <meta name="google-site-verification" content="T_HFYNIO3S70696yFC5rkbPn339gjnfVwMqYPmU866I" /> <!--devilkind--> 
    4243<?php 
    4344    } 
Note: See TracChangeset for help on using the changeset viewer.