Saturday, June 29, 2013

My answer to "Adding/replacing Logo in the header"

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


First thing I would recommend is to run your site in debug mode.
When running in debug mode the names of all the templates used in generation of the page are added to html source as html comments.
So just run the site in debug mode, open a page and view source html in the browser. You will see the full path to template files. Then just open the template file and you will be able to edit it.

My answer to "How to completely delete a user"

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


Completely deleting user in production is a really bad idea.
First of all if you delete a user from the database the questions and answers from that user will still be in the database, the name of user and possibly an avatar will still be shown next to user's posts but link to profile will point to deleted account.
Link to a deleted account is not really a problem.

The problem is that you don't want someone else to later register with the same username that used to belong to deleted user.

This will just create confusion. Imagine you had a user that was so annoying that you deleted his or her account. First of all you don't want the same user to be able to just re-register with the same account.

Second you don't want someone else to just register with the account that used to belong to some really bad user.

Having said that, I agree that sometimes there could be a case when a user really wants his or her information to be completely removed from your database. I have not yet designed a way to completely delete a user in such a way that noone can re-register with the same email address or same username.

I think there should be a feature like this where user can be completely deleted but the hash of the email address will remain in the database. This way the user is deleted but same email address cannot be used again to just re-register. We can also store the timestamp where the email address was deleted. We will also need to keep the username in the database so than noone else can register with the same username.

I think this can be a good feature.

Right now if you want to completely delete user the best way is to manually delete from Mongo database using either mongo shell or some tool like robomongo or mongoVUE.

Tuesday, June 18, 2013

My answer to "Most Voted and Most Active questions doesn't work"

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


The thing about these "Most votes" tabs is that the results are calculated from "the last 7 days"
This basically means "Most voted in the last 7 days"
I just voted up one of the questions and it started appearing in the "Most voted" tabs.

The reason for using the results from 7 days is because if you use the "all time" most voted, then usually there will be several very higly voted questions that will end up always appearing at the top of most voted, even if the questions are from a year ago.

On a fairly popular website with decent amount of voting activity the 7-days period is a good thing but if it's not what you want then you will need to tweak the code because I did not make this period configurable.

I will try to add this configuration to the next version.

Tuesday, June 11, 2013

My answer to "Is Registry->Viewer->save() calling \Lampcms\Mongo\Doc save()?"

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


Yes, Viewer is the User object.
We call it Viewer to indicate that it represents the User who is currently viewing the page. It can be logged in user or a non-logged in guest user.

The reason for calling the user "Viewer" is to differentiate it from just any registered user. For example when you viewing someone's profile or when you following/unfollowing another user we would refer to that other user as "User" but you are a "Viewer" which is also a user.

I did not invent this terminology. I first saw it on some Google's API and I liked the idea.


Anyway, a Viewer is a User and User extends MongoDoc.

If you need help in debugging something you can always add new logging line anywhere in the script.

For example
d("new password is: ".$this->newPassword);

The d() function means debug-level logging. It will work only in debug mode and only when you configured the logging (path to log) in !config.ini properly.

Tuesday, June 4, 2013

MongoDB NYC Conference

My Question on Support site for LampCMS project

Hi everybody! Just wondering if anyone lives in or near NYC and will be going to the MongoDB 2013 conference on June 21?

I'll be there. I'm lucky because my employer is sending several people from our team, myself included.

If you are going just let me know. I'll be there.



Click here to post your reply


My answer to "Responsive design"

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


I will look into that. I think responsive design has to do with css and templates, not so much with the javascript.
Anyway, I will be upgrading to the latest YUI library in about 30 days or so when I have more free time.