source: temp/test-xoops.ec-cube.net/html/modules/mylinks/singlelink.php @ 897

Revision 897, 6.0 KB checked in by uehara, 20 years ago (diff)
Line 
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//  ------------------------------------------------------------------------ //
27include "header.php";
28$myts =& MyTextSanitizer::getInstance();// MyTextSanitizer object
29include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
30$mytree = new XoopsTree($xoopsDB->prefix("mylinks_cat"),"cid","pid");
31$lid = intval($_GET['lid']);
32$cid = intval($_GET['cid']);
33$xoopsOption['template_main'] = 'mylinks_singlelink.html';
34include XOOPS_ROOT_PATH."/header.php";
35
36$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");
37list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description, $developer, $release_date, $development_time, $site_status, $customize_flag) = $xoopsDB->fetchRow($result);
38
39switch($site_status) {
40    case 1:
41    $site_status = _MD_NEW_OPEN;
42    break;
43    case 2:
44    $site_status = _MD_RENEWAL;
45    break;
46    default:
47    $site_status = _MD_NEW_OPEN;
48}
49   
50switch($customize_flag) {
51    case 1:
52    $customize = _MD_ON;
53    break;
54    case 2:
55    $customize = _MD_OFF;
56    break;
57    default:
58    $customize = _MD_OFF;
59}
60
61$pathstring = "<a href='index.php'>"._MD_MAIN."</a>&nbsp;:&nbsp;";
62$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
63$xoopsTpl->assign('category_path', $pathstring);
64
65if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
66        $adminlink = '<a href="'.XOOPS_URL.'/modules/mylinks/admin/?op=modLink&amp;lid='.$lid.'"><img src="'.XOOPS_URL.'/modules/mylinks/images/editicon.gif" border="0" alt="'._MD_EDITTHISLINK.'" /></a>';
67} else {
68        $adminlink = '';
69}
70if ($votes == 1) {
71        $votestring = _MD_ONEVOTE;
72} else {
73        $votestring = sprintf(_MD_NUMVOTES,$votes);
74}
75
76if ($xoopsModuleConfig['useshots'] == 1) {
77        $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
78        $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
79        $xoopsTpl->assign('show_screenshot', true);
80        $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
81}
82$path = $mytree->getPathFromId($cid, "title");
83$path = substr($path, 1);
84$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path);
85$new = newlinkgraphic($time, $status);
86$pop = popgraphic($hits);
87$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' => sprintf(_MD_INTRESTLINK,$xoopsConfig['sitename']), 'mail_body' => rawurlencode(_MD_INTLINKFOUND.':  '.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));
88$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
89$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
90$xoopsTpl->assign('lang_hits', _MD_HITSC);
91$xoopsTpl->assign('lang_rating', _MD_RATINGC);
92$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
93$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
94$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
95$xoopsTpl->assign('lang_modify', _MD_MODIFY);
96$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
97$xoopsTpl->assign('lang_visit' , _MD_VISIT);
98$xoopsTpl->assign('lang_comments' , _COMMENTS);
99$xoopsTpl->assign('lang_siteurl', _MD_SITEURL);
100$xoopsTpl->assign('lang_developer', _MD_DEVELOPER);
101$xoopsTpl->assign('lang_release_date', _MD_RELEASE_DATE);
102$xoopsTpl->assign('lang_development_time', _MD_DEVELOPMENT_TIME);
103$xoopsTpl->assign('lang_site_status', _MD_SITE_STATUS);
104$xoopsTpl->assign('lang_customize', _MD_CUSTOMIZE);
105include XOOPS_ROOT_PATH.'/include/comment_view.php';
106include XOOPS_ROOT_PATH.'/footer.php';
107?>
Note: See TracBrowser for help on using the repository browser.