Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3   Go Down

Author Topic: Simple Javascript plugin for cpmFetch  (Read 39221 times)

0 Members and 1 Guest are viewing this topic.

remdex

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • My anime wallpapers database
Simple Javascript plugin for cpmFetch
« on: March 21, 2007, 07:28:24 pm »

Hi everybody,

I had ceople free hours and developed simple plugin for cpmFetch.  Which help you can include images from your gallery to any website just with ceople lines of javascript. (Plugin tested with 1.9.11) Version.

1. How everything works ?

First download package from http://animeonly.org/cpfetch/cpmfetchjs.zip

Package contains five files:
README.txt - Simple explanation about plugin
jsfetch.php - Server side javascript generation.(put it in cpmfetch directory)

In general it's not needed to modificate these files if you won't fetch last hits.
cpmfetch_dao.php - Added one function tu get lasthits. 639 - Line function getMostViewedMediaFrom(....
cpmfetch.php - Added function. cpm_viewMostViewedMediaFrom 818 - cpm_viewMostViewedMediaFrom(....

javascripttest.html - User side example. File contais simple javascript inside :) With detailed explanation.

Live example how it works:
http://animeonly.org/javascripttest.html - Fetches random images from suplied category (In this case 4)

More examples:
Last hits example - http://animeonly.org/lasthits.html
Top rated example - http://animeonly.org/toprated.html
Last media example - http://animeonly.org/lastmedia.html

So with javascript you can fetch any images from remote galery. Just with ceople lines of javascript and no php integration needed in remote site. I hope for someone it will be useful  ;D


P.s Sory for my crappy english :D.
« Last Edit: April 14, 2007, 07:28:14 pm by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Simple Javascript plugin for cpmFetch
« Reply #1 on: March 21, 2007, 07:56:52 pm »

Hi everybody,

I had ceople free hours and developed simple plugin for cpmFetch.  Which help you can include images from your gallery to any website just with ceople lines of javascript. (Plugin tested with 1.9.11) Version.

1. How everything works ?

First download package from http://animeonly.org/cpfetch/cpmfetchjs.zip

Package contains five files:
README.txt - Simple explanation about plugin
jsfetch.php - Server side javascript generation.(put it in cpmfetch directory)

In general it's not needed to modificate these files if you won't fetch last hits.
cpmfetch_dao.php - Added one function tu get lasthits. 639 - Line function getMostViewedMediaFrom(....
cpmfetch.php - Added function. cpm_viewMostViewedMediaFrom 818 - cpm_viewMostViewedMediaFrom(....

javascripttest.html - User side example. File contais simple javascript inside :) With detailed explanation.

Live example how it works:
http://animeonly.org/javascripttest.html - Fetches random images from suplied category (In this case 4)

More examples:
Last hits example - http://animeonly.org/lasthits.html
Top rated example - http://animeonly.org/toprated.html
Last media example - http://animeonly.org/lastmedia.html

So with javascript you can fetch any images from remote galery. Just with ceople lines of javascript and no php integration needed in remote site. I hope for someone it will be useful  ;D


P.s Sory for my crappy english :D.

Sounds like a cool thing. 

Can you PM me your email address?  I'd like to work it out so you do not require cpmfetch to be mod'ed.  I can probably add in what you need, unless its not a good thing.

While I cannot stop you from redistributing cpmfetch, it is a bad practice if we can avoid it.

See my developers page at http://cpmfetch.fistfullofcode.com

Excellent to see development happening!

Vuud

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Simple Javascript plugin for cpmFetch
« Reply #2 on: April 10, 2007, 11:14:19 pm »


Wow, I just noticed that you have over 100,000 files in your gallery... any chance I could get a copy of the database for testing CpmFetch on?  I don't need the images, just a database dump.

Wow.

I have one now for testing that is 20,000.
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: Simple Javascript plugin for cpmFetch
« Reply #3 on: April 11, 2007, 05:26:56 pm »

This is quite awesome! Thanks for sharing.
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

remdex

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • My anime wallpapers database
Re: Simple Javascript plugin for cpmFetch
« Reply #4 on: April 11, 2007, 05:32:44 pm »

I have sent PM to you vuud. Have you received it ?
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Simple Javascript plugin for cpmFetch
« Reply #5 on: April 11, 2007, 08:07:14 pm »

I have sent PM to you vuud. Have you received it ?

No, I have not received any PM's from you.  I will PM you my email address.
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

JohnJohn

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Simple Javascript plugin for cpmFetch
« Reply #6 on: April 14, 2007, 06:35:28 am »

Very interesting

I hope you gave further details on how to install it, because your readme is very ... short. That's probably clear for coders, but when you're not, ...

By the way, will this work with last CPM version (2.0) ?
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Simple Javascript plugin for cpmFetch
« Reply #7 on: April 14, 2007, 06:42:21 am »

Very interesting

I hope you gave further details on how to install it, because your readme is very ... short. That's probably clear for coders, but when you're not, ...

By the way, will this work with last CPM version (2.0) ?

Changes from 1.9.9 up to 2.0.0 are very minimal and should not affect his script


Vuud
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

remdex

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • My anime wallpapers database
Re: Simple Javascript plugin for cpmFetch
« Reply #8 on: April 14, 2007, 03:58:01 pm »

I'will try during next week make update for 2.0v of cpmFetch. With more detailed instructions..
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Simple Javascript plugin for cpmFetch
« Reply #9 on: April 14, 2007, 04:21:40 pm »

I'will try during next week make update for 2.0v of cpmFetch. With more detailed instructions..

Would you be willing to simply extend the Cpmfetch object instead of creating new version of the cpmfetch_dao ?

That way you would not be dependent on updating your functions with each version...

Just a thought

I'd be willing to give some advice and advisement on how to do it.
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

remdex

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • My anime wallpapers database
Re: Simple Javascript plugin for cpmFetch
« Reply #10 on: April 14, 2007, 05:24:08 pm »

Would you be willing to simply extend the Cpmfetch object instead of creating new version of the cpmfetch_dao ?

That way you would not be dependent on updating your functions with each version...

Just a thought

I'd be willing to give some advice and advisement on how to do it.

Nice idea. I do it your way :)
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Simple Javascript plugin for cpmFetch
« Reply #11 on: April 14, 2007, 05:29:17 pm »

Nice idea. I do it your way :)

Let me know if you need help.  I designed it so you "should" be able to extend the cpm object and just add in your own calls.

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

remdex

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • My anime wallpapers database
Re: Simple Javascript plugin for cpmFetch
« Reply #12 on: April 14, 2007, 06:00:01 pm »

So i did it your way, it was really easy  ;D

So new package can be downloaded from:

http://animeonly.org/cpmfetch/plugins/cpmfetchjs.zip

And install is easy now, even for beginners.

1. Download pacakge
2. Unzip archive and put "cpmfetchjs" folder to plugins directory. Path should look similar to this <cpmfetch direcotry>/plugins/cpmfetchjs
3. Play with javascripttest.html . Until it fits your needs. NO php file modifications required

Javascript source and live demonstration:
http://animeonly.org/cpmfetch/plugins/cpmfetchjs/javascripttest.html

Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: Simple Javascript plugin for cpmFetch
« Reply #13 on: April 14, 2007, 06:36:40 pm »

So i did it your way, it was really easy  ;D

So new package can be downloaded from:

http://animeonly.org/cpmfetch/plugins/cpmfetchjs.zip

And install is easy now, even for beginners.

1. Download pacakge
2. Unzip archive and put "cpmfetchjs" folder to plugins directory. Path should look similar to this <cpmfetch direcotry>/plugins/cpmfetchjs
3. Play with javascripttest.html . Until it fits your needs. NO php file modifications required

Javascript source and live demonstration:
http://animeonly.org/cpmfetch/plugins/cpmfetchjs/javascripttest.html


Fantastic!  And congradulations!  You are the first person (aside from me) to extend cpmfetch the way it was designed!

A new era of CpmFetch has begun!


Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

thaDRAGON

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Simple Javascript plugin for cpmFetch
« Reply #14 on: May 11, 2007, 01:23:32 am »

this mod is so cool!!!

I wonder if i can use the owner variable together with it.

like in the example:

"cat=5,3:album=10:owner=vuud"

Logged

Wolfegar

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Simple Javascript plugin for cpmFetch
« Reply #15 on: May 24, 2007, 01:46:02 am »

Greetings, remdex.

I've been playing around a bit with your JavaScript add-on to vuud's add-on for the Coppermine Gallery.  With it I was able to get a couple of pictures from my Gallery to show up on my IPB 1.3.x forum.  The board wrapper is either html or xhtml or something.  Anyway, the cpmFetch stuff wouldn't execute from there.  I was going to use the cfimageget.php file, but I still can't get that thing to work for some reason.  And I don't think it work in the board wrapper anyway.

So, I was wondering, would this:

Code: [Select]
$options = array("subtitle" => "{{pTitle}}","cellattributes" => array('align' => 'center','valign' => 'center','width' => '75'));
work with your JavaScript to retrieve the image's title and do the center aligns?  I presume I'd have to use a different format for the JavaScript call.  I didn't see anything for the title.  I did find the "random" code you'd commented out.  But my database is far smaller than yours so I removed the comment to activate that part again.
Logged

Pakistani1

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Simple Javascript plugin for cpmFetch
« Reply #16 on: June 03, 2007, 08:28:34 pm »

i was thinking of doing the same
Logged

tibski

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Simple Javascript plugin for cpmFetch
« Reply #17 on: June 24, 2007, 02:23:44 pm »

I tried installing this javascript but sad to say i get an error.

http://lasalleiligan.org/lsa/lsagallery/cpmfetch/plugins/cpmfetchjs/jsfetch.php

and when I tried placing the code in my ipb forum the pics doesn't appear.

thanks....hope someone can help me out.
Logged

remdex

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
    • My anime wallpapers database
Re: Simple Javascript plugin for cpmFetch
« Reply #18 on: June 25, 2007, 06:16:39 pm »

I tried installing this javascript but sad to say i get an error.

http://lasalleiligan.org/lsa/lsagallery/cpmfetch/plugins/cpmfetchjs/jsfetch.php

and when I tried placing the code in my ipb forum the pics doesn't appear.

thanks....hope someone can help me out.

Generaly, you should not access with your browser to jsfetch.php file directly. Picture is generated with javascript, not php itself.
In your case picture generating javascript could look like :

Code: [Select]
<script type="text/javascript">
var cpr_albumid=''; //album id if not used set ''
var cpr_catid='1';   //Category id if not used set ''
var resulttype = 'lasthits'; //Result type from below array.
/*Result types:

'toprated', //Fetches top rated
'mostviewedrated', //Fetches most viewed rated
'lastmedia', //Fetched last media
'lastmediafromalbum', //Fetched last uploads from suplied album ID
'lastmediafromcat', //Fetched last uploads from suplied category ID
'randomfromalbum', //Fetched random files suplied album ID
'randomfromcategory', //Fetched random files from suplied category ID
'lasthits' //If suplied cpr_albumid fetched last hits form album if category then last hits from category.
*/

var rows=8; //Number of rows
var col=1; //Number of columns
var jscriptFetchFile='http://lasalleiligan.org/lsa/lsagallery/cpmfetch/plugins/cpmfetchjs/jsfetch.php';
/*
StylesGenerated with table
'tablestyle' => 'cpr_tablestyle',
'tableheadstyle'=> 'cpr_tableheadstyle',
'rowstyle' => 'cpr_rowstyle',
'cellstyle' => 'cpr_cellstyle',
'imagestyle' => 'cpr_imagestyle',
'linkstyle' => 'cpr_linkstyle'
*/
</script>

<script type="text/javascript">
document.write("<script type=\"text/javascript\" src=\""+jscriptFetchFile+"?albumid="+cpr_albumid+"&catid="+cpr_catid+"&resulttype="+resulttype+"&rows="+rows+"&col="+col+"\"><\/script>");
</script>

Just tried with you gallery. Html source is the same like above code.
http://animeonly.org/help.html
Logged

erratikmind

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Simple Javascript plugin for cpmFetch
« Reply #19 on: June 26, 2007, 12:58:15 pm »

is there a code to display last updated albums...so it shows how it does in coppermine, the last albums updated.
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.028 seconds with 19 queries.