duan7264 2014-10-16 13:24
浏览 78

坚持在php的页面底部加载jquery

I'm fighting with this module since yesterday. Documentation is poor or there is something I am doing wrong.

This is the link from the original html files. www.bestbuildpc.org/Html5_Player/index.html

This is the link for the documentation

www.bestbuildpc.org/Html5_Player/readme/index.html

I converted to a module in order to work in Ravennuke(based on phpnuke)

This is the link where the module is not loading properly.

http://www.bestbuildpc.org/modules.php?name=HTML5_Player

<?php

if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');
if (!defined('PHP_EOL')) define('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "
" : "
");

require_once 'mainfile.php';
$module_name = basename(dirname(__FILE__));
$pagetitle = '- ' . $module_name . '';

$index = 0;
if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
if (defined('INDEX_FILE') AND INDEX_FILE === true) {
    // auto set right blocks for pre patch 3.1 compatibility
    $index = 1;
}
$ThemeSel = get_theme(true);
$html5player = 'themes/' . $ThemeSel . '/css/normalize.css';
if (file_exists($html5player)) {
    define('RN_MODULE_CSS', 'normalize.css');
} else {

    $html5player = 'modules/' . $module_name . '/css/normalize.css';

addCSSToHead($html5player, 'file');
addCSSToHead('modules/' . $module_name . '/mediaelement/mediaelementplayer.min.css', 'file');

//  addJSToHead('modules/' . $module_name . '/js/jquery-1.11.1.min.js', 'file');//I have another version loading
//echo '<script type="text/javascript">!window.jQuery && document.write(\'<script src="modules/HTML5_Player/js/jquery-1.11.1.min.js"><\/script>\')</script>' . PHP_EOL;
//echo '<script type="text/javascript">window.jQuery && document.write(\'<script src="includes/jquery/jquery.js"><\/script>\')</script>' . PHP_EOL;
  addJSToBody('modules/' . $module_name . '/mediaelement/mediaelement-and-player.min.js', 'file');
  addJSToBody('modules/' . $module_name . '/js/jquery-ui-1.11.1.sortable.min.js', 'file');
  addJSToBody('modules/' . $module_name . '/js/jquery.ui.touch-punch-improved.js', 'file');
  addJSToBody('modules/' . $module_name . '/js/jquery.hammer-full.min.js', 'file');
  addJSToBody('modules/' . $module_name . '/js/perfect-scrollbar-with-mousewheel.min.js', 'file');
  addJSToBody('modules/' . $module_name . '/js/jquery.vimuse.min.js', 'file');
  $JStoHeadHTML = '
<script type="text/javascript">' . PHP_EOL
//        . '$(window).load(function(){' . PHP_EOL
        . '$(document).ready(function(){' . PHP_EOL
         . '$(\'#player\').vimuse()({' . PHP_EOL
         . 'mediaType: \'audio\',' . PHP_EOL
         . 'showPlaylistOnLoad: true,' . PHP_EOL
         . 'autoplay: true,' . PHP_EOL
         . 'shuffle: true,' . PHP_EOL
         . 'showPlaylistOnLoad: true,' . PHP_EOL
         . 'playlistProgress: true,' . PHP_EOL
         . 'showFileTypeIcons: true,' . PHP_EOL
         . 'showDeleteButtons: true,' . PHP_EOL
         . 'showItemDuration: true,' . PHP_EOL
         . 'enablePlaylistSort: true,' . PHP_EOL
         . 'showAudioDetails: true,' . PHP_EOL
         . 'showAudioCover: true,' . PHP_EOL
         . 'showAuxControls: true,' . PHP_EOL
         . 'playlistProgress: true,' . PHP_EOL
         . 'stopPlaybackOnPageHide: false,' . PHP_EOL
         . 'showDownloadLinks: false,' . PHP_EOL
         . 'scanMP3Folder: true,' . PHP_EOL
         . 'mp3Folder: \'media/audio\'' . PHP_EOL
         . '});' . PHP_EOL
         . '});' . PHP_EOL
         . '</script>' . PHP_EOL;
    addJSToBody($JStoHeadHTML, 'inline');
}

include_once 'header.php';

OpenTable();
echo '<div class="text-center">' , PHP_EOL
    , '<div class="header-content">' , PHP_EOL
    , '<h1>HTML5 Media Player</h1>' , PHP_EOL
    , '</div></div>' , PHP_EOL
    , '<div class="main">' , PHP_EOL
    , '<div id="player">' , PHP_EOL
    , '</div></div>' , PHP_EOL;
CloseTable();
include_once 'footer.php';

What am I doing wroong. The module is not working. I need example from the same files. I've been reading and testing lots of ways to load jquery but I don't get any more idea of what is going on. it will be nice if someone take a look at it. Thanks in advance.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题
    • ¥15 Python时间序列如何拟合疏系数模型