Results 1 to 8 of 8

Thread: Listing Module display member icon status

  1. #1
    New user
    Join Date
    11-21-15.
    Posts
    12

    Default Listing Module display member icon status

    it's possible display active member icon in listing module?

    I just need to say if active or not active by word or icon on the list, any idea?

    listing_module.jpg


    Thanks for advance!

  2. #2
    New user cliffen's Avatar
    Join Date
    10-18-13.
    Location
    Lüneburg
    Posts
    22

    Default

    Hi, the name of the field you need is "disable" (https://github.com/contao/core/blob/...ember.php#L355)

    Add it in the listing module definition.

    This should at least display a '1' in the frontend for each disabled member.

    Now you have to modify the template of the listing module to display a text or icon.
    Extensions :: Github :: No support via PM.

  3. #3
    New user
    Join Date
    11-21-15.
    Posts
    12

    Idee

    Hi cliffen,

    Interesting, but that value is only for disable users by the eye icon "manually", you know were is the value of disable users by date? "Automatically". It not the same value.

    Thanks for advance...

  4. #4
    New user cliffen's Avatar
    Join Date
    10-18-13.
    Location
    Lüneburg
    Posts
    22

    Default

    Look at this function, it displays the icon: https://github.com/contao/core/blob/...ember.php#L496

    It checks the attributes 'disable', 'start' and 'stop'.
    Extensions :: Github :: No support via PM.

  5. #5
    New user
    Join Date
    11-21-15.
    Posts
    12

    Idee

    Yes, that is the function, you could give me an idea of how to integrate that function in list_default.html5?

    PHP Code:

    <?php foreach ($this->tbody as $class=>$row): ?>
          <tr class="<?= $class ?>">
            <?php foreach ($row as $col): ?>
              <td class="body <?= $col['class'?>"><?= $col['content'?></td>
            <?php endforeach; ?>
            <?php if ($this->details): ?>
              <?php if ($col['details']): ?>
                <td class="body <?= $this->col_last ?> col_last">[B]image status here[/B] <a href="<?= $col['url'?>"><img src="<?= TL_FILES_URL ?>assets/contao/images/info.gif" alt=""></a></td>
              <?php else: ?>
                <td class="body <?= $this->col_last ?> col_last">&nbsp;</td>
              <?php endif; ?>
            <?php endif; ?>
          </tr>
        <?php endforeach; ?>
    Thanks for advance.

  6. #6
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    Do you have $col['start'] and $col['stop'] in your template? You have to check them against actual time - time().
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  7. #7
    New user
    Join Date
    11-21-15.
    Posts
    12

    Idee

    Hi Andreas,

    I only include firstname, lastname, phone, gender, city, stop

    tl_member.PNG

    I will add this value, no problem. Once i add those values, how I call the function in the right way?

    PHP Code:
    <? php $member = new tl_member ();
    $member-> addIcon ($param 1, $param 2, $param 3);

    ? >
    Thank you for your interest in this situation.
    Last edited by marc0s; 06/22/2016 at 15:19.

  8. #8
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    I will not work on your complete code as it is to time-consuming.

    First I think it will be better to switch from the template coding style (alternating php and html) to simple php coding style.

    Then you can do something like
    PHP Code:
    <?php

    $table 
    '<table>';

    // Head
    $table .= '<thead><tr>';
    foreach(
    $this->thead as $col)
    {
      
    $table .= '<th>'.$foo.'</th>';
    }
    $table .= '</tr></thead>';

    // Body
    $table .= '<tbody>';
    foreach(
    $this->tbody as $class => $row)
    {
      
    $table .= '<tr>';
      foreach(
    $row as $col)
      {
        
    $table .= '<td>'.$foo.'</td>';
      }
      
    $table .= '</tr>';
    }
    $table .= '</tbody>';

    $table .= '</table>';

    echo 
    $table;

    ?>
    And now its easier to bring in your IF clauses.

    If you want to show disabled and temporary disabled status you have to add disabled and start to the list module. You then don't need to work with the Member Model to get the values of each data set.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •