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

Revision 405, 5.1 KB checked in by root, 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 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) = $xoopsDB->fetchRow($result);
38
39$pathstring = "<a href='index.php'>"._MD_MAIN."</a>&nbsp;:&nbsp;";
40$pathstring .= $mytree->getNicePathFromId($cid, "title", "viewcat.php?op=");
41$xoopsTpl->assign('category_path', $pathstring);
42
43if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) {
44        $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>';
45} else {
46        $adminlink = '';
47}
48if ($votes == 1) {
49        $votestring = _MD_ONEVOTE;
50} else {
51        $votestring = sprintf(_MD_NUMVOTES,$votes);
52}
53
54if ($xoopsModuleConfig['useshots'] == 1) {
55        $xoopsTpl->assign('shotwidth', $xoopsModuleConfig['shotwidth']);
56        $xoopsTpl->assign('tablewidth', $xoopsModuleConfig['shotwidth'] + 10);
57        $xoopsTpl->assign('show_screenshot', true);
58        $xoopsTpl->assign('lang_noscreenshot', _MD_NOSHOTS);
59}
60$path = $mytree->getPathFromId($cid, "title");
61$path = substr($path, 1);
62$path = str_replace("/"," <img src='".XOOPS_URL."/modules/mylinks/images/arrow.gif' board='0' alt='' /> ",$path);
63$new = newlinkgraphic($time, $status);
64$pop = popgraphic($hits);
65$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)));
66$xoopsTpl->assign('lang_description', _MD_DESCRIPTIONC);
67$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
68$xoopsTpl->assign('lang_hits', _MD_HITSC);
69$xoopsTpl->assign('lang_rating', _MD_RATINGC);
70$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
71$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
72$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
73$xoopsTpl->assign('lang_modify', _MD_MODIFY);
74$xoopsTpl->assign('lang_category' , _MD_CATEGORYC);
75$xoopsTpl->assign('lang_visit' , _MD_VISIT);
76$xoopsTpl->assign('lang_comments' , _COMMENTS);
77include XOOPS_ROOT_PATH.'/include/comment_view.php';
78include XOOPS_ROOT_PATH.'/footer.php';
79?>
Note: See TracBrowser for help on using the repository browser.