I created a view showing the latest closed quizzes, and the view file tpl.php for theming, now I need to test if a quiz is closed or not. How can I do this?
I did this in the Row style output template "views-view-fields.tpl.php":

<?php
if ($fields['quiz_close']->content!='0 sec'):
?>  


<?php foreach ($fields as $id => $field): ?>
  <?php if (!empty($field->separator)): ?>
    <?php print $field->separator; ?>
  <?php endif; ?>

  <<?php print $field->inline_html;?> class="views-field-<?php print $field->class; ?>">
    <?php if ($field->label): ?>
      <label class="views-label-<?php print $field->class; ?>">
        <?php print $field->label; ?>:
      </label>
    <?php endif; ?>
      <?php
      // $field->element_type is either SPAN or DIV depending upon whether or not
      // the field is a 'block' element type or 'inline' element type.
      ?>
      <<?php print $field->element_type; ?> class="field-content"><?php print $field->content; ?></<?php print $field->element_type; ?>>
  </<?php print $field->inline_html;?>>
<?php endforeach; ?>
  <?php endif; ?>

And the result is as follows:

Quiz 2

Quiz 1

  1. john
  2. peter
  3. martin

But only the "Quiz 1" should appear because it is already closed!
I tried to put in the "Style output" view template file and "Display output" view template file but the code "if ($fields['quiz_close']->content!='0 sec'):" did not work. What am I doing wrong?

obs: The "close time" field is configurated to "Time ago" date format.
Sorry for my bad English.

Comments

gutomec’s picture

Issue tags: +views, +Drupal 6, +quiz

Please, help me!

gutomec’s picture

Assigned: gutomec » Unassigned

someone willing to help me please?

-remove-me’s picture

Version: 6.x-3.3 » 6.x-4.0

The problem still persists in version 6.x-4.0.
I can't find a way to filter only the open quizes in my view.

westie’s picture

subscribe

djdevin’s picture

Status: Active » Closed (outdated)

This issue is being closed because it is filed against a version that is no longer supported.

djdevin’s picture

This issue is being closed because it is filed against a version that is no longer supported.