Hello! I am new to php, I will hope for your prudence. There is a code:
<? if ( (($match['live']) == 1 && !empty($match['english'])) || (($match['live']) == 1 && !empty($match['russian'])) || (($match['live']) == 1 && !empty($match['polish'])) || (($match['live']) == 1 && !empty($match['bulgarian'])) || (($match['live']) == 1 && !empty($match['french'])) ){ echo '<div id="stream"> <div class="tabselect" > <div class="tab" style="width: 100%; border-radius: 0px 0px 5px 5px; position: relative; z-index: 10;"> English Stream <div class="submenu" style="width: 810px;"> <a class="tab" style="width: 100%;text-align:center; padding:0; margin:0;" '.$match['id'].' ,Bulgarian)">Bulgarian Stream</a> <a class="tab" style="width: 100%;text-align:center; padding:0; margin:0;" '.$match['id'].' ,French)">French Stream</a> <a class="tab" style="width: 100%;text-align:center; padding:0; margin:0;" '.$match['id'].' ,Russian)">German Stream</a> <a class="tab" style="width: 100%;text-align:center; padding:0; margin:0;" '.$match['id'].' ,Polish)">Polish Stream</a> </div> </div> </div>' ; }elseif ( (($match['live']) == 1 && !empty($match['english'])) || (($match['live']) == 1 && !empty($match['russian'])) || (($match['live']) == 1 && !empty($match['polish'])) || (($match['live']) == 1 && !empty($match['bulgarian'])) || (($match['live']) == 1 && !empty($match['french'])) && (!empty($match['english'])) { echo '<div id="mainstream" style="position: relative; z-index:5;"> <div class="video-container"> <iframe src="//player.twitch.tv/?channel='.$match['english'].'&autoplay=false" height="480" width="832" frameborder="0" scrolling="no" allowfullscreen="" style="display: inline-block;"></iframe> </div> <iframe frameborder="1" scrolling="no" id="chat_embed" src="//www.twitch.tv/'.$match['english'].'/chat?popout=" height="550" width="100%" style="display: inline-block; z-index:10; position: relative; float: right;"></iframe> </div> ' ;}elseif ( (($match['live']) == 1 && !empty($match['english'])) || (($match['live']) == 1 && !empty($match['russian'])) || (($match['live']) == 1 && !empty($match['polish'])) || (($match['live']) == 1 && !empty($match['bulgarian'])) || (($match['live']) == 1 && !empty($match['french'])) && (!empty($match['russian'])) { echo '<div id="mainstream" style="position: relative; z-index:5;"> <div class="video-container"> <iframe src="//player.twitch.tv/?channel='.$match['russian'].'&autoplay=false" height="480" width="832" frameborder="0" scrolling="no" allowfullscreen="" style="display: inline-block;"></iframe> </div> <iframe frameborder="1" scrolling="no" id="chat_embed" src="//www.twitch.tv/'.$match['russian'].'/chat?popout=" height="550" width="100%" style="display: inline-block; z-index:10; position: relative; float: right;"></iframe> </div> ' ;}elseif ( (($match['live']) == 1 && !empty($match['english'])) || (($match['live']) == 1 && !empty($match['russian'])) || (($match['live']) == 1 && !empty($match['polish'])) || (($match['live']) == 1 && !empty($match['bulgarian'])) || (($match['live']) == 1 && !empty($match['french'])) && (!empty($match['polish'])) { echo '<div id="mainstream" style="position: relative; z-index:5;"> <div class="video-container"> <iframe src="//player.twitch.tv/?channel='.$match['polish'].'&autoplay=false" height="480" width="832" frameborder="0" scrolling="no" allowfullscreen="" style="display: inline-block;"></iframe> </div> <iframe frameborder="1" scrolling="no" id="chat_embed" src="//www.twitch.tv/'.$match['polish'].'/chat?popout=" height="550" width="100%" style="display: inline-block; z-index:10; position: relative; float: right;"></iframe> </div> ' ;}elseif ( (($match['live']) == 1 && !empty($match['english'])) || (($match['live']) == 1 && !empty($match['russian'])) || (($match['live']) == 1 && !empty($match['polish'])) || (($match['live']) == 1 && !empty($match['bulgarian'])) || (($match['live']) == 1 && !empty($match['french'])) && (!empty($match['french'])) { echo '<div id="mainstream" style="position: relative; z-index:5;"> <div class="video-container"> <iframe src="//player.twitch.tv/?channel='.$match['french'].'&autoplay=false" height="480" width="832" frameborder="0" scrolling="no" allowfullscreen="" style="display: inline-block;"></iframe> </div> <iframe frameborder="1" scrolling="no" id="chat_embed" src="//www.twitch.tv/'.$match['french'].'/chat?popout=" height="550" width="100%" style="display: inline-block; z-index:10; position: relative; float: right;"></iframe> </div> ' ;}elseif ( (($match['live']) == 1 && !empty($match['english'])) || (($match['live']) == 1 && !empty($match['russian'])) || (($match['live']) == 1 && !empty($match['polish'])) || (($match['live']) == 1 && !empty($match['bulgarian'])) || (($match['live']) == 1 && !empty($match['french'])) && (!empty($match['bulgarian'])) { echo '<div id="mainstream" style="position: relative; z-index:5;"> <div class="video-container"> <iframe src="//player.twitch.tv/?channel='.$match['bulgarian'].'&autoplay=false" height="480" width="832" frameborder="0" scrolling="no" allowfullscreen="" style="display: inline-block;"></iframe> </div> <iframe frameborder="1" scrolling="no" id="chat_embed" src="//www.twitch.tv/'.$match['bulgarian'].'/chat?popout=" height="550" width="100%" style="display: inline-block; z-index:10; position: relative; float: right;"></iframe> </div> ' ;} '</div>'; } ?> It must be converted to the choseStream() function, which will contain the values: <?match['id']?> And <?match['english, russian, bulgarian, french etc'] type choseStream($match['id'], $match['english']) and so that when calling the onclick function, the stream is loaded, for example:
`<a class="tab" style="width: 100%;" onclick="choseStream(<?=$match['id']?>,<?=$match['english']?>)">English Stream</a> <a class="tab" style="width: 100%;" onclick="choseStream(<?=$match['id']?>,<?=$match['russian']?>)">Russian Stream</a> <a class="tab" style="width: 100%;" onclick="choseStream(<?=$match['id']?>,<?=$match['french']?>)">French Stream</a> <a class="tab" style="width: 100%;" onclick="choseStream(<?=$match['id']?>,<?=$match['bulgarian']?>)">Bulgarian Stream</a>`