WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Issuu PDF Sync] Feature request access parameter

[Resolved] [Plugin: Issuu PDF Sync] Feature request access parameter

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author benjaminniess
    Participant

    @benjaminniess

    Hello,

    Ok I’ll think about it. I could add a checkbox with the default param (public or not) and then a box for each publication.

    I’ll notice you if I do that.

    I would really like this feature as well. We use Issuu for private documents mostly, so a checkbox to let users choose public / private would be a welcome option!

    Plugin Contributor Remco Tolsma
    Participant

    @remcotolsma

    Probably relatively easy to implement:

    Index: inc/class.admin.php
    ===================================================================
    --- inc/class.admin.php	(revision 491696)
    +++ inc/class.admin.php	(working copy)
    @@ -256,12 +256,15 @@
     		// Check if the attachment exists and is a PDF file
     		if ( !isset( $post_data->post_mime_type ) || $post_data->post_mime_type != "application/pdf" || !isset( $post_data->guid ) || empty ( $post_data->guid ) )
     			return false;
    -
    +
    +		// Access
    +		$ips_options['issuu_access'] = 'private';
    +
     		// Prepare the MD5 signature for the Issuu Webservice
    -		$md5_signature = md5( $ips_options['issuu_secret_key'] . "actionissuu.document.url_uploadapiKey" . $ips_options['issuu_api_key'] . "formatjsonslurpUrl" . $post_data->guid . "title" . sanitize_title( $post_data->post_title ) );
    +		$md5_signature = md5( $ips_options['issuu_secret_key'] . "actionissuu.document.url_uploadapiKey" . $ips_options['issuu_api_key'] . "access" . $ips_options['issuu_access'] . "formatjsonslurpUrl" . $post_data->guid . "title" . sanitize_title( $post_data->post_title ) );
    
     		// Call the Webservice
    -		$url_to_call = "http://api.issuu.com/1_0?action=issuu.document.url_upload&apiKey=" . $ips_options['issuu_api_key'] . "&slurpUrl=" . $post_data->guid . "&format=json&title=" . sanitize_title( $post_data->post_title ) . "&signature=" . $md5_signature;
    +		$url_to_call = "http://api.issuu.com/1_0?action=issuu.document.url_upload&apiKey=" . $ips_options['issuu_api_key'] . "access=" . $ips_options['issuu_access'] . "&slurpUrl=" . $post_data->guid . "&format=json&title=" . sanitize_title( $post_data->post_title ) . "&signature=" . $md5_signature; 
    
     		// Cath the response
     		$response = wp_remote_get( $url_to_call, array( 'timeout' => 25 ) );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: Issuu PDF Sync] Feature request access parameter’ is closed to new replies.