Example #1
0
<?php

require_once 'test_include.php';
$doc = Vuzit_Document::findById($show_id);
$timestamp = time();
$sig = Vuzit_Service::getSignature("show", $doc->getId(), $timestamp);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Vuzit Show Example</title>
    <link href="http://vuzit.com/stylesheets/Vuzit-2.6.css" rel="Stylesheet" type="text/css" />
    <script src="http://vuzit.com/javascripts/Vuzit-2.6.js" type="text/javascript"></script>
    
    <script type="text/javascript">
      // Called when the page is loaded.  
      function initialize()  {
        vuzit.Base.apiKeySet("<?php 
echo Vuzit_Service::$PublicKey;
?>
"); 
        var options = {signature: '<?php 
echo rawurlencode($sig);
?>
', 
                       timestamp: '<?php 
echo $timestamp;
?>
Example #2
0
 private static function postParams($method, $params)
 {
     $params['method'] = $method;
     $params['key'] = Vuzit_Service::$PublicKey;
     $timestamp = time();
     $sig = Vuzit_Service::getSignature($method, $params['id'], $timestamp);
     $params['signature'] = $sig;
     $params['timestamp'] = sprintf("%d", $timestamp);
     $result = array();
     foreach ($params as $key => &$val) {
         if (!empty($val)) {
             if (is_array($val)) {
                 $val = implode(',', $val);
             }
             if ($key != 'upload' && substr($val, 0, 1) == "@") {
                 $val = chr(32) . $val;
             }
             $result[$key] = $val;
         }
     }
     return $result;
 }