Ticket #208: category.patch

File category.patch, 2.6 KB (added by mrjpiggott@…, 19 years ago)

changes to existing files

  • themes/Default/video.php

     
    4040    if( $Filter_Category == -1)
    4141        echo "selected";
    4242    echo ">All</option>\n";
    43     for($i=0;$i<=$Total_Categories;$i++) {
    44         echo "<option value=$i ";
    45         if( $i == $Filter_Category )
    46             echo "selected";
    47         echo ">";
    48         echo "$Category_String[$i]</option>\n";
     43    $i=0;      // Represents the category's intid
     44    $count=0;  // Number of categories printed so far
     45    while ($count <= $Total_Categories) {
     46        // Check if a category exists with this intid.
     47        if (isset($Category_String[$i]))  {
     48          echo "<option value=$i ";
     49          if ($i == $Filter_Category)
     50              echo "selected";
     51          echo ">";
     52          echo "$Category_String[$i]</option>\n";
     53          $count++;
     54        }
     55        $i++;
    4956    }
    5057?>
    5158    </select>
     
    116123       
    117124        echo 'MythVideo:';
    118125        echo "&nbsp; &nbsp;";
    119         echo "<a href=\"video.php?reverse=$new_reverse";
     126        echo "<a href=\"?reverse=$new_reverse";
    120127        if($new_sortby)
    121128            echo "&sortby=$new_sortby";
    122129        if($new_cat)
     
    124131        echo "\">";
    125132        echo t('Reverse Order');
    126133        echo "</a>";
     134        echo "&nbsp; | &nbsp;";
     135        echo "<a href=\"video.php\">Videos</a>";
     136        echo "&nbsp; | &nbsp;";
     137        echo "<a href=\"video_category.php\">Categories</a>";
    127138    }
    128139}
    129140
  • includes/sorting.php

     
    185185        return ($a->transcoder > $b->transcoder) ? 1 : -1;
    186186    }
    187187
     188    function by_intid(&$a, &$b) {
     189        if ($a->intid == $b->profile) return 0;
     190        return ($a->intid > $b->intid) ? 1 : -1;
     191    }
    188192?>
  • video_edit.php

     
    9696       $result = mysql_query('SELECT * FROM videocategory')
    9797            or trigger_error('SQL Error: '.mysql_error(), FATAL);
    9898           while( $cat_data = mysql_fetch_assoc($result) )  {
    99            $num_cat++;
     99           $num_cat = $cat_data["intid"];
    100100           $cat_str = $cat_data["category"]; ?>
    101101       <option <?if ($category == $num_cat) print "selected"; ?> value="<?print $num_cat; ?>"><?print $cat_str; ?></option>
    102102       <?}