Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline jackiechou  
#1 Posted : Sunday, July 5, 2015 4:25:15 PM(UTC)
jackiechou


Rank: YAF Camper

Reputation:

Joined: 11/8/2013(UTC)
Posts: 27
Man
Viet Nam

Thanks: 4 times
Hi,
Please help me to customize CKeditor to upload and insert image for admin. I'd like to set up for ckeditor to upload image for admin right. Please tell me how to do this.

Best Regards,
Jackie
Sponsor
Offline tha_watcha  
#2 Posted : Monday, July 6, 2015 3:45:57 AM(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

Medals: Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.

Joined: 3/6/2010(UTC)
Posts: 3,736
Germany

Thanks: 70 times
Was thanked: 1149 time(s) in 979 post(s)
Well the easiest way would be to allow attachments for admins via the Access Mask Admin (enable upload).

If you want to allow uploads directly from the CKEditor, then the only way would be to use the NOT FREE CKFinder. If you want that option let me know, i have to update the guide on how to integrate CKFinder into YAF.
thanks 1 user thanked tha_watcha for this useful post.
jackiechou on 7/20/2015(UTC)
Offline jackiechou  
#3 Posted : Sunday, July 12, 2015 6:07:16 PM(UTC)
jackiechou


Rank: YAF Camper

Reputation:

Joined: 11/8/2013(UTC)
Posts: 27
Man
Viet Nam

Thanks: 4 times
Hi,
I'd like to upload directly from the CKEditor by using CKFinder. Please tell me how to integrate CKFinder into YAF.
Thanks,
Best regards,
Jackie
Offline tha_watcha  
#4 Posted : Tuesday, July 14, 2015 4:03:08 AM(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

Medals: Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.

Joined: 3/6/2010(UTC)
Posts: 3,736
Germany

Thanks: 70 times
Was thanked: 1149 time(s) in 979 post(s)
Originally Posted by: jackiechou Go to Quoted Post
Hi,
I'd like to upload directly from the CKEditor by using CKFinder. Please tell me how to integrate CKFinder into YAF.
Thanks,
Best regards,
Jackie


Updated Guide is online here...
http://yetanotherforum.n...-in-this-Forum#post53613
thanks 1 user thanked tha_watcha for this useful post.
jackiechou on 10/16/2015(UTC)
Offline tha_watcha  
#5 Posted : Thursday, July 16, 2015 1:24:48 AM(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

Medals: Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.

Joined: 3/6/2010(UTC)
Posts: 3,736
Germany

Thanks: 70 times
Was thanked: 1149 time(s) in 979 post(s)
Sorry this was posted in a closed forum, here is the Guide...

Quick CKFinder Integrate Guide

- Go to the Website of CKFinder and Download File (CKFinder for ASP.NET)
- Extract the Zip file and copy the file CKFinder.dll from the folder bin\Release to your YAF Forum Root folder
- Copy the folders core, help, lang, plugins, skins and userfiles to the YAF Forum ~\Scripts\ckeditor\ckfinder\
- Copy the files ckfinder.html, config.js, config.ascx and ckfinder.js to the YAF Forum ~\Scripts\ckeditor\ckfinder\
- Modify the ckeditor_init.js and ckeditor_initbbcode.js

change the line from...

Code:
jQuery("a[id*='_PostReply'],a[id*='_Save']").click(function () {


to...

Code:
CKEDITOR.scriptLoader.load('Scripts/ckeditor/ckfinder/ckfinder.js', function (){
			  CKFinder.setupCKEditor( null, 'Scripts/ckeditor/ckfinder/' );
		  });

jQuery("a[id*='_PostReply'],a[id*='_Save']").click(function () {



You also need to add some authentication check to the ckfinder change the CheckAuthentication Check in the file ~/Scripts/ckeditor/ckfinder/config.ascx

Add an import namespace to the header of the file

Code:
<%@ Import Namespace="YAF.Core" %>


change the CheckAuthentication from...

Code:
public override bool CheckAuthentication()
	{
		// WARNING : DO NOT simply return "true". By doing so, you are allowing
		// "anyone" to upload and list the files in your server. You must implement
		// some kind of session validation here. Even something very simple as...
		//
		//		return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
		//
		// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
		// user logs on your system.

		return false;
	}



to..

Code:
public override bool CheckAuthentication()
	{
		return !YafContext.Current.IsGuest;
	}


(You could also add check if the user is in a allowed role if you want to limit the access)

also change the line

Code:
BaseUrl = "";


to..

Code:
BaseUrl = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath + "/Scripts/ckeditor/ckfinder/";


and basedir to...

Code:
BaseDir = Server.MapPath("~/Scripts/ckeditor/ckfinder/userfiles/");
thanks 1 user thanked tha_watcha for this useful post.
jackiechou on 7/20/2015(UTC)
Offline jackiechou  
#6 Posted : Sunday, July 19, 2015 11:53:19 AM(UTC)
jackiechou


Rank: YAF Camper

Reputation:

Joined: 11/8/2013(UTC)
Posts: 27
Man
Viet Nam

Thanks: 4 times
Hi,
Thanks for your reply. I appreciate you very high for your kind to help me.
I try to folow all your steps you have intructed, but I unable to upload file to files to Scripts\ckeditor\ckfinder\userfiles
When I press "Insert Image" Browse file and choose and press button "Upload to server" but no happens here. No file is in this folder "Scripts\ckeditor\ckfinder\userfiles"
Error :
XML Parsing Error: not well-formed Location:
http://localhost:50165/Scripts/ckeditor/ckfinder/ckfinder.html?type=Images&CKEditor=forum_ctl03_YafTextEditor&CKEditorFuncNum=1&langCode=vi
Line Number 214, Column 30: if ((messageId == 0 && lastMessageId != 0) || lastMessageId < messageId)
ckfinder integration in yafnet forum

I suppose that there is a problem in settings that cfkinder is unable to find the uploading folder "Scripts\ckeditor\ckfinder\userfiles"

ckeditor_init.js - ckeditor_initbbcode.js
CKEDITOR.scriptLoader.load('Scripts/ckeditor/ckfinder/ckfinder.js', function (){
CKFinder.setupCKEditor( null, 'Scripts/ckeditor/ckfinder/' );
});

jQuery("a[id*='_PostReply'],a[id*='_Save']"Wink.click(function() {
yafCKEditor.editor.updateElement();
});

config.ascx

public override bool CheckAuthentication()
{
return !YafContext.Current.IsGuest;
}

BaseUrl = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath + "/Scripts/ckeditor/ckfinder/";

BaseDir = Server.MapPath("~/Scripts/ckeditor/ckfinder/userfiles/"Wink;


Please help me!
Best regards,
Jackie

Edited by user Monday, July 20, 2015 7:03:45 PM(UTC)  | Reason: Not specified

Offline tha_watcha  
#7 Posted : Saturday, July 25, 2015 9:09:11 AM(UTC)
tha_watcha


Rank: YAF.NET Project Lead

Reputation:

Medals: Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.

Joined: 3/6/2010(UTC)
Posts: 3,736
Germany

Thanks: 70 times
Was thanked: 1149 time(s) in 979 post(s)
This issue is caused by the url rewriter. To resolve this issue open up the UrlRewriter.config and change line from...

Code:
<if url="^((?!\.ashx|\.asmx|\.axd|\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|install|error|auth\.aspx|default\.aspx|popup\.aspx|advanced\.aspx|digest\.aspx|ftb.imagegallery\.aspx).)*$">


to

Code:
<if url="^((?!\.ashx|\.asmx|\.axd|\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|install|error|auth\.aspx|default\.aspx|popup\.aspx|advanced\.aspx|digest\.aspx|ftb.imagegallery\.aspx|ckfinder).)*$">
thanks 1 user thanked tha_watcha for this useful post.
jackiechou on 10/16/2015(UTC)
Rss Feed  Atom Feed
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error