Services_SharedBook
[ class tree: Services_SharedBook ] [ index: Services_SharedBook ] [ all elements ]

Source for file example.php

Documentation is available at example.php

  1. <?php
  2.  
  3.     require_once 'Services/SharedBook.php'
  4.  
  5.     // Please register at http://www.sharedbook.com/biz/dev/mydevaccount.html
  6.     $my_book = new Services_SharedBook('<Your API>'
  7.                               '<Your secred word>');
  8.     
  9.     try
  10.     {                          
  11.         $my_book->authLogin();
  12.         
  13.         $my_book->bmsCreateInit('Crossing the ocean'
  14.                                 'Chapters of the book'
  15.                                 'Chapters text comes here');
  16.                                 
  17.         $my_book->bmsCreatePublish();
  18.         
  19.         $my_book->bmsAddComment('JohnDoe'
  20.                                 'Nice book!'
  21.                                 'Love the book.');
  22.         
  23.         $my_book->bmsAddComment('Superman'
  24.                                 'Great pictures'
  25.                                 'Where did you buy the cam?');
  26.  
  27.         $my_book->bmsAddPhoto('photo1.jpg''Alex')
  28.         $my_book->bmsAddPhoto('photo2.jpg''Alex')
  29.         $my_book->bmsSetFrontCoverPhoto('photo3.jpg''Alex');
  30.         $my_book->bmsSetBackCoverPhoto('photo4.jpg''Alex');  
  31.         
  32.         $my_book->bmsPublish();  
  33.         $my_book->bookCreateInit();                        
  34.                               
  35.         $my_book->bookCreateSetDedication('This book is dedicated to PHP API');
  36.         $my_book->bookCreatePublish();
  37.         echo 'URL: '.$my_book->bookPreview();
  38.     }
  39.     catch (Services_SharedBook_Exception $e)
  40.     {
  41.         echo $e->getCode().' - '.$e->getMessage();
  42.     }
  43. ?>

Documentation generated on Mon, 11 Mar 2019 14:44:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.