Hello,

Problem:
I have a site with user members. I have a flash application (ammap) that fetched data through xml data files.
In user profile there are cck country fields (checkboxes). Each user checks the country that has visited.

What i want to do:
I want to change a parameter value (color of a country) in the ammap xml setting file if the user has visited or not (lets say black: visited - white:not visited).

I guess it is a two step procedure: a) Export cck field values b) update xml file

I believe a good way to start is views xml module but i am still quite lost on "how" to start...:(

I really need your help, any response is more than welcome.

ps: I am not familiar with xml (quite with php) so please be as specific as possible

Thank you all in advance,
mike

Comments

nevets’s picture

I do not know ammap so this is probably more general than you want, but hopefully it will help.

From your description, part of the xml setting file changed based on the node/profile being viewed.

So you need a path that includes a node id (nid) as an argument and returns a dynamic XML file.

It maybe possible with Views Bonus module (the one you mention is deprecated).

Not knowing the format of the settings file this is meant as a starting point.

You will want a view that takes a nid as an argument and lists the "country" field. Title should be the name expected for the XML tag. So you want to make sure this part works first.

Next add a "feed" display and chose "XML file" for the style, give the feed a path, this is what you will pass to ammap as the setting file though the path needs to include the current node/profile nid.

You will need to override the main template file for the theme (style output) you probably want to use the file name like views-bonus-export-xml--view_name--feed.tpl.php where view_name is your view name.

mike27’s picture

Thank you nevets for your reply... it is a good starting point.

Here is the xml i have for continents (same as countries).. I want to change "color="#56a347" " value if the specific continent (country) is checked

map map_file="maps/continents . swf" zoom_x="0%" zoom_y="0%" zoom="100%" tl_long="-168.49" tl_lat="83.63" br_long="190.3" br_lat="-55.58" > areas> area mc_name="africa" title="africa" color="#56a347" zoom="250%" zoom_x="-84.94%" zoom_y="-118.95%" url="[node url]"/> /areas /map

As far as i understood i will have to rewrite the whole structure of the xml...

eg:
map map_file="maps/continents.swf" zoom_x="0%" zoom_y="0%" zoom="100%" tl_long="-168.49" tl_lat="83.63" br_long="190.3" br_lat="-55.58" > areas> area mc_name="africa" title="africa" color="views bonus - page - exported value" zoom="250%" zoom_x="-84.94%" zoom_y="-118.95%" url="[node url]"/> /areas> /map>

Is it sth like this or i am at a wrong way?

For the first step that you mentioned ...
How can i define a custom color value whether the cck checkbox is checked or not?

nevets’s picture

Ok, that is the data file (not the settings file).

And using the example for the us, we have

<map map_file="maps/usa.swf" zoom="100%" zoom_x="7.8%" zoom_y="0.18%">
  <areas>
    <area mc_name="AL" title="Alabama"/>
    <area mc_name="AK" title="Alaska"/>
    ...
   <area mc_name="WI" title="Wisconsin"/>
   <area mc_name="WY" title="Wyoming"/>
</areas>
</map>

so the part for <area ... /> is the part I am guessing you want to modify based on the the users choices.

For this part you are effectively combining two data sets, one that represents all the values passed to "area", the other the users choices. To work well, you would need the users choices (the values) to reflect the values for mv_name. The fact you have url = node_url suggests you are some how already generating the area lines already.

mike27’s picture

Indeed it is data file and i have to modify part. However i did not understand what you mean in your last sentence
"The fact you have url = node_url suggests you are some how already generating the area lines already."

Can you please make it more clear?

nevets’s picture

The url="[node url]" looks specific to Drupal, I would not expect it in an ammap example, so I am wondering where it comes from.

mike27’s picture

Hello again and honestly your help is appreciated.

I have a view page that displays visited countries for each user (argument user id).

I think this is the first step.

In the second you mention to create the xml. I probably can define the structure of the xml througn theme:information but i have to define a php routine where:

When a cck field id of a country is selected will return a color value. In the opposite case it will return another color value.

To be honest i have no idea how to manipulate data in order to achieve this.

Please provide any link that handles a similar example if possible. I search for hours without finding anything similar.
Maybe i am too new in drupal..
Anyway ANY help appreciated.

Mike