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

le="color: #000000"><?php <{$block.urlCartes}>


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

le="color: #000000"><?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
le="color: #000000"><?php $modversion['templates'][10]['file'] = 'url_carte.html'; $modversion['templates'][10]['description'] = '';

then ../templates/blocks/url_blocks_cartes.html
le="color: #000000"><?php <{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


le="color: #000000"><?php $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:

le="color: #000000"><?php <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
le="color: #000000"><?php http://127.0.0.1/site_test/modules/url/cartes/french/datas.xml

which is not good

le="color: #000000"><?php $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
le="color: #000000"><?php if (!$dom->load($fichier)) {


I try with "xoops_load"
le="color: #000000"><?php 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

le="color: #000000"><?php $racine = simplexml_load_file(''. XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/datas.xml'); $body = $racine->body;


or

//with: simplexml_load_file and asXml
le="color: #000000"><?php $racine = simplexml_load_file(''. XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/datas.xml'); $racine->asXml('datas.xml');


or

le="color: #000000"><?php $racine = simplexml_load_file(''. XOOPS_URL.'/modules/url/cartes/'.$xoopsConfig['language'].'/datas.xml'); $data = $racine->data;


I think the better:

le="color: #000000"><?php $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:

le="color: #000000"><?php //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

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits