beanymanuk Posted July 9, 2012 Share Posted July 9, 2012 Hi I'm using CKfinder and I'm trying to get the file thumbnail url rather than the fileurl does anyone know how exactly to pull this through. function BrowseServer() { // You can use the "CKFinder" class to render CKFinder in a page: var finder = new CKFinder(); finder.basePath = '../'; // The path for the installation of CKFinder (default = "/ckfinder/"). finder.selectActionFunction = SetFileField; finder.popup(); //StartupPath = 'Images:/images/'; // It can also be done in a single line, calling the "static" // popup( basePath, width, height, selectFunction ) function: // CKFinder.popup( '../', null, null, SetFileField ) ; // // The "popup" function can also accept an object as the only argument. // CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ; } // This is a sample function which is called when a file is selected in CKFinder. function SetFileField( fileUrl ) { document.getElementById( 'imagethumb' ).value = fileUrl; document.getElementById('imagedisplay').src = fileUrl; } Link to comment https://forums.phpfreaks.com/topic/265427-ckfinder-thumbnail/ Share on other sites More sharing options...
beanymanuk Posted July 10, 2012 Author Share Posted July 10, 2012 I have found this function but I cant get it working http://docs.cksource.com/CKFinder_2.x/SelectFunction function ShowFileInfo( fileUrl, data ) { alert( 'The selected file URL is "' + fileUrl + '"' ) ; var formatDate = function( date ) { return date.substr(0,4) + "-" + date.substr(4,2) + "-" + date.substr(6,2) + " " + date.substr(8,2) + ":" + date.substr(10,2) ; } alert( 'The selected file URL is: "' + data['fileUrl'] + '"' ) ; alert( 'The size of selected file is: "' + data['fileSize'] + 'KB"' ) ; alert( 'The selected file was last modifed on: "' + formatDate( data['fileDate'] ) + '"' ) ; alert( 'The data passed to the function is: "' + data['selectFunctionData'] + '"' ) ; } function BrowseServer() { // You can use the "CKFinder" class to render CKFinder in a page: var finder = new CKFinder(); finder.basePath = '../'; // The path for the installation of CKFinder (default = "/ckfinder/"). finder.selectActionFunction = SetFileField; //added line finder.SelectThumbnailFunction = ShowFileInfo; finder.popup(); //StartupPath = 'Images:/images/'; } Link to comment https://forums.phpfreaks.com/topic/265427-ckfinder-thumbnail/#findComment-1360475 Share on other sites More sharing options...
Adam Posted July 10, 2012 Share Posted July 10, 2012 I think it would make a lot more sense to post this on the CKSource forums. Link to comment https://forums.phpfreaks.com/topic/265427-ckfinder-thumbnail/#findComment-1360478 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.