Changeset 20


Ignore:
Timestamp:
Dec 26, 2018, 11:55:16 AM (5 years ago)
Author:
chronos
Message:
  • Added: Meet list filtering by name, location and message text.
  • Fixed: Amblar meet source date parsing.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Import/Amblar.php

    r17 r20  
    5353        else $MeetItem->Gender = Gender::Male;
    5454      $MeetItem->Name = trim(GetTextBetween($Item, '<span class="dwqa-author">', '</span>'));
     55      $Type = trim(GetTextBetween($Item, ' ', ' '));
     56      if ($Type == 'odpovězeno') continue;
    5557      $MeetItem->Date = trim(GetTextBetween($Item, '<span class="dwqa-date">', '</span>'));
    56       if ($MeetItem->Date == 'před 1 dní') $MeetItem->Date = strtotime("-1 days");
    57         else if ($MeetItem->Date == 'před 2 dny') $MeetItem->Date = strtotime("-2 days");
    58         else $MeetItem->Date = HumanDateToTime($MeetItem->Date);
     58      if (mb_substr($MeetItem->Date, 0, 4) == 'před')
     59      {           
     60        $Parts = explode(' ', $MeetItem->Date);
     61        if ($Parts[2] == 'hours') $MeetItem->Date = strtotime("-".$Parts[1]." hours");
     62        else if ($Parts[2] == 'dní') $MeetItem->Date = strtotime("-".$Parts[1]." days");
     63        else if ($Parts[2] == 'dny') $MeetItem->Date = strtotime("-".$Parts[1]." days");
     64      } else $MeetItem->Date = HumanDateToTime($MeetItem->Date);
    5965      $MeetItem->Email = '';
    6066      $MeetItem->Message = '';
  • trunk/Import/Csts.php

    r19 r20  
    4141      if ($MeetItem->Phone == 'neuveden') $MeetItem->Phone = '';
    4242      $MeetItem->Link = '';
    43       print_r($MeetItem);
    4443      $MeetItem->Database = $this->Database;
    4544      $MeetItem->Source = $this->Id;
  • trunk/index.php

    r19 r20  
    127127    {
    128128      $this->NoFullPage = true;
     129      if (array_key_exists('name', $_GET) ) $_SESSION['name'] = $_GET['name'];
     130      if (array_key_exists('location', $_GET) ) $_SESSION['location'] = $_GET['location'];
     131      if (array_key_exists('message', $_GET) ) $_SESSION['message'] = $_GET['message'];
    129132      if (array_key_exists('vekod', $_GET) ) $_SESSION['vekod'] = $_GET['vekod'];
    130133      if (array_key_exists('vekdo', $_GET) ) $_SESSION['vekdo'] = $_GET['vekdo'];
     
    184187    $Output .= '<h4 style="text-align: center;">Inzeráty:</h4>';
    185188    $Output .= '<div class="btn-group ma3">'.
     189      '<div class="label-box">Pohlaví</div>'.
    186190      '<button class="btn btn-filter cpohlavi btn-ico" onclick="upf(\'pohlavi\',0)" id="pohlavi0" data-toggle="tooltip" '.
    187       'data-placement="top" title="Obě pohlaví"><span class="icon-both"></span></button>'.
     191      'data-placement="top" title="Obě"><span class="icon-both"></span></button>'.
    188192      '<button class="btn btn-filter cpohlavi btn-ico" onclick="upf(\'pohlavi\',1)" id="pohlavi1" data-toggle="tooltip" '.
    189       'data-placement="top" title="Jen muži"><span class="icon-man"></span></button>'.
     193      'data-placement="top" title="Muži"><span class="icon-man"></span></button>'.
    190194      '<button class="btn btn-filter cpohlavi btn-ico" onclick="upf(\'pohlavi\',2)" id="pohlavi2" data-toggle="tooltip" '.
    191       'data-placement="top" title="Jen ženy"><span class="icon-woman"></span></button>'.
    192       '</div>';
     195      'data-placement="top" title="Ženy"><span class="icon-woman"></span></button>'.
     196      '</div> ';
     197    $Output .= '<div class="filter-num-box">'.
     198      '<div class="label-box">Jméno</div>'.
     199      '<input value="'.$_SESSION['name'].'" onkeyup="if(event.keyCode!=9) upf(\'name\',$(this).val(),(event.keyCode==13?0:1)); '.
     200      '" id="name" autocomplete="off" type="text">'.
     201      '</div> ';
    193202    $Output .= '<div class="filter-num-box">'.
    194203      '<div class="label-box">Věk</div>'.
     
    198207      '<input value="'.$_SESSION['vekdo'].'" onkeyup="'.
    199208      'if(event.keyCode!=9) upf(\'vekdo\',$(this).val(),(event.keyCode==13?0:1));" '.
    200       'id="vekdo" autocomplete="off" type="text"><div class="label-box">let</div></div>'.
     209      'id="vekdo" autocomplete="off" type="text">'.
     210      '<div class="label-box">let</div>'.
    201211      '</div> ';
    202212    $Output .= '<div class="filter-num-box">'.
     
    207217      '<input value="'.$_SESSION['vyskado'].'" onkeyup="'.
    208218      'if(event.keyCode!=9) upf(\'vyskado\',$(this).val(),(event.keyCode==13?0:1));" '.
    209       'id="vyskado" autocomplete="off" type="text"><div class="label-box">cm</div></div>'.
     219      'id="vyskado" autocomplete="off" type="text">'.
     220      '<div class="label-box">cm</div>'.
    210221      '</div> ';
    211222    $Output .= '<div class="filter-num-box">'.
     
    216227      '<input value="'.$_SESSION['vahado'].'" onkeyup="'.
    217228      'if(event.keyCode!=9) upf(\'vahado\',$(this).val(),(event.keyCode==13?0:1));" '.
    218       'id="vahado" autocomplete="off" type="text"><div class="label-box">cm</div></div>'.
    219       '</div>';
     229      'id="vahado" autocomplete="off" type="text">'.
     230      '<div class="label-box">Kg</div>'.
     231      '</div> ';
     232    $Output .= '<div class="filter-num-box">'.
     233      '<div class="label-box">Umístění</div>'.
     234      '<input value="'.$_SESSION['location'].'" onkeyup="if(event.keyCode!=9) upf(\'location\',$(this).val(),(event.keyCode==13?0:1)); '.
     235      '" id="location" autocomplete="off" type="text">'.
     236      '</div> ';   
     237    $Output .= '<div class="filter-num-box">'.
     238      '<div class="label-box">Zpráva</div>'.
     239      '<input value="'.$_SESSION['message'].'" onkeyup="if(event.keyCode!=9) upf(\'message\',$(this).val(),(event.keyCode==13?0:1)); '.
     240      '" id="message" autocomplete="off" type="text">'.
     241      '</div> ';   
    220242    }
    221243
    222244    $Where = '';
     245    if (array_key_exists('name', $_SESSION) and ($_SESSION['name'] != '')) $Where .= ' AND (Name LIKE "%'.$_SESSION['name'].'%")';
     246    if (array_key_exists('location', $_SESSION) and ($_SESSION['location'] != '')) $Where .= ' AND (Location LIKE "%'.$_SESSION['location'].'%")';
     247    if (array_key_exists('message', $_SESSION) and ($_SESSION['message'] != '')) $Where .= ' AND (Message LIKE "%'.$_SESSION['message'].'%")';
    223248    if (array_key_exists('vekod', $_SESSION) and ($_SESSION['vekod'] != '')) $Where .= ' AND (Age >= '.$_SESSION['vekod'].')';
    224249    if (array_key_exists('vekdo', $_SESSION) and ($_SESSION['vekdo'] != '')) $Where .= ' AND (Age <= '.$_SESSION['vekdo'].')';
  • trunk/style.css

    r7 r20  
    3939.btn-group .btn-filter{border-left:1px solid #e6e6e6}
    4040.btn-group .btn-filter:first-child{border-left:none}
     41.btn-group div.label-box{display:inline-block;line-height:28px;font-size:13px;margin:0 4px;vertical-align:middle}
     42.btn-group{display:inline-block;background-color:#e0e0e0;padding:4px 4px;vertical-align:middle}
    4143
    4244.filter-num-box{display:inline-block;background-color:#e0e0e0;padding:4px 4px;vertical-align:middle}
     
    4648.filter-num-box input{width:40px;margin:0;border:0;text-align:center;padding:0 4px;line-height:25px;font-size:13px;vertical-align:middle}
    4749
    48 .filter-num-box div.dropdown{display:inline-block;margin:0 4px;paddig:0}
     50.filter-num-box div.dropdown{display:inline-block;margin:0 4px;padding:0}
    4951.filter-num-box div.dropdown.invi{display:none}
    5052.filter-num-box div.dropdown .btn{background:#fff;margin:0;border:0;padding:0 8px;line-height:28px;font-size:13px;border-radius: 0}
    5153.filter-num-box div.dropdown-menu a.dropdown-item{line-height:20px;font-size:13px}
     54
     55.ma3{margin:3px}
    5256
    5357.icon-both:before {
Note: See TracChangeset for help on using the changeset viewer.