Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Mon Oct 13, 2014 6:46 am Reply with quote

I followed all the instructions from RavenNuke on how to make a module but it seems something is not going well. What am I doing wrong?

Code:
<?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') ? "\r\n" : "\n");
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 . '/cs/normalize.css';

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


  addJSToBody('modules/' . $module_name . '/js/jquery-1.11.1.min.js', 'file');
  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');

echo '<script type="text/javascript">' . PHP_EOL
       . 'var $app = $(\'#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
       . 'showAudioTrackInfo: 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
. '</script>' . PHP_EOL;
}

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>' , PHP_EOL
    , '<div class="main">' , PHP_EOL
    , '<div id="player"></div>' , PHP_EOL;
   
CloseTable();
include_once 'footer.php';


Note: The module is not loading the javascript. I just don't want to create any file in addon folder. I want to load javascript directly.


Last edited by hicuxunicorniobestbuildpc on Fri Oct 17, 2014 5:42 am; edited 1 time in total 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Mon Oct 13, 2014 12:12 pm Reply with quote

It seems that you have messed up yourself with jquery stuff. Wink
[ Only registered users can see links on this board! Get registered or login! ]

_________________
Github: RavenNuke 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Tue Oct 14, 2014 2:39 am Reply with quote

yes, I did mess something with jquery but analizing the files I did comment out the jquery line because Ravennuke has already jquery loaded but even so it didn't work.

I tried this one with no luck

Code:
echo '<script>!window.jQuery && document.write(\'<script src="js/jquery-1.11.1.min.js"><\/script>\')</script>' . PHP_EOL;


Does anybody can explain to me. Neralex is not the only one in this forum. It looks like everybody comes to take a look but don't even try.
 
neralex







PostPosted: Tue Oct 14, 2014 3:05 am Reply with quote

Beginner Lesson 2567891234

In every document should exists only one jquery library file. Double loadings provides errors. Every Javascript code should be placed inside the html tag and not outside. If you have the lib file inside the head, so it must be placed all in the head area or if you have the lib file in the body then it should be placed all in the body area.

If you want check where your code is generated, try a look in the source code view of your browser. Compare it with your php code and compare it with the examples on jquery.com or the other 10k examples in the internet or open modules with jquery addons and compare it.


Last edited by neralex on Thu Oct 16, 2014 2:17 pm; edited 3 times in total 
hicuxunicorniobestbuildpc







PostPosted: Tue Oct 14, 2014 4:28 am Reply with quote

Neralex: I read your post carefully. This is what I did so far. I think there is something I am missing. I will send u a donation asap but I need explanation how to create a module with jquery. I can not understand why it is not working.

Code:
<?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') ? "\r\n" : "\n");

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 . '/cs/normalize.css';

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

  addJSToBody('modules/' . $module_name . '/js/jquery-1.11.1.min.js', 'file');
//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;
  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">
// <![CDATA[
$(document).ready(function() {
var $app = $(\'#player\').vimuse({
mediaType: \'audio\',
showPlaylistOnLoad: true,
autoplay: true,
shuffle: true,
showPlaylistOnLoad: true,
playlistProgress: true,
showFileTypeIcons: true,
showDeleteButtons: true,
showItemDuration: true,
enablePlaylistSort: true,
showAudioDetails: true,
showAudioCover: true,
showAuxControls: true,
playlistProgress: true,
stopPlaybackOnPageHide: false,
showDownloadLinks: false,
scanMP3Folder: true,
mp3Folder: \'media/audio\'

   });
});
// ]]>
</script>
';
   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';



Link: [ Only registered users can see links on this board! Get registered or login! ]


Last edited by hicuxunicorniobestbuildpc on Fri Dec 25, 2015 5:46 am; edited 1 time in total 
neralex







PostPosted: Tue Oct 14, 2014 8:37 am Reply with quote

1. You haven't a jquery library file loaded. BTW that is the fact on all areas on your page. Only on index is a jquery library file loaded.

2. If you want call the options of the vimuse addon, you must have loaded the minified vimuse script before.

3. check your needed/unneeded brackets in the options call.

4. Introducing $(document).ready():
[ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]

5. The file under the path 'modules/' . $module_name . '/cs/normalize.css' doesn't exist. If the file under the path 'themes/' . $ThemeSel . '/css/normalize.css' exists then all your jquery files wouldn't load. Makes your if-statement really sense?

6. player theme css file isn't loaded.
 
hicuxunicorniobestbuildpc







PostPosted: Wed Oct 15, 2014 10:13 am Reply with quote

My mistake neralex!!! I didn't see your replay until today.

Quote:
1. You haven't a jquery library file loaded. BTW that is the fact on all areas on your page. Only on index is a jquery library file loaded.

Quote:
2. If you want call the options of the vimuse addon, you must have loaded the minified vimuse script before.


This is what I need to solve right away. I had to bring back the way I was loading the jquery because it was working properly on the HOME page but not in other places. That is correct!. Here I mentioned what I did:

I created a file named custom-footer.php in this place

includes/custom_files/custom-footer.php

Code:
<?php

    global $ThemeSel, $user, $admin;
    echo '<script type="text/javascript" src="includes/jquery/jquery.js"></script>' . PHP_EOL
       , '<script type="text/javascript" src="includes/jquery/jquery.colorbox-min.js"></script>' . PHP_EOL
       , '<script type="text/javascript" src="includes/jquery/colorbox-settings.js"></script>' . PHP_EOL
       , '<script type="text/javascript" src="modules/HTML5_Player/js/jquery.vimuse.min.js"></script>' . PHP_EOL
       , '<script type="text/javascript" src="includes/jquery/browserdetect.js"></script>' . PHP_EOL;


I open jquery.php and I commented out

Code:
//addJSToHead('includes/jquery/jquery.js', 'file');


Quote:
3. check your needed/unneeded brackets in the options call.


I am not sure if I need another bracket because I am not getting any error.


Quote:
5. The file under the path 'modules/' . $module_name . '/cs/normalize.css' doesn't exist. If the file under the path 'themes/' . $ThemeSel . '/css/normalize.css' exists then all your jquery files wouldn't load. Makes your if-statement really sense?


I correct that mistake. I needed to add css instead of cs.

I really don't understand this jquery. Now one part of the theme is showing but the rest with the playlist NOT. How did you load the jquery at the bottom without beeing conflict? I am out of idea now. I will need your help for sure. I think this module is a challenge for me and maybe for a lot of people here.

This is what I did so far.

Code:
<?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') ? "\r\n" : "\n");

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');

//  addJSToBody('modules/' . $module_name . '/js/jquery-1.11.1.min.js', 'file');
//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;
  $JStoHeadHTML = '
<script type="text/javascript">
$(document).ready(function() {
$(\'#player\').vimuse({
mediaType: \'audio\',
showPlaylistOnLoad: true,
autoplay: true,
shuffle: true,
showPlaylistOnLoad: true,
playlistProgress: true,
showFileTypeIcons: true,
showDeleteButtons: true,
showItemDuration: true,
enablePlaylistSort: true,
showAudioDetails: true,
showAudioCover: true,
showAuxControls: true,
playlistProgress: true,
stopPlaybackOnPageHide: false,
showDownloadLinks: false,
scanMP3Folder: true,
mp3Folder: \'media/audio\'
});
});

</script>
';
   addJSToBody($JStoHeadHTML, 'inline');
}
  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');

include_once 'header.php';
include_once NUKE_INCLUDE_DIR . 'custom_files/custom-footer.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';


Last edited by hicuxunicorniobestbuildpc on Wed Oct 15, 2014 4:16 pm; edited 1 time in total 
neralex







PostPosted: Wed Oct 15, 2014 4:05 pm Reply with quote

Your endless loop returns Wink

1. You purchased this player script and then you should have all instructions to install it. If not then please contact the authors where you have it purchased. I don't know which files are really needed and i don't want have this information. I can only try a look with my browser via source-code viewer, firebug and on your posted php code. This script was created for html5 documents and maybe it will work with other doctypes. But if exists issues with other doctypes or not lies in the hand of the authors and you have to contact them.

2. To load the jquery lib file at the end of the body-area will not work for every jquery addon. It works for me in my setup but not in every case. So i must search addons where i can do it in this way and i try to use jquery addons in a document as few as possible. That is the reason why i don't want share it in public. Because if i would do it then someone would cry that will not work because he is using maybe a addon that will not work on this way - then i would start it from scratch to explain it again and again. The best example for that is you. I think i have typed this reason now more than 1 times. If you want make sure that all jquery addons should work correctly, then leave the lib file in the head-area.

Here in these forums are existing so many threads of you where you created your issues self and everytime you got helpful instructions. The big problem is, that you haven't learned in all the years the basics but you are trying other stuff that depends from it. Why should someone help you if everytime he must start with you from scratch? This thread is sadly a new example for that.

If i would serve it for you as copy&paste solution, then you don't do more than copy&paste and after that you will publish it as your "own" module that no one really need. Then you are getting the next issue and it will start again...


So you have some possible ways:

- use google to learn the basics to understand what do you really want, how it works and try it self (best way)
- open the massive count of modules and compare it with a intensive try&error tour
- hire a coder if you can find someone for that (note: i don't want do it!)
- stop the work on things that will not work

I hope i have it sorted for you.


Last edited by neralex on Thu Oct 16, 2014 2:30 pm; edited 3 times in total 
hicuxunicorniobestbuildpc







PostPosted: Wed Oct 15, 2014 4:50 pm Reply with quote

Quote:
2. To load the jquery lib file at the end of the body-area will not work for every jquery addon. It works for me in my setup as it should but not in every case. So i must search addons where i can do it in this way and i try to use jquery addons in a document as few as possible. That is the reason why i don't want share it in public. Because if i would do it then someone would cry that will not work because he is using maybe a addon that will not work on this way - then i would start it from scratch to explain it again and again. The best example for that is you. I think i have typed this reason now more than 1 times. If you want make sure that all jquery addons should work correctly, then leave the lib file in the head-area.


Neralex: This is really wrong from you and the way u are acting is really SELFISH because this is opensource where u can always try new things even if it doesn't work. When u make a module and it doesn't work u always ask for help here to be sure it works or whatever. That is the way to learn. If this module doesn't work it will be ok. I am not gonna be worried about it. Why should I be? Now I realize I have to load jquery.js in the header because I will always have problem in the future with other addons. Can you tell me why u need to answer my post if you are not gonna help. Since you are around here less people show up because of your behaviour. Everybody learn in his own way. Maybe I don't like to read so much but practicing and testing I do it well.

If everybody is gonna act like you. Believe me. it is better to remove RavenNuke and go for any other free CMS which in my opinion has better performance but I still love this CMS and I do want to go deep into the code even if it fails and if you call my posts a CRY person then with all my respect u are IGNORANT because that is the only way to share knowledge with the community. Anyway, these days I think almost everybody are very busy and most of the people who are posting all the time is you and me.


Last edited by hicuxunicorniobestbuildpc on Thu Oct 16, 2014 1:53 am; edited 2 times in total 
neralex







PostPosted: Wed Oct 15, 2014 10:31 pm Reply with quote

You got a lot of help and call me ignorant? Just because i work with a open source cms then i don't must share all my own written codelines in public. If you don't want read so much to understand the basics, then don't do it but then do not expect that one explain it to you. Wink

I mean with basics stuff like:

- how a HTML document should be established
- what is the difference between the doctypes
- what is the difference between HTML, CSS, Javascript and PHP
- what is the difference between POST and GET

etc.


These things are important to know if you want "go deeper" in the code but without this knowledge it makes no sense to explain it for you. Every answer returns in a new basic question and this for years. The answers are really basic stuff and have nothing to do with the CMS. Why should i search everytime basic FAQs in google for you? You have the same way to do this. But if you don't want read the FAQs to understand it how it works and if you wants only examples without to read the many lines of open source code inside the CMS, then nobody can help you.

You may also like to change the CMS, if you wish. Maybe wait for someone to rotate with you again and again. It's everytime the same result in your threads and if you don't get what do you want, then you attack others. But it does not change the fact that you have to elaborate a certain part in order to understand the basics how a website or CMS works.
 
hicuxunicorniobestbuildpc







PostPosted: Thu Oct 16, 2014 2:27 pm Reply with quote

Come on! U didn't have the knowledge neither but it is funny neralex they way you act here in this forum.

Code:
Simple explanation for neralex

HTML=content structure and semantics
PHP=server-side scripting
CSS=appearance
JavaScript=behavior



I found out you're a student as well asking for help and the most funny thing is you get your answer very fast and for free.

Here u are asking for help
[ Only registered users can see links on this board! Get registered or login! ]

Someone gave u the right answer. Why do you need to act so rude here when u don't even know everything yet? Laughing

Anyway, why am I waisting my time with you?


The module is working now but not the way I would like to do it or not the way it should work with Ravennuke's idea.
[ Only registered users can see links on this board! Get registered or login! ]

Changing the subject. I don't understand how to make a module with RavenNuke's sytem using jquery. I've been having a hard time finding the way to load javascript in the bottom of the page without having 1 issue. It is impossible to make a module when u have many version of jquery's. I hope next version comes with better way to do this job. Sad
 
neralex







PostPosted: Thu Oct 16, 2014 2:41 pm Reply with quote

hicuxunicorniobestbuildpc wrote:
I don't understand how to make a module with RavenNuke's sytem using jquery. I've been having a hard time finding the way to load javascript in the bottom of the page without having 1 issue. It is impossible to make a module when u have many version of jquery's. I hope next version comes with better way to do this job. Sad


Can you remember the link "how jquery works"? You haven't understand it because this wouldn't never work and you haven't a clue why i posted this question on stackoverflow. Its a combination of 3 jquery addons in only one document. This was the middle part between two addons to let it run in a third one. You should better use stackoverflow to find your answers instead to stalk me there.

Sorry but i can't no more for laughing ROTFL
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Thu Oct 16, 2014 4:34 pm Reply with quote

are you trying to move jquery to the body just because of this module? It's not as easy as commenting out some code in jquery.php. If you search the code for jquery.js you will find it is loaded in multiple places (mostly to maintain proper load order, making sure jquery is loaded prior to any scripts that require it)

You would then need to make sure all JavaScript that requires jquery loads in the body as well (and after jquery), which is most of it. It can be done but it requires alot of hacking at the code to do it.

It will be much easier to accomplish in the next version via the new header class... which could be extended to load scripts in the body w/o too much trouble. It's not a change we've looked into at this point, simply because there is so much other work to do.
 
View user's profile Send private message Visit poster's website
hicuxunicorniobestbuildpc







PostPosted: Thu Oct 16, 2014 4:39 pm Reply with quote

I guess u were really busy. Long time no see u spasticdonkey.

Quote:
You would then need to make sure all JavaScript that requires jquery loads in the body as well (and after jquery), which is most of it. It can be done but it requires alot of hacking at the code to do it.


I started yesterday doing that and believe me. Lots of work and sometimes I get conflict with jquery. Anyway, I removed the module. However I got succeed with this one and I'm very happy with it but the other one was so painful believe me. I need to learn more how to trick this jquery.
[ Only registered users can see links on this board! Get registered or login! ]


Code:
<?php

//module made by hicux at bestbuildpc.org
/**********************************/
/*  Module Configuration          */
/* (right side on) v3.1           */
/* Remove the following line      */
/* will remove the right side     */
/**********************************/
//define('INDEX_FILE', true);
//$index = 1;
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') ? "\r\n" : "\n");
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);
$global = 'themes/' . $ThemeSel . '/content/global.css';
if (file_exists($global)) {
   define('RN_MODULE_CSS', 'global.css');
} else {

   $global = 'modules/' . $module_name . '/content/global.css';

   addCSSToHead($global, 'file');
  addCSSToHead('modules/' . $module_name . '/css/stickyplayer.css', 'file');

   addJSToBody('modules/' . $module_name . '/java/FWDStickyAudioPlayer.js', 'file');
   addJSToBody('modules/' . $module_name . '/js/player.js', 'file');
}

include_once 'header.php';
OpenTable();
echo '<div style="width:500px;" class="text-center">' , PHP_EOL
, '<button onmousedown="popup()">popup</button>' , PHP_EOL
, '<button onmousedown="player1.play()">play</button>' , PHP_EOL
, '<button onmousedown="player1.pause()">pause</button>' , PHP_EOL
, '<button onmousedown="player1.stop()">stop</button>' , PHP_EOL
, '<button onmousedown="player1.playSpecificTrack(0,2)">play track 3 from playlist 0)</button>' , PHP_EOL
, '<button onmousedown="player1.playPrev()">play prev</button>' , PHP_EOL
, '<button onmousedown="player1.playNext()">play next</button>' , PHP_EOL
, '<button onmousedown="player1.playShuffle()">play shuffle</button>' , PHP_EOL
, '<button onmousedown="player1.scrub(.5)">scrub to 50%</button>' , PHP_EOL
, '<button onmousedown="player1.setVolume(.2)">set volume to 20%</button>' , PHP_EOL
, '<button onmousedown="player1.showCategories()">show playlists</button>' , PHP_EOL
, '<button onmousedown="player1.showPlaylist()">show playlist</button>' , PHP_EOL
, '<button onmousedown="player1.hidePlaylist()">hide playlist</button>' , PHP_EOL
, '<button onmousedown="player1.share()">share</button>' , PHP_EOL
, '<button onmousedown="player1.loadPlaylist(2)">load soundcast playlist</button>' , PHP_EOL
, '<button onmousedown="player1.loadPlaylist(1)">load podcast</button>' , PHP_EOL
, '<button onmousedown="player1.loadPlaylist(3)">load XML playlist</button>' , PHP_EOL
, '<button onmousedown="player1.loadPlaylist(0)">load HTML playlist</button>' , PHP_EOL
, '<button onmousedown="player1.loadPlaylist(4)">load Official.fm playlist</button>' , PHP_EOL
, '</div>' , PHP_EOL;
echo '<div id="myDiv" style="margin:auto;">' , PHP_EOL
   , '<ul id="playlists" style="display:none;">' , PHP_EOL
   , '<li data-source="folder:mp3" data-thumbnail-path="modules/' , $module_name , '/content/thumbnails/large19.jpg">' , PHP_EOL
   , '<p class="minimalDarkCategoriesTitle"><span class="bold">Title: </span>My playlist 6</p>' , PHP_EOL
   , '<p class="minimalDarkCategoriesType"><span class="bold">Type: </span><span class="minimalDarkCategoriesTypeIn">GENERATE FROM FOLDER</span></p>' , PHP_EOL
   , '<p class="minimalDarkCategoriesDescription"><span class="bold">Description: </span>This playlist is created from a folder of mp3 files.</p>' , PHP_EOL
   , '</li>' , PHP_EOL
   , '</ul>' , PHP_EOL
   , '</div>' , PHP_EOL;


CloseTable();
include_once 'footer.php';


Note: This validationerror I am getting is because data-source is specially for working with HTML5 but it is ok because I think RavenNuke will come with HTML5. I've got lots of nice things in order to work with new RavenNuke. Thank u very much for your words.

line 242 column 1 - Warning: <li> proprietary attribute "data-source"

Quote:
It's not a change we've looked into at this point, simply because there is so much other work to do.


I wonder if you can take neralex to do some job as well so can be busy with some code. Like this he can be busy doing something efficient. Believe me it will be nice. He is a pain in the ass but sometimes he has brain.


Quote:
are you trying to move jquery to the body just because of this module?


Well, the answer is yes, neralex did it and the result is succefully. His site is loading really fast!!! I did made almost all my js and css minimized. it is a lot of work but I am willing to take the risk. I see this change in Wordpress 4.0 and Bootstrap. All javascripts are loading in the bottom of the page and almost all bootstrap sites I visited loads as quickly as Ferrari does.

I do have a question for you. Why I can not use the new version of jquery on Ravennuke? Is it possible to do that with new version of RavenNuke?

If u need someone to test new version let me know. I would like to do that for sure.
 
neralex







PostPosted: Fri Oct 17, 2014 2:53 am Reply with quote

Image

The cause of the speed of my website is not only because the jquery.js is loaded at the end of the body. I'm trying everytime to not overload my page with unneeded scripts etc. So all is reduced to the things that are really needed.


Last edited by neralex on Fri Oct 17, 2014 7:27 am; edited 2 times in total 
wHiTeHaT
Life Cycles Becoming CPU Cycles



Joined: Jul 18, 2004
Posts: 579

PostPosted: Fri Oct 17, 2014 4:06 am Reply with quote

@neralex, sometimes it is wise to just not respond.
@hicuxunicorniobestbuildpc, sometimes it is wise to just not respond.
@wHiTeHaT, sometimes it is wise to just not respond.
 
View user's profile Send private message Send e-mail
misterstereus
Regular
Regular



Joined: Aug 03, 2012
Posts: 56
Location: Rome Italy

PostPosted: Fri Oct 17, 2014 6:11 am Reply with quote

hicuxunicorniobestbuildpc I make for you a module and it work on raven and nuke have other problems?

_________________
MisterStereus from Rome Italy!! 
View user's profile Send private message Send e-mail Visit poster's website
misterstereus







PostPosted: Fri Oct 17, 2014 6:15 am Reply with quote

[ Only registered users can see links on this board! Get registered or login! ]
necessary to fix only css
 
hicuxunicorniobestbuildpc







PostPosted: Fri Oct 17, 2014 2:05 pm Reply with quote

Yes, the index.php u made is not Ravennuke standard and gave me lost of validation error and brakes everything from my theme.

Code:
<?php

//MOD BY MISTERSTEREUS 16-10-2014
if (! defined ( 'MODULE_FILE' )) {
   die ( "You can't access this file directly..." );
}
include_once ("header.php");

echo '
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
   <meta name="description" content="The audio-only mode for the Vimuse Media player">
   <meta name="author" content="CosmoCoder (Nilok Bose)">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">

   <link href=\'http://fonts.googleapis.com/css?family=Oswald|Lato|Open+Sans+Condensed:300\' rel=\'stylesheet\' type=\'text/css\'>

   <link rel="stylesheet" href="modules/HTML5_Player/css/reset.css" />
   <link rel="stylesheet" href="modules/HTML5_Player/mediaelement/mediaelementplayer.min.css" />
   <link rel="stylesheet" href="modules/HTML5_Player/css/perfect-scrollbar.min.css" />
   <link rel="stylesheet" href="modules/HTML5_Player/css/demo.css" />
   <link rel="stylesheet" href="modules/HTML5_Player/css/vimuse-dark.css" />

   <!--[if lt IE 9]>
       <script src="https://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
      <script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
   <![endif]-->


   <div class="main">
      <section>
         <h2>HTML5 Player</h2>
         <div id="player"></div>
      </section>
   </div>';

echo'   <script src="modules/HTML5_Player/mediaelement/mediaelement-and-player.min.js"></script>';
echo'   <script src="modules/HTML5_Player/js/jquery-ui-1.11.1.sortable.min.js"></script>';
echo'   <script src="modules/HTML5_Player/js/jquery.ui.touch-punch-improved.js"></script>';
echo'   <script src="modules/HTML5_Player/js/jquery.hammer-full.min.js"></script>';
echo'   <script src="modules/HTML5_Player/js/perfect-scrollbar-with-mousewheel.min.js"></script>';
echo'   <script src="modules/HTML5_Player/js/jquery.vimuse.min.js"></script>';


echo'<script>
      var $app = $(\'#player\').vimuse({
         mediaType: \'audio\',
         getID3Info: true,
         showPlaylistThumbs: true,
         enableCache: false,
         playlistURL: \'modules/HTML5_Player/demo-audio.json\',
         phpFolder: \'modules/HTML5_Player/php\'
      });
   </script>';

include_once ("footer.php");
?>


I do know it worked this one but that was not what I wanted to get. Anyway, I already removed the module because of jqyery not loading properly.
 
hicuxunicorniobestbuildpc







PostPosted: Fri Nov 07, 2014 6:14 pm Reply with quote

I just worked on this module today and the work has been done!!!
[ Only registered users can see links on this board! Get registered or login! ]

Now it is working as it should be.

Code:
<?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') ? "\r\n" : "\n");

$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/vimuse-dark.css';
if (file_exists($html5player)) {
   define('RN_MODULE_CSS', 'vimuse-light.css');
} else {

$html5player = 'modules/' . $module_name . '/css/vimuse-dark.css';

addCSSToHead($html5player, 'file');

addCSSToHead('modules/' . $module_name . '/mediaelement/mediaelementplayer.min.css', 'file');
addCSSToHead('modules/' . $module_name . '/css/perfect-scrollbar.min.css', 'file');
addCSSToHead('modules/' . $module_name . '/css/demo.css', 'file');


   if (file_exists(NUKE_INCLUDE_DIR . 'custom_files/custom-footer.php')) {
      include_once NUKE_INCLUDE_DIR . 'custom_files/custom-footer.php';
   }

   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.js', 'file');

  $JStoHeadHTML = '<script type="text/javascript">
      var $app = $(\'#player\').vimuse({
         mediaType: \'audio\',
         showPlaylistOnLoad: true,
         getID3Info: true,
         showPlaylistThumbs: true,
         autoplay: true,
         showDeleteButtons: false,
         enablePlaylistSort: true,
         shuffle: true,
         playlistProgress: true,
         showDownloadLinks: false,
         stopPlaybackOnPageHide: false,
         enableCache: false,
         scanMP3Folder: true,
         mp3Folder: \'modules/HTML5_Media_Player/media/audio\'
      });
   </script>';
   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';


If something doesn't work today. Try it tomorrow but never give up!!

Wave RavensScripts
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed Dec 17, 2014 12:31 am Reply with quote

hicuxunicorniobestbuildpc wrote:

Note: This validation error I am getting is because data-source is specially for working with HTML5 but it is ok because I think RavenNuke will come with HTML5. I've got lots of nice things in order to work with new RavenNuke. Thank u very much for your words.

Yes, the data-x attribute would be valid for documents using the html5 doctype and yes, by default, RavenCMS will be using the html5 doctype by default though you could potentially change to any doctype dynamically on a per-theme basis.
Just to remind you again, modules that work with RavenNuke will require modifications to work with RavenCMS and although we are trying to provide *some* backward compatibility, we are not providing backward compatibility where it means we have to add tons of code to do so because there are times when we have no choice but to force developers into a "new way of thinking" rather than give them the means to a certain thing because it is easier.
 
View user's profile Send private message Send e-mail
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©