$tpl = new XoopsTpl(); $xoopsConfig['generator'] = $mydirname . ' ' . $xoopsModule->getVar('version'); $tpl->assign('config', $xoopsConfig); $tpl->assign('builddate', formatTimestamp(time(), 'rss')); if (preg_match('/(iPod|iTunes)/', $name)) { $cache_id = "{$mydirname}/track.php?lid={$lid}"; header("Content-Type: text/xml; charset=UTF-8"); header("Content-Disposition:attachment;filename=\"{$mydirname}.xml\""); header("Cache-Control: public"); header("Pragma: public"); $tpl->xoops_setCaching(2); $tpl->xoops_setCacheTime(3600); if (true || !$tpl->is_cached('db:medialinks_rss.xml', $cache_id)) { include_once 'functions.php'; $content = new MediaContent($mid); $tpl->assign('pubdate', formatTimestamp($content->getVar('mtime'), 'rss')); $item = $content->dispVars(); $item['url'] = $url; $item['item_title'] = htmlspecialchars($name); if (preg_match('/\\.mov$/i', $url)) { $type = 'video/quicktime'; } elseif (preg_match('/\\.(m4v|mp4)$/i', $url)) { $type = 'video/mp4'; } elseif (preg_match('/\\.(wmv|avi)$/i', $url)) { $type = 'video/x-msvideo'; } $item['mimetype'] = $type; $item['pubdate'] = formatTimestamp($content->getVar('mtime'), 'rss'); $tpl->assign('items', array($item)); $tpl->assign('builddate', formatTimestamp(time(), 'rss')); }
$keyid = intval($_GET['keyid']); $xoopsTpl->assign('keypath', $keypath); $res = $xoopsDB->query("SELECT midref FROM " . RELAY . " WHERE keyref=" . $keyid); $mids = array(); while (list($mid) = $xoopsDB->fetchRow($res)) { $mids[] = $mid; } $cond .= " AND mid IN (" . join(',', $mids) . ")"; } if (!$isadmin) { $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; $acl = "LEFT JOIN " . ACLS . " ON amid=mid AND auid=" . $uid; $cond .= " AND (nacl=0 OR auid>0)"; } $res = $xoopsDB->query("SELECT count(mid) FROM " . MAIN . " {$acl} WHERE {$cond}"); list($n) = $xoopsDB->fetchRow($res); $start = isset($_GET['start']) ? intval($_GET['start']) : 0; $max = $xoopsModuleConfig['max_list']; $res = $xoopsDB->query("SELECT * FROM " . MAIN . " {$acl} WHERE {$cond} ORDER BY {$order}", $max, $start); $nav = new XoopsPageNav($n, $max, $start, "start"); if ($n > $max) { $xoopsTpl->assign('pagenav', $nav->renderNav()); } $list = array(); while ($content->load(0, $res)) { $fields = $content->dispVars(); $fields['detail'] = "detail.php?mid=" . $content->getVar('mid'); $list[] = $fields; } $xoopsTpl->assign('list', $list); include XOOPS_ROOT_PATH . "/footer.php";
# Medialinks view a page # $Id: delete.php,v 1.2 2007/11/24 09:49:13 nobu Exp $ include "../../mainfile.php"; include_once "functions.php"; if (isset($_POST['delete'])) { $mid = isset($_POST['mid']) ? intval($_POST['mid']) : 0; } else { $mid = isset($_GET['mid']) ? intval($_GET['mid']) : 0; } if (!$mid || !is_object($xoopsUser)) { redirect_header('index.php', 3, _NOPERM); exit; } $content = new MediaContent($mid); $mid = $content->getVar('mid'); if (empty($mid) || $content->getVar('status') == 'X' || $content->getVar('poster') != $xoopsUser->getVar('uid') && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { redirect_header('index.php', 3, _NOPERM); exit; } if (isset($_POST['delete'])) { $content->setVar('status', 'X'); if ($content->store()) { redirect_header('index.php', 1, _MD_DBUPDATE_DEL); } else { redirect_header('index.php', 2, _MD_DBUPDATE_FAIL); } } include XOOPS_ROOT_PATH . "/header.php"; $xoopsOption['template_main'] = 'medialinks_operate.html'; //$xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsModule->getVar('name')._MD_SEP.$content->getVar('title')));
// <http://www.xoops.org/> // // ------------------------------------------------------------------------ // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // You may not change or alter any portion of this comment or credits // // of supporting developers from this source code or any supporting // // source code which is considered copyrighted (c) material of the // // original comment or credit authors. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // include '../../mainfile.php'; include 'functions.php'; require_once XOOPS_ROOT_PATH . '/class/template.php'; $mid = $com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0; $content = new MediaContent($mid); $tpl = new XoopsTpl(); $tpl->assign('fields', $content->dispVars()); $com_replytext = $tpl->fetch('db:medialinks_item.html'); $com_replytitle = htmlspecialchars($content->getVar('title')); include XOOPS_ROOT_PATH . '/include/comment_new.php';
<?php # Medialinks view a page # $Id: detail.php,v 1.4 2007/12/28 15:17:34 nobu Exp $ include "../../mainfile.php"; include_once "functions.php"; $mid = isset($_GET['mid']) ? intval($_GET['mid']) : 0; if (!$mid) { redirect_header('index.php', 3, _NOPERM); exit; } $content = new MediaContent($mid); if ($content->getVar('mid') != $mid) { redirect_header('index.php', 3, _NOPERM); exit; } $content->hits(); if ($content->getVar('status') != 'N') { // deleted content view only admin if (!is_object($xoopsUser) || !($xoopsUser->isAdmin($xoopsModule->getVar('mid')) || $content->getVar('status') == 'W' && $content->getVar('poster') == $xoopsUser->getVar('uid'))) { redirect_header('index.php', 3, _NOPERM); exit; } } include XOOPS_ROOT_PATH . "/header.php"; $xoopsOption['template_main'] = 'medialinks_detail.html'; $xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsModule->getVar('name') . _MD_SEP . $content->getVar('title'))); $xoopsTpl->assign('fields', $content->dispVars()); $keyid = isset($_GET['keyid']) ? intval($_GET['keyid']) : 0; $keys =& $content->getKeywords(); if (count($keys) && !in_array($keyid, $keys)) {
} $y = formatTimestamp(time(), 'Y'); $xoopsTpl->assign('calrange', array($y - 10, $y + 10)); $title = $mid ? _MD_CONTENT_EDIT : _MD_CONTENT_NEW; $xoopsTpl->assign('xoops_pagetitle', htmlspecialchars($xoopsModule->getVar('name') . _MD_SEP . $title)); $xoopsTpl->assign('lang_title', htmlspecialchars($title)); $preview = isset($_POST['preview']); if ($preview) { $content = new MediaContent(intval($_POST['mid'])); $content = store_entry($content); $xoopsTpl->assign('fields', $content->dispVars(false)); } else { $content = new MediaContent($mid); } $isadmin = $xoopsUser->isAdmin($xoopsModule->getVar('mid')); if ($mid && $content->getVar('status') != 'N') { // deleted content view only admin if (!$isadmin || $content->getVar('status') == 'W' && $content->getVar('poster') == $xoopsUser->getVar('uid')) { redirect_header('index.php', 3, _NOPERM); exit; } } $form = array('mid' => $mid); $nop = $mid ? array() : array('mtime', 'ctime', 'poster', 'hits'); keywords_widget($keywidget, $relays, $roots); function squote($x) { return '"' . addslashes($x) . '"'; } $dests = array(); if ($relays) {