booka |
|
---|---|
Is it possible?
booka
|
Trustmaster |
|
---|---|
Why not?
May the Source be with you!
|
booka |
|
---|---|
dunno why, but it is not working...(((
where is mistake?
<?PHP
/* ====================
[BEGIN_SED_EXTPLUGIN]
Code=jQPlayer
Part=header
File=jQPlayer.header
Hooks=header.main
Tags=header.tpl:{HEADER_COMPOPUP}
Order=10
[END_SED_EXTPLUGIN]
==================== */
defined('SED_CODE') or die('Wrong URL');
$sql = sed_sql_query("SELECT * FROM `sed_jqplayer_playlist`");
while($row = sed_sql_fetcharray($sql))
$i=1;
{
$track .= "{name:\"".$row['track_artist']." - ".$row['track_song']."\",mp3:\"".$row['track_loc']."\"}";
if ($i<sed_sql_numrows($sql)) { $track .= ", "; }
$i++;
}
$out['compopup'] .= '
<script type="text/javascript" src="js/jquery.jplayer.min.js"></script>
<script>
$(document).ready(function(){
var playItem = 0;
var myPlayList = [ '.$track.' ];
// Local copy of jQuery selectors, for performance.
var jpPlayTime = $("#jplayer_play_time");
var jpTotalTime = $("#jplayer_total_time");
$("#jquery_jplayer").jPlayer({
ready: function () {
displayPlayList();
playListInit(false); // Parameter is a boolean for autoplay.
},
swfPath: "/js", nativeSupport: true, oggSupport: false,
customCssIds: false
})
.jPlayer("onProgressChange", function(loadPercent, playedPercentRelative, playedPercentAbsolute, playedTime, totalTime) {
jpPlayTime.text($.jPlayer.convertTime(playedTime));
jpTotalTime.text($.jPlayer.convertTime(totalTime));
})
.jPlayer("onSoundComplete", function() {
playListNext();
});
$("#jplayer_previous").click( function() {
playListPrev();
return false;
});
$("#jplayer_next").click( function() {
playListNext();
return false;
});
function displayPlayList() {
for (i=0; i < myPlayList.length; i++) {
$("#jplayer_playlist ul").append("<li id=\'jplayer_playlist_item_"+i+"\'>"+ myPlayList[i].name +"</li>");
$("#jplayer_playlist_item_"+i).data( "index", i ).click( function() {
var index = $(this).data("index");
if (playItem != index) {
playListChange( index );
} else {
$("#jquery_jplayer").jPlayer("play");
}
});
}
}
function playListInit(autoplay) {
if(autoplay) {
playListChange( playItem );
} else {
playListConfig( playItem );
}
}
function playListConfig( index ) {
$("#jplayer_playlist_item_"+playItem).removeClass("jplayer_playlist_current");
$("#jplayer_playlist_item_"+index).addClass("jplayer_playlist_current");
playItem = index;
$("#jquery_jplayer").jPlayer("setFile", myPlayList[playItem].mp3, myPlayList[playItem].ogg);
}
function playListChange( index ) {
playListConfig( index );
$("#jquery_jplayer").jPlayer("play");
}
function playListNext() {
var index = (playItem+1 < myPlayList.length) ? playItem+1 : 0;
playListChange( index );
}
function playListPrev() {
var index = (playItem-1 >= 0) ? playItem-1 : myPlayList.length-1;
playListChange( index );
}
});
</script>';
$out['compopup'] .= '<link rel="stylesheet" type="text/css" href="plugins/jQPlayer/jQPlayer.css" />';
?>
Добавлено 3 Минуты спустя: oooooooouuuuuuuuuuuuuuuhhhhhhhhhhhh... shit... I'm stupid lazy dumb ass...))) Found and fixed booka
|
pieter |
|
---|---|
And what was the problem?
Or the fault? ... can we help you ...
|
booka |
|
---|---|
here: )))))))))
while($row = sed_sql_fetcharray($sql)) $i=1; { $track .= "{name:\"".$row['track_artist']." - ".$row['track_song']."\",mp3:\"".$row['track_loc']."\"}"; if ($i<sed_sql_numrows($sql)) { $track .= ", "; } $i++; } think tomorrow I'll release it booka
|
Trustmaster |
|
---|---|
Note: it is recommended to use variable prefixes in plugin parts that hook into modules, to ensure that no variable conflicts occur. E.g. use $jqp_sql and $jqp_row to make sure you don't destroy $sql and $row in the outer context.
May the Source be with you!
|
booka |
|
---|---|
thanks... looks like here I didn't break anything, but I'll try to review code and add prefixes...
anyway - because I'm not very skilled coder it will be a huge field for optimization ))) booka
|
tensh |
|
---|---|
Will you publish the plugin after completion?
|
booka |
|
---|---|
yep...
Firstly I need to solve question with scroll... Don't know why but I can't change default scroll with custom by jQuery. And decide how I will sync playlist for cases when file is removed from PFS... booka
|
musiconly |
|
---|---|
I have one plugin with header.main hook and I was wondering if you have problems with system messages because of that hook?
For example, the output of the plugin is shown AFTER the system message like "You're not allowed to do that! Redirecting... (and then output of the plugin that is using that header.main hook). Live example is on my website, http://www.gitare.info It's about that scrolling marquee. Try visiting this link http://www.gitare.info/forums.php?m=topics&s=88 as non-registered user, and you'll see how big my error message gets Any ideas? |
booka |
|
---|---|
Zabranjeno neregistriranim korisnicima. ??? Looks like it is your scroll text, right? May be you should check variables for concatenation with some system vars? booka
|
musiconly |
|
---|---|
you were right! Body of message and body of my scroll text had same var name fixed that and now it's working like a charm thanks!
|