'100%' ,'height' => '600' ,'page' => '1' ,'view' => 'scroll' # scroll will actually be assigned 'list'; )); SDV($ScribdROEenabled, true); #### ROEPatterns - SCRIBD EMBED CONVERSION if ($ScribdROEenabled) { # *** Scribd-EMBED-CODE-ROE: NEW UNIVERSAL VERSION - AUGUST 2010 *** # Converts pasted Scribd embed code into valid pmwiki (:Scribd:) code $ROEPatterns['!!ie'] = "ScribdROE(PSS('$0'))"; function ScribdROE($pattern) { global $ScribdDefaultParams; # get id & key, height & width preg_match("#height=\"([^\"]+)\" width=\"([^\"]+)\".*document_id=(\d+)&.*key-([^&\"]+)[&\"]#", $pattern, $matches); $height = $matches[1]; $width = $matches[2]; $id = $matches[3]; $key = $matches[4]; # page preg_match("#page=(\d+)[&\"]#", $pattern, $matches); $page = $matches[1]; # viewMode preg_match("#viewMode=([^&\"]+)[&\"]#", $pattern, $matches); $viewMode = $matches[1]; # output $out = "(:Scribd id=$id key=$key view=$viewMode page=$page height=$height width=$width:)"; return $out; } } ########### ######## # *** SCRIBD VIEWER FUNCTION *** function ShowScribd($args) { global $ScribdDefaultParams, $ScribdOverrideUserParams; # gather up args $args = ParseArgs($args); # gather id and key (both necessary) if($args['id']) $id = $args['id']; else return "Scribd error: no 'id' provided"; if($args['key']) $key = $args['key']; else return "Scribd error: no 'key' provided"; if($args['doc']) $doc = $args['doc']; # doc doesn't seem to be necessary # add default parameters before parsing arguments $args = array_merge($ScribdDefaultParams, $args); # uses ScribdDefaultParams, unless supplied by user $width = $args['width']; $height = $args['height']; $page = $args['page']; $custom_logo_image_url = $args['custom_logo_image_url']; # load your own logo at the top $viewMode = $args['view']; # view options: scroll, book, slideshow, tiled if($viewMode=="scroll") $viewMode = 'list'; # the 'scroll' option actually requires &viewMode=list elseif($viewMode=="tiled") $viewMode = 'tile'; # the 'tiled' option actually requires &viewMode=tile # the 2 other options (book & slideshow) are fine as-is # Output $out = ' '; return Keep($out); }