We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28667
    • 1 Posts
    based on zviewer

    <?php
    
    /***************************************************************
    * modxpdf
    * setup:
    *	download zviewer from
    *	http://wordpress.org/extend/plugins/wordpresspdf/
    *	view instructions and demo, if needed
    *	copy contents of wordpresspdf to assets/snippets/modxpdf
    *	or any folder you want (don't forget to change $playerbase)
    *
    * usage: 
    * default:
    * [[modxpdf]]
    *	embeds swf with current document id from default location
    * [[modxpdf? &filename=`filename.swf`]]
    *	embeds swf by filename
    * [[modxpdf? &docid=`id`]]
    *	embeds swf with provided document id from default location
    **************************************************************/
    
    $playerbase='assets/snippets/modxpdf/zviewer';
    $playerf=$playerbase."/zviewer.swf";
    
    if (!$width || !$height){
    	$width='100%'; // full container width
    	$height='600';
    }
    
    if ($docid) {
        $doc_url='assets/flash/'.$docid.'.swf';
    }elseif ($filename) {
        $doc_url=$filename;
    	$docid=$filename;
    }else {
        $docid = $modx->documentIdentifier;
        $doc_url='assets/flash/'.$docid.'.swf';
    }
    $zviewer_id=$docid;
    if (!file_exists($doc_url)) {
        return;
    }
    
    $zviewer_id = 'wp_pdf_zviewer_' . $zviewer_id;
    
    $output.="<script type='text/javascript' src='".$playerbase."/swfobject/swfobject.js'></script>
    <script type='text/javascript'>
    var flashvars = {
    	doc_url: '".$doc_url."'
    };
    var params = {
    	menu: 'false',
    	bgcolor: '#efefef',
    	allowFullScreen: 'true'
    };
    var attributes = {
    	id: '".$zviewer_id."'
    };
    
    swfobject.embedSWF('".$playerf."?r=11', '".$zviewer_id."', '".$width."', '".$height."', '9.0.45','swfobject/expressinstall.swf', flashvars, params, attributes);
    </script>
    
    <div id='".$zviewer_id."'>
    	<p align='center' class='style1'>In order to view this page you need Flash Player 9+ support!</p>
    	<p align='center'>
    	<a href='http://www.adobe.com/go/getflashplayer'>
    	<img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>
    	</p>
    </div>";
    
    //	wpZviewer end
    
    return  $output;
    
    
    ?>
    
      • 11681
      • 98 Posts
      Interesting idea!

      What is the licensing effect of combining MODx and Wordpress intellectual property in a derivative work, in particular a Web site I’m developing for a non-profit organization?
        I looked just like that in 1964.
        • 16702 ☆ A M B ☆
        • 536 Posts
        Quote from: halfnium at Apr 09, 2010, 11:46 PM

        Interesting idea!

        What is the licensing effect of combining MODx and Wordpress intellectual property in a derivative work, in particular a Web site I’m developing for a non-profit organization?

        GNU rolleyes
          palma non sine pulvere
          • 16702 ☆ A M B ☆
          • 536 Posts
          something in addition:

          http://www.swftools.org/download.html

          first we need to convert PDF to SWF this tools is absolute FREE smiley
            palma non sine pulvere