1
cpascal
add a swf file
  • 2010/9/30 23:08

  • cpascal

  • Just popping in

  • Posts: 26

  • Since: 2010/3/20


hello

I try to add a map of France in swf format in a block
blocks in the file ../templates/blocks/url_blocks_cartes.html

<{$block.urlCartes}>


and in the file ../blocks/url_cartes.php

function b_url_cartes($options)
{
global 
$xoopsDB$xoopsModuleConfig$xoopsModule$xoopsTpl$xoopsConfig$xoopsUser;
$block = array();
$block['title'] = _MB_TITLE_CARTE;

$block['urlCartes'] =
$fichier XOOPS_URL "/modules/url/cartes/".$xoopsConfig['language']."/datas.xml";
$dom = new DOMDocument();
if (!
$dom->load($fichier)) {
   die(
redirect_header(XOOPS_URL."/modules/url/index.php",3"Impossible de charger le fichier XML du bloc cartes !"));
}
;

$block['urlCartes'] .= '
<object type="application/x-shockwave-flash" data="'
.XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/france.swf" width="385" height="400">
<param name="movie" value="'
.XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/france.swf" />
<param name="loop" value="false" />
<param name="wmode" value="#CCBF73" />
<param name="quality" value="best" />
</object>
'
;

return 
$block;

}

}


my card does not appear??
I try as hard link in the html template does not work!

because of my xml file is not loaded and the file is needed france.swf

lack there a call to a function or class of xoops?

I try directly calling html page or is my card, so I add module_version.php
$modversion['templates'][10]['file'] = 'url_carte.html';
$modversion['templates'][10]['description'] = '';

then ../templates/blocks/url_blocks_cartes.html
<{include file="db:url_carte.html"}>


nothing appears !

thank you if you can help





2
ghia
Re: add a swf file
  • 2010/10/1 7:31

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


$block['urlCartes'] = $fichier XOOPS_URL "/modules/url/cartes/".$xoopsConfig['language']."/datas.xml";
Why do you do that?
What is the result of it in your navigator with 'view HTML source'?

3
cpascal
Re: add a swf file
  • 2010/10/1 11:18

  • cpascal

  • Just popping in

  • Posts: 26

  • Since: 2010/3/20


hi ghia

thank you kindly help me.
I want to display this map of France which is in swf format
I want to display a map of franceet other countries in a swf in a block of the module, but the file datas.xml is not taken into account unless I place it at the root of which is xoops impractical.

I prefer it to be taken into account if it is placed in a folder of the module. Here is the source code:

<div class="blockTitle"><h2>Cartes</h2></div>
<
div class="blockContent">
<!-- 
bloc des cartes -->
<
script type="text/javascript" src="http://127.0.0.1/site_test/modules/url/js/swfobject.js"></script

http://127.0.0.1/site_test/modules/url/cartes/french/datas.xml

<object type="application/x-shockwave-flash" data="http://127.0.0.1/site_test/modules/url/cartes/french/france.swf" width="385" height="400">
<
param name="movie" value="http://127.0.0.1/site_test/modules/url/cartes/french/france.swf" />
<
param name="loop" value="false" />
<
param name="wmode" value="#CCBF73" />
<
param name="quality" value="best" />
</
object>


this is
http://127.0.0.1/site_test/modules/url/cartes/french/datas.xml

which is not good

$block['urlCartes'] =
$fichier XOOPS_URL "/modules/url/cartes/".$xoopsConfig['language']."/datas.xml";
$dom = new DOMDocument();
if (!
$dom->load($fichier)) {
   die(
redirect_header(XOOPS_URL."/modules/url/index.php",3"Unable to load XML file block maps !"));
}
;


I think "load" is not interpreted read
if (!$dom->load($fichier)) {


I try with "xoops_load"
if (!$dom->xoops_load($fichier)) {


I have a blank page

thank you if you have the solution






4
cpascal
Re: add a swf file
  • 2010/10/2 9:52

  • cpascal

  • Just popping in

  • Posts: 26

  • Since: 2010/3/20


hi !

I find the solution but if there's more I'm interested
in any case his works:

with: simplexml_load_file

$racine simplexml_load_file(''XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/datas.xml'); 
$body $racine->body;


or

//with: simplexml_load_file and asXml
$racine simplexml_load_file(''XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/datas.xml'); 
$racine->asXml('datas.xml');


or

$racine simplexml_load_file(''XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/datas.xml'); 
$data $racine->data;


I think the better:

$racine->asXml('datas.xml');


thank you


5
cpascal
Re: add a swf file
  • 2010/10/4 12:51

  • cpascal

  • Just popping in

  • Posts: 26

  • Since: 2010/3/20


hi

I make a correction on my test method: asXML had copied my data file to the root of my site which has distorted my other tests, so the only solution is found:

//fetches the file datas
$racine simplexml_load_file(''XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/datas.xml'); 
//copied to the root of the site
$racine->asXml('datas.xml');

Login

Who's Online

157 user(s) are online (102 user(s) are browsing Support Forums)


Members: 0


Guests: 157


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits