Permalink
Browse files

Merge pull request #53 from iam-merlin/master

(Add a new readme in markdown format + translation
  • Loading branch information...
2 parents 3d0ff18 + ca97f0c commit a63c93508f2afdb780f7a86e4572727b12691dbd @Datawalke committed Aug 14, 2012
View
124 Readme.md
@@ -0,0 +1,124 @@
+Requirements
+==================================
+All that is required is your basic LAMP/WAMP stack.
+However the best-case conditions:
+* PHP5+
+* MySQL 5.1+
+
+
+How to Install Coordino
+==================================
+Unzip the Coordino package your root working www directory.
+
+ ex: /var/www/htdocs/test.com
+
+Then open your web browser and proceed to <http://test.com> to complete instillation.
+
+
+Widget Tokens
+==================================
+Tokens may be used to render dynamic content to the user.
+
+The following tokens are available:
+* The logged in user's username. - [user.username]
+* The logged in user's reputation. - [user.reputation]
+* The logged in user's age. - [user.age]
+* The logged in user's website. - [user.website]
+* The logged in user's information. - [user.info]
+* The logged in user's location. - [user.location]
+* The logged in user's answer count. - [user.answer-count]
+* The logged in user's comment count. - [user.comment-count]
+* The logged in user's question count. - [user.question-count]
+* A link to the user's profile. - [user.profile-link]
+
+For example:
+
+ Hello [user.username], Welcome to Coordino!
+ Check out your profile at: [user.profile-link]
+ Or answer some questions!
+
+
+Remote Auth. Logins
+==================================
+Coordino works in two modes:
+
+1. An internal userbase. (Remote Auth Only "No")
+2. Remote userbase. (Remote Auth Only "Yes")
+
+These settings may be changed in the administration setting under "Admin" -> "Remote Settings"
+
+The internal userbase is the standard setting for Coordino. New users will register either by asking a question,
+answering a question or registering themselves. The users username, password, and email are kept internally.
+
+However, if you have an external userbase already and do not wish to have all of your users re-register for a system you can use a form of automatic integration. You must create a script that first compiles a message and then forwards it to Coordino's Remote Login system based off of your current logged in user's details.
+
+The following user details from your userbase are needed:
+
+- Username
+- Email Address
+
+The following extra message details are needed:
+
+- Timestamp
+- Remote Auth Key (Found in Remote Settings)
+- Hash
+
+Take the following example in PHP:
+
+```Php
+/*
+ * Remote authentication for PHP
+ * This is meant to be used as a template to base the integration with your application.
+ */
+
+// The following values should comefrom your source of information
+$username = 'BillyRogan';
+$email = 'rbillyscool@aol.com';
+
+// Insert your Authentication key here
+$key = '98y94NIUfafnajskfn9823JNAIUz';
+
+// Build the Message
+$timestamp = time();
+$message = $username . $email . $timestamp . $key;
+$hash= md5($message);
+
+// Set the URL of your Answer Engine install and form the correct remote authentication URL.
+$url = 'http://your.domain.com/coordino_install/access/remote' . $name . '/' . $email . '/' . $timestamp . '/' . $hash;
+header('Location: ' . $url);
+```
+
+The username and email address are pulled from your current userbase.
+Then a message is compiled with the User's username, email, a timestamp, and your remote auth key. That message is then md5'd into a check hash. A URL is then formed with the correct information and the remote logged in user is then forwarded to the Coordino Remote Access URL.
+
+
+Translate Coordino
+==================================
+Because Coordino is ready for i18n, you can contribute to tranlate it!
+To help you, you can have some informations in :
+<http://book.cakephp.org/1.3/en/view/1229/Internationalizing-Your-Application>
+
+How to generate .pot files ?
+----------------------------
+Run this command in the root path of Coordino :
+
+ $ php cake/console/cake.php i18n
+ > [E]xtract POT file from sources
+ > Verify the full path in [] for "app" and validate it
+ > [D] Done
+ > Verify the full path in [] for "app/locale" and enter to validate it
+ > Merge all domains strings in the default.pot file (y)
+ > Waiting for extractig
+ > Default.pot already exists, Overwrite it! (y)
+ > verb.pot already exists, Overwrite it too! (y)
+ > Done ;)
+
+Contributors - Thank you!
+==================================
+
+* do9iigane
+* [iam-merlin](https://github.com/iam-merlin)
+* ultramundane
+* datawalke
+
+Don't see yourself Just edit the Readme!
@@ -37,16 +37,16 @@ public function afterFilter() {
public function delete($id) {
if(!$this->isAdmin($this->Auth->user('id'))) {
- $this->Session->setFlash('You do not have permission to access that..', 'error');
+ $this->Session->setFlash(__('You do not have permission to access that..',true), 'error');
$this->redirect('/');
}
$this->Post->delete($id);
- $this->Session->setFlash('Post Deleted', 'error');
+ $this->Session->setFlash(__('Post deleted',true), 'error');
$this->redirect('/');
}
public function ask() {
- $this->set('title_for_layout', 'Ask a question!');
+ $this->set('title_for_layout', __('Ask a question',true));
if(!empty($this->data)) {
@@ -123,7 +123,7 @@ public function answer($public_key) {
$this->set('answer', $this->data['Post']['content']);
$this->Email->from = 'Answerman <answers@' . $_SERVER['SERVER_NAME'] . '>';
$this->Email->to = $user['User']['email'];
- $this->Email->subject = 'Your question has been answered!';
+ $this->Email->subject = __('Your question has been answered!',true);
$this->Email->template = 'notification';
$this->Email->sendAs = 'both';
$this->Email->send();
@@ -154,7 +154,7 @@ public function __validatePost($data, $redirectUrl, $reCaptcha = false) {
if($reCaptcha == true) {
if(!$this->Recaptcha->valid($data['reCAPTCHA'])) {
$data['Post']['content'] = $this->Markdownify->parseString($data['Post']['content']);
- $recaptchaErrors = array('recaptcha' => 'Invalid reCAPTCHA entered.');
+ $recaptchaErrors = array('recaptcha' => __('Invalid reCAPTCHA entered.',true));
$errors = array(
'errors' => $recaptchaErrors,
'data' => $data
@@ -404,7 +404,7 @@ public function view($public_key) {
* If so redirect.
*/
if($question['Post']['flags'] >= $flag_check['Setting']['value'] && $this->Setting->repCheck($this->Auth->user('id'), 'rep_edit')) {
- $this->Session->setFlash('The question you are trying to view no longer exists.', 'error');
+ $this->Session->setFlash(__('The question you are trying to view no longer exists.',true), 'error');
$this->redirect('/');
}
@@ -444,7 +444,7 @@ public function edit($public_key) {
$redirect = $this->Post->findById($redirect['Post']['related_id']);
}
if($question['Post']['user_id'] != $this->Auth->user('id') && !$this->isAdmin($this->Auth->user('id')) && !$this->Setting->repCheck($this->Auth->user('id'), 'rep_edit')) {
- $this->Session->setFlash('That is not your question to edit, and you need more reputation!', 'error');
+ $this->Session->setFlash(__('That is not your question to edit, and you need more reputation!',true), 'error');
$this->redirect('/questions/' . $redirect['Post']['public_key'] . '/' . $redirect['Post']['url_title']);
}
if(!empty($question['Post']['title'])) {
@@ -539,15 +539,15 @@ public function display($type='recent', $page=1) {
$keywords = array('hot', 'week', 'month', 'recent', 'solved', 'unanswered');
if(($search == 'no') && (!in_array($type, $keywords))) {
- $this->Session->setFlash('Invalid search type.', 'error');
+ $this->Session->setFlash(__('Invalid search type.',true), 'error');
$this->redirect('/');
}
if(empty($questions)) {
if(isset($type['needle'])) {
- $this->Session->setFlash('No results for "' . $type['needle'] . '"!', 'error');
+ $this->Session->setFlash(__('No results for',true) . ' "' . $type['needle'] . '"!', 'error');
}else {
- $this->Session->setFlash('No results for "' . $type . '"!', 'error');
+ $this->Session->setFlash(__('No results for',true) . ' "' . $type . '"!', 'error');
}
if($this->Post->find('count') > 0) {
$this->redirect('/');
@@ -579,7 +579,7 @@ public function markCorrect($public_key) {
* Check to make sure the Post is an answer
*/
if($answer['Post']['type'] != 'answer') {
- $this->Session->setFlash('What are you trying to do?', 'error');
+ $this->Session->setFlash(__('What are you trying to do?',true), 'error');
$this->redirect('/');
}
@@ -588,7 +588,7 @@ public function markCorrect($public_key) {
* Check to make sure the logged in user is authorized to edit this Post
*/
if($question['Post']['user_id'] != $this->Auth->user('id')) {
- $this->Session->setFlash('You are not allowed to edit that.');
+ $this->Session->setFlash(__('You are not allowed to edit that.',true));
$this->redirect('/questions/' . $question['Post']['public_key'] . '/' . $question['Post']['url_title']);
}
@@ -628,18 +628,18 @@ public function markCorrect($public_key) {
public function flag($public_key) {
$redirect = $this->Post->correctRedirect($public_key);
if(!$this->Auth->user('id')) {
- $this->Session->setFlash('You need to be logged in to do that!', 'error');
+ $this->Session->setFlash(__('You need to be logged in to do that!',true), 'error');
$this->redirect('/questions/' . $redirect['Post']['public_key'] . '/' . $redirect['Post']['url_title']);
}elseif(!$this->Setting->repCheck($this->Auth->user('id'), 'rep_flag')) {
- $this->Session->setFlash('You need more reputation to do that.', 'error');
+ $this->Session->setFlash(__('You need more reputation to do that.',true), 'error');
$this->redirect('/questions/' . $redirect['Post']['public_key'] . '/' . $redirect['Post']['url_title']);
}else{
$flag = $this->Vote->throwFlag($this->Auth->user('id'), $public_key);
if($flag == 'exists') {
- $this->Session->setFlash('You have already flagged that.', 'error');
+ $this->Session->setFlash(__('You have already flagged that.',true), 'error');
$this->redirect('/questions/' . $redirect['Post']['public_key'] . '/' . $redirect['Post']['url_title']);
}elseif($flag == 'success') {
- $this->Session->setFlash('Post flagged.', 'error');
+ $this->Session->setFlash(__('Post flagged.',true), 'error');
$this->redirect('/questions/' . $redirect['Post']['public_key'] . '/' . $redirect['Post']['url_title']);
}
}
Oops, something went wrong.

0 comments on commit a63c935

Please sign in to comment.