vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Complicated redirect using frameset - Possible? (https://vborg.vbsupport.ru/showthread.php?t=253116)

sburns1992 11-03-2010 06:46 PM

Complicated redirect using frameset - Possible?
 
Hey,
I have a vBulletin forum, I also have a radio player... I have put the radio player and the forum into a frameset so that the radio doesn't stop and start everytime the page changes. The code for the index.html looks like this:
Code:

<frameset framespacing="0" border="0" frameborder="0" rows="0,*">
        <frame  id="radio" name="radio" scrolling="no" noresize target="main" src="radio/play.php" marginwidth="0" marginheight="0">
        <frame id="main" name="main" src="index.php">
        <noframes>
        <body>

        <p>This page uses frames, but your browser doesn't support them.</p>

        </body>
        </noframes>
</frameset>

With index.php being the forum & the radio/play.php being the radio player

The only problem with this is, when someone wants to link to a thread to the forum, it will load the forum without the frameset meaning the radio won't play.
If there a way, that when a link to the forum is clicked it will redirect to the index.html page and then open the clicked link in the main frame, so that the radio will then play and show the linked thread in the main frame?

I think that makes sence

Thanks,
Scott :)

sburns1992 11-05-2010 05:33 PM

Can anyone help at all?

kh99 11-05-2010 10:40 PM

Well, you could make your index.php something like this:

PHP Code:

<?php
    $page 
$_REQUEST["page"];
    if (empty(
$page))
        
$page "forums.php"// or whatever your home page is...
?>
<frameset framespacing="0" border="0" frameborder="0" rows="0,*">
    <frame id="radio" name="radio" scrolling="no" noresize target="main" src="radio/play.php" marginwidth="0" marginheight="0">
    <frame id="main" name="main" src="<?php echo $page ?>">
    <noframes>
    <body>

    <p>This page uses frames, but your browser doesn't support them.</p>

    </body>
    </noframes>
</frameset>

and then in a page you could have something like

Code:


<script type="text/javascript">
function loadframes()
{
    var page = document.location.href;
    page = page.substring(page.lastIndexOf('/') + 1, page.length) ;
    document.location.href = "index.php?page=" + encodeURI(page);
}
</script>
...
<BODY onload="if (self==top) loadframes();">

And it would load itself in to the frames. The problem is that I don't know how you'd get that in to every page, and what you'd do if a page already had an "onload" attribute.

ETA: Maybe you could have a "start radio" link or button instead of having it load automatically? That might be easier to add to every page.


All times are GMT. The time now is 05:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01062 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete