Example #1
0
 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them in the $_entry array based upon DOM data.
  *
  * @param DOMNode $child The DOMNode to process
  */
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('media') . ':' . 'content':
             $content = new MediaContent();
             $content->transferFromDOM($child);
             $this->_content[] = $content;
             break;
         case $this->lookupNamespace('media') . ':' . 'rating':
             $mediarating = new MediaRating();
             $mediarating->transferFromDOM($child);
             $this->_mediarating = $mediarating;
             break;
         case $this->lookupNamespace('media') . ':' . 'credit':
             $mediacredit = new MediaCredit();
             $mediacredit->transferFromDOM($child);
             $this->_mediacredit = $mediacredit;
             break;
         case $this->lookupNamespace('yt') . ':' . 'duration':
             $duration = new Duration();
             $duration->transferFromDOM($child);
             $this->_duration = $duration;
             break;
         case $this->lookupNamespace('yt') . ':' . 'private':
             $private = new PrivateExtension();
             $private->transferFromDOM($child);
             $this->_private = $private;
             break;
         case $this->lookupNamespace('yt') . ':' . 'videoid':
             $videoid = new VideoId();
             $videoid->transferFromDOM($child);
             $this->_videoid = $videoid;
             break;
         case $this->lookupNamespace('yt') . ':' . 'uploaded':
             $uploaded = new Uploaded();
             $uploaded->transferFromDOM($child);
             $this->_uploaded = $uploaded;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Example #2
0
}
$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'));
Example #3
0
 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them in the $_entry array based upon DOM data.
  *
  * @param DOMNode $child The DOMNode to process
  */
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('media') . ':' . 'content':
             $content = new MediaContent();
             $content->transferFromDOM($child);
             $this->_content[] = $content;
             break;
         case $this->lookupNamespace('media') . ':' . 'category':
             $category = new MediaCategory();
             $category->transferFromDOM($child);
             $this->_category[] = $category;
             break;
         case $this->lookupNamespace('media') . ':' . 'copyright':
             $copyright = new MediaCopyright();
             $copyright->transferFromDOM($child);
             $this->_copyright = $copyright;
             break;
         case $this->lookupNamespace('media') . ':' . 'credit':
             $credit = new MediaCredit();
             $credit->transferFromDOM($child);
             $this->_credit[] = $credit;
             break;
         case $this->lookupNamespace('media') . ':' . 'description':
             $description = new MediaDescription();
             $description->transferFromDOM($child);
             $this->_description = $description;
             break;
         case $this->lookupNamespace('media') . ':' . 'hash':
             $hash = new MediaHash();
             $hash->transferFromDOM($child);
             $this->_hash[] = $hash;
             break;
         case $this->lookupNamespace('media') . ':' . 'keywords':
             $keywords = new MediaKeywords();
             $keywords->transferFromDOM($child);
             $this->_keywords = $keywords;
             break;
         case $this->lookupNamespace('media') . ':' . 'player':
             $player = new MediaPlayer();
             $player->transferFromDOM($child);
             $this->_player[] = $player;
             break;
         case $this->lookupNamespace('media') . ':' . 'rating':
             $rating = new MediaRating();
             $rating->transferFromDOM($child);
             $this->_rating[] = $rating;
             break;
         case $this->lookupNamespace('media') . ':' . 'restriction':
             $restriction = new MediaRestriction();
             $restriction->transferFromDOM($child);
             $this->_restriction[] = $restriction;
             break;
         case $this->lookupNamespace('media') . ':' . 'text':
             $text = new MediaText();
             $text->transferFromDOM($child);
             $this->_mediaText[] = $text;
             break;
         case $this->lookupNamespace('media') . ':' . 'thumbnail':
             $thumbnail = new MediaThumbnail();
             $thumbnail->transferFromDOM($child);
             $this->_thumbnail[] = $thumbnail;
             break;
         case $this->lookupNamespace('media') . ':' . 'title':
             $title = new MediaTitle();
             $title->transferFromDOM($child);
             $this->_title = $title;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Example #4
0
<?php

# Medialinks view a page
# $Id: list.php,v 1.2 2007/11/24 09:49:13 nobu Exp $
include "../../mainfile.php";
include_once "functions.php";
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
include XOOPS_ROOT_PATH . "/header.php";
$xoopsOption['template_main'] = 'medialinks_list.html';
$content = new MediaContent();
$order = 'ctime DESC';
$cond = "status='N'";
$isadmin = is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->getVar('mid'));
$acl = "";
if (isset($_GET['uid'])) {
    $cond .= ' AND poster=' . intval($_GET['uid']);
}
$keyid = isset($_GET['keyid']) ? intval($_GET['keyid']) : 0;
$keypath = $content->keys_path($keyid, 0, true);
set_ml_breadcrumbs($keypath);
if (!empty($_GET['keyid'])) {
    $order = 'weight,mid';
    $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) . ")";
}
Example #5
0
<?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';
//                       <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';
Example #7
0
<?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)) {
Example #8
0
}
if (isset($monthname)) {
    $xoopsTpl->assign('monthname', $monthname);
}
$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) . '"';