
Jake
Staff
/ Moderator

Feb 12, 2008, 2:20 PM
Post #2 of 10
(10022 views)
Shortcut
|
Hi Damien, Thanks for your post! Since that tutorial has been removed from our site, I'll post it here for you: Page Publisher Tutorial: Uploading images within the WYSIWYG editor This tutorial is going to outline the steps needed to allow image uploading right through Page Publisher's WYSIWYG editor. There are several files in the zip file attached to this post that you'll need to complete this tutorial. Please let us know if you need assistance setting this up on your site. You can post to the forum or fill out a support request, or even give us a call. We also offer a Priority Consulting service if you would prefer for us to set this up on your site. To inquire, send us an email or call 1-800-752-0455. 1. directory.cgi This is a little helper script that needs to be configured, then uploaded to the same folder as pp.cgi on your webserver. You'll be opening it up with a text editor and making two changes. First, find these lines: # Upload URL and Dir (CHANGE THESE TO MATCH YOUR SERVER) my $uploadURL = "http://www.yoursite.com/pp/uploads/"; my $uploadDIR = "C:/www/pp/uploads/"; The $uploadURL will need to be the web path to your uploads folder and the $uploadDIR will need to be the full directory path on your server for the uploads folder. To get a better idea of what the $uploadDIR needs to be, take a look at the "program dir" of the Server tab in Setup Options. Once you make those to changes, upload directory.cgi to the same folder as pp.cgi and give it "755" permissions if you are using a UNIX server and world read/execute if you are on a Windows server. 2. editor_config.js This is the TinyMCE config file and it can be found at /pp/images/tiny_mce/. For this step, log onto your server and download /pp/images/tiny_mce/. You'll be enabling the advanced image tool. To do that, find this line: plugins : "table, fullscreen, contextmenu" and add "advimage" to it like this: plugins : "table, fullscreen, contextmenu,advimage" 3. _select_menus.html This is one of Page Publisher's interface templates. Take the template from your zip attachment, and find this line: var uploadPath = "http://www.yoursite.com/pp/uploads/"; That will need to be the URL to your uploads folder. It's actually the same URL you used in step one, so you can use that as a reference. After making the change, upload that file to your /pp/templates folder. 4. image_page.html For this step, you'll need to add a new page to Page Publisher that just has an image_select tag on it. You'll find one in the zip file called image_page.html. Once it's been added go back to Update Pages list and click on the update button for the page you just created. Up in the URL now, you'll see something like this: http://www.yoursite.com/cgi-bin/pp/pp.cgi?editpage=7 Make a note of the number you see at the end there. In this case it's a 7. One neat thing you can do so that no one actually edits this page is just assign it to a user account that no one can log in with using the admin link. 5. image.htm This page is what controls the popup for selecting images. Take the new copy in the zip file and go to line 65. Look for the onclick attribute of the button. The first part of it will look like this: http://www.yoursite.com/cgi-bin/pp/pp.cgi Change just that part so it points to your pp.cgi. Then, find this part: thispagenum=1 Change the 1 there to the number you made a note of in step 4. Next, find the iframe on line 66. The source of this iframe will need to be the URL for directory.cgi. You can get this easily by going to your login page for Page Publisher and changing pp.cgi to directory.cgi in the URL bar. After making the change, upload this to /pp/images/tiny_mce/plugins/advimage/ 6. editor_plugin.js No changes are needed with this file. Simply upload the editor_plugin.js (included in the zip file) to your server here: /pp/images/tiny_mce/plugins/advimage 7. All done And that's all there is to it. Make sure to take your time going through this and feel free to send in an email if you get stuck anywhere. ----------------------------------------------------------- Cheers, Jake Marvin - Product Specialist support@interactivetools.com [hr][i][url "http://www.interactivetools.com/consulting/"][b]Hire me![/b][/url] Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with [url "http://www.interactivetools.com/consulting/"][b]Priority Consulting[/b][/url].[/i]
|