' . $OC_sortImg; $tsort = 'Topic'; $sortfld = 'paperid'; } else { $sort = 'topicid, paperid'; $psort = 'Submission'; $tsort = 'Topic
' . $OC_sortImg; $sortfld = 'topicid'; } printHeader("$scope & Topics",1); print '

Show Topic Count for ' . $scope . '

'; $q = "SELECT " . OCC_TABLE_PAPER . ".paperid, " . OCC_TABLE_TOPIC . ".topicid, " . OCC_TABLE_PAPER . ".title, " . OCC_TABLE_TOPIC . ".topicname, " . OCC_TABLE_TOPIC . ".short FROM " . OCC_TABLE_PAPER . ", " . OCC_TABLE_TOPIC . ", " . OCC_TABLE_PAPERTOPIC . " WHERE " . OCC_TABLE_PAPERTOPIC . ".paperid=" . OCC_TABLE_PAPER . ".paperid AND " . OCC_TABLE_PAPERTOPIC . ".topicid=" . OCC_TABLE_TOPIC . ".topicid $accSQL ORDER BY $sort"; $r = ocsql_query($q) or err("Unable to get information ".mysql_errno()); if (mysql_num_rows($r) == 0) { print 'No papers available

'; } else { print ' '; $currid = -1; $row = 1; if ($sortfld == 'paperid') { $pbo = ''; $pbc = ''; $tbo = ''; $tbc = ''; } else { $tbo = ''; $tbc = ''; $pbo = ''; $pbc = ''; } while ($l = mysql_fetch_array($r)) { if ($currid != $l[$sortfld]) { if ($currid != -1) { if ($row==1) { $row=2; } else { $row=1; } } $currid = $l[$sortfld]; print ''; print ''; } elseif ($sortfld == 'paperid') { print ''; } else { print ''; } /* if (empty($l['paperid'])) { print ""; } else { */ // print ''; /* } */ print "\n"; } print '
' . $tsort . '' . $psort . '
' . $tbo . $l['topicid'] . ' - ' . useTopic($l['short'],$l['topicname']) . $tbc . '' . $pbo . '' . $l['paperid'] . ' - ' . safeHTMLstr($l['title']) . '' . $pbc . '
' . $l['topicid'] . ' - ' . useTopic($l['short'],$l['topicname']) . ' 
 ' . $l['paperid'] . ' - ' . safeHTMLstr($l['title']) . '   '.$l['paperid'].' - ' . safeHTMLstr($l['title']) . '
'; } printFooter(); ?>