onokazu
onoka****@users*****
2005年 5月 30日 (月) 21:00:11 JST
Index: xoops2jp/html/modules/mydownloads/index.php diff -u xoops2jp/html/modules/mydownloads/index.php:1.2 xoops2jp/html/modules/mydownloads/index.php:1.2.6.1 --- xoops2jp/html/modules/mydownloads/index.php:1.2 Fri Mar 18 21:52:14 2005 +++ xoops2jp/html/modules/mydownloads/index.php Mon May 30 21:00:10 2005 @@ -1,5 +1,5 @@ <?php -// $Id: index.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $ +// $Id: index.php,v 1.2.6.1 2005/05/30 12:00:10 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -38,48 +38,48 @@ $count = 1; while($myrow = $xoopsDB->fetchArray($result)) { - $title = $myts->makeTboxData4Show($myrow['title']); - if ($myrow['imgurl'] && $myrow['imgurl'] != "http://"){ - $imgurl = $myts->makeTboxData4Edit($myrow['imgurl']); - } else { - $imgurl = ''; - } - $totaldownload = getTotalItems($myrow['cid'], 1); - - // get child category objects - $arr=array(); - $arr=$mytree->getFirstChild($myrow['cid'], "title"); - $space = 0; - $chcount = 0; - $subcategories = ""; - foreach($arr as $ele){ - $chtitle=$myts->makeTboxData4Show($ele['title']); - if ($chcount>5){ - $subcategories .= "..."; - break; - } - if ($space>0) { - $subcategories .= ", "; - } - $subcategories .= "<a href=\"".XOOPS_URL."/modules/mydownloads/viewcat.php?cid=".$ele['cid']."\">".$chtitle."</a>"; - $space++; - $chcount++; - } - $xoopsTpl->append('categories', array('image' => $imgurl, 'id' => $myrow['cid'], 'title' => $myts->makeTboxData4Show($myrow['title']), 'subcategories' => $subcategories, 'totaldownloads' => $totaldownload, 'count' => $count)); - $count++; + $title = $myts->makeTboxData4Show($myrow['title']); + if ($myrow['imgurl'] && $myrow['imgurl'] != "http://"){ + $imgurl = $myts->makeTboxData4Edit($myrow['imgurl']); + } else { + $imgurl = ''; + } + $totaldownload = getTotalItems($myrow['cid'], 1); + + // get child category objects + $arr=array(); + $arr=$mytree->getFirstChild($myrow['cid'], "title"); + $space = 0; + $chcount = 0; + $subcategories = ""; + foreach($arr as $ele){ + $chtitle=$myts->makeTboxData4Show($ele['title']); + if ($chcount>5){ + $subcategories .= "..."; + break; + } + if ($space>0) { + $subcategories .= ", "; + } + $subcategories .= "<a href=\"".XOOPS_URL."/modules/mydownloads/viewcat.php?cid=".$ele['cid']."\">".$chtitle."</a>"; + $space++; + $chcount++; + } + $xoopsTpl->append('categories', array('image' => $imgurl, 'id' => $myrow['cid'], 'title' => $myts->makeTboxData4Show($myrow['title']), 'subcategories' => $subcategories, 'totaldownloads' => $totaldownload, 'count' => $count)); + $count++; } list($numrows)=$xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE status>0")); $xoopsTpl->assign('lang_thereare', sprintf(_MD_THEREARE,$numrows)); if ($xoopsModuleConfig['useshots'] == 1) { - $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']); - $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10); - $xoopsTpl->assign('show_screenshot', true); - $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS); + $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']); + $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10); + $xoopsTpl->assign('show_screenshot', true); + $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS); } if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) { - $isadmin = true; + $isadmin = true; } else { - $isadmin = false; + $isadmin = false; } $xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC); $xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC); @@ -101,32 +101,32 @@ $xoopsTpl->assign('lang_comments' , _COMMENTS); $result = $xoopsDB->query("SELECT d.lid, d.cid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d, ".$xoopsDB->prefix("mydownloads_text")." t WHERE d.status>0 AND d.lid=t.lid ORDER BY date DESC", $xoopsModuleConfig['newdownloads'], 0); while(list($lid, $cid, $dtitle, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description)=$xoopsDB->fetchRow($result)) { - $path = $mytree->getPathFromId($cid, "title"); - $path = substr($path, 1); - $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt=''> ",$path); - $rating = number_format($rating, 2); - $dtitle = $myts->makeTboxData4Show($dtitle); - $url = $myts->makeTboxData4Show($url); - $homepage = $myts->makeTboxData4Show($homepage); - $version = $myts->makeTboxData4Show($version); - $size = PrettySize($myts->makeTboxData4Show($size)); - $platform = $myts->makeTboxData4Show($platform); - $logourl = $myts->makeTboxData4Show($logourl); - $datetime = formatTimestamp($time,"s"); - $description = $myts->makeTareaData4Show($description,0); //no html - $new = newdownloadgraphic($time, $status); - $pop = popgraphic($hits); - if ($isadmin) { - $adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>'; - } else { - $adminlink = ''; - } - if ($votes == 1) { - $votestring = _MD_ONEVOTE; - } else { - $votestring = sprintf(_MD_NUMVOTES,$votes); - } - $xoopsTpl->append('file', array('id' => $lid,'cid'=>$cid,'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'comments' => $comments, 'platform' => $platform,'size' => $size,'homepage' => $homepage,'version' => $version,'category' => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&lid='.$lid))); + $path = $mytree->getPathFromId($cid, "title"); + $path = substr($path, 1); + $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt='' /> ",$path); + $rating = number_format($rating, 2); + $dtitle = $myts->makeTboxData4Show($dtitle); + $url = $myts->makeTboxData4Show($url); + $homepage = $myts->makeTboxData4Show($homepage); + $version = $myts->makeTboxData4Show($version); + $size = PrettySize($myts->makeTboxData4Show($size)); + $platform = $myts->makeTboxData4Show($platform); + $logourl = $myts->makeTboxData4Show($logourl); + $datetime = formatTimestamp($time,"s"); + $description = $myts->makeTareaData4Show($description,0); //no html + $new = newdownloadgraphic($time, $status); + $pop = popgraphic($hits); + if ($isadmin) { + $adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>'; + } else { + $adminlink = ''; + } + if ($votes == 1) { + $votestring = _MD_ONEVOTE; + } else { + $votestring = sprintf(_MD_NUMVOTES,$votes); + } + $xoopsTpl->append('file', array('id' => $lid,'cid'=>$cid,'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'comments' => $comments, 'platform' => $platform,'size' => $size,'homepage' => $homepage,'version' => $version,'category' => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&lid='.$lid))); } include XOOPS_ROOT_PATH."/modules/mydownloads/footer.php"; Index: xoops2jp/html/modules/mydownloads/singlefile.php diff -u xoops2jp/html/modules/mydownloads/singlefile.php:1.2 xoops2jp/html/modules/mydownloads/singlefile.php:1.2.6.1 --- xoops2jp/html/modules/mydownloads/singlefile.php:1.2 Fri Mar 18 21:52:14 2005 +++ xoops2jp/html/modules/mydownloads/singlefile.php Mon May 30 21:00:10 2005 @@ -1,5 +1,5 @@ <?php -// $Id: singlefile.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $ +// $Id: singlefile.php,v 1.2.6.1 2005/05/30 12:00:10 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -44,7 +44,7 @@ $xoopsTpl->assign('category_path', $pathstring); $path = $mytree->getPathFromId($cid, "title"); $path = substr($path, 1); -$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt=''> ",$path); +$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt='' /> ",$path); $rating = number_format($rating, 2); $dtitle = $myts->makeTboxData4Show($title); $url = $myts->makeTboxData4Show($url); @@ -58,20 +58,20 @@ $new = newdownloadgraphic($time, $status); $pop = popgraphic($hits); if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) { - $adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>'; + $adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>'; } else { - $adminlink = ''; + $adminlink = ''; } if ($votes == 1) { - $votestring = _MD_ONEVOTE; + $votestring = _MD_ONEVOTE; } else { - $votestring = sprintf(_MD_NUMVOTES,$votes); + $votestring = sprintf(_MD_NUMVOTES,$votes); } if ($xoopsModuleConfig['useshots'] == 1) { - $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']); - $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10); - $xoopsTpl->assign('show_screenshot', true); - $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS); + $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']); + $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10); + $xoopsTpl->assign('show_screenshot', true); + $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS); } $xoopsTpl->assign('file', array('id' => $lid, 'cid' => $cid,'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'platform' => $platform, 'comments' => $comments, 'size' => $size,'homepage' => $homepage,'version' => $version,'category' => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&lid='.$lid))); $xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC); Index: xoops2jp/html/modules/mydownloads/viewcat.php diff -u xoops2jp/html/modules/mydownloads/viewcat.php:1.2 xoops2jp/html/modules/mydownloads/viewcat.php:1.2.6.1 --- xoops2jp/html/modules/mydownloads/viewcat.php:1.2 Fri Mar 18 21:52:14 2005 +++ xoops2jp/html/modules/mydownloads/viewcat.php Mon May 30 21:00:10 2005 @@ -1,5 +1,5 @@ <?php -// $Id: viewcat.php,v 1.2 2005/03/18 12:52:14 onokazu Exp $ +// $Id: viewcat.php,v 1.2.6.1 2005/05/30 12:00:10 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -35,18 +35,18 @@ include XOOPS_ROOT_PATH."/header.php"; if (isset($HTTP_GET_VARS['show']) && $HTTP_GET_VARS['show']!="") { - $show = intval($HTTP_GET_VARS['show']); + $show = intval($HTTP_GET_VARS['show']); } else { - $show = $xoopsModuleConfig['perpage']; + $show = $xoopsModuleConfig['perpage']; } $min = isset($HTTP_GET_VARS['min']) ? intval($HTTP_GET_VARS['min']) : 0; if (!isset($max)) { - $max = $min + $show; + $max = $min + $show; } if(isset($HTTP_GET_VARS['orderby'])) { - $orderby = convertorderbyin($HTTP_GET_VARS['orderby']); + $orderby = convertorderbyin($HTTP_GET_VARS['orderby']); } else { - $orderby = "title ASC"; + $orderby = "title ASC"; } @@ -58,132 +58,132 @@ $arr=array(); $arr=$mytree->getFirstChild($cid, "title"); if ( count($arr) > 0 ) { - $scount = 1; - foreach($arr as $ele){ - $sub_arr=array(); - $sub_arr=$mytree->getFirstChild($ele['cid'], "title"); - $space = 0; - $chcount = 0; - $infercategories = ""; - foreach($sub_arr as $sub_ele){ - $chtitle=$myts->makeTboxData4Show($sub_ele['title']); - if ($chcount>5){ - $infercategories .= "..."; - break; - } - if ($space>0) { - $infercategories .= ", "; - } - $infercategories .= "<a href=\"".XOOPS_URL."/modules/mydownloads/viewcat.php?cid=".$sub_ele['cid']."\">".$chtitle."</a>"; - $space++; - $chcount++; - } - $xoopsTpl->append('subcategories', array('title' => $myts->makeTboxData4Show($ele['title']), 'id' => $ele['cid'], 'infercategories' => $infercategories, 'totallinks' => getTotalItems($ele['cid'], 1), 'count' => $scount)); - $scount++; - } + $scount = 1; + foreach($arr as $ele){ + $sub_arr=array(); + $sub_arr=$mytree->getFirstChild($ele['cid'], "title"); + $space = 0; + $chcount = 0; + $infercategories = ""; + foreach($sub_arr as $sub_ele){ + $chtitle=$myts->makeTboxData4Show($sub_ele['title']); + if ($chcount>5){ + $infercategories .= "..."; + break; + } + if ($space>0) { + $infercategories .= ", "; + } + $infercategories .= "<a href=\"".XOOPS_URL."/modules/mydownloads/viewcat.php?cid=".$sub_ele['cid']."\">".$chtitle."</a>"; + $space++; + $chcount++; + } + $xoopsTpl->append('subcategories', array('title' => $myts->makeTboxData4Show($ele['title']), 'id' => $ele['cid'], 'infercategories' => $infercategories, 'totallinks' => getTotalItems($ele['cid'], 1), 'count' => $scount)); + $scount++; + } } if ($xoopsModuleConfig['useshots'] == 1) { - $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']); - $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10); - $xoopsTpl->assign('show_screenshot', true); - $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS); + $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']); + $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10); + $xoopsTpl->assign('show_screenshot', true); + $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS); } if (!empty($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) { - $isadmin = true; + $isadmin = true; } else { - $isadmin = false; + $isadmin = false; } $fullcountresult=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_downloads")." WHERE cid=$cid AND status>0"); list($numrows) = $xoopsDB->fetchRow($fullcountresult); $page_nav = ''; if($numrows>0){ - $xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC); - $xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC); - $xoopsTpl->assign('lang_hits', _MD_HITSC); - $xoopsTpl->assign('lang_ratingc', _MD_RATINGC); - $xoopsTpl->assign('lang_email', _MD_EMAILC); - $xoopsTpl->assign('lang_ratethissite', _MD_RATETHISFILE); - $xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN); - $xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND); - $xoopsTpl->assign('lang_modify', _MD_MODIFY); - $xoopsTpl->assign('lang_version' , _MD_VERSION); - $xoopsTpl->assign('lang_subdate' , _MD_SUBMITDATE); - $xoopsTpl->assign('lang_dlnow' , _MD_DLNOW); - $xoopsTpl->assign('lang_category' , _MD_CATEGORYC); - $xoopsTpl->assign('lang_size' , _MD_FILESIZE); - $xoopsTpl->assign('lang_platform' , _MD_SUPPORTEDPLAT); - $xoopsTpl->assign('lang_homepage' , _MD_HOMEPAGE); - $xoopsTpl->assign('lang_comments' , _COMMENTS); - $xoopsTpl->assign('show_links', true); - $q = "SELECT d.lid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d, ".$xoopsDB->prefix("mydownloads_text")." t WHERE cid=".$cid." AND d.status>0 AND d.lid=t.lid ORDER BY ".$orderby.""; - $result = $xoopsDB->query($q,$show,$min); + $xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC); + $xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC); + $xoopsTpl->assign('lang_hits', _MD_HITSC); + $xoopsTpl->assign('lang_ratingc', _MD_RATINGC); + $xoopsTpl->assign('lang_email', _MD_EMAILC); + $xoopsTpl->assign('lang_ratethissite', _MD_RATETHISFILE); + $xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN); + $xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND); + $xoopsTpl->assign('lang_modify', _MD_MODIFY); + $xoopsTpl->assign('lang_version' , _MD_VERSION); + $xoopsTpl->assign('lang_subdate' , _MD_SUBMITDATE); + $xoopsTpl->assign('lang_dlnow' , _MD_DLNOW); + $xoopsTpl->assign('lang_category' , _MD_CATEGORYC); + $xoopsTpl->assign('lang_size' , _MD_FILESIZE); + $xoopsTpl->assign('lang_platform' , _MD_SUPPORTEDPLAT); + $xoopsTpl->assign('lang_homepage' , _MD_HOMEPAGE); + $xoopsTpl->assign('lang_comments' , _COMMENTS); + $xoopsTpl->assign('show_links', true); + $q = "SELECT d.lid, d.title, d.url, d.homepage, d.version, d.size, d.platform, d.logourl, d.status, d.date, d.hits, d.rating, d.votes, d.comments, t.description FROM ".$xoopsDB->prefix("mydownloads_downloads")." d, ".$xoopsDB->prefix("mydownloads_text")." t WHERE cid=".$cid." AND d.status>0 AND d.lid=t.lid ORDER BY ".$orderby.""; + $result = $xoopsDB->query($q,$show,$min); //if 2 or more items in result, show the sort menu - if($numrows>1){ - $xoopsTpl->assign('show_nav', true); - $orderbyTrans = convertorderbytrans($orderby); - $xoopsTpl->assign('lang_sortby', _MD_SORTBY); - $xoopsTpl->assign('lang_title', _MD_TITLE); - $xoopsTpl->assign('lang_date', _MD_DATE); - $xoopsTpl->assign('lang_rating', _MD_RATING); - $xoopsTpl->assign('lang_popularity', _MD_POPULARITY); - $xoopsTpl->assign('lang_cursortedby', sprintf(_MD_CURSORTBY, convertorderbytrans($orderby))); - } - while(list($lid, $dtitle, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description)=$xoopsDB->fetchRow($result)) { - $path = $mytree->getPathFromId($cid, "title"); - $path = substr($path, 1); - $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' board='0' alt=''> ",$path); - $rating = number_format($rating, 2); - $dtitle = $myts->makeTboxData4Show($dtitle); - $url = $myts->makeTboxData4Show($url); - $homepage = $myts->makeTboxData4Show($homepage); - $version = $myts->makeTboxData4Show($version); - $size = PrettySize($myts->makeTboxData4Show($size)); - $platform = $myts->makeTboxData4Show($platform); - $logourl = $myts->makeTboxData4Show($logourl); - $datetime = formatTimestamp($time,"s"); - $description = $myts->makeTareaData4Show($description,0); //no html - $new = newdownloadgraphic($time, $status); - $pop = popgraphic($hits); - if ($isadmin) { - $adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>'; - } else { - $adminlink = ''; - } - if ($votes == 1) { - $votestring = _MD_ONEVOTE; - } else { - $votestring = sprintf(_MD_NUMVOTES,$votes); - } - $xoopsTpl->append('file', array('id' => $lid, 'cid' => $cid, 'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'comments' => $comments, 'platform' => $platform,'size' => $size,'homepage' => $homepage,'version' => $version,'category' => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&lid='.$lid))); - } - $orderby = convertorderbyout($orderby); + if($numrows>1){ + $xoopsTpl->assign('show_nav', true); + $orderbyTrans = convertorderbytrans($orderby); + $xoopsTpl->assign('lang_sortby', _MD_SORTBY); + $xoopsTpl->assign('lang_title', _MD_TITLE); + $xoopsTpl->assign('lang_date', _MD_DATE); + $xoopsTpl->assign('lang_rating', _MD_RATING); + $xoopsTpl->assign('lang_popularity', _MD_POPULARITY); + $xoopsTpl->assign('lang_cursortedby', sprintf(_MD_CURSORTBY, convertorderbytrans($orderby))); + } + while(list($lid, $dtitle, $url, $homepage, $version, $size, $platform, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description)=$xoopsDB->fetchRow($result)) { + $path = $mytree->getPathFromId($cid, "title"); + $path = substr($path, 1); + $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mydownloads/images/arrow.gif' border='0' alt='' /> ",$path); + $rating = number_format($rating, 2); + $dtitle = $myts->makeTboxData4Show($dtitle); + $url = $myts->makeTboxData4Show($url); + $homepage = $myts->makeTboxData4Show($homepage); + $version = $myts->makeTboxData4Show($version); + $size = PrettySize($myts->makeTboxData4Show($size)); + $platform = $myts->makeTboxData4Show($platform); + $logourl = $myts->makeTboxData4Show($logourl); + $datetime = formatTimestamp($time,"s"); + $description = $myts->makeTareaData4Show($description,0); //no html + $new = newdownloadgraphic($time, $status); + $pop = popgraphic($hits); + if ($isadmin) { + $adminlink = '<a href="'.XOOPS_URL.'/modules/mydownloads/admin/index.php?lid='.$lid.'&fct=mydownloads&op=modDownload"><img src="'.XOOPS_URL.'/modules/mydownloads/images/editicon.gif" border="0" alt="'._MD_EDITTHISDL.'" /></a>'; + } else { + $adminlink = ''; + } + if ($votes == 1) { + $votestring = _MD_ONEVOTE; + } else { + $votestring = sprintf(_MD_NUMVOTES,$votes); + } + $xoopsTpl->append('file', array('id' => $lid, 'cid' => $cid, 'rating' => $rating,'title' => $dtitle.$new.$pop,'logourl' => $logourl,'updated' => $datetime,'description' => $description,'adminlink' => $adminlink,'hits' => $hits,'votes' => $votestring, 'comments' => $comments, 'platform' => $platform,'size' => $size,'homepage' => $homepage,'version' => $version,'category' => $path,'lang_dltimes' => sprintf(_MD_DLTIMES,$hits),'mail_subject' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename'])),'mail_body' => rawurlencode(sprintf(_MD_INTFILEFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mydownloads/singlefile.php?cid='.$cid.'&lid='.$lid))); + } + $orderby = convertorderbyout($orderby); //Calculates how many pages exist. Which page one should be on, etc... - $downpages = ceil($numrows / $show); + $downpages = ceil($numrows / $show); //Page Numbering - if ($downpages!=1 && $downpages!=0) { - $prev = $min - $show; - if ($prev>=0) { - $page_nav .= "<a href='viewcat.php?cid=$cid&min=$prev&orderby=$orderby&show=$show'><b><u>«</u></b></a> "; - } - $counter = 1; - $currentpage = ($max / $show); - while ( $counter<=$downpages ) { - $mintemp = ($show * $counter) - $show; - if ($counter == $currentpage) { - $page_nav .= "<b>($counter)</b> "; - } else { - $page_nav .= "<a href='viewcat.php?cid=$cid&min=$mintemp&orderby=$orderby&show=$show'>$counter</a> "; - } - $counter++; - } - if ( $numrows>$max ) { - $page_nav .= "<a href='viewcat.php?cid=$cid&min=$max&orderby=$orderby&show=$show'>"; - $page_nav .= "<b><u>»</u></b></a>"; - } - } + if ($downpages!=1 && $downpages!=0) { + $prev = $min - $show; + if ($prev>=0) { + $page_nav .= "<a href='viewcat.php?cid=$cid&min=$prev&orderby=$orderby&show=$show'><b><u>«</u></b></a> "; + } + $counter = 1; + $currentpage = ($max / $show); + while ( $counter<=$downpages ) { + $mintemp = ($show * $counter) - $show; + if ($counter == $currentpage) { + $page_nav .= "<b>($counter)</b> "; + } else { + $page_nav .= "<a href='viewcat.php?cid=$cid&min=$mintemp&orderby=$orderby&show=$show'>$counter</a> "; + } + $counter++; + } + if ( $numrows>$max ) { + $page_nav .= "<a href='viewcat.php?cid=$cid&min=$max&orderby=$orderby&show=$show'>"; + $page_nav .= "<b><u>»</u></b></a>"; + } + } } $xoopsTpl->assign('page_nav', $page_nav); include XOOPS_ROOT_PATH."/modules/mydownloads/footer.php";