| 1 | <?php |
|---|
| 2 | // $Id: singlelink.php,v 1.5 2005/09/04 20:46:10 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------- // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | // ¥ê¥ó¥¯°ì¤Äɽ¼¨ |
|---|
| 28 | include "header.php"; |
|---|
| 29 | $myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object |
|---|
| 30 | include_once XOOPS_ROOT_PATH."/class/xoopstree.php"; |
|---|
| 31 | $mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid"); |
|---|
| 32 | $lid = intval($_GET['lid']); |
|---|
| 33 | $cid = intval($_GET['cid']); |
|---|
| 34 | $xoopsOption['template_main'] = 'mylinks_singlelink.html'; |
|---|
| 35 | include XOOPS_ROOT_PATH."/header.php"; |
|---|
| 36 | |
|---|
| 37 | $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, l.developer, l.release_date, l.development_time, l.site_status, l.customize_flag from ".$xoopsDB->prefix("mylinks_links")." l, ".$xoopsDB->prefix("mylinks_text")." t where l.lid=$lid and l.lid=t.lid and status>0"); |
|---|
| 38 | list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description, $developer, $release_date, $development_time, $site_status, $customize_flag) = $xoopsDB->fetchRow($result); |
|---|
| 39 | |
|---|
| 40 | switch($site_status) { |
|---|
| 41 | case 1: |
|---|
| 42 | $site_status = _MD_NEW_OPEN; |
|---|
| 43 | break; |
|---|
| 44 | case 2: |
|---|
| 45 | $site_status = _MD_RENEWAL; |
|---|
| 46 | break; |
|---|
| 47 | default: |
|---|
| 48 | $site_status = _MD_NEW_OPEN; |
|---|
| 49 | } |
|---|
| 50 | |
|---|
| 51 | switch($customize_flag) { |
|---|
| 52 | case 1: |
|---|
| 53 | $customize = _MD_ON; |
|---|
| 54 | break; |
|---|
| 55 | case 2: |
|---|
| 56 | $customize = _MD_OFF; |
|---|
| 57 | break; |
|---|
| 58 | default: |
|---|
| 59 | $customize = _MD_OFF; |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | $pathstring = "<a href='index.php'>"._MD_MAIN."</a> : "; |
|---|
| 63 | $pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op="); |
|---|
| 64 | $xoopsTpl->assign('category_path', $pathstring); |
|---|
| 65 | |
|---|
| 66 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) { |
|---|
| 67 | $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>'; |
|---|
| 68 | } else { |
|---|
| 69 | $adminlink = ''; |
|---|
| 70 | } |
|---|
| 71 | if ($votes == 1) { |
|---|
| 72 | $votestring = _MD_ONEVOTE; |
|---|
| 73 | } else { |
|---|
| 74 | $votestring = sprintf(_MD_NUMVOTES,$votes); |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | if ($xoopsModuleConfig['useshots'] == 1) { |
|---|
| 78 | $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']); |
|---|
| 79 | $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10); |
|---|
| 80 | $xoopsTpl->assign('show_screenshot', true); |
|---|
| 81 | $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS); |
|---|
| 82 | } |
|---|
| 83 | $path = $mytree->getPathFromId($cid, "title"); |
|---|
| 84 | $path = substr($path, 1); |
|---|
| 85 | $path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path); |
|---|
| 86 | $new = newlinkgraphic($time, $status); |
|---|
| 87 | $pop = popgraphic($hits); |
|---|
| 88 | $xoopsTpl->assign('link', array('id' => $lid, 'cid' => $cid, 'url' => $url, '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),'developer' => $developer, 'release_date' => $release_date, 'development_time' => $development_time, 'site_status' => $site_status, 'customize_flag' => $customize)); |
|---|
| 89 | $xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC); |
|---|
| 90 | $xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC); |
|---|
| 91 | $xoopsTpl->assign('lang_hits', _MD_HITSC); |
|---|
| 92 | $xoopsTpl->assign('lang_rating', _MD_RATINGC); |
|---|
| 93 | $xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE); |
|---|
| 94 | $xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN); |
|---|
| 95 | $xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND); |
|---|
| 96 | $xoopsTpl->assign('lang_modify', _MD_MODIFY); |
|---|
| 97 | $xoopsTpl->assign('lang_category' , _MD_CATEGORYC); |
|---|
| 98 | $xoopsTpl->assign('lang_visit' , _MD_VISIT); |
|---|
| 99 | $xoopsTpl->assign('lang_comments' , _COMMENTS); |
|---|
| 100 | $xoopsTpl->assign('lang_siteurl', _MD_SITEURL); |
|---|
| 101 | $xoopsTpl->assign('lang_developer', _MD_DEVELOPER); |
|---|
| 102 | $xoopsTpl->assign('lang_release_date', _MD_RELEASE_DATE); |
|---|
| 103 | $xoopsTpl->assign('lang_development_time', _MD_DEVELOPMENT_TIME); |
|---|
| 104 | $xoopsTpl->assign('lang_site_status', _MD_SITE_STATUS); |
|---|
| 105 | $xoopsTpl->assign('lang_customize', _MD_CUSTOMIZE); |
|---|
| 106 | include XOOPS_ROOT_PATH.'/include/comment_view.php'; |
|---|
| 107 | include XOOPS_ROOT_PATH.'/footer.php'; |
|---|
| 108 | ?> |
|---|