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


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.

Tuesday, July 30, 2013

My answer to "question on links"

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


1) Write your answer in the editor, highlight the word you want to link, then the icon is not grayed out anymore. 2) Click on link icon, insert your link
3) Enjoy.

Saturday, July 27, 2013

My answer to "How do I generate a sitemap"

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


First in your www/w directory create subdirectory called 'sitemap'
Make it writable.

Second - from command like issue this command

/path/to/your/php /path/to/your/lampcms/sitemap.php
Here /path/to/your/php is the path to your executable php (cgi version of php) file - usually it is not the same php as used by your web server.
On Windows it will be php.exe file, on Linux it is an executable php file installed with your php installation.

If it does not work look in your logs/cli-php.log file

It should generate the sitemap and index file in the www/w/sitemap/ directory

It will also ping Google, Bing and Yahoo with the locations of you sitemap

If it works then you may want to add this command to your cron file to be executed every day or every week.

You may also add the location of your w/sitemap/index.xml to your robots.txt file

Just add something like this to your robots.txt


Sitemap: http://yoursite.com/w/sitemap/index.xml


Thursday, July 25, 2013

My answer to "LOCALE and LANG problems"

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


No need to remove database. All you need to do is login to your site as administrator, click on settings and then click on "Clear Cache" link

That will remove all cached translation objects from cache. Translation objects are cached to improve performance because you don't want to parse the xml file on every page load to load translation strings. These are parsed once and then created object is stored in C_Cache mongo collection. It's alot faster to get the object from Mongo then re-create it from xml files on every page load.

Anyway, there is a "Clear Cache" link in settings but it is only visible when you logged in with admin account.

You must clear cache after you change anything in your translation files which are basically xml files with the .xlf extension - in /config/translations/ directory