WordPress.org

Ready to get started?Download WordPress

Forums

POST2PDF Converter
User variable not transmitted in plugin (14 posts)

  1. Sev
    Member
    Posted 2 years ago #

    Hello,

    I am using a plugin on a page that display different informations depending on the user name and role.
    I tried to add post2pdf on this page but it seems that when your plugins renders my plugin, it does not transmit the information about the user. It is certainly because the get_currentuserinfo() retrieve the name of the post2pdf instead of the name of the user who launched it.

    Do you have any idea how to solve this plugin in plugin problem ?

    Thanks
    Severin

    http://wordpress.org/extend/plugins/post2pdf-converter/

  2. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, Sev san

    That isn't be a good way, but please try following way.

    1. Eidt post2pdf-converter.php.

    Line 39
    var $get_by_http_request = 0;

    =>

    var $get_by_http_request = 1;

    2. Eidt post2pdf-converter-pdf-maker.php.

    Line 16
    var $get_by_http_request = 0;

    =>

    var $get_by_http_request = 1;

  3. Sev
    Member
    Posted 2 years ago #

    Thanks for quick reply, with this hack, it sends me back this error :
    Fatal error: Cannot use object of type WP_Error as array in /home/www/6abc2510c0c8c00b5f0092a4f7df2a81/web/wordpress/wp-content/plugins/post2pdf-converter/post2pdf-converter-pdf-maker.php on line 127

    Line 127 is this one :
    $content = preg_replace("|^.*?<!-- post2pdf-converter-begin -->(.*?)<!-- post2pdf-converter-end -->.*?$|is", "$1", $response_data['body']);

  4. Sev
    Member
    Posted 2 years ago #

    Hello Redcocker, is it complex to solve ? Or are you simply busy with other stuffs ?

  5. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, Sev san

    Sorry for not replying sooner.
    Give me a little more time.

  6. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, Sev san

    Please re-intall Development Version.

    And make a change as follows.

    1. Eidt post2pdf-converter.php.

    Line 39
    var $get_by_http_request = 0;

    =>

    var $get_by_http_request = 1;

    2. Eidt post2pdf-converter-pdf-maker.php.

    Line 16
    var $get_by_http_request = 0;

    =>

    var $get_by_http_request = 1;

  7. Sev
    Member
    Posted 2 years ago #

    First, thanks for your efforts.
    There is stil an error, I got "HTTP status code is not 200."

  8. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, Sev san

    If you can, let me know your site URL.

    Contact:http://www.near-mint.com/blog/contact

  9. Sev
    Member
    Posted 2 years ago #

    Hello redcocker,
    Unfortunately I cannot give you access due to sensible information. What I can tell you is that I am using the plugin "participants-database".
    Tell me if I could launch some tests to try to debug this.

  10. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, Sev san

    Thank you for your reply.

    Maybe, Participants Database doesn't cause this issue.

    Please check HTTP status code(200, 404 etc.) by following tool and let me know it.

    http://httpstatus.nl/

  11. Sev
    Member
    Posted 2 years ago #

    I got this message :

    Warning: mkdir() [function.mkdir]: Permission denied in /home/www/6abc2510c0c8c00b5f0092a4f7df2a81/web/wordpress/wp-content/plugins/post2pdf-converter/post2pdf-converter-pdf-maker.php on line 55
    HTTP status code is not 200.

    So I manually created the folder "tcpdf-pdf" in "wp-content" with the good permissions (as on line 55) but I still have the "HTTP status code is not 200."
    Entering it in "http://httpstatus.nl/" it only gives me status code = 500.

    I guess there is something wrong with the rights to create the temporary PDF on my folders...

  12. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, Sev san

    Thank you for your reply.

    When $get_by_http_request is set to "1", this plugin will get your content by HTTP request(NOT by database access).

    But Internal server error(status code 500) occurs in your site.

    Did you restrict access to your site/page?

  13. Sev
    Member
    Posted 2 years ago #

    Yes, my full site in under "Member Only" plugin, meaning that you have to register before entering.
    But in previous version (or at least without the $get_by_http_request is set to "1") it was possible to generate the PDF.

    I am using the user name of the connected user in other plugins that I modified, so may be I should have to do the same with your plugin ? Could you just tell me where to look at ?

  14. redcocker
    Member
    Plugin Author

    Posted 2 years ago #

    Hi, Sev san

    Yes, my full site in under "Member Only" plugin, meaning that you have to register before entering.

    Now I remember.
    This plugin can't get contents by HTTP request under access restriction.

    But in previous version (or at least without the $get_by_http_request is set to "1") it was possible to generate the PDF.

    When $get_by_http_request is set to "0", it will be possible to generate the PDF.
    But It can't get different informations depending on the user and role.
    Because this plugin gets contents from DB.

    I'm sorry, but it may be difficult to respond to your request.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic