CKeditor & KCFinder in localhost - windows

I am a building a website locally and I am using CKeditor with KCFinder at a part of it. CKEditor runs properly and KCFinder Upload Tab is also visible, so I guess my installation was correct.
BUT! When I try to upload an image using the KCFinder module ("Browse" then "Send to server") I get an error message showing in the same popped-up window saying:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
03/01/12 14:31:05
Apache/2.2.21 (Win32) PHP/5.3.8
I have Windows 7, running it in localhost with Easy PHP and the local path to my target folder is:
C:\PROGRA~2\EASYPH~2.1\www\electro\kcfinder\upload
In my kcfinder/config.php I have:
'uploadURL' => "/upload",
'uploadURL' => "../upload",
'uploadDir' => "",
'uploadDir' => "C:\PROGRA~2\EASYPH~2.1\www\electro\kcfinder\upload",
as instructed by the official related thread here.
Anyone has any idea what might be wrong?
EDIT:
Solved it. Needed to change the paths on both KCFinder/config.php AND CKEditor/config.js. Since my paths are:
The project path:
C:\PROGRA~2\EASYPH~2.1\www\electro
and it has the subfolders "ckeditor" and "kcfinder" and I want to have the folder "kcfinder/upload" as the target folder of the filed to be uploaded, then the following changes need to made...
ckeditor/config.js:
CKEDITOR.editorConfig = function(config) {
config.filebrowserBrowseUrl = '../electro/kcfinder/browse.php?type=files';
config.filebrowserImageBrowseUrl = '../electro/kcfinder/browse.php?type=images';
config.filebrowserFlashBrowseUrl = '../electro/kcfinder/browse.php?type=flash';
config.filebrowserUploadUrl = '../electro/kcfinder/upload.php?type=files';
config.filebrowserImageUploadUrl = '../electro/kcfinder/upload.php?type=images';
config.filebrowserFlashUploadUrl = '../electro/kcfinder/upload.php?type=flash';
};
kcfinder/config.php:
'uploadURL' => "upload",
'uploadDir' => "",
For some reason it needed the ../ while it was already in the same folder. I don't understand why, but it works.
Now, I would like to say how displeased I am at the developer of the KCFinder where people with the same issue or others on its support forum the given "help" was things like "RTFM", "Do better searches" etc. As if everyone was born an experienced programmer.

I actually found the answer shortly after I posted my answer. It seems that the path system on ckeditor/config.js doesn't really work as a normal path usually works. so, you have to play around with the "../" and try to find out where it is aiming at. In my case, I didn't need any "../" to refer to a file that was in a separated folder one level up. So the final code for me was:
CKEDITOR.editorConfig = function(config) {
config.filebrowserBrowseUrl = 'kcfinder/browse.php?type=files';
config.filebrowserImageBrowseUrl = 'kcfinder/browse.php?type=images';
config.filebrowserFlashBrowseUrl = 'kcfinder/browse.php?type=flash';
config.filebrowserUploadUrl = 'kcfinder/upload.php?type=files';
config.filebrowserImageUploadUrl = 'kcfinder/upload.php?type=images';
config.filebrowserFlashUploadUrl = 'kcfinder/upload.php?type=flash';
};
when actually should be '../kcfinder/browse.php?type=files'
Hope it helps...

Related

Deprecated: mysql_connect() message and Warnings occur in step 3 of the opencart configuration setup after we enter the details and hit continue

We need help trying to upload our opencart templatemonster.com template correctly on godaddy but we are not clear on how to do that.
FYI our public_html/system/database folder contains a mysqli.php file as well.
We made sure to upload the template via fullpackage (The name of the file is themeXXX(full).zip, where XXX is your theme number) to the public_html folder.
Extracted the zip files in the public_html folder.
Performed the installation using the installation manager .
At step 3 configuration we were prompted to input our database access details and made sure the database was empty. (GoDaddy told us to use the localhost)
After hitting continue:
The deprecated: mysql_connect() message and Warnings occur in step 3 of the opencart configuration setup after we enter the details and hit continue.
Where ‘store’ is the new directory name. Where ‘user’ is your server
account address. Where ‘yourdomainname.co.uk’ is the web domain of
your new website:
(DUMMY LINK FOR DEMONSTRATION PURPOSES) http://www.yourdomainname.co.uk/install/index.php?route=step_3
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/user /public_html/system/database/mysql.php on line 6
Lines 5-16:
public function __construct($hostname, $username, $password, $database) {
if (!$this->link = mysql_connect($hostname, $username, $password)) {
trigger_error('Error: Could not make a database link using ' . $username . '#' . $hostname);
}
if (!mysql_select_db($database, $this->link)) {
trigger_error('Error: Could not connect to database ' . $database);
}
Errors:
Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/system/database/mysql.php:6) in /home/user/public_html/system/engine/controller.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/system/database/mysql.php:6) in /home/user/public_html/system/engine/controller.php on line 29
Lines 27-31
protected function redirect($url, $status = 302) {
header('Status: ' . $status);
header('Location: ' . str_replace(array('&', "\n", "\r"), array('&', '', ''), $url));
exit();
}
Template Features
OpenCart Compatibility: 1.5.6.x
OpenCart Engine: 1.5.6.4
(Trimmed)
Sources Available
PSD PNG PHP TPL JS
Hosting Requirements
Web Server (preferably Apache)
PHP (at least 5.2)
MySQL
Curl
Fsock
OpenCart Templates Help Center
Software Required
Adobe Photoshop CS+
For uncompressing a template ZIP package: WinZip 9+ (Windows);
Stuffit Expander 10+ (Mac)
Apache Server
PHP v. 5 or higher
MySQL 4.1.14 or later
OpenCart 1.5.6.4
Sublime Text2 or later, Notepad++ or any php-editor
A commenter stated
mysql_ calls will work on this server but are causing deprecation
notices. A quick fix would be to turn off warnings in your php.ini
file, in your error_reporting value. Or you could try turning off
display errors, set display_errors to 0.
I like the comment but could someone provide a slightly more comprehensive explanation or visual resource to this suggestion? Such as articulating a little further how to proceed? Should I download the file through GoDaddys public FTP or should I use FileZilla FTP client (does it matter), make a copy, make the proper changes then re-upload?
I like the possible solution but I am curious to know if these are the only ones.
UPDATE
I just changed display_errors = 1; to display_errors = 0;
saved the file (I edited the file withing GoDaddy's text editor)
re-input our database access details
hit continue on step 3 configuration and got the same error.
php.ini
magic_quotes_gpc = Off;
register_globals = Off;
default_charset = UTF-8;
memory_limit = 64M;
max_execution_time = 36000;
upload_max_filesize = 999M;
safe_mode = Off;
mysql.connect_timeout = 20;
session.use_only_cookies = On;
session.use_trans_sid = Off;
session.cookie_httponly = On;
session.gc_maxlifetime = 172800;
allow_url_fopen = on;
;display_errors = 0;
;error_reporting = E_ALL;
???
I have a similar experience! You don't need to enable these extensions the PHP Version needs to be update:
Sign into GoDaddy
Go to My Products under your sign in name at the top right.
Go to Web Hosting and click the Manage button.
Click manage again.
Scroll to the Software header and click "Select PHP Version"
Then change to an earlier version, in which this extension is not deprecated.
Let me know how that works for you.

Compass sprite path causing error

I've tried many responses already, but for some reason I can't get this to work. The error is:
No files were found in the load path matching "sprites/*.png"
My config.rb code:
relative_assets = true
cache=false
Encoding.default_external = "utf-8"
#########
# 1. Set this to the root of your project when deployed:
http_path = "/"
http_generated_images_path = "../images";
# 2. probably don't need to touch these
css_dir = "../css"
sass_dir = "./"
images_dir = "../images"
images_path = "../images"
javascripts_dir = "../js"
environment = :development
line_comments = true
My folder structure:
css
images
- sprites
scss (config.rb located in scss folder)
- partials
- - _mixins.scss (the file where the error is occuring)
And in mixins:
#import "sprites/*.png";
Any ideas what's wrong with the paths?
Thanks for any help.
First question is: do you actually have any files in your sprites folder? If yes, try adding this setting:
generated_images_path = "../images"
http_generated_images_path will be used to define what is the final path for the generated image, in the final (compiled) css, so maybe the setting above (without http_) is the one you need. My project structure is different but it works fine for me, I have more settings pointing to the same path though, this is what I have:
images_dir = "/assets/img"
generated_images_path = "assets/img"
http_images_dir = "assets/img"
http_images_path = "assets/img"
If just the first one doesn't solve the problem for you, try maybe adding all these?
Worst case change your project structure so you don't have to go up one level to get the folder (not saying that this is the problem as it shouldn't be but well, testing is the best way to find out)
I tried various options here. In the end I updated to Ruby 2.1.5 and turned off the Compass "save on build" plugin for Sublime, which seems to have fixed it. Not a perfect solution, but it works for now!

Is there a way to define the local profile in the config for Protractor?

I have Jasmine-Reporters set up in my config files and working great for me, locally:
require('C:/Users/**<me>**/AppData/Roaming/npm/node_modules/jasmine-node/node_modules/jasmine-reporters')
var outputPath = "C:/Users/**<me>**/<myPath>/"
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(outputPath, true, true));
},
What I'd like to do now is to somehow make the path declarations dynamic so that my tests can be shared and run on someone else's machine. I've tried just replacing my local profile with %USERPROFILE% but that didn't work. Any hints as to how to do this?
I think I have this figured out. What I ended up doing was to create a separate 'prop.js' file that just had this one line in it:
exports.username = "<myProfileName>";
Then, in my conf.js files, I can simply do this:
var properties = require('././prop.js');
var username = properties.username;
require('C:/Users/' + username + '/../jasmine-reporters')
That way, anyone on my team that I want to share these tests with only has to edit the prop.js file once with their own profile name.

Automatic downloading stopped due to the proper MIME type mismatch

I have written one script to download files automatically from the web as below:
#Automatically download files to a given folder profile settings
#---------------------------------------------------------------
profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.download.dir'] = 'C:\Documents and Settings\My Documents\userdata\Rubydownloads'
profile['browser.download.folderList'] = 2
profile['browser.helperApps.neverAsk.saveToDisk'] = "application/pdf,application/x-pdf,application/acrobat,application/vnd.pdf,text/pdf,text/x-pdf,image/jpeg,image/pjpeg,image/gif,image/bmp,image/x-windows-bmp,image/tif,image/x-tif,image/tiff,image/x-tiff,application/tif,application/x-tif,application/tiff,application/x-tiff"
profile['browser.download.manager.showWhenStarting'] = false
driver = Selenium::WebDriver.for :firefox, :profile => profile
But my bad, some of the .tif,.tiff and .pdf still missed without being download. Can it be done, say - if proper mime type not found in the above profile settings,then the script should add that mime to the browser settings,to continue downloading ?
Please help me here.
I'm working through a similar problem.
I'm not sure if you're missing mime-types in your neverAsk.saveToDisk list (it doesn't look like it), but I'll suggest that the following may help:
profile['browser.helperApps.alwaysAsk.force'] = 'false'

Moving blog articles location in Middleman

I'm using the Middleman Blog gem for my site, but by default it appears the blog articles need to be located in /source which isn't particularly nice when looking at the tree in vim and trying to locate one of the other files in there (a template for instance).
From looking at the documentation I can't see if there is any way of moving the blog articles so they are stored somewhere else such as a blog_articles folder or similar.
Is this possible?
Put the following in your config.rb file.
activate :blog do |blog|
blog.permalink = ":year-:month-:day-:title.html"
blog.sources = "blog_articles/:title.html"
end
Assuming you have a post 2012-01-01-example-article.html.markdown stored in the folder source/blog_articles.
You should now see the post with this URL: http://localhost:4567/2012-01-01-example-article.html. (You might have to restart middleman when changing the config.rb file.)
Please note that I also had to set blog.permalink, the blog.sources setting alone didn't do the trick.
A bonus tip: I have activate :directory_indexes in my config.rb file. This setting gives you nice looking URLs, without the .html part.
If you want the same for your blog posts you can drop the .html from your blog.permalinksetting. Like so:
activate :blog do |blog|
blog.permalink = ":year-:month-:day-:title"
blog.sources = "blog_articles/:title.html"
end
Now you can see your post with this URL: http://localhost:4567/2012-01-01-example-article.
I messed with the middleman-blog extension, but gave up for its relative opaqueness. In looking at the source, though, it appears the prefix option might do the trick for you? It's somewhat unclear whether the prefix is a URL prefix or a local path prefix:
activate :blog do |blog|
blog.prefix = "/blog_articles"
end
From looking at the code it transpires there is a :sources option which you can use. If you poke around in the source there is an example of this:
https://github.com/middleman/middleman-blog/tree/master/fixtures/article-dirs-app
The solution above worked for me when I made the following changes to the permalink / source config options:
blog.permalink = ":title.html"
blog.sources = "posts/:year-:month-:day-:title.html"
The permalink is the location which it will appear in the web browser url where the source is the locations of the posts.
Using middleman 3.2.1
I made blog folder inside source directory. Then i make posts directory and moved all my posts there. source/blog/posts/...
and then inside config.rb
activate :blog do |blog|
..........
blog.permalink = "blog/:year/:month/:day/:title.html"
blog.sources = "blog/posts/:year-:month-:day-:title.html"
.........
end

Resources