onokazu
onoka****@users*****
2005年 5月 30日 (月) 21:26:42 JST
Index: xoops2jp/html/modules/mylinks/index.php diff -u xoops2jp/html/modules/mylinks/index.php:1.2 xoops2jp/html/modules/mylinks/index.php:1.2.6.1 --- xoops2jp/html/modules/mylinks/index.php:1.2 Fri Mar 18 21:52:24 2005 +++ xoops2jp/html/modules/mylinks/index.php Mon May 30 21:26:41 2005 @@ -1,5 +1,5 @@ <?php -// $Id: index.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $ +// $Id: index.php,v 1.2.6.1 2005/05/30 12:26:41 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -34,47 +34,47 @@ $count = 1; while($myrow = $xoopsDB->fetchArray($result)) { - $imgurl = ''; - if ($myrow['imgurl'] && $myrow['imgurl'] != "http://"){ - $imgurl = $myts->makeTboxData4Edit($myrow['imgurl']); - } - $totallink = 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/mylinks/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, 'totallink' => $totallink, 'count' => $count)); - $count++; + $imgurl = ''; + if ($myrow['imgurl'] && $myrow['imgurl'] != "http://"){ + $imgurl = $myts->makeTboxData4Edit($myrow['imgurl']); + } + $totallink = 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/mylinks/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, 'totallink' => $totallink, 'count' => $count)); + $count++; } list($numrows) = $xoopsDB->fetchRow($xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")." 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); @@ -92,22 +92,22 @@ $result = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t where l.status>0 and l.lid=t.lid ORDER BY date DESC", $xoopsModuleConfig['newlinks'], 0); while(list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result)) { - if ($isadmin) { - $adminlink = '<a href="'.XOOPS_URL.'/modules/mylinks/admin/?op=modLink&lid='.$lid.'"><img src="'.XOOPS_URL.'/modules/mylinks/images/editicon.gif" border="0" alt="'._MD_EDITTHISLINK.'" /></a>'; - } else { - $adminlink = ''; - } - if ($votes == 1) { - $votestring = _MD_ONEVOTE; - } else { - $votestring = sprintf(_MD_NUMVOTES,$votes); - } - $path = $mytree->getPathFromId($cid, "title"); - $path = substr($path, 1); - $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt=''> ",$path); - $new = newlinkgraphic($time, $status); - $pop = popgraphic($hits); - $xoopsTpl->append('links', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->makeTareaData4Show($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mylinks/singlelink.php?cid='.$cid.'&lid='.$lid))); + if ($isadmin) { + $adminlink = '<a href="'.XOOPS_URL.'/modules/mylinks/admin/?op=modLink&lid='.$lid.'"><img src="'.XOOPS_URL.'/modules/mylinks/images/editicon.gif" border="0" alt="'._MD_EDITTHISLINK.'" /></a>'; + } else { + $adminlink = ''; + } + if ($votes == 1) { + $votestring = _MD_ONEVOTE; + } else { + $votestring = sprintf(_MD_NUMVOTES,$votes); + } + $path = $mytree->getPathFromId($cid, "title"); + $path = substr($path, 1); + $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path); + $new = newlinkgraphic($time, $status); + $pop = popgraphic($hits); + $xoopsTpl->append('links', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->makeTareaData4Show($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mylinks/singlelink.php?cid='.$cid.'&lid='.$lid))); } include XOOPS_ROOT_PATH.'/footer.php'; ?> Index: xoops2jp/html/modules/mylinks/singlelink.php diff -u xoops2jp/html/modules/mylinks/singlelink.php:1.2 xoops2jp/html/modules/mylinks/singlelink.php:1.2.6.1 --- xoops2jp/html/modules/mylinks/singlelink.php:1.2 Fri Mar 18 21:52:24 2005 +++ xoops2jp/html/modules/mylinks/singlelink.php Mon May 30 21:26:41 2005 @@ -1,5 +1,5 @@ <?php -// $Id: singlelink.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $ +// $Id: singlelink.php,v 1.2.6.1 2005/05/30 12:26:41 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -59,7 +59,7 @@ } $path = $mytree->getPathFromId($cid, "title"); $path = substr($path, 1); -$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt=''> ",$path); +$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path); $new = newlinkgraphic($time, $status); $pop = popgraphic($hits); $xoopsTpl->assign('link', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->makeTareaData4Show($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mylinks/singlelink.php?lid='.$lid))); Index: xoops2jp/html/modules/mylinks/viewcat.php diff -u xoops2jp/html/modules/mylinks/viewcat.php:1.2 xoops2jp/html/modules/mylinks/viewcat.php:1.2.6.1 --- xoops2jp/html/modules/mylinks/viewcat.php:1.2 Fri Mar 18 21:52:24 2005 +++ xoops2jp/html/modules/mylinks/viewcat.php Mon May 30 21:26:41 2005 @@ -1,5 +1,5 @@ <?php -// $Id: viewcat.php,v 1.2 2005/03/18 12:52:24 onokazu Exp $ +// $Id: viewcat.php,v 1.2.6.1 2005/05/30 12:26:41 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -58,26 +58,26 @@ 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/mylinks/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++; + $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/mylinks/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++; } } @@ -108,7 +108,7 @@ $xoopsTpl->assign('lang_category' , _MD_CATEGORYC); $xoopsTpl->assign('lang_visit' , _MD_VISIT); $xoopsTpl->assign('show_links', true); - $xoopsTpl->assign('lang_comments' , _COMMENTS); + $xoopsTpl->assign('lang_comments' , _COMMENTS); $sql = "select l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description from ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t where cid=$cid and l.lid=t.lid and status>0 order by $orderby"; $result=$xoopsDB->query($sql,$show,$min); @@ -136,17 +136,17 @@ } $path = $mytree->getPathFromId($cid, "title"); $path = substr($path, 1); - $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt=''> ",$path); + $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path); $new = newlinkgraphic($time, $status); $pop = popgraphic($hits); $xoopsTpl->append('links', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle).$new.$pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time,"m"), 'description' => $myts->makeTareaData4Show($description,0), 'adminlink' => $adminlink, 'hits' => $hits, 'comments' => $comments, 'votes' => $votestring, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND,$xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/mylinks/singlelink.php?cid='.$cid.'&lid='.$lid))); - } + } $orderby = convertorderbyout($orderby); //Calculates how many pages exist. Which page one should be on, etc... $linkpages = ceil($numrows / $show); //Page Numbering if ($linkpages!=1 && $linkpages!=0) { - $cid = intval($HTTP_GET_VARS['cid']); + $cid = intval($HTTP_GET_VARS['cid']); $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> ";