// // ------------------------------------------------------------------------- // // Original Author: The Xoops Project // Author Website : http://www.xoops.org // License Type : GPL: See /manual/LICENSES/GPL.txt // ------------------------------------------------------------------------- // include_once("./header.php"); include_once(XOOPS_ROOT_PATH . "/class/xoopscomments.php"); //include_once("./class/class.newsstory.php"); include_once("./cache/config.php"); $item_id = (!empty($item_id)) ? intval($item_id) : 0; $lid = $item_id; //$lid = (!empty($lid)) ? intval($lid) : 0; if ( empty($item_id) ) { redirect_header("index.php", 2, _NW_NOSTORY); exit(); } // set comment mode if not set $mode = $_GET['mode']; if ( ($mode != "0") && ($mode != "thread") && ($mode != "flat") ) { if ($xoopsUser) { $mode = $xoopsUser->getVar("umode"); } else { $mode = $bcoosConfig['com_mode']; } } // set comment order if not set $order = $_GET['order']; if ( ($order != "0") && ($order != "1") ) { if ( $xoopsUser ) { $order = $xoopsUser->getVar("uorder"); } else { $order = $bcoosConfig['com_order']; } } $mytree = new XoopsTree($db->prefix("mydownloads_cat"), "cid", "pid"); $result = $db->query("SELECT cid, title, imgurl FROM ".$db->prefix("mydownloads_cat")." WHERE pid=0 ORDER BY title") or die("Error"); if ( !empty($comment_id) ) { $artcomment = new XoopsComments($db->prefix("mydownloads_comments"), $comment_id); } else { $artcomment = new XoopsComments($db->prefix("mydownloads_comments")); } $item_id = $lid; $artcomment->setVar("item_id", $item_id); $sql = "SELECT lid, cid, title, description, url, homepage, version, size, platform, logourl, submitter, status, date, hits, rating, votes, comments FROM ".$db->prefix("mydownloads_downloads")." WHERE lid=".$lid.""; $result = $db->query($sql); list($lid, $cid, $ltitle, $description, $url, $homepage, $version, $size, $platform, $logourl, $submitter, $status, $date, $hits, $rating, $votes, $comments) = $db->fetchRow($result); $bcoosConfig['title'] .= " - ".$ltitle; include_once(XOOPS_ROOT_PATH."/header.php"); $rating = number_format($rating, 2); $dtitle = $myts->makeTboxData4Show($ltitle); $url = $myts->makeTboxData4Show($url); $email = $myts->makeTboxData4Show($email); $logourl = $myts->makeTboxData4Show($logourl); $datetime = formatTimestamp($date, "s"); $description = $myts->makeTareaData4Show($description, 1, 1, 1); include("include/dlformat.php"); $orderby = ($order == 1) ? "date DESC" : "date ASC"; if ( $mode == "flat" ) { $criteria = array("item_id=".$item_id.""); $commentsArray = $artcomment->getAllComments($criteria, true, $orderby); } elseif ( $mode=="thread" ) { $criteria = array("item_id=".$item_id."", "pid=".$artcomment->getVar("pid").""); $commentsArray = $artcomment->getAllComments($criteria, true, $orderby); } else { $commentsArray = ""; } include_once(XOOPS_ROOT_PATH."/header.php"); OpenTable(); // print navbar $artcomment->printNavBar($item_id, $mode, $order); // Now, show comments if ( is_array($commentsArray) && count($commentsArray) ) { if ( $xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid()) ) { $adminview = 1; } else { $adminview = 0; } if ( $mode=="flat" ) { $count = 0; foreach($commentsArray as $ele) { if ( !($count % 2) ) { $color_num = 1; } else { $color_num = 2; } $ele->showThreadPost($order, $mode, $adminview, $color_num); $count++; } } if ( $mode=="thread" ) { foreach($commentsArray as $ele) { $ele->showThreadPost($order, $mode, $adminview); //show thread tree //if not in the top page, show links to parent and top comment if ( $ele->getVar("pid") != 0 ) { echo "