Changeset 48 for trunk/Modules/Meet


Ignore:
Timestamp:
Dec 22, 2019, 11:43:06 PM (5 years ago)
Author:
chronos
Message:
  • Added: Allow to login as administrator.
  • Added: Allow to hide meet items.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Meet/MeetPage.php

    r46 r48  
    5959
    6060    $DbResult = $this->Database->query('SELECT COUNT(*) FROM (SELECT *, '.
    61       '(SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName FROM `MeetItem`) AS T WHERE '.$Where);
     61      '(SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName FROM `MeetItem`) AS T WHERE (T.Hidden=0) AND '.$Where);
    6262    $DbRow = $DbResult->fetch_row();
    6363    $PageList = GetPageList($DbRow[0]);
     
    8282    $Output .= $Order['Output'];
    8383    $DbResult = $this->Database->query('SELECT * FROM (SELECT *, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
    84       '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL FROM MeetItem) AS T WHERE '.
     84      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL FROM MeetItem) AS T WHERE (T.Hidden=0) AND '.
    8585      $Where.$Order['SQL'].$PageList['SQLLimit']);
    8686    while($MeetItem = $DbResult->fetch_assoc())
     
    149149      $id = $this->System->PathItems[2] * 1;
    150150    } else return 'Položka nenalezena';
     151    if ($this->System->IsAdmin())
     152    {
     153      if (array_key_exists('hide', $_GET)) $this->Database->update('MeetItem', 'Id='.$id, array('Hidden' => 1));
     154      if (array_key_exists('unhide', $_GET)) $this->Database->update('MeetItem', 'Id='.$id, array('Hidden' => 0));
     155    }
     156
    151157    $Output .= '<div class="title">Inzerát</div>';
    152158    $Gender = array('', 'Muž', 'Žena');
     
    172178        '<tr><th>Zdroj importu</th><td><a href="'.$MeetItem['SourceURL'].'">'.$MeetItem['SourceName'].'</a></td></tr>';
    173179      $Output .= '</table>';
     180      if ($this->System->IsAdmin()) {
     181        if ($MeetItem['Hidden'] == '1')
     182          $Output .= '<div>Skrytá položka <a href="?unhide">Zviditelnit</a></div>';
     183          else $Output .= '<div>Viditelná položka <a href="?hide">Skrýt</a></div>';
     184      }
    174185    } else $Output .= 'Položka nenalezena';
    175186    return $Output;
     
    197208
    198209    $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
    199       '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '1 ORDER BY `Time` DESC LIMIT 30');
     210      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '`Hidden`=0 ORDER BY `Time` DESC LIMIT 30');
    200211    while($MeetItem = $DbResult->fetch_assoc())
    201212    {
Note: See TracChangeset for help on using the changeset viewer.