Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: categories()  (Read 2033 times)

Leonardo

  • Newbie
  • *
  • Karma: 2
  • Posts: 22
    • http://leonardoprosperi.com
categories()
« on: May 22, 2007, 01:16:59 am »

I had problems with the XHTML validation for missing
    .
    I added  two lines:
    echo '
      ';
      and
      echo '
    ';

    Code: [Select]
    function categories() {
    $categorySEF = get_id('category');
    $class = $category_title == $categorySEF ? ' class="current"' : '';
             echo '
      ';
      echo '
    • '.l('home').'
    • ';
      $query = "SELECT * FROM ".db('prefix')."categories WHERE published = 'YES' ORDER BY catorder ASC";
      $result = mysql_query($query);
      while ($r = mysql_fetch_array($result)) {
      $calc_num_query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND category = $r[id] AND published = 1";
      $cm_result = mysql_query($calc_num_query);
      $num_rows = mysql_num_rows($cm_result);
      $category_title = $r['seftitle'];
      $class = $category_title == $categorySEF ? ' class="current"' : '';
      echo '
    • '.$r[multiLangPick('name')];
      echo (s('num_categories') == 'on' ? ' ('.$num_rows.')' : '').'
    • ';
      }echo '
    ';
    }
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
categories()
« Reply #1 on: May 22, 2007, 01:59:13 am »

ah, this could have been fixed in index.php, by wrapping function call in these tags... as per default snews index.php
Logged
Of all the things I have lost, it is my mind that I miss the most.

piXelatedEmpire

  • MIA
  • ULTIMATE member
  • ******
  • Karma: 37
  • Posts: 1401
  • currently MIA
categories()
« Reply #2 on: May 22, 2007, 02:00:01 am »

I'd suggest this isn't a bug then ;)

Move to problem solving ;)
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
categories()
« Reply #3 on: May 22, 2007, 07:27:46 am »

Moved as requested
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version