Javascript-форум (https://javascript.ru/forum/)
-   (X)HTML/CSS (https://javascript.ru/forum/xhtml-html-css/)
-   -   Вписать flash в страницу (https://javascript.ru/forum/xhtml-html-css/73028-vpisat-flash-v-stranicu.html)

3eJleHuY 15.03.2018 09:35

Вписать flash в страницу
 
Здравствуйте! Помогите плиз.

Хочу сделать чтобы игровой автомат был не на весь экран
скрин:

А вот так чтобы было
скрин:

Nexus 15.03.2018 09:50

Ознакомьтесь со страницей:
http://htmlbook.ru/css/width

3eJleHuY 15.03.2018 09:59

Цитата:

Сообщение от Nexus (Сообщение 480586)
Ознакомьтесь со страницей:
http://htmlbook.ru/css/width

((( без не помогло

Nexus 15.03.2018 10:00

3eJleHuY, как элемент вставляется на страницу (код интересует)?

3eJleHuY 15.03.2018 10:08

Цитата:

Сообщение от Nexus (Сообщение 480592)
3eJleHuY, как элемент вставляется на страницу (код интересует)?

вот пример ссылки на полно экранный слот
https://site.ru/games/novomatic/inde...game=luckylady

я так понимаю мне в файле
https://site.ru/games/novomatic/index.php

надо дописать header, footer, и боковые блоки
но шаблон в .tpl написать, а там .php

Nexus 15.03.2018 10:15

Цитата:

Сообщение от 3eJleHuY
вот пример ссылки на полно экранный слот

мой хрустальный шар не умеет предсказывать ни код страницы по примеру ссылки, ни как реализован роутинг на сервере и какие файлы подключаются.

3eJleHuY 15.03.2018 10:24

Цитата:

Сообщение от Nexus (Сообщение 480595)
мой хрустальный шар не умеет предсказывать ни код страницы по примеру ссылки, ни как реализован роутинг на сервере и какие файлы подключаются.

https://winspins.pro
вот ссылка

Nexus 15.03.2018 10:29

3eJleHuY, страница доступна только авторизованным пользователям.

3eJleHuY 15.03.2018 10:34

Цитата:

Сообщение от Nexus (Сообщение 480598)
3eJleHuY, страница доступна только авторизованным пользователям.

логин - demo
пароль - demo

Nexus 15.03.2018 10:48

3eJleHuY, (https://site.ru/games/novomatic/inde...game=luckylady) так на странице ничего нет, кроме самой игры...
На странице на скриншоте вы, вероятно, подключаете игру как iframe.
Чтобы уменьшить размеры окна можете добавить ближайшему родителю тега iframe тег "style" со значением "max-width:300px;"
Пример:
<div style="max-width:300px;">
<iframe/>
</div>

3eJleHuY 15.03.2018 10:55



мне надо сделать чтобы вот так игры запускались в шаблоне

3eJleHuY 15.03.2018 10:56

Цитата:

Сообщение от Nexus (Сообщение 480602)
3eJleHuY, (https://site.ru/games/novomatic/inde...game=luckylady) так на странице ничего нет, кроме самой игры...
На странице на скриншоте вы, вероятно, подключаете игру как iframe.
Чтобы уменьшить размеры окна можете добавить ближайшему родителю тега iframe тег "style" со значением "max-width:300px;"
Пример:
<div style="max-width:300px;">
<iframe/>
</div>


мне надо чтобы в шаблоне запускались слоты вот так

Nexus 15.03.2018 11:04

На странице игры найдите тег "object", у этого тега измените значение тега "width" на "100%".

3eJleHuY 15.03.2018 11:09

Цитата:

Сообщение от Nexus (Сообщение 480605)
На странице игры найдите тег "object", у этого тега измените значение тега "width" на "100%".

там стоит 100%

щас игры запускаються вот так в полном екране


а мне надо вот так чтобы

Nexus 15.03.2018 11:13

3eJleHuY, попробуйте обернуть "object" в "<div>".

3eJleHuY 15.03.2018 11:42

Цитата:

Сообщение от Nexus (Сообщение 480607)
3eJleHuY, попробуйте обернуть "object" в "<div>".

не дало результата

3eJleHuY 15.03.2018 11:47

Цитата:

Сообщение от Nexus (Сообщение 480607)
3eJleHuY, попробуйте обернуть "object" в "<div>".

мне надо php код шаблона закинуть чтобы автомат в шаблоне был

вот нашол какой то php код страницы главной, можешь исправить чтобы слот был как на скриншоте

и походу еще надо будет tpl писать к нему да?

<?php
if (!defined("CASINOENGINE"))
	die("Нет доступа!<script>location.href='/';</script>");

require_once ('m/M_Lotteries.php');
require_once ('m/M_Winners.php');
require_once ('m/M_Users.php');
require_once ('m/M_Tools.php');
$mLotteries = M_Lotteries::Instance();
$mWinners = M_Winners::Instance();
$mUsers = M_Users::Instance();
$mTools = M_Tools::Instance();

if (!empty($_SESSION['login']))
	$clients_query = $mUsers->GetUserInfoByLogin($_SESSION['login']);

$header_nomain_tpl = file_get_contents(TEMPLATE_DIR . "/header_nomain.tpl");
$header_nomain_tpl = str_replace("{language}", $_SESSION['language'], $header_nomain_tpl);

if (!empty($_SESSION['login'])){
	//Аватар пользователя.
$avatar_name = $mUsers->GetUserAvatarName($clients_query['id_avatar']);
$avatar_src = "/img/avatars/".$avatar_name;
	$header_nomain_tpl = str_replace("{cash_wmr}", $clients_query['cash'], $header_nomain_tpl);
	$header_nomain_tpl = str_replace("{id}", $clients_query['id'], $header_nomain_tpl);
	$header_nomain_tpl = str_replace("{avatar_src}", $avatar_src, $header_nomain_tpl);
	$header_nomain_tpl = str_replace("{cash_fun}", $clients_query['cashfun'], $header_nomain_tpl);
	$header_nomain_tpl = str_replace("{login}", $_SESSION['login'], $header_nomain_tpl);
	$header_nomain_tpl = str_replace("{cash_partnerka}",  $clients_query['cash_ref'], $header_nomain_tpl);
}

//Джекпот
$newJP = $mTools->GetJackpot(true);
$arrayJP = str_split ($newJP);
$howMuch = 6 - count($arrayJP);
for ($i =0; $i < $howMuch; $i++ ){
	array_unshift($arrayJP, '&nbsp;');
}
	
//Большие слайды.
$bigSlides = $mLotteries->GetBigSlides();									
$countBigSlides = 0;
	
//Слайд победителей.
$winners = $mWinners->GetWinners();
if(count($winners) > 1)
	array_unshift($winners, end($winners));
  
eval("?>" . $header_nomain_tpl . "<?");
?>

Nexus 15.03.2018 11:58

3eJleHuY, этот скрипт, судя по наименования переменной "header_nomain_tpl ", должен отрисовывать только шапку.
Ваш нужно редактировать представление.
Оно должно быть в папке, на которую ссылается константа "TEMPLATE_DIR".

3eJleHuY 15.03.2018 12:01

Цитата:

Сообщение от Nexus (Сообщение 480610)
3eJleHuY, этот скрипт, судя по наименования переменной "header_nomain_tpl ", должен отрисовывать только шапку.
Ваш нужно редактировать представление.
Оно должно быть в папке, на которую ссылается константа "TEMPLATE_DIR".

у меня header_nomain_tpl и footer_nomain_tpl еще есть

<?php
if (!defined("CASINOENGINE"))
	die("Нет доступа!<script>location.href='/';</script>");

require_once ('m/M_Tools.php');
$mTools = M_Tools::Instance();
$siteadress = $mTools->GetSiteAdress();

$footer_nomain_tpl = file_get_contents(TEMPLATE_DIR . "/footer_nomain.tpl");
$footer_nomain_tpl  = str_replace("{siteadress}", $siteadress, $footer_nomain_tpl);
$footer_nomain_tpl  = str_replace("{theme}", "/templates/" . $template . "/" . $_SESSION['language'], $footer_nomain_tpl);
$footer_nomain_tpl  = str_replace("{language}", $_SESSION['language'], $footer_nomain_tpl);
$footer_nomain_tpl  = str_replace("{users_online}", $_SESSION['online'], $footer_nomain_tpl);

//get template lotteries
$lottery_template = get_template($footer_nomain_tpl, "[lotteries_wrapping]", "[/lotteries_wrapping]");

//header
$head_lottery_template = get_template($lottery_template, "[lottery_wrapping_top]", "[/lottery_wrapping_top]");
$head_lottery_template = str_replace("[lottery_wrapping_top]", "", $head_lottery_template);
$head_lottery_template = str_replace("[/lottery_wrapping_top]", "", $head_lottery_template);
	
//links
$links_template = get_template ($lottery_template, "[list_navigation]", "[/list_navigation]");
$links_navigation = "";
if ($count_pages_lotteries > 1){
	for ($i = 0; $i < $count_pages_lotteries; $i++){
		if ($i == 0)
			$links_navigation .= str_replace("{special_class}", "marker_link_select", $links_template);
		else
			$links_navigation .= str_replace("{special_class}", "marker_link_empty", $links_template);
	}
}
$head_lottery_template = str_replace($links_template, $links_navigation, $head_lottery_template);
$head_lottery_template = str_replace("[list_navigation]", "", $head_lottery_template);
$head_lottery_template = str_replace("[/list_navigation]", "", $head_lottery_template);

//loteries block
$lottery_block_tempalte = get_template($lottery_template, "[lottery_block]", "[/lottery_block]");
$lottery_block_tempalte = str_replace("[lottery_block]", "", $lottery_block_tempalte);
$lottery_block_tempalte = str_replace("[/lottery_block]", "", $lottery_block_tempalte);
// Подстановка данных
$arrLotteriesModifer = $arr_lotteries;
if ($countLotteriesInBlock >= count($arr_lotteries)){
	$countEmptyBlocks = $countLotteriesInBlock - count($arr_lotteries);
}
elseif($countLotteriesInBlock == 1 || $countLotteriesInBlock == 0){
	$countEmptyBlocks = 0;
}
else{
	$countEmptyBlocks = $countLotteriesInBlock - (count($arr_lotteries)%$countLotteriesInBlock);
}
for ($i = 0; $i<$countEmptyBlocks; $i++){
	$arrLotteriesModifer [] = array ('id_lottery'=> '', 'img' => "default.jpg", "title" => "Акция отсутствует...", "short_story" => "");
}
//Наполнение акциями.
$counterDisplayNone = 0; // Счетчик для скрывания акций
$counterForLClass = 0;	// Счетчик для l_ класса
$sringLotteries = "";	// Акции для выдачи
$tLotteryblock = "";	// Временная строка
$classString = "";	// Допонительные классы
foreach ($arrLotteriesModifer as $arrLotteryModifer){
	$classString .= " l_".$counterForLClass;
	if ($counterDisplayNone >= $countLotteriesInBlock)
		$classString .= " displayNone";
	$tLotteryblock = str_replace("{adding_classes}", $classString, $lottery_block_tempalte);
	$tLotteryblock = str_replace("{lottery_img}", 'img/lotteries/small/'.$arrLotteryModifer['img'], $tLotteryblock);
	$tLotteryblock = str_replace("{lottery_title}", $arrLotteryModifer['title'], $tLotteryblock);
	$tLotteryblock = str_replace("{lottery_short_story}", $arrLotteryModifer['short_story'], $tLotteryblock);
	$tLotteryblock = str_replace("{lottery_link}", "/lottery/".$arrLotteryModifer['id_lottery'], $tLotteryblock);
	if (empty($arrLotteryModifer['id_lottery'])){
		$tLinks = get_template($tLotteryblock, "[link_to_lottery]", "[/link_to_lottery]");
		$tLotteryblock = str_replace($tLinks, "", $tLotteryblock);			
	}
	$tLotteryblock = str_replace("[link_to_lottery]", "", $tLotteryblock);
	$tLotteryblock = str_replace("[/link_to_lottery]", "", $tLotteryblock);
	
	$sringLotteries .= $tLotteryblock;
	$tLotteryblock = "";
	$classString = "";
	$counterDisplayNone++;
	if ((floor($counterDisplayNone / $countLotteriesInBlock)) == ($counterDisplayNone / $countLotteriesInBlock) && $counterDisplayNone != 0){
		$counterForLClass++;
	}
}

//footer
$bottom_lottery_template = get_template($lottery_template, "[lottery_wrapping_bottom]", "[/lottery_wrapping_bottom]");
$bottom_lottery_template = str_replace("[lottery_wrapping_bottom]", "", $bottom_lottery_template);
$bottom_lottery_template = str_replace("[/lottery_wrapping_bottom]", "", $bottom_lottery_template);
//replace data
$footer_nomain_tpl = str_replace ($lottery_template, $head_lottery_template.$sringLotteries.$bottom_lottery_template, $footer_nomain_tpl);
$footer_nomain_tpl = str_replace ("[lotteries_wrapping]", "", $footer_nomain_tpl);
$footer_nomain_tpl = str_replace ("[/lotteries_wrapping]", "", $footer_nomain_tpl);
eval("?>" . $footer_nomain_tpl . "<?");
?>

Nexus 15.03.2018 12:07

3eJleHuY,
Цитата:

Сообщение от Nexus
Ваш нужно редактировать представление.
Оно должно быть в папке, на которую ссылается константа "TEMPLATE_DIR".

Ищите файлы с расширением ".tpl".

3eJleHuY 15.03.2018 12:17

Цитата:

Сообщение от Nexus (Сообщение 480612)
3eJleHuY,
Ищите файлы с расширением ".tpl".

ничего не будет так, помоги этот код под tpl запилить

<?      
//Досутп тока скрипту
define ( 'CASINOENGINE', true );
//Запускаем сессии
session_start();
//Проверяем на вход и сессию
include_once('../../engine/core/games/game_secure.php');



  
$game = $_GET['game'];
if ($_SESSION['mode'] == 'fun') { $mode = 'demo';} else { $mode = 'real';}

  
?>
<html>
<head>

 
<title>Novomatic (Мультигаминатор) | <?=$game?></title>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" src="pages/swfobject.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" src="pages/main.js"></SCRIPT>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#333333">
<center>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="100%" height="100%" id="loader" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="/slots/slotmenu.swf?backurl=/game.php&game=<?=$game?>&min=1&user=real&cur=RUR&denoms=1|2|3|4|5|10|15|20|30|40|50|100&loadpath=/slots/" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="/slots/slotmenu.swf?backurl=/game.php&game=<?=$game?>&min=1&user=real&cur=RUR&denoms=1|2|3|4|5|10|15|20|30|40|50|100&loadpath=/slots/" quality="high" bgcolor="#333333" width="100%" height="100%" name="loader" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>

</center></body></html>

Nexus 15.03.2018 12:29

Так можно ограничить ширину области объекта.
<div style="max-width:150px;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="100%" height="100%" id="loader" align="middle" style="background:#F00">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="/slots/slotmenu.swf?backurl=/game.php&game=<?=$game?>&min=1&user=real&cur=RUR&denoms=1|2|3|4|5|10|15|20|30|40|50|100&loadpath=/slots/" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="/slots/slotmenu.swf?backurl=/game.php&game=<?=$game?>&min=1&user=real&cur=RUR&denoms=1|2|3|4|5|10|15|20|30|40|50|100&loadpath=/slots/" quality="high" bgcolor="#333333" width="100%" height="100%" name="loader" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</div>

Однако это нужно делать на странице, на которой присутствует не только игра, но и остальной интерфейс.

3eJleHuY 15.03.2018 12:56

я тебя одно прошу, а ты мне пихаешь совсем другое

мне код надо под tpl переписать который я последний кинул можешь???

3eJleHuY 15.03.2018 12:58

или хотябы это как в tpl переписать надо скажи

<?=$game?>

он в tpl не роботает

Nexus 15.03.2018 13:24

Цитата:

Сообщение от 3eJleHuY
мне код надо под tpl переписать который я последний кинул можешь???

Это выстрел в свою ногу:
<?      
//Досутп тока скрипту
define ( 'CASINOENGINE', true );
//Запускаем сессии
session_start();
//Проверяем на вход и сессию
include_once('../../engine/core/games/game_secure.php');



  
$game = $_GET['game'];
if ($_SESSION['mode'] == 'fun') { $mode = 'demo';} else { $mode = 'real';}

  
?>
<html>
<head>

 
<title>Novomatic (Мультигаминатор) | <?=$game?></title>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" src="pages/swfobject.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" src="pages/main.js"></SCRIPT>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#333333">
<center>

<div style="max-width:150px;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="100%" height="100%" id="loader" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="/slots/slotmenu.swf?backurl=/game.php&game=<?=$game?>&min=1&user=real&cur=RUR&denoms=1|2|3|4|5|10|15|20|30|40|50|100&loadpath=/slots/" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="/slots/slotmenu.swf?backurl=/game.php&game=<?=$game?>&min=1&user=real&cur=RUR&denoms=1|2|3|4|5|10|15|20|30|40|50|100&loadpath=/slots/" quality="high" bgcolor="#333333" width="100%" height="100%" name="loader" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</div>

</center></body></html>


Часовой пояс GMT +3, время: 01:16.