Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Knowledge Base - Easy Attachments

Hi OSTicketers!

As we've been playing around with the system a little more, I realized one area that could use a small modification would be allowing screen shots to be uploaded. I know I can add attachments to an article, and I've used this as a work around (Upload as attachment, copy link to attachment, use image tool in WYSIWYG editor to paste link).

I'm not sure how this would be best accomplished - either through a seperate tool, or maybe a different editor?

Thanks for any ideas, or pointing me in the direction that this is already done!

-Stead
Eugene, OR

Comments

  • Moving thread to Feedback and Suggestions as that's where it appears to belong.
  • Thanks for the move!
  • Simply visit here: http://nicedit.com/download.php

    Select "nicUpload" from the optional nicEdit plugins, then extract the file nicEdit.js into scp/js this will overwrite the version from osTicket, supplying the upload button! (Images will be hosted by imgur, not your server)

    To make it work for your server not imgur, read here:
    http://stackoverflow.com/questions/12697664/nicedit-picture-upload-to-own-server-doesnt-work-configuration-wrong

    Then here:
    http://stackoverflow.com/questions/12662062/nicedit-upload-images-locally-fails

    Download that guys files, edit scp.js to include your uploadURI, then faff some more, then remember you need to create the upload directory (mine is kb/images), set the URI (in nicUpload.php, you did download nicUpload.php right?), I used a hard-coded value.. this is so when the script completes it creates an
    <img src=URI+imageID />
    element..

    I changed nicUpload.js:
    var nicUploadButton = nicEditorAdvancedButton.extend({	
    nicURI : 'http://yourserver.tld/kb/nicUpload.php',

    and nicEdit.js:
    /* END CONFIG */

    var nicUploadButton = nicEditorAdvancedButton.extend({
    nicURI : 'http://intranet.tdj.com.au/support/kb/nicUpload.php',


    Took a bit, but I got it working, only mod to osTicket code was the inclusion of the uploadURI bit in scp.js: (seriously, a comma and uploadURI: 'http://yourserver.tld/kb/nicUpload.php')


    /* NicEdit richtext init */
    var rtes = $('.richtext');
    var rtes_count = rtes.length;
    for (i = 0; i < rtes_count; i++) {
    var initial_value = rtes[i].value;
    rtes[i].id = 'rte-' + i;
    new nicEditor({
    iconsPath: 'images/nicEditorIcons.gif',
    uploadURI: 'http://yourserver.tld/kb/nicUpload.php'
    }).panelInstance('rte-' + i);
    if (initial_value == '') {
    nicEditors.findEditor('rte-' + i).setContent('');
    }
    }


    If that was confusing, its because I need food.. but rest-assured, if you stare at it hard enough, the button will appear, then you can delete the stupid "Image Shack" mod if you are using his code:
    		if(this.uri == this.nicURI) {
    myDoc.write('<div style=\"position: absolute; margin-left: 160px;\"><img src=\"http://imageshack.us/img/imageshack.png\" width=\"30\" style=\"float: left;\" /><div style=\"float: left; margin-left: 5px; font-size: 10px;\">Hosted by<br /><a href=\"http://www.imageshack.us/\" target=\"_blank\">ImageShack</a></div></div>');
    }


    Because, well, you aren't.. so having that there is wrong.
  • Wow, thanks for the write up! We'll try this out today!
Sign In or Register to comment.