PDA

View Full Version : making an xml for the first time


Michael.A
09-28-2009, 03:07 PM
i want to overwrite a Template in postbit_legacy using an xml?

exp:-
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</div>

to

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] </div>
</div>

how can i do that?

thanks.

Lynne
09-28-2009, 03:46 PM
It looks like all you did is remove the skypeicon from the template? Why don't you just edit it to remove it or in the plugin set $post[skypeicon]='' so it won't get printed?

Michael.A
09-28-2009, 03:50 PM
see am making a mod thats why i need to know how to make a xml i only used this as an exp:-
please help if you can...

James Birkett
09-28-2009, 03:55 PM
The XML is made automatically when you export your product I believe?

Michael.A
09-28-2009, 04:01 PM
yes sir but am trying to make it overwrite part in postbit_legacy who ever helps me i well give him or her credit on the mod i made for helping make it in a xml....

James Birkett
09-28-2009, 04:13 PM
A plugin maybe?

str_replace("<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div></div>","<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] </div></div>","<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div></div>");


I'm not 100% sure if it would work - however, it can't hurt to try.


You'd probably want the "parse_template" hook.

Michael.A
09-28-2009, 04:21 PM
so this is the code to use
str_replace("");

--------------- Added 1254158851 at 1254158851 ---------------

is this right?
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="mad first xml" active="1">
<title>mad first xml</title>
<description>mad first xml</description>
<version>0.0.0</version>
<url />
<versioncheckurl />
<dependencies>
</dependencies>
<codes>
</codes>
<templates>
</templates>
<plugin active="1" executionorder="5">
<title>Postbit</title>
<hookname>postbit_display_complete</hookname>
code here


</plugin>

see i know this is not right buc its a plugin and am trying to overwrite Template?

James Birkett
09-28-2009, 04:36 PM
You'd need to edit it in the template - not the postbit.
Try using the parse_templates hook.

Michael.A
09-28-2009, 04:54 PM
how about now?

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="mad first xml" active="1">
<title>mad first xml</title>
<description>mad first xml</description>
<version>0.0.0</version>
<url />
<versioncheckurl />
<dependencies>
</dependencies>
<codes>
</codes>
<templates>
</templates>
<phpcode active="1" executionorder="5">
<title>template</title>
<hookname>parse_templates</hookname>
code here


</phpcode>
is there any tut for this on .org?

James Birkett
09-28-2009, 04:58 PM
I thought any plugin code had to be wrapped in <phpcode></phpcode>?

It should work (providing the hook is parse_templates and not parse_template).

Lynne
09-28-2009, 05:49 PM
You don't write the xml file yourself. You first create a product... then you create plugins that belong in the product... then you export the product and it creates the xml file. This is covered in the manual - Creating a Product (http://www.vbulletin.com/docs/html/creating_a_product)

Michael.A
09-29-2009, 03:55 AM
omg thank you yo got the credit Lynne...

this well be my last nooby question.