View ' . $scope . ' by Topic

'; $q = "SELECT topicname, short, COUNT(*) AS num FROM " . OCC_TABLE_TOPIC . ", " . OCC_TABLE_PAPERTOPIC . ", " . OCC_TABLE_PAPER . " WHERE " . OCC_TABLE_TOPIC . ".topicid=" . OCC_TABLE_PAPERTOPIC . ".topicid AND " . OCC_TABLE_PAPERTOPIC . ".paperid=" . OCC_TABLE_PAPER . ".paperid $accSQL GROUP BY " . OCC_TABLE_TOPIC . ".topicid ORDER BY "; if (!isset($_GET['s']) || ($_GET['s']=="topicname")) { $q .= "topicname"; $tsort = 'Topic
' . $OC_sortImg; $nsort = 'Count'; } else { $q .= "num"; $nsort = 'Count
' . $OC_sortImg; $tsort = 'Topic'; } $r = ocsql_query($q) or err("Unable to get information ".mysql_errno()); if (mysql_num_rows($r) == 0) { print 'No papers available

'; } else { print ''; $row = 1; while ($l = mysql_fetch_array($r)) { print '\n"; if ($row==1) { $row=2; } else { $row=1; } } print "
' . $tsort . '' . $nsort .'
' . useTopic($l['short'],$l['topicname']) . '' . $l['num'] . "
"; } printFooter(); ?>