Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog
December 04, 2008, 07:25:52 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Coppermine Live-Demo 1.5
For those who want to preview Coppermine before actually installing it on a real production server we have created a Live-Demo. It is just a package that provides a local webserver with a pre-configured Coppermine install rolled into one package to preview the "real" Coppermine Photo Gallery on your Windows box. The webserver is being started by only executing one single file, so you don't have to go through the troubles of setting up a webserver environment on your local PC just for evaluation purposes. The sole purpose of the live-demo is to give you an impression how the admin backend of Coppermine looks and feels. It is only meant to be used for evaluation purposes. You mustn't run it as a production system, because it has deliberately been configured in an unsecure manner to provide a newbie-proof experience in the first place.
The Live-Demo 1.5 is not the release of cpg1.5.x - it is version 1.5 of the Live-Demo that is built against cpg1.4.18
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: Scribd Document Viewer Plugin  (Read 1240 times)
0 Members and 1 Guest are viewing this topic.
Abbas Ali Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 1672


Spread the PHP Web


WWW
« on: August 13, 2008, 02:37:39 PM »

You have quite a few documents (txt, doc, pdf etc..) in your gallery? and you want to display them in a better way? If yes then this is the plugin for you.

For those of you who are not familiar with Scribd, take a look at this. This is how you can display the documents in your coppermine installation too. Here is a working demo after installing the plugin.

First you will have to register an account on Scribd and get the API key and secret phrase. You can do so from here.

After you get the API key and secret phrase install the attached plugin and your are all done.

Unfortunately cpg lacks a few plugin hooks which is needed by this plugin, So you will have to add those hooks manually i.e. you will have to add a few lines of code manually before installing the plugin.

Edit include/picmgmt.inc.php (function add_picture)
Add

Code:
    $CURRENT_PIC_DATA['pid'] = mysql_insert_id();
    CPGPluginAPI::filter('add_file_data_success',$CURRENT_PIC_DATA);

just before

Code:
    return $result;
}

Edit delete.php (function delete_picture)
Add

Code:
    $pic['pid'] = $pid;
    CPGPluginAPI::filter('before_delete_file', $pic);

just before

Code:
    $query = "DELETE FROM {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' LIMIT 1";
    $result = cpg_db_query($query);

Edit editpics.php (function process_post_data)

Add

Code:
       $pic['pid'] = $pid;
       CPGPluginAPI::filter('before_delete_file', $pic);

just before

Code:
                        $query = "DELETE FROM {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' LIMIT 1";
                        $result = cpg_db_query($query);

Thats it. After making the above changes you can install the plugin. The configure screen of plugin will ask you the Scribd API key and Secret phrase.

Supported formats are txt, doc, ppt, xls, pdf and rtf

Note:
  • The plugin requires PHP 5 and CURL
  • Only documents uploaded after installing the plugin will be converted to Sribd. All older documents will continue to be displayed in normal way.
  • All the documents you upload to your cpg installation will also be copied to scribd server.
  • After you uninstall the plugin, the copies from scribd server will not get deleted. You will have to do that manually by visiting their site.

Cheers,
Abbas

* scribd_1.0.zip (6.81 KB - downloaded 69 times.)
« Last Edit: August 13, 2008, 04:50:16 PM by Abbas Ali » Logged

--- Love is blind, wish it was mute too ---
Visit me @ www.abbasali.net
Joachim Müller
Administrator
Coppermine addict
*****
Gender: Male
Posts: 40948


aka "GauGau"


WWW
« Reply #1 on: August 13, 2008, 11:05:44 PM »

Wow, that's cool. Are you going to add the "missing" hooks to cpg1.5.x, so it can be used with that version easily?
Logged

Don't contact me over PM or email unless I asked you to. Instead: post on the proper board. All unrequested messages will be ignored!
Like my avatar? Create a free custom avatar just like mine.
Abbas Ali Topic starter
Dev Team member
Coppermine addict
****
Gender: Male
Posts: 1672


Spread the PHP Web


WWW
« Reply #2 on: August 14, 2008, 06:45:47 AM »

Yes i will. Actually i was thinking to add them in cpg14x as well. Perhaps i will create a separate thread to discuss this.
Logged

--- Love is blind, wish it was mute too ---
Visit me @ www.abbasali.net
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.149 seconds with 20 queries.