vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Problem with a product (https://vborg.vbsupport.ru/showthread.php?t=269845)

Scanu 09-07-2011 09:09 PM

Problem with a product
 
Hi i write this simple plugin
PHP Code:

<?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
PHP Code:

$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:

Code:

<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. ;)
Code:

<?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

Quote:

Originally Posted by Tecnowii (Post 2243190)
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 [DATE]1315438370[/DATE] at [TIME]1315438370[/TIME] ---------------

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


All times are GMT. The time now is 03:11 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01032 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete