Friday, September 20, 2013

My answer to "Search Doesn't appear to be searching Titles"

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


Fist about title search: try searching "searching titles" on this site. You will find this question, confirming that searching by title works.

Second: comments are not added to search index, so searching in comment does not work. This can be changed but will require tweaking indexer and search.

At this time search is powered by MySQL Full text search feature. One thing about MySQL full text search is that it will exclude documents from search results if the results are not unique enough. For example if you have just 3 questions in your new database and 2 of the questiosn have "building widgets" in the title, then searching for 'building widgets' will not return any results because MySQL will consider the results to be too common. I think document must appear in the index in less than 50% of documents to be returned in results.

Read this document:
http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html

Especially this paragraph:
"The search result is empty because the word "MySQL" is present in at least 50% of the rows. As such, it is effectively treated as a stopword. "

My answer to "lighttpd subdirectory example"

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


I use lighttpd for hosting this support site and for development I use WAMP at home. So I know it works on Apache and Lighttpd. I have not tried on Nginx myself, just never had time to setup Nginx.

The lighttpd.conf sample file is included with Lampcms distribution, just give it a try. Of cause you must setup php using FPM

Here are some details about FPM
http://php.net/manual/en/install.fpm.php

Saturday, September 7, 2013

My answer to "ACL file for disabling anonymous users to see content"

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


The viewing of questions and answers is not currently protected by ACL.

What will not logged in user see on the home page? Is user suppose to see list of questions but then clicking on a questions will show some sort of permission error?

If that's what you want you can add this line to the Lampcms/controllers/Viewquestion.php
right about the "protected function main()" line


protected $membersOnly = true;

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'