Changeset 514 for trunk


Ignore:
Timestamp:
Feb 16, 2013, 8:31:12 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Částečna snaha o správu odkazů tabulky propagace. Bude potřeba zajistit nejdříve obecný formulářový systém.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/banners.php

    r504 r514  
    22
    33include('includes/global.php');
     4
     5function ParentWebs($Selected)
     6{
     7  global $System;
     8
     9  $Output = '<select name="Parent">';
     10  $Output .= '<option value=""';
     11  if($Selected == '')
     12    $Output .= ' selected="selected"';
     13  $Output .= '></option>';
     14  $DbResult = $System->Database->select('Referrer', '`Id`, `Web`', 'Parent IS NULL');
     15  while($Language = $DbResult->fetch_assoc())
     16  {
     17    $Output .= '<option value="'.$Language['Id'].'"';
     18    if($Selected == $Language['Id'])
     19      $Output .= ' selected="selected"';
     20    $Output .= '>'.$Language['Web'].'</option>';
     21  }
     22  $Output .= '</select>';
     23  return($Output);
     24}
    425
    526$MonthAge = 3;
     
    2243
    2344
     45if(!$User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Show`=1) AND (`Parent` IS NULL)';
     46  else $Where = '';
    2447$Query = 'SELECT * FROM (SELECT *, (`Hits` + COALESCE((SELECT SUM(`Hits`) FROM '.
    2548'`Referrer` AS `T1` WHERE `T1`.`Parent` = `T2`.`Id`), 0)) AS `TotalHits`, '.
    2649'GREATEST(`DateLast`, COALESCE((SELECT MAX(`DateLast`) FROM '.
    2750'`Referrer` AS `T1` WHERE `T1`.`Parent` = `T2`.`Id`), 0)) AS `MaxDateLast` FROM '.
    28 '`Referrer` AS `T2` WHERE (`Show`=1) AND (`Parent` IS NULL)) AS `T3` '.
     51'`Referrer` AS `T2`'.$Where.') AS `T3` '.
    2952'WHERE (`T3`.`MaxDateLast` > (NOW() - INTERVAL '.$MonthAge.' MONTH))';
    30   
     53 
    3154
    3255$DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS T');
     
    4265  array('Name' => 'TotalHits', 'Title' => 'Příchodů'),
    4366);
     67if($User->Licence(LICENCE_ADMIN))
     68{
     69        $TableColumns[] = array('Name' => 'Show', 'Title' => 'Viditelné');
     70  $TableColumns[] = array('Name' => 'Parent', 'Title' => 'Rodič');
     71  $TableColumns[] = array('Name' => 'Description', 'Title' => 'Komentář');
     72  $TableColumns[] = array('Name' => 'Action', 'Title' => 'Akce');
     73}
    4474$Order = GetOrderTableHeader($TableColumns, 'MaxDateLast', 1);
    4575$Output .= $Order['Output'];
     
    5282  $Output .= '<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'.
    5383    '<td>'.HumanDate($Line['MaxDateLast']).'</td>'.
    54     '<td>'.$Line['TotalHits'].'</td></tr>';
     84    '<td>'.$Line['TotalHits'].'</td>';
     85    if($User->Licence(LICENCE_ADMIN))
     86    {
     87      $Output .= 
     88    '<td>'.$Line['Show'].'</td>'.
     89    '<td>'.$Line['Parent'].'</td>'.
     90    '<td>'.$Line['Description'].'</td>'.
     91    '<td><a href="?action=edit&amp;id='.$Line['Id'].'">Upravit</a></td>';
     92    }
     93    $Output .= '</tr>';
    5594}
    5695$Output .= '</table>';
  • trunk/import/cmd.php

    r504 r514  
    6464        if(($Group['MangosTable'] != '') and ($Group['TablePrefix'] != '') and ($Group['MangosDatabase'] == 'mangos'))
    6565        {
    66       $Output .= '  '.$TranslationTree[$Group['Id']]['Name'].' ')
    67             ImportSQLMangos($Config['Web']['GameVersion'], $Group['Id'];
     66      $Output .= '  '.$TranslationTree[$Group['Id']]['Name'].' '
     67      ImportSQLMangos($Config['Web']['GameVersion'], $Group['Id']);
    6868      $Output .= '
    6969      ';
     
    7676        if(($Group['DBCFileName'] != '') and ($Group['TablePrefix'] != ''))
    7777        {
    78       $Output .= '  '.$TranslationTree[$Group['Id']]['Name'].' ')
    79             ImportDBC($Config['Web']['GameVersion'], $Group['Id'];
     78      $Output .= '  '.$TranslationTree[$Group['Id']]['Name'].' '
     79            ImportDBC($Config['Web']['GameVersion'], $Group['Id']);
    8080      $Output .= '
    8181      ';
  • trunk/includes/user.php

    r499 r514  
    4040      WriteLog('Login: '.$Name, LOG_TYPE_USER);
    4141      $this->UpdateState();
    42     } else $ŧhis->Role = LICENCE_ANONYMOUS;
     42    } else $this->Role = LICENCE_ANONYMOUS;
    4343  }
    4444 
  • trunk/save.php

    r504 r514  
    188188      '<input type="hidden" name="user" value="'.$_POST['user'].'" />'.
    189189      '<input type="hidden" name="ID" value="'.$_POST['ID'].'" />'.
    190       '<input type="hidden" name="Language" value="'.$_POST['Language'].'" />');
     190      '<input type="hidden" name="Language" value="'.$_POST['Language'].'" />';
    191191
    192192    foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
Note: See TracChangeset for help on using the changeset viewer.