Giter Site home page Giter Site logo

Comments (10)

johnstray avatar johnstray commented on July 17, 2024

This appears to be an issue with the JavaScript behind the uploader. I will investigate this...

from gs-blog.

webservsol avatar webservsol commented on July 17, 2024

Yes I agree however I couldn't locate the error I have no clear logs of which script causing this issue, I tracked the post-edit.php and found everything defined perfectly and in the chrome console no errors

from gs-blog.

webservsol avatar webservsol commented on July 17, 2024

Uncaught SyntaxError: Unexpected token <
at XMLHttpRequest. (image_upload.js:35)
(

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ImageManipulation has a deprecated constructor in I:\xampp\htdocs\example\admin\inc\imagemanipulation.php on line 17

{"code":0,"url":"portfolio//1.jpg"})

Line 55 in admin\inc\imagemanipulation.php
Replace: public function ImageManipulation($imgfile)
With: public function __construct($imgfile)

from gs-blog.

webservsol avatar webservsol commented on July 17, 2024

Change post-editor.php Line 110

From:

                    function triggerUploaderChange(id) {$('#'+id).trigger('change');}
                    $('#uploaderPreviewImage').error(function(){$(this).attr('src', '<?php echo $SITEURL; ?>plugins/<?php echo BLOGFILE; ?>/images/missing.png');});
                    function triggerUploaderChange(id) {$('#'+id).trigger('change');}
                    $('#uploaderPreviewImage').on('error', function(){$(this).attr('src', '<?php echo $SITEURL; ?>plugins/<?php echo BLOGFILE; ?>/images/missing.png');});

Add uploadThumbALT to post-thumbalt input and add their css:

.uploaderFileName {
    width: 60% !important;
	font-size:14px !important;
}
.uploadThumbALT {
	font-size:14px !important;
}

from gs-blog.

johnstray avatar johnstray commented on July 17, 2024

The depreciated constructor method is a bug in GetSimple itself as the imagemanipulation.php is part of the core. I see you've already reported this in GetSimpleCMS/GetSimpleCMS#1289.

I'm going to modify image_upload.js so that is can handle an invalid response (ie: not JSON) in the AJAX call and trigger the error state when that happens.
I'll also implement the small JS change you mentioned above.

Not going to change the CSS though. .uploaderFileName already has with set, and I'm not going to set the font-size: 14px property, because I want it to inherit that from GS's own stylesheet. This is so that the styles can be kept as close to the GS core as possible, which also allows for better handling of custom admin stylesheets used by some plugins.

from gs-blog.

johnstray avatar johnstray commented on July 17, 2024

Also spotted this minor bug in post-editor.php:

Line 87: alert('Uploader Error: ' + res.code);

Should be changed to:

Line 87: alert('Uploader Error: ' + code);

from gs-blog.

webservsol avatar webservsol commented on July 17, 2024

Thanks for the update, yet the issue of replacing the image isn't working. I was able to resolve the upload file issue but replace yet persist. For CSS side I totally agree with you however I found some plugins are overwriting the main CSS of GS which is causing issues not showing the input value (as if there's nothing there) thus I added the CSS and has resolved this issue.

For the imagemanipulation.php yes I have mentioned that to GS hope they update it as I've did at my end.

Back to your plugin I've added new functions such as show_sidebar_blog_recent_posts based on your main show_blog_recent_posts however there's a difference when using each function. The show_blog_recent_posts will be used in main body of the website and here I'd like to mention I've edited the layout-list.php and layout-post.php to be Bootstrap Compatible. The show_sidebar_blog_recent_posts will allow the users to show recent posts in the sidebar of any page especially if they wanna use it in Blog pages or in the footer.

What I'm not trying to implement is a shortcode system to allow users parse recent posts in any page basically homepage as you know we can't use php tags in CKEditor although I tried to find a solution but didn't work out at my end. Please update me if there's a simple solution to parse data in CKEditor or WYSIWYG.

Also my next step to build a tag manager something like the wordpress system which creates a tag cloud and allows the users to pick pre-used tags in their posts, this might take some time.

One additional thing based on your script I'm building a GS Portfolio System for people to use it for their portfolios.

I can update you with all the codes I have once I've completed my testing.

Thank you!

from gs-blog.

johnstray avatar johnstray commented on July 17, 2024

I'm not quite sure exactly what you mean by replacing the image is not working, but I found the following when i did some testing:

  • On a new post, selecting or uploading an image works fine.
  • When editing a post, selecting a different image from the file manager or uploading a new one works.
  • BUG [Both in new post and edit post]: When you select Upload image more than once, (ie. you upload 1 image, change your mind and upload another image), the second image upload fails with uploader.php reporting No such file or Directory on line 49. I think this might be related to the uploader javascript not liking running more than once on each page load, but i'm not quite sure yet. Might have to have a good scrounge through JS code.

Also, I'm happy for new features to be developed and suggested, but please make sure you have read the instructions in CONTRIBUTING.md in the .github directory first (ie.: Create a new issue for the feature so that is can be discussed and commits can be attributed to the issue. Makes keeping track of things much easier.)

The tag cloud idea is already an open issue that is planned for this next release. Refer to issue #5 . Feel free to work on that, but please reference the issue in your commits.

from gs-blog.

johnstray avatar johnstray commented on July 17, 2024

Sidenote: I think there is a plugin available that allows you to place PHP code into a component (PHP is eval()'d in a component), then use that component on a page. Can recall what the plugin was called though.

from gs-blog.

johnstray avatar johnstray commented on July 17, 2024

Figured this one out. My thought process was totally wrong. It turns out the the upload.php script was not happy because it didn't know how to handle any errors, like file size being too large (some of the files i tested with earlier were too large.)

Going to add some error handling to the script.

from gs-blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.