cowboysdude Posted August 18, 2009 Share Posted August 18, 2009 I have this php file that displays a menu and when a user clicks on it, it loads the player and plays that video... what I'm trying to get it to do now is show the menu... once a user picks a video a greybox opens with the player and shows the video... for some reason I just cannot get this figured out... Help please...below is what I have... <?php //don't allow other scripts to grab and execute our file defined('_JEXEC') or die('Direct Access to this location is not allowed.'); // Include the syndicate functions only once require_once (dirname(__FILE__).DS.'helper.php'); require_once (dirname(__FILE__).DS.'mod_flowplayv.css'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript">var GB_ROOT_DIR = "modules/mod_flowplay/greybox/";</script> <script type="text/javascript" src="modules/mod_flowplay/greybox/AJS.js"></script> <script type="text/javascript" src="modules/mod_flowplay/greybox/AJS_fx.js"></script> <script type="text/javascript" src="modules/mod_flowplay/greybox/gb_scripts.js"></script> <!-- DO NOT CHANGE THIS --> <c:if test="true"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script src="<?php echo $baseurl ?>/modules/mod_flowplay/js/flowplayer-3.0.5.min.js"></script> </c:if> <script src="<?php echo $baseurl ?>/modules/mod_flowplay/js/flowplayer.playlist-3.0.5.pack.js"></script> <script> $(function() { // setup player $f("player", "/modules/mod_flowplay/swf/flowplayer-3.1.1.swf",{ clip: {baseUrl: '<?php echo $baseurl ?>'} // playlist plugin }).playlist("#playlist"); plugins: { lighttpd: { url: "/modules/mod_flowplay/swf/flowplayer.pseudostreaming-3.1.1.swf" } } }); </script> <!-- player container --> <a id="player" class="player plain"> <img src="modules/mod_flowplay/images/logo.png" /> </a> <!-- the playlist. simple HTML controlled with CSS --> <div id="playlist"> <?php $lines = file('modules/mod_flowplay/edit/file.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach($lines as $line) { list($filename, $title, $time) = explode('-', $line); echo "<a href='$path/$filename'> $title <br />$time"; } ?> </div> <!-- let the rest of the page float normally --> <br clear="all" /> <!-- END DO NOT CHANGE THIS --> Quote Link to comment https://forums.phpfreaks.com/topic/170905-interesting-and-should-be-easy-but-help-lol/ Share on other sites More sharing options...
bubbasheeko Posted August 18, 2009 Share Posted August 18, 2009 so is the grey box not appearing or is it the menu? Where is the menu supposed to show? Quote Link to comment https://forums.phpfreaks.com/topic/170905-interesting-and-should-be-easy-but-help-lol/#findComment-901438 Share on other sites More sharing options...
cowboysdude Posted August 18, 2009 Author Share Posted August 18, 2009 so is the grey box not appearing or is it the menu? Where is the menu supposed to show? The menu appears but once clicked on it loads another page and doesn't do the popup box as it should. The menu will be the only thing showing... with perhaps a picture and description so users can click on that and open the video in greybox Quote Link to comment https://forums.phpfreaks.com/topic/170905-interesting-and-should-be-easy-but-help-lol/#findComment-901440 Share on other sites More sharing options...
oni-kun Posted August 18, 2009 Share Posted August 18, 2009 The menu appears but once clicked on it loads another page and doesn't do the popup box as it should. The menu will be the only thing showing... with perhaps a picture and description so users can click on that and open the video in greybox I don't get what you mean, How about writing it so the menu appears, and use javascript to show the video section as collapsed or 'hidden', when one clicks an item on the menu, it'll call onClick and activate the video box div with said variable.. 'onClick = "loadVid;var vid=bla;" ' Quote Link to comment https://forums.phpfreaks.com/topic/170905-interesting-and-should-be-easy-but-help-lol/#findComment-901446 Share on other sites More sharing options...
cowboysdude Posted August 19, 2009 Author Share Posted August 19, 2009 The menu appears but once clicked on it loads another page and doesn't do the popup box as it should. The menu will be the only thing showing... with perhaps a picture and description so users can click on that and open the video in greybox I don't get what you mean, How about writing it so the menu appears, and use javascript to show the video section as collapsed or 'hidden', when one clicks an item on the menu, it'll call onClick and activate the video box div with said variable.. 'onClick = "loadVid;var vid=bla;" ' Awesome idea but.. I guess I'm not getting past the "How will it know what video to load stage".. I guess I"m over thinking it is the real problem here..LOL Quote Link to comment https://forums.phpfreaks.com/topic/170905-interesting-and-should-be-easy-but-help-lol/#findComment-901479 Share on other sites More sharing options...
oni-kun Posted August 19, 2009 Share Posted August 19, 2009 Well, like this kinda? <a href="#" onclick="toggle('videobox'); SetVid('cat') ">Cat video</a> But all in all this isn't really a php problem.. If you're wanting to do it in PHP, redirect to video.php?video=cat, and you can do.. if $_GET['video'] == "cat" { echo '<embed bla video=cat.swf/>' } but it'll refresh the page, if no $_GET[''] is shown you can keep the vid box invisible.. aka not echo it. Quote Link to comment https://forums.phpfreaks.com/topic/170905-interesting-and-should-be-easy-but-help-lol/#findComment-901495 Share on other sites More sharing options...
cowboysdude Posted August 19, 2009 Author Share Posted August 19, 2009 Well, like this kinda? <a href="#" onclick="toggle('videobox'); SetVid('cat') ">Cat video</a> But all in all this isn't really a php problem.. If you're wanting to do it in PHP, redirect to video.php?video=cat, and you can do.. if $_GET['video'] == "cat" { echo '<embed bla video=cat.swf/>' } but it'll refresh the page, if no $_GET[''] is shown you can keep the vid box invisible.. aka not echo it. Well now that is getting closer... the code below is actually what I'm using because that way I can load whatever video they choose... <div id="playlist"> <?php $lines = file('modules/mod_flowplay/edit/file.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach($lines as $line) { list($filename, $title, $time) = explode('-', $line); echo "<a href='$path/$filename' rel='gb_page_center[500, 300]'> $title <br />$time"; } ?> </div> That is the playlist... I added the rel='gb_page_center[500, 300]' and got the popup to work but no video... gives me a page error in the greybox so it's not loading the player I believe... or the video or both... I can edit your suggestion to get the $filename and $title... and use $filename in place of 'cat' and $title in place of 'Cat Video'... Quote Link to comment https://forums.phpfreaks.com/topic/170905-interesting-and-should-be-easy-but-help-lol/#findComment-901497 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.