Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter klangrud

    (@klangrud)

    Hi bjonesilg,

    I just saw your question. I don’t know if you are still trying to figure this out but I might be able to help you.

    Change what I have from:

    <?php if ( isset($match->{sanitize_title($stat->name)}) && $stat->name == 'Referee' ) : ?>
      <?php echo $data[sanitize_title($field['name'])] ?>
       <br />
    <?php endif; ?>

    To:

    <?php if ( isset($match->{sanitize_title($stat->name)}) && $stat->name == 'report' ) : ?>
      <?php if ( isset($data[sanitize_title('URL')])) : ?>
        <a href="<?php echo $data[sanitize_title($field['name'])] ?>">URL</a>
        <br />
      <?php endif; ?>
    <?php endif; ?>

    Let me know how that works for you and if you have any questions.

    Thread Starter klangrud

    (@klangrud)

    I resolved this by creating my own template from matches.php. I pulled code from template match.php and added it into my new matches.php template. In the following code you just need to change $stat->name to the name of your stat. Here is the snippet:

    <td>
              <?php if ( isset($match->hasStats) && $match->hasStats ) :?>
                <?php foreach ( $lmStats->get($match->league_id) AS $stat ) : ?>
    
                  <?php if ( isset($match->{sanitize_title($stat->name)}) ) : ?>
                    <?php foreach ( (array)$match->{sanitize_title($stat->name)} AS $i => $data ) : ?>
                      <?php foreach ( (array)maybe_unserialize($stat->fields) AS $field ) : ?>
                        <?php if ( isset($match->{sanitize_title($stat->name)}) && $stat->name == 'Referee' ) : ?>
                          <?php echo $data[sanitize_title($field['name'])] ?>
                          <br />
                        <?php endif; ?>
                     <?php endforeach; ?>
                   <?php endforeach; ?>
                 <?php endif; ?>
    
               <?php endforeach; ?>
             <?php endif; ?>
            </td>
Viewing 2 replies - 1 through 2 (of 2 total)