PDA

View Full Version : Problem with a product


Scanu
09-07-2011, 09:09 PM
Hi i write this simple plugin
<?xml version="1.0" encoding="utf-8"?>
<product productid="Userstopicpostbit" active="1">
<title>User's topic in postbit/postbit_legacy</title>
<description>Add user's topic link in postbit or postbit legacy</description>
<version>0.0.1</version>
<url>http://tecnowii.altervista.org</url>
<versioncheckurl>
</versioncheckurl>
<dependencies>
</dependencies>
<codes>
</codes>
<templates>
</templates>
<stylevardfns>
</stylevardfns>
<stylevars>
</stylevars>
<plugins>
<plugin active="1" executionorder="5">
<title>User's topic in postbit/postbit_legacy</title>
<hookname>postbit_display_complete</hookname>
<phpcode>
$template_hook['postbit_userinfo_left'] .= '<a href="/search.php?do=finduser&amp;userid=' .$post[userid]. '">Topic di ' .$post[username]. '</a>';
</phpcode>
</plugin>
</plugins>
<phrases>
</phrases>
<options>
</options>
<helptopics>
</helptopics>
<cronentries>
</cronentries>
<faqentries>
</faqentries>
</product>
But when i go in a trhead i get various error.. So i go in admincp e search for my plugin
in the phpcode of the plugin there is
Array
and if i change Array with this work
$template_hook['postbit_userinfo_left'] .= '<a href="/search.php?do=finduser&amp;userid=' .$post[userid]. '">Topic di ' .$post[username]. '</a>';
But if i upload the product doesn't work... :(

kh99
09-07-2011, 09:29 PM
I think you need the code to be inside that CDATA thing, like:

<phpcode><![CDATA[

// your code

]]></phpcode>


You really should create a new product with the product manager, write your plugins and whatever else you want, then export the product xml rather than doing it the other way around. (Although I believe you need to have a test site in debug mode to be able to do that).

nhawk
09-07-2011, 09:30 PM
I'm surprised it even installs at all.

Here's a corrected install xml. Compare them to see where you went wrong. ;)
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="userstopicpostbit" active="1">
<title><![CDATA[User's Topic in postbit/postbit legacy]]></title>
<description><![CDATA[Add user's topic link in postbit or postbit legacy]]></description>
<version>0.0.1</version>
<url>http://tecnowii.altervista.org</url>
<versioncheckurl />
<dependencies>
</dependencies>
<codes>
</codes>
<templates>
</templates>
<stylevardfns>
</stylevardfns>
<stylevars>
</stylevars>
<plugins>
<plugin active="1" executionorder="5">
<title><![CDATA[User's topic in postbit/postbit_legacy]]></title>
<hookname>postbit_display_complete</hookname>
<phpcode><![CDATA[$template_hook['postbit_userinfo_left'] .= '<a href="/search.php?do=finduser&amp;userid=' .$post[userid]. '">Topic di ' .$post[username]. '</a>';]]></phpcode>
</plugin>
</plugins>
<phrases>
</phrases>
<options>
</options>
<helptopics>
</helptopics>
<cronentries>
</cronentries>
<faqentries>
</faqentries>
</product>

Scanu
09-07-2011, 09:56 PM
Wow really thanks i never do a product and i don't thought that CDATA was required
Really thank you so much :)

kh99
09-07-2011, 10:08 PM
i don't thought that CDATA was required

I don't think it's required, but it allows the data for a tag to have specials characters in it. That way the xml parser doesn't get confused.

Scanu
09-07-2011, 10:31 PM
thank you for the info :)

--------------- Added 1315438370 at 1315438370 ---------------

Now i'm just looking for a plugin that can delete code from a template :(