Tuesday, August 27, 2013

My answer to "Sorting to see just unread"

This is my answer to a Question on Support site for LampCMS project


Currently unread (new) questions or questions that have new items are represented by the closed envelope icons. The logic to keep track of new items is actually implemented on client-side using html5 local storage feature.

In order to be able to have a tab where only new questions and questions with new items are shown per-user
we need to keep track on per-user 'read' activity on the server. It's a good suggestion for a new feature but it may take awhile for something like that to be added.

Tuesday, August 13, 2013

My answer to "Character Limit Questions/Answers"

This is my answer to a Question on Support site for LampCMS project




Did you look in !config.ini (in !confiig.dist.ini which of cause should be renamed to !config.ini before the install)

There are a few lines there (with comments above the config parameters)


So for Question and Answers there are way to set minimum chars, minimum words and only minimum length of title of the question.

There are no maximum limit for Questions and Answers.

;
; Minimum length of question in chars
MIN_QUESTION_CHARS = 10
;
; Minimum required length of question title
MIN_TITLE_CHARS = 10
;
; Minimum required length of comment
MIN_COMMENT_CHARS = 10
;
; Maximum length of comment
MAX_COMMENT_CHARS = 600
;
; Minimum number of words required in question
MIN_QUESTION_WORDS = 3
;
; Minimum length of answer in chars
MIN_ANSWER_CHARS = 10
;
; Minimum number of words required for answer
MIN_ANSWER_WORDS = 3

Sunday, August 11, 2013

My answer to "Comments ignoring MAX_COMMENT_CHARS"

This is my answer to a Question on Support site for LampCMS project


Basically the minimum of 10 and maximum of 600 chars were hard-coded in the javascript file and anything in between could be configured by changing these 2 values on !config.ini, so you were not allowed to set values outside of 10 - 600 chars.

I removed these hard coded strings from javascript and pushed commit to github. It's only in the qa.js file - so if you need this change for production you will have to minify this js file yourself and same with the same name as your current minified js file.

Tuesday, August 6, 2013

My answer to "Cannot ask a question using Internet Explorer"

This is my answer to a Question on Support site for LampCMS project


LampCMS was designed to handle multiple templating packages. I would rather create a second templating based on bootstrap. The idea is that end-user can select different 'theme' in which to view LampCMS.

That's why the structure of the style folder in www directory is
www/style/1/www

The idea is that you can have another theme under
www/style/2/www
theme can include own css file and own set of templates.

Also the reason for www folder under the theme id is that you can also have a mobile folder next to it.

The template loader was designed to handle inheritence-like loading of templates in the modile directory.

For example you may put a template in the
www/style/1/mobile and when viewing the site in mobile phone browser the loader will look in the
www/style/1/mobile directory but if template is not found there that it will load the template of the same name from the www/style/1/www directory.

This way you can create a more specific mobile-version template only for the templates that you want to be specific to mobile browsers while some other templates can be reused in all browsers.

I have not implemented this feature but the logic is there, all is left to do is for someone to create a different 'theme'

My answer to "Cannot ask a question using Internet Explorer"

This is my answer to a Question on Support site for LampCMS project


It's not a bad idea to upgrade YUI, but the problem is - the rich text editor that we use is actually from YUI 2.x, not even from YUI 3. It works really well with Chrome and Firefox.

I don't know if upgrading YUI will help in this situation if we still using the same version of editor.

As for using bootstrap for css it's a great idea. I would like to create bootstrap-based templating package for Lampcms. I even think we should use LESS for creating CSS files and then convert less files to css during build time for production release and use javascript-based less parser in debug mode.

Sunday, August 4, 2013

My answer to "Error when requesting password after joining with oAuth"

This is my answer to a Question on Support site for LampCMS project


I think it may be better to just allow underscores and dots in username so these created usernames will validate.

Try to make username() function in Lampcms\Validate look like this, let me know if this will allow underscores and dots in generated usernames.

public static function username($string)
    {
        d('$string: ' . $string);
        $ret = (0 !== \preg_match('/([a-zA-Z0-9@])([a-zA-Z0-9\-_.]{1,18})([a-zA-Z0-9])$/A', $string, $m));

        d('ret ' . $ret);

        return $ret;
    }


My answer to "Difference between revokeFacebookConnect and revokeOauthToken"

This is my answer to a Question on Support site for LampCMS project


These methods just remove the oauth token from their account (document in USERS collection)
These methods are used internally to unset the Twitter, Facebook details when the APIs return authorization errors.

So basically if script is trying to post to Twitter on behalf of user but Twitter API returns some type of authentication error we realize that user probably removed our app from their Twitter account. We then remove the Twitter token from user's account so that next time we don't waste time trying to post to Twitter API again, essentially will treat that user as someone who has not added Twitter to their account.

If you want you can write a script that will call these methods manually allowing user to remove the Twitter or Facebook credentials from their account.

Saturday, August 3, 2013

My answer to "Edited question/summary doesn't change"

This is my answer to a Question on Support site for LampCMS project


This was a bug, thank you for finding it. I pushed the updated code to github. It will also be included in the official release, but it will take awhile before the next build is released, so for now use github if you want this update.