Forum Replies Created

Viewing 15 replies - 151 through 165 (of 180 total)
  • Thread Starter claudio

    (@calberti)

    Hi Chouby,
    I’ve almost got it. Now I understand what’s happening.
    In class-wp.php I have this function

    function main($query_args = ”) {
    $this->init();
    $this->parse_request($query_args);
    $this->send_headers();
    $this->query_posts();
    $this->handle_404();
    $this->register_globals();
    do_action_ref_array(‘wp’, array(&$this));
    }

    What happens is that the other plugin is called within “parse_request” (dont ask me why, probably some pages may receive query string params), while polylang is executed within “do_action_ref_array”.
    I found that if I add to the Polylang_Core constructor this line

    add_action( ‘parse_request’, array( &$this, ‘load_textdomains’ ), 1 );

    the plugin translation works. On the other hand this breaks the login logic (login page is blank) and when the user is not authenticated the language is stuck to the one set in the cookie.
    It seems that this line breaks the user authentication model…

    Do you have an idea on how force polylang to be executed during parse_request cleanly?
    thanks!
    Claudio

    Thread Starter claudio

    (@calberti)

    Thanks Chouby, I can I make sure that load_plugin_textdomain is called only after plugins_loaded has fired?
    With something like this?

    add_action( ‘plugins_loaded’, ‘plugin_localization’ );

    and then call load_plugin_textdomain in plugin_localization()?

    I tried to do so but didnt work….
    thanks
    Claudio

    Thread Starter claudio

    (@calberti)

    The plugin is Groupbuyingsite. it is a premium plugin
    http://groupbuyingsite.com/

    it is supposed to be internationalized. All strings are translated using calls to __(). I have both .po and .mo files, but I have the feeling that the locale does not switch from EN to FR.
    load_plugin_textdomain is called but I don’t understand why it might not switch locale.
    Where should I look to understand what’s actually preventing the plugin from switching locale?
    thanks!

    Thread Starter claudio

    (@calberti)

    Hello, what I meant was that I wanted to translate eveything except the custom post content (i.e. having a single custom post for both languages).
    I solved my issue differently. I created two posts and localized the theme.
    thanks anyway

    Hello Anes,
    yes this is a possible solution, or you can just extend the existing WPBI code base so as to be able to serve the deta via web service calls. You don’t necessarily need to develop a separate WP plugin, but simply add a file that receives parameters in the query string (query ID typically) executes the query and sends back the results as a JSON string.
    I hope this helps.

    What you would need in this case is a Web Service interface to be integrated with the plugin code that calls the internal API to retrieve the data and make them available via Web Service.
    The data are retrieved as JSON son creating a web service to serve them should be quite easy.
    For the moment the plugin does not implement such interface.

    Forum: Hacks
    In reply to: How to copy post into page
    Thread Starter claudio

    (@calberti)

    OK I see what you mean, I try to better explain what I’m trying to achieve.
    I have a post that is automatically created by a plugin. For simplicity let’s say it’s a product of an e-commerce site.
    Now I want to embed the product description into a page where the theme elements are in another language. The plugin+theme do not work well with most ML plugins. I found one which works OK but needs to associate the translated post to the original one. I.e. I have to provide the post ID of the english version when I create the french version.
    If I create 2 independent posts these will be 2 separate products for the e-commerce plugin, while I need to have a single product with 2 translations.
    Now, I have 1 post which is the english version of the product; then I have a page (or post) where I’m trying to copy the entire english version of the product without creating a new product with the e-commerce plugin. In this way I will still show the english description of the product but within a french theme.
    I understand it may look complicated, I’ll try anyway your suggestion.
    thanks!

    Forum: Hacks
    In reply to: How to copy post into page
    Thread Starter claudio

    (@calberti)

    Thank you for the reply. If I understand correctly, wp_insert_post() will insert a copy of the original post in the DB, but this will be a separate new post.
    What I need is only to render the post in the concerned page without creating a copy. I’m just interested in creating an “alias” and not a real duplicate post.
    thanks!

    Hi Mercedes,
    yes that was me! Thanks for answering promptly!
    Kind regards,
    Claudio

    Hi Mark,
    I’m glad that you were able to fix the issue and can use the plugin. Enjoy!
    kind regards,
    Claudio

    PS
    when you have time, would you mind rating the plugin on the WP plugin portal? thanks!

    Hello,
    we already had some issues with themes already defining a function called register_button. This is a conflict with your theme. We’re currently preparing version 1.0.5 that fixes this issue.
    If you want to test the plugin you have to switch to another theme.
    Sorry about that,
    regards,
    Claudio

    Hi Mark sorry for the late reply.
    Were you able to fix the issue? If the ID is correct, the chart should display OK unless you have some javascript issues.
    Do you have any error message in the Javascript console?
    cheers,
    Claudio

    Hi Mark,
    concerning your first post yes and no. The columns order is not important. You decide which column contains the labels and which one contains the values. For some charts types you may need several columns with values.

    Concerning the second issue it seems that your query returns no data because in the generated JS I find:

    nvd3Data_ph_Finish = ;

    There is no data retrieved from the DB. Have you tested the query and the chart in the admin dashboard?

    regards,
    Claudio

    Hello,
    actually the logic is a bit different. You should get a result of this type:
    One column for “outcome” with values: KO, Submission, Decision, Draw
    and another column “total” with values: 301, 277, 423, 3.
    Then you should select the “outcome” column as “label” and the “total” column as “value”.
    When testing the query in the query submenu you should get a 2 columns table
    I hope this helps.

    Hi,
    yes actually the type should be =”chart” (to distinguish from table)
    then it should work.
    look here:

    http://www.wpbusinessintelligence.com/wp-content/uploads/assets/screenshot-5.png

    cheers,
    Claudio

Viewing 15 replies - 151 through 165 (of 180 total)