Thread: [Isocial-svn] SF.net SVN: isocial: [26] app
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-02-25 18:11:06
|
Revision: 26 http://isocial.svn.sourceforge.net/isocial/?rev=26&view=rev Author: dim0s77 Date: 2008-02-25 10:10:24 -0800 (Mon, 25 Feb 2008) Log Message: ----------- minor fixes in login Modified Paths: -------------- app/controllers/user_controller.php app/models/user.php Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-02-25 17:58:01 UTC (rev 25) +++ app/controllers/user_controller.php 2008-02-25 18:10:24 UTC (rev 26) @@ -38,11 +38,7 @@ return; } - $user = $this->User->login($this->params['email'], $this->params['password']); - if ($user) { - $this->_login($user->id); - $this->redirectToAction( 'home' ); - } + $this->_loginUser($this->params['email'], $this->params['password']); $this->addError( '_common', @@ -51,6 +47,15 @@ ); } + function _loginUser ($email, $password) + { + $user = $this->User->login($email, $password); + if ($user && $user->active) { + $this->_login($user->id); + $this->redirectToAction( 'home' ); + } + } + function logout () { $this->_logout(); $this->redirectToAction( 'login' ); @@ -122,14 +127,14 @@ $confirmation = $this->Confirmation->findFirst(array('uuid' => $this->params['uuid'])); if ($confirmation) { $user = $this->User->findFirst(array( 'id' => $confirmation->user_id )); - if ($user && $user->active == 1) { + if ($user) { if ($user->email == $this->params['email']) { if (!empty($this->params['user'])){ - $user->setAttributes($this->params['user']); + $user_data = $this->params['user']; + $user->setAttributes($user_data); if ($user->updatePassword()) { $confirmation->destroy(); - $this->_login($user->id); - $this->redirectToAction( 'home' ); + $this->_loginUser($this->params['email'], $user_data['password']); } } else { $this->email = $user->email; Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-02-25 17:58:01 UTC (rev 25) +++ app/models/user.php 2008-02-25 18:10:24 UTC (rev 26) @@ -10,6 +10,7 @@ $this->validatePasswords(); if (!count($this->getErrors())) { $this->_encryptPassword(); + $this->active = 1; return $this->save(); } return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-26 11:13:25
|
Revision: 30 http://isocial.svn.sourceforge.net/isocial/?rev=30&view=rev Author: dim0s77 Date: 2008-02-26 03:13:30 -0800 (Tue, 26 Feb 2008) Log Message: ----------- translated other user templates. minor fixes Modified Paths: -------------- app/controllers/user_controller.php app/locales/user/ru.php app/views/user/confirm.tpl app/views/user/forgot_password.tpl app/views/user/laststep.tpl app/views/user/login.tpl app/views/user/register.tpl Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-02-26 10:07:55 UTC (rev 29) +++ app/controllers/user_controller.php 2008-02-26 11:13:30 UTC (rev 30) @@ -42,7 +42,7 @@ $this->addError( '_common', - 'Incorrect email/password combination', + 'Incorrect e-mail/password combination', 'Passwords are case sensitive. Please check your CAPS lock key' ); } @@ -99,7 +99,7 @@ } // some error occured. // it doesn't really matter which exactly - $this->addError('_common', 'Confirmation error', 'Bad confirmation link'); + $this->addError('_common', 'Confirmation error', 'bad confirmation link'); } function laststep () { @@ -119,7 +119,7 @@ } return; } - $this->addError('_common', 'Password reset error', 'No user found with the given email'); + $this->addError('_common', 'Password reset error', 'No user found with the given e-mail'); } function reset_password () { @@ -145,7 +145,7 @@ } } } - $this->addError('_common', 'Password reset error', 'Bad reset link'); + $this->addError('_common', 'Password reset error', 'bad reset link'); } function renderSidebar () { Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-02-26 10:07:55 UTC (rev 29) +++ app/locales/user/ru.php 2008-02-26 11:13:30 UTC (rev 30) @@ -6,39 +6,55 @@ $dictionary['iSocial Login'] = 'Вход в iSocial'; $dictionary['Sign Up for iSocial'] = 'Регистрация в iSocial'; $dictionary['Sign Up'] = 'Регистрация'; -$dictionary['Incorrect email/password combination'] = 'Неправильное имя и/или пароль'; -$dictionary['Passwords are case sensitive. Please check your CAPS lock key'] = 'Пароли чувствительны к регистру. Проверьте состояние индикатора Caps Lock'; +$dictionary['Incorrect email/password combination'] = 'Неправильные email и/или пароль'; +$dictionary['Passwords are case sensitive. Please check your CAPS lock key'] = 'Пароли чувствительны к регистру. Проверьте, не нажата ли клавиша Caps Lock'; $dictionary['Name'] = 'Имя'; -$dictionary['Confirm password'] = 'Подтвердите пароль'; +$dictionary['Confirm Password'] = 'Подтвердите пароль'; $dictionary['Name is missing'] = 'Не указано имя'; -$dictionary['please enter the name'] = 'это поле не может быть пустым'; -$dictionary['Incorrect email'] = 'Неверный e-mail адрес'; -$dictionary['please enter the correct email'] = 'введите корректный e-mail адрес, например va...@pu...'; -$dictionary['Email is taken'] = 'Пользователь с таким e-mail адресом уже зарегистрирован'; -$dictionary['please enter other email'] = 'введите другой e-mail адрес'; +$dictionary['please enter the name'] = 'пожалуйста, введите свое имя'; +$dictionary['this field can\'t be empty'] = 'это поле не может быть пустым'; +$dictionary['Incorrect email'] = 'Неверный email адрес'; +$dictionary['please enter the correct email'] = 'пожалуйста, введите корректный email адрес, например, va...@pu...'; +$dictionary['email is taken'] = 'Пользователь с таким email адресом уже зарегистрирован'; +$dictionary['please enter other email'] = 'введите другой email адрес'; $dictionary['Password is missing'] = 'Не указан пароль'; -$dictionary['please enter the password'] = 'это поле не может быть пустым'; +$dictionary['please enter the password'] = 'пожалуйста, введите пароль'; $dictionary['Password confirmation is missing'] = 'Повторите пароль'; -$dictionary['please enter the password confirmation'] = 'это поле не может быть пустым'; +$dictionary['please enter the password confirmation'] = 'пожалуйста, проверьте подтверждение пароля'; $dictionary['Passwords don\'t match'] = 'Пароли не совпадают'; $dictionary['please reenter both passwords'] = 'убедитесь, что оба пароля совпадают'; $dictionary['Thank you for registration'] = 'Спасибо за регистрацию'; $dictionary['Everyone Can Join'] = 'Присоединиться может каждый'; $dictionary['Last step'] = 'Последний шаг'; -$dictionary['Check please your e-mail and click on confirmation link'] = 'Проверьте, пожалуйста, Ваш e-mail и подтвердите регистрацию переходом по ссылке'; +$dictionary['Check please your email and click on confirmation link'] = 'Проверьте, пожалуйста, Ваш email и подтвердите регистрацию переходом по ссылке'; $dictionary['go to login'] = 'войти'; $dictionary['Confirmation'] = 'Подтверждение'; -$dictionary['Thank you for signing up on ISocial'] = 'Спасибо за регистрация в iSocial'; +$dictionary['Thank you for signing up on iSocial'] = 'Спасибо за регистрация в iSocial'; $dictionary['With best regards'] = 'С наилучшими пожеланиями'; -$dictionary['The ISocial Team'] = 'команда iSocial'; +$dictionary['The iSocial Team'] = 'команда iSocial'; $dictionary['Hey'] = 'Привет'; -$dictionary['ISocial confirm registration'] = 'Подтверждение регистрации в iSocial'; -$dictionary['You recently registered for ISocial using this e-mail address.'] = 'Вы только что зарегистрировались в iSocial используя этот e-mail адрес'; +$dictionary['iSocial confirm registration'] = 'Подтверждение регистрации в iSocial'; +$dictionary['You recently registered for iSocial using this email address.'] = 'Вы только что зарегистрировались в iSocial используя этот email адрес'; $dictionary['To complete your registration, follow the link below'] = 'Для завершения регистрации, перейдите по ссылке ниже'; $dictionary['If clicking on the link doesn\'t work, try copying and pasting it into your browser'] = 'Если переход по ссылке не работает, попробуйте скопировать ее и вставить в адресную строку Вашего браузера'; -$dictionary['If you did not register for ISocial, please disregard this message'] = 'Если Вы не регистрировались в iSocial, проигнорируйте, пожалуйста, это сообщение'; -$dictionary['Check out'] = 'Проверьте и подтвердите'; +$dictionary['If you did not register for iSocial, please disregard this message'] = 'Если Вы не регистрировались в iSocial, проигнорируйте, пожалуйста, это сообщение'; +$dictionary['Check out'] = 'Посетите'; $dictionary['if you have any questions'] = 'если у Вас есть какие-либо вопросы'; $dictionary['Thanks'] = 'Спасибо'; +$dictionary['Confirmation error'] = 'Ошибка подтверждения'; +$dictionary['bad confirmation link'] = 'ссылка подтверждения содержит ошибки'; +$dictionary['Password reset error'] = 'Ошибка сброса пароля'; +$dictionary['no user found with the given email'] = 'пользователь с указанным email не зарегистрирован'; +$dictionary['bad reset link'] = 'ссылка сброса пароля содержит ошибки'; +$dictionary['Trouble Accessing Your Account'] = 'Проблема с доступом к Вашей учетной записи'; +$dictionary['Forgot password'] = 'Забыли пароль'; +$dictionary['Enter your login email below'] = 'Введите свой email адрес ниже'; +$dictionary['We will send you an email with a link to reset your password'] = 'Мы вышлем Вам письмо, содержащее ссылку для сброса пароля'; +$dictionary['Reset Password'] = 'Сбросить пароль'; +$dictionary['New Password'] = 'Новый пароль'; +$dictionary['Change Password'] = 'Изменить пароль'; +$dictionary['If you have a different problem accessing your account, please see our'] = 'Если у Вас другая проблема доступа к учетной записи, смотрите нашу'; +$dictionary['Login Problems Help Page'] = 'страницу помощи'; +$dictionary['Please enter a new password'] = 'Введите, пожалуйста, новый пароль'; ?> Modified: app/views/user/confirm.tpl =================================================================== --- app/views/user/confirm.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/confirm.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -4,6 +4,6 @@ if ($controller->getErrors()) { echo $controller->renderPartial("errors"); } else { ?> - <p>_{Thank you for registration}</p> + <p>_{Thank you for registration}</p><br> <p><a href="/user/login">_{go to login}</a></p> <? } ?> Modified: app/views/user/forgot_password.tpl =================================================================== --- app/views/user/forgot_password.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/forgot_password.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -2,7 +2,7 @@ <?= $controller->renderPartial("errors") ?> -<p>_{Forgot your password}? _{Enter your login email below}. +<p>_{Forgot Password}? _{Enter your login email below}. _{We will send you an email with a link to reset your password}.</p> <form action="/user/forgot_password" method="post"> Modified: app/views/user/laststep.tpl =================================================================== --- app/views/user/laststep.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/laststep.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -1,2 +1,2 @@ <div class="title">_{Last step}</div> -<div>_{Check please your e-mail and click on confirmation link}.</div> +<div>_{Check please your email and click on confirmation link}.</div> Modified: app/views/user/login.tpl =================================================================== --- app/views/user/login.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/login.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -27,7 +27,7 @@ </div> <p class="formrow forgotpassword"> <label></label> - <a href="/user/forgot_password">_{Forgot Password?}</a> + <a href="/user/forgot_password">_{Forgot Password}?</a> </p> </div> </form> Modified: app/views/user/register.tpl =================================================================== --- app/views/user/register.tpl 2008-02-26 10:07:55 UTC (rev 29) +++ app/views/user/register.tpl 2008-02-26 11:13:30 UTC (rev 30) @@ -17,7 +17,7 @@ <input class="textinput" type="password" name="user[password]"> </div> <div class="formrow"> - <label>_{Confirm password}:</label> + <label>_{Confirm Password}:</label> <input class="textinput" type="password" name="user[password_confirmation]"> </div> <div class="formrow"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-26 11:27:27
|
Revision: 31 http://isocial.svn.sourceforge.net/isocial/?rev=31&view=rev Author: dim0s77 Date: 2008-02-26 03:27:32 -0800 (Tue, 26 Feb 2008) Log Message: ----------- translated of user email templates. minor fixes Modified Paths: -------------- app/locales/user/ru.php app/views/user/email/confirm.tpl app/views/user/email/forgot_password.tpl app/views/user/email/register.tpl Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-02-26 11:13:30 UTC (rev 30) +++ app/locales/user/ru.php 2008-02-26 11:27:32 UTC (rev 31) @@ -29,7 +29,7 @@ $dictionary['Check please your email and click on confirmation link'] = 'Проверьте, пожалуйста, Ваш email и подтвердите регистрацию переходом по ссылке'; $dictionary['go to login'] = 'войти'; $dictionary['Confirmation'] = 'Подтверждение'; -$dictionary['Thank you for signing up on iSocial'] = 'Спасибо за регистрация в iSocial'; +$dictionary['Thank you for signing up on iSocial'] = 'Спасибо за регистрацию в iSocial'; $dictionary['With best regards'] = 'С наилучшими пожеланиями'; $dictionary['The iSocial Team'] = 'команда iSocial'; $dictionary['Hey'] = 'Привет'; @@ -56,5 +56,11 @@ $dictionary['If you have a different problem accessing your account, please see our'] = 'Если у Вас другая проблема доступа к учетной записи, смотрите нашу'; $dictionary['Login Problems Help Page'] = 'страницу помощи'; $dictionary['Please enter a new password'] = 'Введите, пожалуйста, новый пароль'; +$dictionary['Link for login'] = 'Ссылка для входа'; +$dictionary['here'] = 'здесь'; +$dictionary['iSocial Password Reset Confirmation'] = 'Подтверждение сброса пароля на iSocial'; +$dictionary['You recently requested a new password'] = 'Вы недавно запросили новый пароль'; +$dictionary['To reset your password, follow the link below'] = 'Чтобы сбросить Ваш старый пароль, перейдите по ссылке ниже'; +$dictionary['If you did not reset your password, please disregard this message'] = 'Если Вы не хотите менять пароль, не обращайте внимание на это письмо'; ?> Modified: app/views/user/email/confirm.tpl =================================================================== --- app/views/user/email/confirm.tpl 2008-02-26 11:13:30 UTC (rev 30) +++ app/views/user/email/confirm.tpl 2008-02-26 11:27:32 UTC (rev 31) @@ -1,13 +1,13 @@ -Subject: _{Thank you for signing up on ISocial} -From: "iSocial" <no-...@ma...> +Subject: _{Thank you for signing up on iSocial} +From: iSocial <no-...@ma...> <? $user = $controller->User->findFirst(array( 'email' => $controller->params['email'] )) ?> -<p>_{Hey} <?= $user->name ?></p> +<p>_{Hey}, <?= $user->name ?>!</p> -<p>_{Thank you for signing up on ISocial}.</p> +<p>_{Thank you for signing up on iSocial}.</p> <? $link = AK_SITE_URL . "user/login" ?> -<p>Link for login <a href="{link}">here</a>.</p> +<p>_{Link for login} <a href="{link}">here</a>.</p> <p>_{With best regards},<br> -_{The ISocial Team}</p> +_{The iSocial Team}</p> Modified: app/views/user/email/forgot_password.tpl =================================================================== --- app/views/user/email/forgot_password.tpl 2008-02-26 11:13:30 UTC (rev 30) +++ app/views/user/email/forgot_password.tpl 2008-02-26 11:27:32 UTC (rev 31) @@ -1,8 +1,8 @@ -Subject: _{ISocial Password Reset Confirmation} -From: "iSocial" <no-...@ma...> +Subject: _{iSocial Password Reset Confirmation} +From: iSocial <no-...@ma...> <? $user = $controller->User->findFirst(array( 'email' => $controller->params['email'] )) ?> -<p>_{Hey} <?= $user->name ?></p> +<p>_{Hey}, <?= $user->name ?>!</p> <p>_{You recently requested a new password}. _{To reset your password, follow the link below}:<br> @@ -15,4 +15,4 @@ _{Check out} <a href="{link}">{link}</a> _{if you have any questions}.</p> <p>_{Thanks},<br> -_{The ISocial Team}</p> +_{The iSocial Team}</p> Modified: app/views/user/email/register.tpl =================================================================== --- app/views/user/email/register.tpl 2008-02-26 11:13:30 UTC (rev 30) +++ app/views/user/email/register.tpl 2008-02-26 11:27:32 UTC (rev 31) @@ -1,18 +1,18 @@ -Subject: _{ISocial confirm registration} -From: "iSocial" <no-...@ma...> +Subject: _{iSocial confirm registration} +From: iSocial <no-...@ma...> -<p>_{Hey} <?= $controller->User->name ?></p> +<p>_{Hey}, <?= $controller->User->name ?>!</p> -<p>_{You recently registered for ISocial using this email address.} _{To complete your registration, follow the link below}:<br> +<p>_{You recently registered for iSocial using this email address.} _{To complete your registration, follow the link below}:<br> <? $link = AK_SITE_URL . "user/confirm?uuid=" . $controller->Confirmation->uuid . "&email=" . $controller->User->email ?> <a href="<?= $link ?>"><?= $link ?></a><br> (_{If clicking on the link doesn't work, try copying and pasting it into your browser})</p> -<p>_{If you did not register for ISocial, please disregard this message}.<br> +<p>_{If you did not register for iSocial, please disregard this message}.<br> <? $link = AK_SITE_URL . "help" ?> _{Check out} <a href="{link}">{link}</a> _{if you have any questions}.</p> <p>_{Thanks},<br> -_{The ISocial Team}</p> +_{The iSocial Team}</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-02-26 11:33:42
|
Revision: 32 http://isocial.svn.sourceforge.net/isocial/?rev=32&view=rev Author: dim0s77 Date: 2008-02-26 03:33:47 -0800 (Tue, 26 Feb 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/locales/user/ru.php app/views/user/email/confirm.tpl Modified: app/locales/user/ru.php =================================================================== --- app/locales/user/ru.php 2008-02-26 11:27:32 UTC (rev 31) +++ app/locales/user/ru.php 2008-02-26 11:33:47 UTC (rev 32) @@ -47,7 +47,7 @@ $dictionary['no user found with the given email'] = 'пользователь с указанным email не зарегистрирован'; $dictionary['bad reset link'] = 'ссылка сброса пароля содержит ошибки'; $dictionary['Trouble Accessing Your Account'] = 'Проблема с доступом к Вашей учетной записи'; -$dictionary['Forgot password'] = 'Забыли пароль'; +$dictionary['Forgot Password'] = 'Забыли пароль'; $dictionary['Enter your login email below'] = 'Введите свой email адрес ниже'; $dictionary['We will send you an email with a link to reset your password'] = 'Мы вышлем Вам письмо, содержащее ссылку для сброса пароля'; $dictionary['Reset Password'] = 'Сбросить пароль'; Modified: app/views/user/email/confirm.tpl =================================================================== --- app/views/user/email/confirm.tpl 2008-02-26 11:27:32 UTC (rev 31) +++ app/views/user/email/confirm.tpl 2008-02-26 11:33:47 UTC (rev 32) @@ -7,7 +7,7 @@ <p>_{Thank you for signing up on iSocial}.</p> <? $link = AK_SITE_URL . "user/login" ?> -<p>_{Link for login} <a href="{link}">here</a>.</p> +<p>_{Link for login} <a href="{link}">_{here}</a>.</p> <p>_{With best regards},<br> _{The iSocial Team}</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-09 13:53:18
|
Revision: 50 http://isocial.svn.sourceforge.net/isocial/?rev=50&view=rev Author: dim0s77 Date: 2008-03-09 06:53:21 -0700 (Sun, 09 Mar 2008) Log Message: ----------- added reading message after his opening by recipient Modified Paths: -------------- app/controllers/message_controller.php app/views/message/_rows.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 13:06:23 UTC (rev 49) +++ app/controllers/message_controller.php 2008-03-09 13:53:21 UTC (rev 50) @@ -9,45 +9,30 @@ } function inbox () { - $this->inbox_messages = $this->_getInboxMessages(); + $this->inbox_messages = $this->_getBoxMessages('inbox_message'); $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', 'conditions' => "sender_id = " . $this->current_user->getId())); } - - function _getInboxMessages () { - $messages = $this->current_user->inbox_message->load(); - $inbox_messages = array(); - if(!empty($messages)) { - foreach ($messages as $message_loop_key => $message) { - if (isset($inbox_messages[$message->thread_id])) { - if ($inbox_messages[$message->thread_id]->id < $message->id) { - $inbox_messages[$message->thread_id] = $message; - } - } else { - $inbox_messages[$message->thread_id] = $message; - } - } - } - return $inbox_messages; + + function outbox () { + $this->outbox_messages = $this->_getBoxMessages('outbox_message'); + $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', + 'conditions' => "recipient_id = " . $this->current_user->getId())); } - function outbox () { - $messages = $this->current_user->outbox_message->load(); - $outbox_messages = array(); + function _getBoxMessages ($box_message) { + $messages = $this->current_user->$box_message->load(); + $box_messages = array(); if(!empty($messages)) { foreach ($messages as $message_loop_key => $message) { - if (isset($outbox_messages[$message->thread_id])) { - if ($outbox_messages[$message->thread_id]->id < $message->id) { - $outbox_messages[$message->thread_id] = $message; - } - } else { - $outbox_messages[$message->thread_id] = $message; + if (!isset($inbox_messages[$message->thread_id])) { + $box_messages[$message->thread_id] = $message; } } } - $this->outbox_messages = $outbox_messages; + return $box_messages; } - + function send () { if (!empty($this->params['message']) && !empty($this->params['message']['recipient']) && @@ -57,10 +42,9 @@ $message = $this->current_user->outbox_message->build(); $message->setAttributes($this->params['message']); $message->recipient->assign($recipient); - if (empty($message->subject)) { - $message->subject = $this->t('(no subject)'); - } - + if (empty($message->subject)) { + $message->subject = $this->t('(no subject)'); + } if ($message->save()) { if (!$message->thread_id) { $message->thread_id = $message->getId(); @@ -96,7 +80,7 @@ 'include' => array('sender', 'recipient'))); return $this->render(array('partial' =>'thread', 'locals' => array('interlocutor' => $interlocutor, - 'messages' => $messages))); + 'messages' => $messages))); } } } @@ -113,9 +97,18 @@ if ($thread->sender_id == $user_id || $thread->recipient_id == $user_id ) { $recipient_id = $thread->sender_id == $user_id ? $thread->recipient_id : $thread->sender_id; $this->interlocutor = $this->User->findFirst(array( 'id' => $recipient_id)); - $this->messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), - 'order' => 'created_at', - 'include' => array('sender', 'recipient'))); + $messages = $this->Message->find('all', array('conditions' => array('thread_id' => $thread->getId()), + 'order' => 'created_at', + 'include' => array('sender', 'recipient'))); + if(!empty($messages)) { + foreach ($messages as $message_loop_key => $message) { + if ($message->recipient_id == $this->current_user->getId()) { + $message->is_read = 1; + $message->save(); + } + } + } + $this->messages = $messages; return; } } Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-09 13:06:23 UTC (rev 49) +++ app/views/message/_rows.tpl 2008-03-09 13:53:21 UTC (rev 50) @@ -7,9 +7,9 @@ <? if ($target == 'sender') { echo '<a href="">'; if (!$message->is_read) { - echo '<img src="/images/email.png" alt="_{New message}" class="">'; + echo '<img src="/images/email.png" alt="' . $text_helper->translate("New message", array()) . '">'; } else { - echo '<img src="/images/email_open.png" alt="_{Message is readed}" class="">'; + echo '<img src="/images/email_open.png" alt="' . $text_helper->translate("Message is read", array()) . '">'; } echo '</a>'; } else { @@ -20,7 +20,7 @@ <td class="checkbox"><input onclick="oncheck(this, {?message.is_read}{message.is_read}{else}0{end})" type="checkbox" class="check{?message.is_read}read{else}unread{end}" id="{message.id}" name="check_messages[]" value="{message.id}"></td> <td class="profile_photo"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> <td class="info"> - <span class="name"><a href="">{sender.name?}</a></span> + <span class="name"><a href=""><? if ($target == 'recipient') { ?>_{To}: <? } ?>{sender.name?}</a></span> <span class="datetime">{message.created_at?}</span> </td> <td class="msg"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-09 14:40:07
|
Revision: 52 http://isocial.svn.sourceforge.net/isocial/?rev=52&view=rev Author: dim0s77 Date: 2008-03-09 07:40:12 -0700 (Sun, 09 Mar 2008) Log Message: ----------- minor fix Modified Paths: -------------- app/controllers/message_controller.php app/views/message/_rows.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 14:16:35 UTC (rev 51) +++ app/controllers/message_controller.php 2008-03-09 14:40:12 UTC (rev 52) @@ -130,11 +130,11 @@ function _mark_messages ($is_read) { if (!empty($this->params['check_messages'])) { $messages = $this->Message->find('all', - array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")", ))); + array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")"))); if ($messages) { foreach ($messages as $message_loop_key => $message) { - if ($message->sender_id = $this->current_user->getId() || - $message->recipient_id = $this->current_user->getId()) { + if ($message->sender_id == $this->current_user->getId() || + $message->recipient_id == $this->current_user->getId()) { $message->is_read = $is_read; $message->save(); } @@ -152,15 +152,15 @@ array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")", ))); if ($threads) { foreach ($threads as $thread_loop_key => $thread) { - if ($thread->sender_id = $this->current_user->getId() || - $thread->recipient_id = $this->current_user->getId()) { + if ($thread->sender_id == $this->current_user->getId() || + $thread->recipient_id == $this->current_user->getId()) { $this->Message->destroyAll("thread_id = $thread->thread_id"); } } } } return $this->render(array('partial' => 'rows', - 'locals' => array('messages' => $this->_getInboxMessages(), + 'locals' => array('messages' => $this->_getBoxMessages('inbox_message'), 'target' => 'sender'))); } } Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-09 14:16:35 UTC (rev 51) +++ app/views/message/_rows.tpl 2008-03-09 14:40:12 UTC (rev 52) @@ -20,7 +20,7 @@ <td class="checkbox"><input onclick="oncheck(this, {?message.is_read}{message.is_read}{else}0{end})" type="checkbox" class="check{?message.is_read}read{else}unread{end}" id="{message.id}" name="check_messages[]" value="{message.id}"></td> <td class="profile_photo"><a href=""><img src="/images/nophoto_men_sm.gif" alt="" class=""></a></td> <td class="info"> - <span class="name"><a href=""><? if ($target == 'recipient') { ?>_{To}: <? } ?>{sender.name?}</a></span> + <span class="name"><? if ($target == 'recipient') { ?>_{To}: <? } ?><a href="">{sender.name?}</a></span> <span class="datetime">{message.created_at?}</span> </td> <td class="msg"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-09 19:33:28
|
Revision: 55 http://isocial.svn.sourceforge.net/isocial/?rev=55&view=rev Author: aguidrevitch Date: 2008-03-09 12:33:31 -0700 (Sun, 09 Mar 2008) Log Message: ----------- unread message count simplified / speedup Modified Paths: -------------- app/controllers/message_controller.php Removed Paths: ------------- app/views/message/_count.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-09 17:38:17 UTC (rev 54) +++ app/controllers/message_controller.php 2008-03-09 19:33:31 UTC (rev 55) @@ -115,8 +115,11 @@ } function inbox_count () { - $this->count = $this->Message->count('id', array('conditions' => array("recipient_id = ? AND is_read = 0", $this->current_user->getId()))); - return $this->render(array('partial' =>'count')); + if ($this->current_user) { + $count = $this->Message->count('id', array('conditions' => array("recipient_id = ? AND is_read = 0", $this->current_user->getId()))); + return $this->renderText($count); + } + return $this->renderNothing(); } function mark_unread () { Deleted: app/views/message/_count.tpl =================================================================== --- app/views/message/_count.tpl 2008-03-09 17:38:17 UTC (rev 54) +++ app/views/message/_count.tpl 2008-03-09 19:33:31 UTC (rev 55) @@ -1 +0,0 @@ -{count} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-10 09:29:09
|
Revision: 57 http://isocial.svn.sourceforge.net/isocial/?rev=57&view=rev Author: aguidrevitch Date: 2008-03-10 02:29:13 -0700 (Mon, 10 Mar 2008) Log Message: ----------- city selection improved Modified Paths: -------------- app/controllers/profile_controller.php app/installers/city_installer.php localities_to_sql.pl Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-03-09 19:52:38 UTC (rev 56) +++ app/controllers/profile_controller.php 2008-03-10 09:29:13 UTC (rev 57) @@ -14,43 +14,25 @@ if (empty($this->params['basic']['city'])) { $this->renderNothing(); } else { - $query = $this->params['basic']['city']; + $query = $this->params['basic']['city']; + $aquery = utf8_to_ascii($query); + if ($aquery != $query) { + $conditions = array( + 'first_id IS NOT NULL AND name LIKE ? OR name LIKE ?', $query . '%', $aquery . '%' + ); + } else { + $conditions = array( + 'first_id IS NOT NULL AND name LIKE ?', $query . '%' + ); + } $entries = $this->City->find('all', - array('conditions' => - array( - 'first_id IS NOT NULL AND name LIKE ?', $query . '%' - ), - 'include' => 'country', - 'limit' => 10 + array( + 'conditions' => $conditions, + 'include' => 'country', + 'limit' => 10 ) ); - - $limit = empty($entries) ? 10 : 10 - count($entries); - if ($limit) { - $aquery = utf8_to_ascii($query); - if ($aquery != $query) { - $asciied = $this->City->find('all', - array('conditions' => - array( - 'first_id IS NOT NULL AND name LIKE ?', $aquery . '%' - ), - 'include' => 'country', - 'limit' => $limit - ) - ); - } - } - - if (empty($entries) && empty($asciied)) { - $entries = array(); - } else if (empty($entries)) { - $entries = $asciied; - } else if (empty($asciied)) { - $entries = $entries; - } else { - $entries = array_merge($entries, $asciied); - } $this->renderText( $this->_city_auto_complete_result($entries, $query) ); } } Modified: app/installers/city_installer.php =================================================================== --- app/installers/city_installer.php 2008-03-09 19:52:38 UTC (rev 56) +++ app/installers/city_installer.php 2008-03-10 09:29:13 UTC (rev 57) @@ -11,8 +11,10 @@ `first_id` int(11), `second_id` int(11), `third_id` int(11), + `is_alternative` bool NOT NULL DEFAULT 0, `name` char(100) NOT NULL DEFAULT '', INDEX oid_idx (oid), + INDEX name_idx (name), FOREIGN KEY (country_id) REFERENCES countries(id) ) ENGINE=InnoDB"); Modified: localities_to_sql.pl =================================================================== --- localities_to_sql.pl 2008-03-09 19:52:38 UTC (rev 56) +++ localities_to_sql.pl 2008-03-10 09:29:13 UTC (rev 57) @@ -19,7 +19,7 @@ print "INSERT INTO countries VALUES ($id, $oid, '$name');\n"; $id++; } else { - $other{$name} = $oid; + $other{$name} ||= $oid; } } @@ -35,10 +35,13 @@ my $third_id = defined $data[11] && $other{$data[11]} ? $other{$data[11]} : 'NULL'; my @names = ($data[1], split(/\s*,\s*/, $data[2]), split(/\s*,\s*/, $data[3])); + my $i = 0; foreach my $name (@names) { + my $is_alt = $i > 0 ? 1 : 0; $name =~ s/\"/'/g; - print "INSERT INTO cities VALUES ($id, $oid, $country_id, $first_id, $second_id, $third_id, \"$name\");\n"; + print "INSERT INTO cities VALUES ($id, $oid, $country_id, $first_id, $second_id, $third_id, $is_alt, \"$name\");\n"; $id++; + $i++; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-10 13:36:48
|
Revision: 58 http://isocial.svn.sourceforge.net/isocial/?rev=58&view=rev Author: dim0s77 Date: 2008-03-10 06:36:49 -0700 (Mon, 10 Mar 2008) Log Message: ----------- added functionality to outbox messages Modified Paths: -------------- app/controllers/message_controller.php app/views/message/_rows.tpl app/views/message/inbox.tpl app/views/message/outbox.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-10 09:29:13 UTC (rev 57) +++ app/controllers/message_controller.php 2008-03-10 13:36:49 UTC (rev 58) @@ -27,15 +27,14 @@ } } $user_id = $box_message == 'inbox_message' ? 'sender_id' : 'recipient_id'; - $this->message_threads = $this->Message->count('thread_id', array('distinct' => 'thread_id', - 'conditions' => "$user_id = " . $this->current_user->getId())); + $this->message_threads = count($box_messages); return $box_messages; } function send () { if (!empty($this->params['message']) && - !empty($this->params['message']['recipient']) && - !empty($this->params['message']['body'])) { + !empty($this->params['message']['recipient']) && + !empty($this->params['message']['body'])) { $recipient = $this->User->findFirst(array( 'id' => $this->params['message']['recipient'] )); if ($recipient) { $message = $this->current_user->outbox_message->build(); @@ -149,7 +148,21 @@ 'target' => 'sender'))); } - function delete_thread () { + function delete_inbox_thread () { + $this->_delete_thread(); + return $this->render(array('partial' => 'rows', + 'locals' => array('messages' => $this->_getBoxMessages('inbox_message'), + 'target' => 'sender'))); + } + + function delete_outbox_thread () { + $this->_delete_thread(); + return $this->render(array('partial' => 'rows', + 'locals' => array('messages' => $this->_getBoxMessages('outbox_message'), + 'target' => 'sender'))); + } + + function _delete_thread () { if (!empty($this->params['check_messages'])) { $threads = $this->Message->find('all', array('conditions' => array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ")", ))); @@ -162,9 +175,6 @@ } } } - return $this->render(array('partial' => 'rows', - 'locals' => array('messages' => $this->_getBoxMessages('inbox_message'), - 'target' => 'sender'))); } } ?> \ No newline at end of file Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-10 09:29:13 UTC (rev 57) +++ app/views/message/_rows.tpl 2008-03-10 13:36:49 UTC (rev 58) @@ -2,7 +2,7 @@ <tbody> {loop messages} <? $sender = $message->$target->load() ?> -<tr class="<? if (!$message->is_read) { echo 'new_message'; } ?>"> +<tr class="<? if ($target == 'sender' && !$message->is_read) { echo 'new_message'; } ?>"> <td class="msg_icon"> <? if ($target == 'sender') { echo '<a href="">'; Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-10 09:29:13 UTC (rev 57) +++ app/views/message/inbox.tpl 2008-03-10 13:36:49 UTC (rev 58) @@ -81,7 +81,7 @@ function delete_thread (element) { new Ajax.Updater('messages', - '/message/delete_thread', + '/message/delete_inbox_thread', { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); disable_action_links(); return false; Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-03-10 09:29:13 UTC (rev 57) +++ app/views/message/outbox.tpl 2008-03-10 13:36:49 UTC (rev 58) @@ -3,23 +3,56 @@ <div class="inbox_submenu"> <div class="menu_block selector"> <label for="action_select">_{Select}: - <select class="" onchange="" id="action_select" name="action_selector"> + <select class="" onchange="onselect(this)" id="action_select" name="action_selector"> <option selected="selected" value="_">---------</option> - <option value="">_{None}</option> - <option value="read">_{Read}</option> - <option value="unread">_{Unread}</option> + <option value="none">_{None}</option> <option value="all">_{All}</option> </select> </label> </div> <div class="menu_block"> <ul id="inbox_action" class="buttons"> - <li class="disabled"><a href="#" onclick="" id="delete">_{Delete}</a></li> + <li><a href="#" onclick="delete_thread(this)" id="delete_link" class="disabled">_{Delete}</a></li> </ul> </div> </div> -<?= $controller->render(array('partial' => 'rows', - 'locals' => array('messages' => $outbox_messages, - 'target' => 'recipient'))) ?> +<form id="messages_form" action="/message/inbox" method="post" onsubmit="return false;"> + <div id="messages"> + <?= $controller->render(array('partial' => 'rows', + 'locals' => array('messages' => $outbox_messages, + 'target' => 'recipient'))) ?> + </div> +</form> +<script> +function oncheck (element, is_read) { + checked = $$('input[type=checkbox]:checked'); + checked.length ? $("delete_link").removeClassName('disabled') : $("delete_link").addClassName('disabled'); +}; + +function onselect (element) { + var checkboxes; + switch (element.getValue()) { + case "none": + checkboxes = $$('input[type=checkbox]:checked'); + break; + case "all": + checkboxes = $$('input[type=checkbox]:not(:checked)'); + break; + } + if (checkboxes) { + checkboxes.invoke('click'); + } +}; + +function delete_thread (element) { + new Ajax.Updater('messages', + '/message/delete_outbox_thread', + { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + $("delete_link").addClassName('disabled'); + return false; +} + +</script> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-06-01 15:39:56
|
Revision: 229 http://isocial.svn.sourceforge.net/isocial/?rev=229&view=rev Author: aguidrevitch Date: 2008-06-01 08:40:00 -0700 (Sun, 01 Jun 2008) Log Message: ----------- Independent File storage (on local disk) implemented Modified Paths: -------------- app/application_controller.php app/controllers/photoapp/album_controller.php app/installers/photoapp/album_installer.php app/installers/user_installer.php app/models/photoapp_album.php app/models/photoapp_photo.php app/models/user.php app/shared_model.php app/views/photoapp/album/view.tpl Added Paths: ----------- app/models/base_file.php app/models/stored_file.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/application_controller.php 2008-06-01 15:40:00 UTC (rev 229) @@ -20,8 +20,10 @@ var $_errors = array(); - var $app_models = array('User', 'Message'); - var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField'); + var $app_models = array('User', 'Message', 'BaseFile', 'StoredFile'); + var $app_helpers = array('AutoComplete', 'City', 'Dialog', 'AccessField'); + var $uploaded_files = array(); + var $current_user; function __construct () { @@ -40,6 +42,7 @@ function beforeAction ( $method = '' ) { $this->_validateLoginStatus(); + $this->_processFiles(); } function _validateLoginStatus () { @@ -47,6 +50,47 @@ $this->redirectTo(array( 'controller' => 'user', 'action' => 'login' )); } } + + + function _processFiles() { + $uploaded = $this->Request->_getNormalizedFilesArray($this->params); + foreach ($uploaded as $fieldname => $key_or_value) { + if (is_array($key_or_value)) { + foreach ($key_or_value as $key => $value) { + if ($stored = $this->_processSingleFile($key_or_value[$key])) { + array_push($this->uploaded_files, $stored); + } + } + } else { + if ($stored = $this->_processSingleFile($uploaded[$fieldname])) { + array_push($this->uploaded_files, $stored); + } + } + } + } + + function _isValidUploadedFile($tmpfile) { + return $this->_isImage($tmpfile['tmp_name']); + } + + function _isImage ($filename) { + return getimagesize($filename); + } + + function _processSingleFile($tmpfile) { + if (empty($tmpfile['error']) && $tmpfile['size'] > 0) { + if (!$this->_isValidUploadedFile($tmpfile)) { + return; + } + $stored = $this->current_user->stored_file->build(); + $stored->setAttributes($tmpfile); + if ($stored->upload($tmpfile['name'], $tmpfile['type'], $tmpfile['size'], $tmpfile['tmp_name'])) { + if ($stored->save()) { + return $stored; + } + } + } + } function _getUserFromSession () { if (isset($this->session['user_id'])) { Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/controllers/photoapp/album_controller.php 2008-06-01 15:40:00 UTC (rev 229) @@ -146,9 +146,24 @@ } } + /* + function _isValidUploadedFile($tmpfile) { + return true; + } + */ + function add_photo () { - if (!empty($this->params['album']) && !empty($_FILES)){ - $this->_upload($this->params); + if (!empty($this->params['album'])){ + $this->album = $this->PhotoappAlbum->find($this->params['id']); + foreach ($this->uploaded_files as $file) { + unset($photo); + $photo = $this->album->photo->build(); + $photo->base_file_id = $file->id; + //$photo->stored_file->assign($file); + //$photo->stored_file->build(); + //$photo->stored_file->assign($file); + $photo->save(); + } } else if ($this->params['id']) { $this->album = $this->PhotoappAlbum->find($this->params['id']); return; @@ -198,42 +213,6 @@ } } - function _upload($params) { - //$this->debug($_FILES); - for ($i = 1 ; $i < 6 ; $i++) { - $field = 'photo' . $i; - - if ($_FILES['album']['error'][$field] == 0 ) { - // copy file; save photo - $photo_name = microtime(true) . ".jpeg"; - $user_path = AK_PUBLIC_DIR. "/images/uploaded/" . $this->current_user->getId(); - if(!file_exists($user_path)) { - `mkdir $user_path`; - `chmod 777 $user_path`; - } - $copy_to = $user_path . "/" . $photo_name;//$_FILES['album']['name'][$field]; - $copy_from = $_FILES['album']['tmp_name'][$field]; - if (move_uploaded_file($copy_from, $copy_to)) { - $album = $this->PhotoappAlbum->find($this->params['id']); - $photo = new PhotoappPhoto (); - $photo->img = $this->current_user->getId() . "@" . $photo_name; - $photo->album_id = $album->getId(); - $photo->save(); - - $album = $this->PhotoappAlbum->find($this->params['id']); - if( empty($album->img)) { - $album->img = $photo->img; - $photo->save(); - } - //$album->photos_count += 1; - $album->save(); - } - } - } // for - $this->redirectTo(array('action' => 'uploaded', 'id' => $this->params['id'])); - - } - function defaultUrlOptions($options) { return array('id' => $this->params['id']); } Modified: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/installers/photoapp/album_installer.php 2008-06-01 15:40:00 UTC (rev 229) @@ -22,12 +22,13 @@ $this->execute( "CREATE TABLE `photoapp_photos` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `album_id` int(11) NOT NULL , + `album_id` int(11) NOT NULL, + `base_file_id` int(11) NOT NULL, `name` char(100) NOT NULL DEFAULT '', `caption` char(255) NOT NULL DEFAULT '', - `created_at` datetime NOT NULL , - `img` char(255) NOT NULL DEFAULT '' - + FOREIGN KEY (album_id) REFERENCES photoapp_albums(id), + FOREIGN KEY (base_file_id) REFERENCES base_files(id), + INDEX album_idx (album_id) ) ENGINE=InnoDB"); Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/installers/user_installer.php 2008-06-01 15:40:00 UTC (rev 229) @@ -14,6 +14,18 @@ `updated_at` datetime NOT NULL, `active` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `base_files` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `name` char(255) NOT NULL, + `type` char(40) NOT NULL, + `size` int(11) NOT NULL, + `created_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `confirmations` ( @@ -197,14 +209,10 @@ `address` varchar(100), `website` text, `city_id` int(11), - `mobile_access` int(11) NOT NULL DEFAULT 0, `land_access` int(11) NOT NULL DEFAULT 0, `address_access` int(11) NOT NULL DEFAULT 0, `website_access` int(11) NOT NULL DEFAULT 0, - - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (city_id) REFERENCES cities(id), INDEX user_idx (user_id) @@ -238,16 +246,12 @@ `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, `marital_status_id` int(11) NOT NULL, - `interested_in_men` bool, `interested_in_women` bool, `looking_for_friendship` bool, `looking_for_dating` bool, `looking_for_relationship` bool, `looking_for_networking` bool, - - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (marital_status_id) REFERENCES marital_statuses(id), INDEX user_idx (user_id) @@ -257,6 +261,7 @@ "CREATE TABLE `personal_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, + `former_name` varchar(100), `activities` text, `interests` text, `music` text, @@ -265,17 +270,42 @@ `books` text, `quotes` text, `about` text, - `created_at` datetime NOT NULL, - `updated_at` datetime NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `groups` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `name` varchar(255), + `type` + `city_id` int(11), + `count` int(11), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `group_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `group_id` int(11), + `from` datetime, + `to` datetime, + `position` char(100), + `concentration` char(100), + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); } function down_1() { $this->transactionComplete(); + $this->dropTable('group_profiles'); + $this->dropTable('groups'); $this->dropTable('personal_profiles'); $this->dropTable('marital_statuses'); $this->dropTable('relationship_profiles'); Added: app/models/base_file.php =================================================================== --- app/models/base_file.php (rev 0) +++ app/models/base_file.php 2008-06-01 15:40:00 UTC (rev 229) @@ -0,0 +1,21 @@ +<?php + +class BaseFile extends ActiveRecord +{ + var $table_name = 'base_files'; + var $belongs_to = array('User'); + + function upload () { + die("upload method is virtual"); + } + + function remove () { + die("remove method is virtual"); + } + + function url () { + die("url method is virtual"); + } +} + +?> Modified: app/models/photoapp_album.php =================================================================== --- app/models/photoapp_album.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/models/photoapp_album.php 2008-06-01 15:40:00 UTC (rev 229) @@ -2,7 +2,6 @@ class PhotoappAlbum extends ActiveRecord { - //var $has_one = array('group_member' => array('class_name' => 'GroupappMember','foreign_key' => 'group_id'), ); var $has_many = array('photos' => array('class_name' => 'PhotoappPhoto', 'foreign_key' => 'album_id')); function validateOnCreate () Modified: app/models/photoapp_photo.php =================================================================== --- app/models/photoapp_photo.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/models/photoapp_photo.php 2008-06-01 15:40:00 UTC (rev 229) @@ -2,10 +2,12 @@ class PhotoappPhoto extends ActiveRecord { - var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id') ); + var $belongs_to = array('album' => array('class_name' => 'PhotoappAlbum', 'primary_key_name' => 'album_id'), + 'stored_file' => array('class_name' => 'StoredFile', 'primary_key_name' => 'base_file_id')); + /* function beforeDestroy() { - + $albums_cover = $this->album->find('all', array('conditions' => array("img = '" . $this->img . "'"))); if ($albums_cover) foreach ($albums_cover as $album) { @@ -19,14 +21,9 @@ $file = AK_PUBLIC_DIR . "/images/uploaded/" . $path; `rm -f $file`; return parent::beforeDestroy(); + } - - function debug($str) { - echo "<pre>"; - print_r($str); - echo "</pre>"; - } - + */ } ?> \ No newline at end of file Added: app/models/stored_file.php =================================================================== --- app/models/stored_file.php (rev 0) +++ app/models/stored_file.php 2008-06-01 15:40:00 UTC (rev 229) @@ -0,0 +1,30 @@ +<?php + +class StoredFile extends BaseFile +{ + + function path () { + return "images" . DS . "uploaded" . DS . $this->user_id . DS; + } + + function upload ($name, $type, $size, $tmpname) { + $user_path = AK_PUBLIC_DIR . DS . $this->path(); + if(!file_exists($user_path)) { + mkdir($user_path, 0755, true); + } + $forbidden = preg_quote('\/:*?"<>', '/'); + $this->name = microtime(true) . "_" . preg_replace("/([\\x00-\\x1f{$forbidden}])/e", "_", $name); + return move_uploaded_file($tmpname, $user_path . DS . $this->name); + } + + function remove () { + unlink(AK_PUBLIC_DIR . DS . $this->path() . DS . $this->name); + } + + function url () { + return AK_ASSET_URL_PREFIX . "/" . $this->path() . "/" . $this->name; + } + +} + +?> Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/models/user.php 2008-06-01 15:40:00 UTC (rev 229) @@ -12,6 +12,8 @@ 'conditions' => 'is_recipient_del = 0'), 'im_profiles' => array('class_name' => 'ImProfile', 'foreign_key' => 'user_id'), + 'stored_files' => array('class_name' => 'StoredFile', + 'foreign_key' => 'user_id'), /* 'groupapp_groups' => array('class_name' => 'GroupappMember', */ /* 'foreign_key' => 'user_id'), */ ); Modified: app/shared_model.php =================================================================== --- app/shared_model.php 2008-05-29 17:22:03 UTC (rev 228) +++ app/shared_model.php 2008-06-01 15:40:00 UTC (rev 229) @@ -14,6 +14,11 @@ */ class ActiveRecord extends AkActiveRecord { + + function getInheritanceColumn() { + return false; + } + function collect(&$source_array, $key_index, $value_index) { $resulting_array = array(); @@ -111,4 +116,9 @@ } -?> +class MediaItem extends ActiveRecord { + var $table_name = 'media_items'; +} + + +?> \ No newline at end of file Modified: app/views/photoapp/album/view.tpl =================================================================== --- app/views/photoapp/album/view.tpl 2008-05-29 17:22:03 UTC (rev 228) +++ app/views/photoapp/album/view.tpl 2008-06-01 15:40:00 UTC (rev 229) @@ -17,7 +17,8 @@ {loop photos} <div class="photo_view"> <div class="img"> - <img src="/preview/index/100x100/<?= $photo->get('img')?>" /> + <ximg src="/preview/index/100x100/<?= $photo->stored_file->load()->url()?>" /> + <img src="<? $photo->stored_file->load(); echo $photo->stored_file->url() ?>" /> </div> <div class="links"> <ul class="actions_list"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-15 11:50:45
|
Revision: 238 http://isocial.svn.sourceforge.net/isocial/?rev=238&view=rev Author: dim0s77 Date: 2008-06-15 04:50:47 -0700 (Sun, 15 Jun 2008) Log Message: ----------- hide photos and videos in the Groups Modified Paths: -------------- app/installers/groupapp/group_installer.php app/views/groupapp/group/_customize.tpl app/views/groupapp/group/show_group.tpl Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-06-15 11:43:32 UTC (rev 237) +++ app/installers/groupapp/group_installer.php 2008-06-15 11:50:47 UTC (rev 238) @@ -40,9 +40,9 @@ `show_related_groups` tinyint(1) NOT NULL DEFAULT '1', `show_discussion_board` tinyint(1) NOT NULL DEFAULT '1', `show_wall` tinyint(1) NOT NULL DEFAULT '1', - `show_photos` tinyint(1) NOT NULL DEFAULT '1', + `show_photos` tinyint(1) NOT NULL DEFAULT '0', `photo_member` tinyint(1) NOT NULL DEFAULT '0', - `show_videos` tinyint(1) NOT NULL DEFAULT '1', + `show_videos` tinyint(1) NOT NULL DEFAULT '0', `video_member` tinyint(1) NOT NULL DEFAULT '0', `access` int(1) UNSIGNED NOT NULL DEFAULT '0', `show_in_search` tinyint(1) NOT NULL DEFAULT '1', Modified: app/views/groupapp/group/_customize.tpl =================================================================== --- app/views/groupapp/group/_customize.tpl 2008-06-15 11:43:32 UTC (rev 237) +++ app/views/groupapp/group/_customize.tpl 2008-06-15 11:50:47 UTC (rev 238) @@ -36,43 +36,43 @@ <div class="clearfix"></div> </div> - <div class="formrow"> - <label> </label> - <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_photos', array('class' => 'checkboxinput')) ?>_{Enable photos}.</label> - </div> - <div class="clearfix"></div> - </div> - <div class="formrow"> - <label> </label> - <div class="formcol"> - <div class="formblock border"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '0', array('checked' => 'checked', 'class' => 'radioinput')) ?>_{Allow all members to upload photos}.</label> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '1', array('class' => 'radioinput')) ?>_{Only allow admins to upload photos}.</label> - <div class="clearfix"></div> - </div> - </div> - <div class="clearfix"></div> - </div> +<!-- <div class="formrow"> --> +<!-- <label> </label> --> +<!-- <div class="formcol"> --> +<!-- <label class="checkbox"><?= $form_helper->check_box('group', 'show_photos', array('class' => 'checkboxinput')) ?>_{Enable photos}.</label> --> +<!-- </div> --> +<!-- <div class="clearfix"></div> --> +<!-- </div> --> +<!-- <div class="formrow"> --> +<!-- <label> </label> --> +<!-- <div class="formcol"> --> +<!-- <div class="formblock border"> --> +<!-- <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '0', array('checked' => 'checked', 'class' => 'radioinput')) ?>_{Allow all members to upload photos}.</label> --> +<!-- <label class="radiobutton"><?= $form_helper->radio_button('group', 'photo_member', '1', array('class' => 'radioinput')) ?>_{Only allow admins to upload photos}.</label> --> +<!-- <div class="clearfix"></div> --> +<!-- </div> --> +<!-- </div> --> +<!-- <div class="clearfix"></div> --> +<!-- </div> --> - <div class="formrow"> - <label> </label> - <div class="formcol"> - <label class="checkbox"><?= $form_helper->check_box('group', 'show_videos', array('class' => 'checkboxinput')) ?>_{Enable videos}.</label> - </div> - <div class="clearfix"></div> - </div> - <div class="formrow"> - <label> </label> - <div class="formcol"> - <div class="formblock border"> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '0', array('checked' => 'checked', 'class' => 'radioinput')) ?>_{Allow all members to upload videos}.</label> - <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '1', array('class' => 'radioinput')) ?>_{Only allow admins to upload videos}.</label> - <div class="clearfix"></div> - </div> - </div> - <div class="clearfix"></div> - </div> +<!-- <div class="formrow"> --> +<!-- <label> </label> --> +<!-- <div class="formcol"> --> +<!-- <label class="checkbox"><?= $form_helper->check_box('group', 'show_videos', array('class' => 'checkboxinput')) ?>_{Enable videos}.</label> --> +<!-- </div> --> +<!-- <div class="clearfix"></div> --> +<!-- </div> --> +<!-- <div class="formrow"> --> +<!-- <label> </label> --> +<!-- <div class="formcol"> --> +<!-- <div class="formblock border"> --> +<!-- <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '0', array('checked' => 'checked', 'class' => 'radioinput')) ?>_{Allow all members to upload videos}.</label> --> +<!-- <label class="radiobutton"><?= $form_helper->radio_button('group', 'video_member', '1', array('class' => 'radioinput')) ?>_{Only allow admins to upload videos}.</label> --> +<!-- <div class="clearfix"></div> --> +<!-- </div> --> +<!-- </div> --> +<!-- <div class="clearfix"></div> --> +<!-- </div> --> <div class="formrow"> <label>_{Access}:</label> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-06-15 11:43:32 UTC (rev 237) +++ app/views/groupapp/group/show_group.tpl 2008-06-15 11:50:47 UTC (rev 238) @@ -45,7 +45,7 @@ <div class="body"> <ul class="simple_list"> {loop admins} - <li><a href="/groupapp/">{admin.user.name?}</a> <span>(<?= $admin->role->get('name') ?>)</span></li> + <li><a href="/profile/show/{admin.user.id?}">{admin.user.name?}</a> <span>(<?= $admin->role->get('name') ?>)</span></li> {end} </ul> </div> @@ -73,6 +73,7 @@ </div> </div> + {?group.show_photos} <div class="box"> <div class="header"> <div class="box_title">_{Photos}</div> @@ -82,7 +83,9 @@ _{No one has uploaded any photos}. <a href="#">_{Add Photos}</a>. </div> </div> + {end} + {?group.show_videos} <div class="box"> <div class="header"> <div class="box_title">_{Videos}</div> @@ -92,6 +95,7 @@ _{No one has uploaded any videos}. <a href="#">_{Add Videos}</a>. </div> </div> + {end} <div class="box"> <div class="header"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-06-25 18:33:23
|
Revision: 251 http://isocial.svn.sourceforge.net/isocial/?rev=251&view=rev Author: dim0s77 Date: 2008-06-25 11:33:10 -0700 (Wed, 25 Jun 2008) Log Message: ----------- added rus translate of subgroup names Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/installers/groupapp/russian_installer.php app/views/groupapp/group/browse.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-06-25 16:35:09 UTC (rev 250) +++ app/controllers/groupapp/group_controller.php 2008-06-25 18:33:10 UTC (rev 251) @@ -251,26 +251,21 @@ function browse () { $all_groups = $this->GroupappGroup->find('all'); - $this->all_groups_count = count($all_groups); - if (!empty($this->params['g'])) { - $all_group_types = $this->GroupappGroupType->find('all'); + if (!($this->all_groups_count = count($all_groups))) { return; } + $all_group_types = $this->GroupappGroupType->find('all'); + if ($all_group_types) { foreach($all_group_types as $group_type) { + $gt = array("id" => $group_type->id, "parent_id" => $group_type->parent_id, "name" => $group_type->get('name')); if ($group_type->parent_id == 0) { - $gt = array("id" => $group_type->id, "name" => $group_type->get('name')); $this->group_types[] = $gt; - } else if (is_numeric($this->params['g']) && $group_type->parent_id == $this->params['g']) { - $this->subgroup_types[] = $group_type; - } - } - } else { - $all_group_types = $this->GroupappGroupType->find('all'); - $this->group_types = array(); - foreach($all_group_types as $group_type) { - if ($group_type->parent_id == 0) { - $gt = array("name" => $group_type->get('name'), "id" => $group_type->id); - $this->group_types[] = $gt; + } else if (!empty($this->params['g'])) { + if (is_numeric($this->params['g']) && $group_type->parent_id == $this->params['g']) { + $this->subgroup_types[] = $gt; + if (isset($this->params['sg']) && is_numeric($this->params['sg'])) { + $this->subgroup = $this->params['sg']; + } + } } else if ($group_type->parent_id == 1) { - $gt = array("id" => $group_type->id, "name" => $group_type->get('name')); $this->subgroup_types[] = $gt; } } Modified: app/installers/groupapp/russian_installer.php =================================================================== --- app/installers/groupapp/russian_installer.php 2008-06-25 16:35:09 UTC (rev 250) +++ app/installers/groupapp/russian_installer.php 2008-06-25 18:33:10 UTC (rev 251) @@ -18,6 +18,166 @@ $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Отдых и Спорт' WHERE id = 10"); $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Студенческие группы' WHERE id = 11"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Предприятия' WHERE id = 101"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Группы потребителей' WHERE id = 102"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Служба и работа' WHERE id = 103"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общее' WHERE id = 104"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Домашний бизнес' WHERE id = 105"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Инвестиции' WHERE id = 106"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Маркетинг и реклама' WHERE id = 107"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Связи с общественностью' WHERE id = 108"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Недвижимость' WHERE id = 109"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Активный отдых' WHERE id = 201"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Возраст' WHERE id = 202"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Красота' WHERE id = 203"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Доверие и благотворительность' WHERE id = 204"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Актуальные события' WHERE id = 205"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Знакомства и взаимоотношения' WHERE id = 206"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Семья' WHERE id = 207"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Продовольствие и напитки' WHERE id = 208"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Друзья' WHERE id = 209"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Садоводство' WHERE id = 210"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Здоровье и благополучие' WHERE id = 211"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='История' WHERE id = 212"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Хобби и ремесла' WHERE id = 213"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Языки' WHERE id = 214"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Домашние животные и звери' WHERE id = 215"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Философия' WHERE id = 216"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Политика' WHERE id = 217"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Религия и духовность' WHERE id = 218"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Наука' WHERE id = 219"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Самопомощь' WHERE id = 220"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Сексуальность' WHERE id = 221"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Путешествия' WHERE id = 222"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Вино' WHERE id = 223"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Книги и литература' WHERE id = 301"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Знаменитости' WHERE id = 302"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Комиксы и анимация' WHERE id = 303"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Танцы' WHERE id = 304"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Мода' WHERE id = 305"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Изобразительное искусство' WHERE id = 306"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общее' WHERE id = 307"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Юмор' WHERE id = 308"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Кино' WHERE id = 309"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Ночная жизнь' WHERE id = 310"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Online-медия' WHERE id = 311"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Performing Arts' WHERE id = 312"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Радио' WHERE id = 313"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Телевидение' WHERE id = 314"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Театр' WHERE id = 315"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Города' WHERE id = 401"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Страны' WHERE id = 402"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общее' WHERE id = 403"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Соседи' WHERE id = 404"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Места' WHERE id = 405"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Области' WHERE id = 406"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Дороги и транспорт' WHERE id = 407"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Государства' WHERE id = 408"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Компьютеры и комплектующие' WHERE id = 501"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Киберкультура' WHERE id = 502"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Гаджеты' WHERE id = 503"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Игры' WHERE id = 504"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общее' WHERE id = 505"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Языки программирования' WHERE id = 506"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Мобильные устройства' WHERE id = 507"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Мультимедиа' WHERE id = 508"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Новости' WHERE id = 509"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Программное обеспечение' WHERE id = 510"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Сайты' WHERE id = 511"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Классика PROJECT_NAME' WHERE id = 601"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Фан-клубы' WHERE id = 602"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Шутки' WHERE id = 603"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Иностранные утверждения' WHERE id = 604"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Слишком много информации' WHERE id = 605"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Сплошной бред' WHERE id = 606"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Флуд' WHERE id = 607"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Блюз' WHERE id = 701"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Классика' WHERE id = 702"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Кантри' WHERE id = 703"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Танцевальная' WHERE id = 704"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Электронная' WHERE id = 705"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Фольклор' WHERE id = 706"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общее' WHERE id = 707"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Инди' WHERE id = 708"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Инструментальная' WHERE id = 709"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Интернациональная' WHERE id = 710"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Джаз' WHERE id = 711"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Латино' WHERE id = 712"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Живая музыка' WHERE id = 713"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Металл' WHERE id = 714"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='R&B и Soul' WHERE id = 715"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Рэп и Хип-Хоп' WHERE id = 716"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Рэгги' WHERE id = 717"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Религиозная' WHERE id = 718"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Рок' WHERE id = 719"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Звукозапись' WHERE id = 720"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Академические организации' WHERE id = 801"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Правозащитные организации' WHERE id = 802"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Клубы и общества' WHERE id = 803"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общественные организации' WHERE id = 804"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общее' WHERE id = 805"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Некомерческие организации' WHERE id = 806"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Благотворительные организации' WHERE id = 807"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Политические организации' WHERE id = 808"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Профессиональные организации' WHERE id = 809"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Религиозные организации' WHERE id = 810"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Волонтерские организации' WHERE id = 811"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Рекламное' WHERE id = 901"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Автомобили и Рэйсинг' WHERE id = 1001"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Группы поддержки' WHERE id = 1002"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Коллежский спорт' WHERE id = 1003"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Танцы' WHERE id = 1004"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Экстремальный спорт' WHERE id = 1005"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Фэнтези спорт' WHERE id = 1006"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Фитнесс и физкультура' WHERE id = 1007"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Изартные игры' WHERE id = 1008"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Игры' WHERE id = 1009"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общий спорт' WHERE id = 1010"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Университетский спорт' WHERE id = 1011"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Интернациональный спорт' WHERE id = 1012"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Спорт в помещении' WHERE id = 1013"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Боевые искусства' WHERE id = 1014"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Олимпийский спорт' WHERE id = 1015"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Спорт на отрытом воздухе' WHERE id = 1016"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Профессиональный спорт' WHERE id = 1017"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Развлекательный спорт' WHERE id = 1018"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Спортивные лиги' WHERE id = 1019"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Водный спорт' WHERE id = 1020"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Тяжелая атлетика и бодибилдинг' WHERE id = 1021"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Зимний спорт' WHERE id = 1022"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Йога' WHERE id = 1023"); + + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Заграничные/иностранные группы' WHERE id = 1101"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Академические группы' WHERE id = 1102"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Консультационные группы' WHERE id = 1103"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Выпускные группы' WHERE id = 1104"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Классы и факультеты' WHERE id = 1105"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Клубы и общества' WHERE id = 1106"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Сообщества' WHERE id = 1107"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Творческие группы' WHERE id = 1108"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общежития и резиденции' WHERE id = 1109"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Этнические/культурные группы' WHERE id = 1110"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Содружества и соратничества' WHERE id = 1111"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Общее' WHERE id = 1112"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Журналистские группы' WHERE id = 1113"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Музыкальные группы' WHERE id = 1114"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Политические группы' WHERE id = 1115"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Полупрофессиональные группы' WHERE id = 1116"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Религиозные группы' WHERE id = 1117"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Группы по оказанию услуг' WHERE id = 1118"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Социальные группы' WHERE id = 1119"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Студенческое управление' WHERE id = 1120"); + $this->execute("UPDATE groupapp_group_types set {$locale}_name ='Студенческие группы' WHERE id = 1121"); + $this->execute("ALTER TABLE groupapp_member_roles ADD COLUMN {$locale}_name char(100) NOT NULL AFTER en_name"); $this->execute("UPDATE groupapp_member_roles set {$locale}_name ='Владелец' WHERE id = 1"); $this->execute("UPDATE groupapp_member_roles set {$locale}_name ='Администратор' WHERE id = 2"); Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-06-25 16:35:09 UTC (rev 250) +++ app/views/groupapp/group/browse.tpl 2008-06-25 18:33:10 UTC (rev 251) @@ -2,14 +2,24 @@ {?all_groups_count} <div class="info">_{You are in groups}: <? if (isset($user_groups)) echo count($user_groups); else echo 0; ?></div> + <div class="two_column"> <div class="right_small"> <div class="right_content"> <ul class="actions_list"> {loop group_types} - <li><a href="#">{group_type-name}</a></li> + <li><a href="/groupapp/group/browse?g={group_type-id?}">{group_type-name}</a></li> {end} </ul> + <ul> + {loop subgroup_types} + <? if (isset($subgroup) && $subgroup == $subgroup_type["id"]) { ?> + <li><b>{subgroup_type-name?}</b></li> + <? } else { ?> + <li><a href="/groupapp/group/browse?g={subgroup_type-parent_id?}&sg={subgroup_type-id?}">{subgroup_type-name?}</a></li> + <? } ?> + {end} + </ul> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-07-03 19:04:37
|
Revision: 263 http://isocial.svn.sourceforge.net/isocial/?rev=263&view=rev Author: aguidrevitch Date: 2008-07-03 12:04:46 -0700 (Thu, 03 Jul 2008) Log Message: ----------- initial network profile upload Modified Paths: -------------- app/controllers/profile_controller.php app/installers/user_installer.php app/views/profile/_menu.tpl Added Paths: ----------- app/models/network.php app/models/network_profile.php app/views/profile/networks.tpl Removed Paths: ------------- app/views/profile/groups.tpl Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-07-03 17:39:44 UTC (rev 262) +++ app/controllers/profile_controller.php 2008-07-03 19:04:46 UTC (rev 263) @@ -109,7 +109,7 @@ } } - function groups () { + function networks () { } function picture () { Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-07-03 17:39:44 UTC (rev 262) +++ app/installers/user_installer.php 2008-07-03 19:04:46 UTC (rev 263) @@ -286,14 +286,21 @@ ) ENGINE=InnoDB"); $this->execute( - "CREATE TABLE `group_profiles` ( + "CREATE TABLE `networks` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `city_id` int(11), + `name` char(255) + FOREIGN KEY (user_id) REFERENCES users(id), + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `network_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `user_id` int(11) NOT NULL, - `group_id` int(11), + `network_id` int(11), `from` datetime, `to` datetime, - `position` char(100), - `concentration` char(100), + `description` char(255), FOREIGN KEY (user_id) REFERENCES users(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); @@ -303,8 +310,8 @@ { $this->transactionComplete(); - $this->dropTable('group_profiles'); - $this->dropTable('groups'); + $this->dropTable('network_profiles'); + $this->dropTable('networks'); $this->dropTable('personal_profiles'); $this->dropTable('marital_statuses'); $this->dropTable('relationship_profiles'); Added: app/models/network.php =================================================================== --- app/models/network.php (rev 0) +++ app/models/network.php 2008-07-03 19:04:46 UTC (rev 263) @@ -0,0 +1,36 @@ +<?php + +class Network extends VotableActiveRecord +{ + var $belongs_to = array('City'); + var $votes_model = 'NetworkVote'; + var $strtolower = false; + var $_alternate = false; + + function findConditions () { + return array('conditions' => array("country_id = ? AND region_id = ? AND name LIKE ?", $this->country_id, $this->region_id, $this->name)); + } + + function validateOnCreate () { + $this->validatesPresenceOf('name', "Network Name|network name can't be blank"); + $this->validatesPresenceOf('city_id', "City|city can't be blank"); + if (!$this->getErrors()) { + $this->validatesNumericalityOf('city_id', "City: hack attempt detected|city does not exist"); + if (!$this->getErrors()) { + $City = new City(); + $city = $City->find( $this->city_id ); + if (empty($city)) { + $this->addError('city_id', "City: hack attempt detected|city does not exist"); + } + } + } + } + +} + +class NetworkVote extends ActiveRecord +{ + var $primary_key_name = 'network_id'; +} + +?> Added: app/models/network_profile.php =================================================================== --- app/models/network_profile.php (rev 0) +++ app/models/network_profile.php 2008-07-03 19:04:46 UTC (rev 263) @@ -0,0 +1,8 @@ +<?php + +class NetworkProfile extends ActiveRecord +{ + var $belongs_to = array('User', 'Network'); +} + +?> Modified: app/views/profile/_menu.tpl =================================================================== --- app/views/profile/_menu.tpl 2008-07-03 17:39:44 UTC (rev 262) +++ app/views/profile/_menu.tpl 2008-07-03 19:04:46 UTC (rev 263) @@ -6,7 +6,7 @@ ?><li><a href="/profile/contact" class="<?= $controller->getActionName() == 'contact' ? 'selected' : '' ?>">_{Contact}</a></li><? ?><li><a href="/profile/relationships" class="<?= $controller->getActionName() == 'relationships' ? 'selected' : '' ?>">_{Relationships}</a></li><? ?><li><a href="/profile/personal" class="<?= $controller->getActionName() == 'personal' ? 'selected' : '' ?>">_{Personal}</a></li><? - ?><li><a href="/profile/groups" class="<?= $controller->getActionName() == 'groups' ? 'selected' : '' ?>">_{Groups}</a></li><? + ?><li><a href="/profile/networks" class="<?= $controller->getActionName() == 'groups' ? 'selected' : '' ?>">_{Groups}</a></li><? ?><li><a href="/profile/picture" class="last <?= $controller->getActionName() == 'picture' ? 'selected' : '' ?>">_{Picture}</a></li> </ul> </div> Deleted: app/views/profile/groups.tpl =================================================================== --- app/views/profile/groups.tpl 2008-07-03 17:39:44 UTC (rev 262) +++ app/views/profile/groups.tpl 2008-07-03 19:04:46 UTC (rev 263) @@ -1,5 +0,0 @@ -<?= $controller->renderPartial("menu") ?> - -<?= $controller->renderErrors() ?> - -<p class="indent">Coming soon</p> \ No newline at end of file Added: app/views/profile/networks.tpl =================================================================== --- app/views/profile/networks.tpl (rev 0) +++ app/views/profile/networks.tpl 2008-07-03 19:04:46 UTC (rev 263) @@ -0,0 +1,5 @@ +<?= $controller->renderPartial("menu") ?> + +<?= $controller->renderErrors() ?> + +<p class="indent">Coming soon</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-07-08 12:47:48
|
Revision: 272 http://isocial.svn.sourceforge.net/isocial/?rev=272&view=rev Author: dim0s77 Date: 2008-07-08 05:47:57 -0700 (Tue, 08 Jul 2008) Log Message: ----------- added picture upload to the few groupapp pages Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/installers/groupapp/group_installer.php app/models/groupapp_group.php app/models/user.php app/views/blogapp/post/_form.tpl app/views/groupapp/group/_customize.tpl app/views/groupapp/group/_picture_upload.tpl app/views/groupapp/group/browse.tpl app/views/groupapp/group/customize.tpl app/views/groupapp/group/index.tpl app/views/groupapp/group/show_group.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-07 19:30:34 UTC (rev 271) +++ app/controllers/groupapp/group_controller.php 2008-07-08 12:47:57 UTC (rev 272) @@ -19,7 +19,11 @@ if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { $group = $this->GroupappGroup->find( $this->params['id'] ); if (isset($group) && $group) { - if ($group->base_file_id) { $group->picture->load(); } + $this->group_picture = GROUPAPP_DEFAULT_PICTURE_URL; + if ($group->stored_file_id) { + $group->picture->load(); + $this->group_picture = $group->picture->url(); + } $this->group = $group; $members = $this->_getGroupMembers($this->group->getId()); $current_user_id = $this->current_user->getId(); @@ -100,13 +104,9 @@ function edit_group () { if (isset($this->group)) { - $this->group_picture = GROUPAPP_DEFAULT_PICTURE_URL; - if ($this->group->picture) { - $this->group_picture = $this->group->picture->url(); - } if (!empty($this->params['group'])){ - if ($this->params['group']['base_file_id'] != $this->group->base_file_id) { - $stored_file = $this->StoredFile->findFirst(array( 'id' => $this->params['group']['base_file_id'] )); + if ($this->params['group']['stored_file_id'] != $this->group->stored_file_id) { + $stored_file = $this->StoredFile->findFirst(array( 'id' => $this->params['group']['stored_file_id'] )); $this->group->picture->assign($stored_file); } $this->group->setAttributes($this->params['group']); @@ -281,7 +281,7 @@ $links = $group_pages->paginator->getLinks(); $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; - $_filter = array('conditions' => "type_id" . $type_id); + $_filter = array('conditions' => "type_id" . $type_id, 'include' => 'picture'); $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); $this->groups = $this->GroupappGroup->find('all', $options); } Modified: app/installers/groupapp/group_installer.php =================================================================== --- app/installers/groupapp/group_installer.php 2008-07-07 19:30:34 UTC (rev 271) +++ app/installers/groupapp/group_installer.php 2008-07-08 12:47:57 UTC (rev 272) @@ -206,10 +206,10 @@ `video_member` tinyint(1) NOT NULL DEFAULT '0', `access` int(1) UNSIGNED NOT NULL DEFAULT '0', `show_in_search` tinyint(1) NOT NULL DEFAULT '1', - `base_file_id` int(11) DEFAULT NULL, + `stored_file_id` int(11) DEFAULT NULL, FOREIGN KEY (type_id) REFERENCES groupapp_group_types(id), - FOREIGN KEY (base_file_id) REFERENCES base_files(id), + FOREIGN KEY (stored_file_id) REFERENCES base_files(id), INDEX type_idx (type_id) ) ENGINE=InnoDB"); Modified: app/models/groupapp_group.php =================================================================== --- app/models/groupapp_group.php 2008-07-07 19:30:34 UTC (rev 271) +++ app/models/groupapp_group.php 2008-07-08 12:47:57 UTC (rev 272) @@ -3,19 +3,15 @@ class GroupappGroup extends ActiveRecord { var $has_one = array('group_member' => array('class_name' => 'GroupappMember', - 'foreign_key' => 'groupapp_group_id') - ); - var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', - 'foreign_key' => 'groupapp_group_id') ); + 'foreign_key' => 'groupapp_group_id')); + var $has_many = array( 'messages' => array('class_name' => 'GroupappMessage', + 'foreign_key' => 'groupapp_group_id')); - var $belongs_to = array('group_type' => array('class_name' => 'GroupappGroupType', + var $belongs_to = array('group_type' => array('class_name' => 'GroupappGroupType', 'primary_key_name' => 'type_id'), - 'picture' => array('class_name' => 'StoredFile', - 'primary_key_name' => 'base_file_id') + 'picture' => array('class_name' => 'StoredFile', + 'primary_key_name' => 'stored_file_id')); - ); - - function validateOnCreate () { $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-07-07 19:30:34 UTC (rev 271) +++ app/models/user.php 2008-07-08 12:47:57 UTC (rev 272) @@ -14,8 +14,6 @@ 'foreign_key' => 'user_id'), 'stored_files' => array('class_name' => 'StoredFile', 'foreign_key' => 'user_id'), - /* 'groupapp_groups' => array('class_name' => 'GroupappMember', */ - /* 'foreign_key' => 'user_id'), */ ); var $has_and_belongs_to_many = array('groupapp_groups' => array('join_table' => 'groupapp_members')); Modified: app/views/blogapp/post/_form.tpl =================================================================== --- app/views/blogapp/post/_form.tpl 2008-07-07 19:30:34 UTC (rev 271) +++ app/views/blogapp/post/_form.tpl 2008-07-08 12:47:57 UTC (rev 272) @@ -21,7 +21,7 @@ <div class="formrow"> <label class="required">_{Attach}:<br><small>(_{required})</small></label> <div class="formcol"> - <?= $form_helper->file_field('post', 'base_file_id', array('class' => 'textinput small')) ?> + <?= $form_helper->file_field('post', 'stored_file_id', array('class' => 'textinput small')) ?> </div> <div class="clearfix"></div> </div> Modified: app/views/groupapp/group/_customize.tpl =================================================================== --- app/views/groupapp/group/_customize.tpl 2008-07-07 19:30:34 UTC (rev 271) +++ app/views/groupapp/group/_customize.tpl 2008-07-08 12:47:57 UTC (rev 272) @@ -137,4 +137,4 @@ </div> <div class="clearfix"></div> - <?= $form_helper->hidden_field('group', 'base_file_id') ?> + <?= $form_helper->hidden_field('group', 'stored_file_id') ?> Modified: app/views/groupapp/group/_picture_upload.tpl =================================================================== --- app/views/groupapp/group/_picture_upload.tpl 2008-07-07 19:30:34 UTC (rev 271) +++ app/views/groupapp/group/_picture_upload.tpl 2008-07-08 12:47:57 UTC (rev 272) @@ -8,7 +8,7 @@ var uploaded = response.evalJSON(true); if (uploaded.length) { $('current_picture').innerHTML = '<img src="/preview/200x200/' + uploaded[0].url + '">'; - $('group_base_file_id').value = uploaded[0].id; + $('group_stored_file_id').value = uploaded[0].id; } } @@ -32,7 +32,9 @@ <div class="left_content"> <div class="imghead">_{Current picture}:<br><br> - <div id="current_picture"><img src="/preview/200x200/{group_picture}"></div> + <div id="current_picture"> + <img src="/preview/200x200/{group_picture}"> + </div> </div> </div> Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-07 19:30:34 UTC (rev 271) +++ app/views/groupapp/group/browse.tpl 2008-07-08 12:47:57 UTC (rev 272) @@ -75,7 +75,12 @@ <div class="group_row"> <div class="avatar"> - <a href="/groupapp/group/show_group/{group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + {?group.picture.id} + <? $group_picture = $group->picture->load()->url(); ?> + {else} + <? $group_picture = GROUPAPP_DEFAULT_PICTURE_URL; ?> + {end} + <a href="/groupapp/group/show_group/{group.id?}"><img src="/preview/100x100/{group_picture}"></a> </div> <div class="actions"> Modified: app/views/groupapp/group/customize.tpl =================================================================== --- app/views/groupapp/group/customize.tpl 2008-07-07 19:30:34 UTC (rev 271) +++ app/views/groupapp/group/customize.tpl 2008-07-08 12:47:57 UTC (rev 272) @@ -10,6 +10,12 @@ <?= $controller->renderPartial("bar") ?> <div class="editform"> + <div class="formrow"> + <?= $controller->renderErrors() ?> + </div> + + <?= $controller->renderPartial("picture_upload") ?> + <form action="/groupapp/group/customize/{group.id?}" method="post"> <?= $controller->renderPartial("customize") ?> </form> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-07 19:30:34 UTC (rev 271) +++ app/views/groupapp/group/index.tpl 2008-07-08 12:47:57 UTC (rev 272) @@ -50,7 +50,12 @@ </div> <div class="avatar"> - <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/images/nophoto_men_sm.gif" alt="" class=""></a> + {?user_group.stored_file_id} + <? $group_picture = $user_group->picture->load()->url(); ?> + {else} + <? $group_picture = GROUPAPP_DEFAULT_PICTURE_URL; ?> + {end} + <a href="/groupapp/group/show_group/{user_group.id?}"><img src="/preview/100x100/{group_picture}"></a> </div> <div class="info"> Modified: app/views/groupapp/group/show_group.tpl =================================================================== --- app/views/groupapp/group/show_group.tpl 2008-07-07 19:30:34 UTC (rev 271) +++ app/views/groupapp/group/show_group.tpl 2008-07-08 12:47:57 UTC (rev 272) @@ -12,7 +12,7 @@ <div class="right_content"> <div class="group_avatar"> - <img src="/images/nophoto_men_sm.gif" alt="" class=""> + <img src="/preview/100x100/{group_picture}"> </div> <ul class="actions_list"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-10 16:47:38
|
Revision: 59 http://isocial.svn.sourceforge.net/isocial/?rev=59&view=rev Author: dim0s77 Date: 2008-03-10 09:47:44 -0700 (Mon, 10 Mar 2008) Log Message: ----------- added deleting of single thread Modified Paths: -------------- app/controllers/message_controller.php app/views/message/_rows.tpl app/views/message/inbox.tpl app/views/message/outbox.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-10 13:36:49 UTC (rev 58) +++ app/controllers/message_controller.php 2008-03-10 16:47:44 UTC (rev 59) @@ -21,12 +21,11 @@ $box_messages = array(); if(!empty($messages)) { foreach ($messages as $message_loop_key => $message) { - if (!isset($inbox_messages[$message->thread_id])) { + if (!isset($box_messages[$message->thread_id])) { $box_messages[$message->thread_id] = $message; } } } - $user_id = $box_message == 'inbox_message' ? 'sender_id' : 'recipient_id'; $this->message_threads = count($box_messages); return $box_messages; } @@ -159,7 +158,7 @@ $this->_delete_thread(); return $this->render(array('partial' => 'rows', 'locals' => array('messages' => $this->_getBoxMessages('outbox_message'), - 'target' => 'sender'))); + 'target' => 'recipient'))); } function _delete_thread () { Modified: app/views/message/_rows.tpl =================================================================== --- app/views/message/_rows.tpl 2008-03-10 13:36:49 UTC (rev 58) +++ app/views/message/_rows.tpl 2008-03-10 16:47:44 UTC (rev 59) @@ -33,7 +33,7 @@ </div> </td> <td class="delete_msg"> - <a href="#" onclick=""> </a> + <a href="#" onclick="delete_single_thread(this)" name="{message.id}"> </a> </td> </tr> {else} @@ -45,4 +45,3 @@ </table> <div class="inbox_footer"><div class="mailbox_size">{message_threads} _{Message Threads}</div></div> - Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-10 13:36:49 UTC (rev 58) +++ app/views/message/inbox.tpl 2008-03-10 16:47:44 UTC (rev 59) @@ -17,7 +17,7 @@ <li><a class="disabled">_{Mark as}:</a></li> <li><a href="#" onclick="mark_as_unread(this)" id="unread_link" class="disabled">_{Unread},</a></li> <li><a href="#" onclick="mark_as_read(this)" id="read_link" class="disabled">_{Read};</a></li> - <li><a href="#" onclick="delete_thread(this)" id="delete_link" class="disabled">_{Delete}</a></li> + <li><a href="#" onclick="delete_threads(this)" id="delete_link" class="disabled">_{Delete}</a></li> </ul> </div> </div> @@ -31,9 +31,15 @@ </form> <script> +var checkids = new Array(); function oncheck (element, is_read) { + checked = $$('input[type=checkbox]:checked'); checkread = $$('input[type=checkbox].checkread:checked'); checkunread = $$('input[type=checkbox].checkunread:checked'); + checkids.clear(); + for (var index = 0; index < checked.length; index++) { + checkids.push(checked[index].id); + } checkread.length ? $("unread_link").removeClassName('disabled') : $("unread_link").addClassName('disabled'); checkunread.length ? $("read_link").removeClassName('disabled') : $("read_link").addClassName('disabled'); @@ -79,14 +85,35 @@ return false; } -function delete_thread (element) { +function delete_threads (element) { new Ajax.Updater('messages', '/message/delete_inbox_thread', - { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + { method:'post', + asynchronous:true, + parameters:$('messages_form').serialize() + }); disable_action_links(); return false; } +function delete_single_thread (element) { + new Ajax.Updater('messages', + '/message/delete_inbox_thread', + { method:'post', + asynchronous:true, + parameters: 'check_messages[]=' + element.name, + onComplete: function () { + disable_action_links(); + tocheck = new Array(); + $$('input[type=checkbox]').each( function (el) { + if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } + }); + tocheck.invoke('click'); + } + }); + return false; +} + function disable_action_links () { $("read_link").addClassName('disabled'); $("unread_link").addClassName('disabled'); Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-03-10 13:36:49 UTC (rev 58) +++ app/views/message/outbox.tpl 2008-03-10 16:47:44 UTC (rev 59) @@ -12,12 +12,12 @@ </div> <div class="menu_block"> <ul id="inbox_action" class="buttons"> - <li><a href="#" onclick="delete_thread(this)" id="delete_link" class="disabled">_{Delete}</a></li> + <li><a href="#" onclick="delete_threads(this)" id="delete_link" class="disabled">_{Delete}</a></li> </ul> </div> </div> -<form id="messages_form" action="/message/inbox" method="post" onsubmit="return false;"> +<form id="messages_form" action="/message/outbox" method="post" onsubmit="return false;"> <div id="messages"> <?= $controller->render(array('partial' => 'rows', 'locals' => array('messages' => $outbox_messages, @@ -26,8 +26,13 @@ </form> <script> +var checkids = new Array(); function oncheck (element, is_read) { - checked = $$('input[type=checkbox]:checked'); + checkids = $$('input[type=checkbox]:checked').toArray(); + checkids.clear(); + for (var index = 0; index < checked.length; index++) { + checkids.push(checked[index].id); + } checked.length ? $("delete_link").removeClassName('disabled') : $("delete_link").addClassName('disabled'); }; @@ -46,13 +51,34 @@ } }; -function delete_thread (element) { +function delete_threads (element) { new Ajax.Updater('messages', '/message/delete_outbox_thread', - { method:'post', asynchronous:true, parameters:$('messages_form').serialize()}); + { method:'post', + asynchronous:true, + parameters:$('messages_form').serialize() + }); $("delete_link").addClassName('disabled'); return false; } +function delete_single_thread (element) { + new Ajax.Updater('messages', + '/message/delete_outbox_thread', + { method:'post', + asynchronous:true, + parameters: 'check_messages[]=' + element.name, + onComplete: function () { + $("delete_link").addClassName('disabled'); + tocheck = new Array(); + $$('input[type=checkbox]').each( function (el) { + if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } + }); + tocheck.invoke('click'); + } + }); + return false; +} + </script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-11 18:57:08
|
Revision: 60 http://isocial.svn.sourceforge.net/isocial/?rev=60&view=rev Author: aguidrevitch Date: 2008-03-11 11:57:11 -0700 (Tue, 11 Mar 2008) Log Message: ----------- number of unread messages is displayed instantly on page load (was ajax update only) Modified Paths: -------------- app/application_controller.php app/controllers/message_controller.php app/models/message.php app/views/shared/loggedin/pageheader.tpl Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-10 16:47:44 UTC (rev 59) +++ app/application_controller.php 2008-03-11 18:57:11 UTC (rev 60) @@ -19,7 +19,7 @@ var $_errors = array(); - var $models = array('User'); + var $app_models = array('User', 'Message'); var $app_helpers = array('AutoComplete', 'City'); var $current_user; @@ -173,66 +173,9 @@ return "=?utf-8?B?" . base64_encode($value) . "?="; } - - function auto_complete_for_city () { - if (empty($this->params['city'])) { - $this->renderNothing(); - } else { - $query = $this->params['city']; - - $entries = $this->City->find('all', - array('conditions' => - array( - 'first_id IS NOT NULL AND name LIKE ?', $query . '%' - ), - 'include' => 'country', - 'limit' => 10 - ) - ); - - $limit = empty($entries) ? 10 : 10 - count($entries); - if ($limit) { - $aquery = utf8_to_ascii($query); - if ($aquery != $query) { - $asciied = $this->City->find('all', - array('conditions' => - array( - 'first_id IS NOT NULL AND name LIKE ?', $aquery . '%' - ), - 'include' => 'country', - 'limit' => $limit - ) - ); - } - } - - if (empty($entries) && empty($asciied)) { - $entries = array(); - } else if (empty($entries)) { - $entries = $asciied; - } else if (empty($asciied)) { - $entries = $entries; - } else { - $entries = array_merge($entries, $asciied); - } - $this->renderText( $this->city_helper->auto_complete_result($entries, $query) ); - } + function unread_messages_count () { + return $this->current_user ? $this->Message->unread_messages_count($this->current_user->getId()) : 0; } - - function _auto_complete_result ($items, $field, $phrase = '') { - // converting to an array - $entries = array(); - foreach ($items as $item) { - $entry = array(); - foreach ($item->getColumns() as $column => $details) { - $entry[$column] = $item->get($column); - } - $entries[] = $entry; - } - - return $this->javascript_macros_helper->auto_complete_result($entries, $field, $phrase); - } - } ?> Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-10 16:47:44 UTC (rev 59) +++ app/controllers/message_controller.php 2008-03-11 18:57:11 UTC (rev 60) @@ -113,11 +113,7 @@ } function inbox_count () { - if ($this->current_user) { - $count = $this->Message->count('id', array('conditions' => array("recipient_id = ? AND is_read = 0", $this->current_user->getId()))); - return $this->renderText($count); - } - return $this->renderNothing(); + return $this->renderText( $this->unread_messages_count() ); } function mark_unread () { Modified: app/models/message.php =================================================================== --- app/models/message.php 2008-03-10 16:47:44 UTC (rev 59) +++ app/models/message.php 2008-03-11 18:57:11 UTC (rev 60) @@ -5,6 +5,9 @@ var $belongs_to = array('sender' => array('class_name' => 'User', 'primary_key_name' => 'sender_id'), 'recipient' => array('class_name' => 'User', 'primary_key_name' => 'recipient_id')); + function unread_messages_count ( $recipient_id ) { + return $this->count('id', array('conditions' => array("recipient_id = ? AND is_read = 0", $recipient_id))); + } } ?> Modified: app/views/shared/loggedin/pageheader.tpl =================================================================== --- app/views/shared/loggedin/pageheader.tpl 2008-03-10 16:47:44 UTC (rev 59) +++ app/views/shared/loggedin/pageheader.tpl 2008-03-11 18:57:11 UTC (rev 60) @@ -1,7 +1,7 @@ <ul id="headermenuleft"> <li><a class="globallink" href="/profile/">_{Profile}</a> <a href="/profile/basic">_{edit}</a></li> <li><a class="globallink" href="/friend/">_{Friends}</a></li> - <li><a class="globallink" href="/message/">_{Messages} (<span id="messages_count">0</span>)</a></li> + <li><a class="globallink" href="/message/">_{Messages} (<span id="messages_count"><?= $controller->unread_messages_count() ?></span>)</a></li> </ul> <ul id="headermenuright"> <li><a href="/user/logout">_{Logout}</a></li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-11 19:21:34
|
Revision: 61 http://isocial.svn.sourceforge.net/isocial/?rev=61&view=rev Author: dim0s77 Date: 2008-03-11 12:21:38 -0700 (Tue, 11 Mar 2008) Log Message: ----------- delete message after mark it as deleted by two interlocutors Modified Paths: -------------- app/controllers/message_controller.php app/installers/message_installer.php app/locales/message/ru.php app/models/user.php app/views/message/outbox.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-11 18:57:11 UTC (rev 60) +++ app/controllers/message_controller.php 2008-03-11 19:21:38 UTC (rev 61) @@ -165,7 +165,9 @@ foreach ($threads as $thread_loop_key => $thread) { if ($thread->sender_id == $this->current_user->getId() || $thread->recipient_id == $this->current_user->getId()) { - $this->Message->destroyAll("thread_id = $thread->thread_id"); + $is_del = $thread->sender_id == $this->current_user->getId() ? 'is_sender_del' : 'is_recipient_del'; + $this->Message->updateAll("$is_del = 1", "thread_id = " . $thread->getId()); + $this->Message->destroyAll("is_sender_del = 1 AND is_recipient_del = 1"); } } } Modified: app/installers/message_installer.php =================================================================== --- app/installers/message_installer.php 2008-03-11 18:57:11 UTC (rev 60) +++ app/installers/message_installer.php 2008-03-11 19:21:38 UTC (rev 61) @@ -5,14 +5,16 @@ { $this->execute( "CREATE TABLE `messages` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `sender_id` int(11) NOT NULL DEFAULT 0, - `recipient_id` int(11) NOT NULL DEFAULT 0, - `thread_id` int(11) NOT NULL DEFAULT 0, - `subject` char(255) NOT NULL DEFAULT '', - `body` text NOT NULL DEFAULT '', - `created_at` datetime NOT NULL, - `is_read` tinyint(1) NOT NULL DEFAULT '0', + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `sender_id` int(11) NOT NULL DEFAULT 0, + `recipient_id` int(11) NOT NULL DEFAULT 0, + `thread_id` int(11) NOT NULL DEFAULT 0, + `subject` char(255) NOT NULL DEFAULT '', + `body` text NOT NULL DEFAULT '', + `created_at` datetime NOT NULL, + `is_read` tinyint(1) NOT NULL DEFAULT '0', + `is_sender_del` tinyint(1) NOT NULL DEFAULT '0', + `is_recipient_del` tinyint(1) NOT NULL DEFAULT '0', FOREIGN KEY (sender_id) REFERENCES users(id), FOREIGN KEY (recipient_id) REFERENCES users(id) ) ENGINE=InnoDB"); Modified: app/locales/message/ru.php =================================================================== --- app/locales/message/ru.php 2008-03-11 18:57:11 UTC (rev 60) +++ app/locales/message/ru.php 2008-03-11 19:21:38 UTC (rev 61) @@ -21,7 +21,7 @@ $dictionary['Delete'] = 'Удалить'; $dictionary['New message'] = 'Новое сообщение'; $dictionary['Message is readed'] = 'Сообщение прочитано'; -$dictionary['Message successfully sended'] = 'Сообщение отправлено'; +$dictionary['Message successfully sent'] = 'Сообщение отправлено'; $dictionary['Thread unavailable'] = 'Нить сообщений недоступна'; $dictionary['Sorry, the contents of this thread are temporarily unavailable. Please check back later.'] = 'К сожалению, содержание этой нити сообщений временно недоступно. Повторите попытку позже.'; $dictionary['Between'] = 'в беседе участвуют:'; Modified: app/models/user.php =================================================================== --- app/models/user.php 2008-03-11 18:57:11 UTC (rev 60) +++ app/models/user.php 2008-03-11 19:21:38 UTC (rev 61) @@ -2,8 +2,14 @@ class User extends ActiveRecord { - var $has_many = array('outbox_messages' => array('class_name' => 'Message', 'order' => 'created_at desc', 'foreign_key' => 'sender_id'), - 'inbox_messages' => array('class_name' => 'Message', 'order' => 'created_at desc', 'foreign_key' => 'recipient_id'), + var $has_many = array('outbox_messages' => array('class_name' => 'Message', + 'order' => 'created_at desc', + 'foreign_key' => 'sender_id', + 'conditions' => 'is_sender_del = 0'), + 'inbox_messages' => array('class_name' => 'Message', + 'order' => 'created_at desc', + 'foreign_key' => 'recipient_id', + 'conditions' => 'is_recipient_del = 0'), ); function login($email, $password) { Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-03-11 18:57:11 UTC (rev 60) +++ app/views/message/outbox.tpl 2008-03-11 19:21:38 UTC (rev 61) @@ -28,7 +28,7 @@ <script> var checkids = new Array(); function oncheck (element, is_read) { - checkids = $$('input[type=checkbox]:checked').toArray(); + checked = $$('input[type=checkbox]:checked'); checkids.clear(); for (var index = 0; index < checked.length; index++) { checkids.push(checked[index].id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-13 10:27:19
|
Revision: 69 http://isocial.svn.sourceforge.net/isocial/?rev=69&view=rev Author: dim0s77 Date: 2008-03-13 03:27:24 -0700 (Thu, 13 Mar 2008) Log Message: ----------- added deleted dialog for inbox messages Modified Paths: -------------- app/controllers/message_controller.php app/models/message.php app/views/message/inbox.tpl app/views/message/outbox.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-12 20:37:58 UTC (rev 68) +++ app/controllers/message_controller.php 2008-03-13 10:27:24 UTC (rev 69) @@ -160,20 +160,20 @@ function _delete_thread () { if (!empty($this->params['check_messages'])) { $threads = $this->Message->find('all', - array('conditions' => - array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ") AND sender_id = ? OR recipient_id = ?", - $this->current_user->getId(), $this->current_user->getId() - ) - ) - ); + array('conditions' => + array("id IN (" . $this->Message->_make_in_statement_from_array('id', $this->params['check_messages']) . ") AND (sender_id = ? OR recipient_id = ?)", + $this->current_user->getId(), $this->current_user->getId() + ) + ) + ); if ($threads) { foreach ($threads as $thread_loop_key => $thread) { $this->Message->updateAll("is_sender_del = 1", "sender_id = " . $this->current_user->getId() . " AND thread_id = " . $thread->thread_id); $this->Message->updateAll("is_recipient_del = 1", "recipient_id = " . $this->current_user->getId() . " AND thread_id = " . $thread->thread_id); - $thread->reload(); - if ($thread->is_sender_del && $thread->is_recipient_del) { + $thread->reload(); + if ($thread->is_sender_del && $thread->is_recipient_del) { $this->Message->destroyAll("thread_id = " . $thread->thread_id); - } + } } } } Modified: app/models/message.php =================================================================== --- app/models/message.php 2008-03-12 20:37:58 UTC (rev 68) +++ app/models/message.php 2008-03-13 10:27:24 UTC (rev 69) @@ -6,7 +6,7 @@ 'recipient' => array('class_name' => 'User', 'primary_key_name' => 'recipient_id')); function unread_messages_count ( $recipient_id ) { - return $this->count('id', array('conditions' => array("recipient_id = ? AND is_read = 0", $recipient_id))); + return $this->count('id', array('conditions' => array("recipient_id = ? AND is_read = 0 AND is_recipient_del = 0", $recipient_id))); } } Modified: app/views/message/inbox.tpl =================================================================== --- app/views/message/inbox.tpl 2008-03-12 20:37:58 UTC (rev 68) +++ app/views/message/inbox.tpl 2008-03-13 10:27:24 UTC (rev 69) @@ -86,33 +86,54 @@ } function delete_threads (element) { - new Ajax.Updater('messages', - '/message/delete_inbox_thread', - { method:'post', - asynchronous:true, - parameters:$('messages_form').serialize(), - onSuccess: function () { - disable_action_links(); - } - }); + new Dialog.Box({ + reference: element, + title: '_{Delete Threads}', + body: '_{Are you sure you want to delete selected threads}?', + yes: '_{Delete}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Updater('messages', + '/message/delete_inbox_thread', + { method:'post', + asynchronous:true, + parameters:$('messages_form').serialize(), + onSuccess: function () { + disable_action_links(); + } + }); + } + }); + return false; } function delete_single_thread (element) { - new Ajax.Updater('messages', - '/message/delete_inbox_thread', - { method:'post', - asynchronous:true, - parameters: 'check_messages[]=' + element.name, - onComplete: function () { - disable_action_links(); - tocheck = new Array(); - $$('input[type=checkbox]').each( function (el) { - if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } + new Dialog.Box({ + reference: element, + title: '_{Delete Thread}', + body: '_{Are you sure you want to delete this thread}?', + yes: '_{Delete}', + cancel: '_{Cancel}', + onYes : function () { + new Ajax.Updater('messages', + '/message/delete_inbox_thread', + { method:'post', + asynchronous:true, + parameters: 'check_messages[]=' + element.name, + onComplete: function () { + disable_action_links(); + tocheck = new Array(); + $$('input[type=checkbox]').each( + function (el) { + if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } + }); + tocheck.invoke('click'); + } }); - tocheck.invoke('click'); - } - }); + } + }); + return false; } Modified: app/views/message/outbox.tpl =================================================================== --- app/views/message/outbox.tpl 2008-03-12 20:37:58 UTC (rev 68) +++ app/views/message/outbox.tpl 2008-03-13 10:27:24 UTC (rev 69) @@ -53,6 +53,12 @@ function delete_threads (element) { new Dialog.Box({ + reference: element, + title: '_{Delete Threads}', + body: '_{Are you sure you want to delete selected threads}?', + yes: '_{Delete}', + cancel: '_{Cancel}', + hfloat: 'left', onYes : function () { new Ajax.Updater('messages', '/message/delete_outbox_thread', @@ -73,23 +79,24 @@ new Dialog.Box({ reference: element, title: '_{Delete Thread}', - body: '_{Are you sure you want to delete this thread} ?', + body: '_{Are you sure you want to delete this thread}?', yes: '_{Delete}', - cancel: '_{Cancel}', + cancel: '_{Cancel}', onYes : function () { - new Ajax.Updater('messages', - '/message/delete_outbox_thread', - { method:'post', - asynchronous:true, - parameters: 'check_messages[]=' + element.name, - onComplete: function () { - $("delete_link").addClassName('disabled'); - tocheck = new Array(); - $$('input[type=checkbox]').each( function (el) { - if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } - }); - tocheck.invoke('click'); - } + new Ajax.Updater('messages', + '/message/delete_outbox_thread', + { method:'post', + asynchronous:true, + parameters: 'check_messages[]=' + element.name, + onComplete: function () { + $("delete_link").addClassName('disabled'); + tocheck = new Array(); + $$('input[type=checkbox]').each( + function (el) { + if (checkids.indexOf(el.value) != -1) { tocheck.push(el); } + }); + tocheck.invoke('click'); + } } ); }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-13 14:22:34
|
Revision: 73 http://isocial.svn.sourceforge.net/isocial/?rev=73&view=rev Author: dim0s77 Date: 2008-03-13 07:22:40 -0700 (Thu, 13 Mar 2008) Log Message: ----------- send email after messaging Modified Paths: -------------- app/controllers/message_controller.php app/locales/message/ru.php Added Paths: ----------- app/views/message/email/ app/views/message/email/send.tpl Modified: app/controllers/message_controller.php =================================================================== --- app/controllers/message_controller.php 2008-03-13 13:29:50 UTC (rev 72) +++ app/controllers/message_controller.php 2008-03-13 14:22:40 UTC (rev 73) @@ -46,12 +46,12 @@ if (!$message->thread_id) { $message->thread_id = $message->getId(); if ($message->save()) { + $this->message = $message; + $this->sendMail( $recipient->email ); $this->redirectTo(array('action' => 'send_successfully')); return; } } - $this->redirectTo(array('action' => 'send_successfully')); - return; } } $this->addError('_common', 'Sending message error', 'please, try again'); @@ -66,6 +66,8 @@ $message->recipient->assign($recipient); $message->setAttributes($this->params['message']); if ($message->save()) { + $this->message = $message; + $this->sendMail( $recipient->email, 'email/send' ); $thread_id = $this->params['message']['thread_id']; $thread = $this->Message->findFirst(array('thread_id' => $thread_id )); $user_id = $this->current_user->getId(); Modified: app/locales/message/ru.php =================================================================== --- app/locales/message/ru.php 2008-03-13 13:29:50 UTC (rev 72) +++ app/locales/message/ru.php 2008-03-13 14:22:40 UTC (rev 73) @@ -31,5 +31,8 @@ $dictionary['Back to'] = 'Обратно во'; $dictionary['Delete Thread'] = 'Удалить нить сообщений'; $dictionary['Are you sure you want to delete this thread'] = 'Вы уверены, что хотите удалить эту нить сообщений'; +$dictionary['sent you a message'] = 'прислал(а) Вам сообщение'; +$dictionary['on'] = 'на'; +$dictionary['To reply to this message, follow the link below'] = 'Чтобы ответить на это сообщение, следуйте по ссылке ниже'; ?> Added: app/views/message/email/send.tpl =================================================================== --- app/views/message/email/send.tpl (rev 0) +++ app/views/message/email/send.tpl 2008-03-13 14:22:40 UTC (rev 73) @@ -0,0 +1,13 @@ +Subject: <?= $controller->current_user->name ?> _{sent you a message} _{on} iSocial... +From: iSocial <no-...@ma...> + +<?= $controller->current_user->name ?> _{sent you a message}. + +<p>{message.subject}</p> +<p>"{message.body}"</p> + +<p>_{To reply to this message, follow the link below}:<br> +<? $link = AK_SITE_URL . "message/show?t=" . $message->thread_id ?> +<a href="{link}">{link}</a>.</p> + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-17 20:02:23
|
Revision: 91 http://isocial.svn.sourceforge.net/isocial/?rev=91&view=rev Author: aguidrevitch Date: 2008-03-17 13:01:58 -0700 (Mon, 17 Mar 2008) Log Message: ----------- minor fixes Modified Paths: -------------- app/application_controller.php app/controllers/profile_controller.php app/controllers/user_controller.php app/installers/user_installer.php app/shared_model.php Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/application_controller.php 2008-03-17 20:01:58 UTC (rev 91) @@ -1,6 +1,7 @@ <?php require_once(AK_LIB_DIR.DS.'AkActionController.php'); +require_once(AK_VENDOR_DIR.DS.'phputf8'.DS.'ucfirst.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_template'.DS.'ExtPhpTemplateHandler.php'); Modified: app/controllers/profile_controller.php =================================================================== --- app/controllers/profile_controller.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/controllers/profile_controller.php 2008-03-17 20:01:58 UTC (rev 91) @@ -44,6 +44,12 @@ } function contact () { + $this->contact_profile = $this->current_user->contact_profile->load(); + if ($this->Request->isPost()) { + if (!empty($this->params['contact_profile'])) { + + } + } } function relationships () { Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/controllers/user_controller.php 2008-03-17 20:01:58 UTC (rev 91) @@ -3,7 +3,7 @@ class UserController extends ApplicationController { - var $models = 'user, confirmation'; + var $models = array('User', 'Confirmation'); function beforeAction ( $method = '' ) { Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/installers/user_installer.php 2008-03-17 20:01:58 UTC (rev 91) @@ -16,22 +16,24 @@ $this->execute( "CREATE TABLE `confirmations` ( - `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), `uuid` char(40) NOT NULL, `created_at` datetime NOT NULL, - FOREIGN KEY (user_id) REFERENCES users(id) + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) ) ENGINE=innoDB"); $this->execute( "CREATE TABLE `friends` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL DEFAULT 0, + `user_id` int(11), `friend_id` int(11) NOT NULL DEFAULT 0, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (friend_id) REFERENCES users(id), UNIQUE forward_key (user_id, friend_id), - UNIQUE reverse_key (friend_id, user_id) + UNIQUE reverse_key (friend_id, user_id), + INDEX user_idx (user_id) ) ENGINE=InnoDB"); $this->execute( @@ -47,7 +49,10 @@ `is_sender_del` tinyint(1) NOT NULL DEFAULT '0', `is_recipient_del` tinyint(1) NOT NULL DEFAULT '0', FOREIGN KEY (sender_id) REFERENCES users(id), - FOREIGN KEY (recipient_id) REFERENCES users(id) + FOREIGN KEY (recipient_id) REFERENCES users(id), + INDEX thread_idx (thread_id), + INDEX sender_idx (sender_id, is_sender_del), + INDEX recipient_idx (recipient_id, is_read, is_recipient_del) ) ENGINE=InnoDB"); $this->execute( @@ -69,9 +74,9 @@ `third_id` int(11), `is_native` bool NOT NULL DEFAULT 0, `name` char(100) NOT NULL DEFAULT '', + FOREIGN KEY (country_id) REFERENCES countries(id), INDEX oid_idx (oid), - INDEX name_idx (name, first_id), - FOREIGN KEY (country_id) REFERENCES countries(id) + INDEX name_idx (name, first_id) ) ENGINE=InnoDB"); $this->execute( @@ -86,7 +91,7 @@ $this->execute( "CREATE TABLE `political_views` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `en_name` char(255) NOT NULL DEFAULT '' + `en_name` char(255) NOT NULL DEFAULT '' ) ENGINE=InnoDB"); $this->execute("INSERT INTO political_views (id, en_name) VALUES (0, 'Very Liberal')"); @@ -101,37 +106,38 @@ "CREATE TABLE `religious_views` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `name` char(100) NOT NULL DEFAULT '', - `votes` int(11) NOT NULL DEFAULT 0, + `votes` int(11) NOT NULL DEFAULT 0, INDEX name_idx (name, votes) ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `religious_view_votes` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11), - `religious_view_id` int(11), + `user_id` int(11), + `religious_view_id` int(11), FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id), + UNIQUE vote_idx (user_id, religious_view_id) ) ENGINE=InnoDB"); $this->execute( "CREATE TRIGGER rvv_insert AFTER INSERT ON religious_view_votes - FOR EACH ROW BEGIN - UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; - END; + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes + 1 WHERE id = NEW.religious_view_id; + END; "); $this->execute( "CREATE TRIGGER rvv_delete AFTER DELETE ON religious_view_votes - FOR EACH ROW BEGIN - UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; - END; + FOR EACH ROW BEGIN + UPDATE `religious_views` SET votes = votes - 1 WHERE id = OLD.religious_view_id; + END; "); $this->execute( "CREATE TABLE `basic_profiles` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `user_id` int(11) NOT NULL, + `user_id` int(11), `sex_id` int(11), `city_id` int(11), `city_other` char(100), @@ -141,20 +147,76 @@ `religious_view_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, - FOREIGN KEY (user_id) REFERENCES users(id), - FOREIGN KEY (sex_id) REFERENCES sexes(id), - FOREIGN KEY (city_id) REFERENCES cities(id), - FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (sex_id) REFERENCES sexes(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + FOREIGN KEY (country_id) REFERENCES countries(id), FOREIGN KEY (political_view_id) REFERENCES political_views(id), - FOREIGN KEY (religious_view_id) REFERENCES religious_views(id) + FOREIGN KEY (religious_view_id) REFERENCES religious_views(id), + INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `email_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `email` char(100) NOT NULL DEFAULT '', + FOREIGN KEY (user_id) REFERENCES users(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `ims` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `name` char(100) NOT NULL DEFAULT '' + ) ENGINE=InnoDB"); + + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'ICQ')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Mail.ru Agent')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Skype')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Windows Live')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Google Talk')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Yahoo')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'AIM')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Jabber')"); + $this->execute("INSERT INTO ims (id, name) VALUES (0, 'Gadu-Gadu')"); + $this->execute( + "CREATE TABLE `im_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `im_id` int(11), + `value` varchar(50), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (im_id) REFERENCES ims(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); + $this->execute( + "CREATE TABLE `contact_profiles` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `mobile` varchar(40), + `land` varchar(40), + `address` varchar(100), + `website` text, + `city_id` int(11), + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + INDEX user_idx (user_id) + ) ENGINE=InnoDB"); } function down_1() { + $this->dropTable('contact_profiles'); + $this->dropTable('im_profiles'); + $this->dropTable('ims'); + $this->dropTable('email_profiles'); $this->dropTable('basic_profiles'); + // triggers should be dropped automatically // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html $this->dropTable('religious_view_votes'); Modified: app/shared_model.php =================================================================== --- app/shared_model.php 2008-03-17 19:04:39 UTC (rev 90) +++ app/shared_model.php 2008-03-17 20:01:58 UTC (rev 91) @@ -29,6 +29,8 @@ var $votes_model; var $min_votes_to_appear = 2; + var $strtolower = true; + var $ucfirst = true; function &voteOrCreate ($value, $user) { @@ -40,6 +42,15 @@ $record = $this->findFirst(array('conditions' => array("name LIKE ?", $value))); if (empty($record)) { + + if ($this->strtolower) { + $value = utf8_strtolower($value); + } + + if ($this->ucfirst) { + $value = utf8_ucfirst($value); + } + $this->name = $value; $this->save(); $record =& $this; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-03-18 19:16:01
|
Revision: 95 http://isocial.svn.sourceforge.net/isocial/?rev=95&view=rev Author: dim0s77 Date: 2008-03-18 12:16:07 -0700 (Tue, 18 Mar 2008) Log Message: ----------- added controller, installer and bases view for groups Modified Paths: -------------- app/installers/user_installer.php Added Paths: ----------- app/controllers/group_controller.php app/views/group/ app/views/group/show.tpl Added: app/controllers/group_controller.php =================================================================== --- app/controllers/group_controller.php (rev 0) +++ app/controllers/group_controller.php 2008-03-18 19:16:07 UTC (rev 95) @@ -0,0 +1,13 @@ +<?php + +class GroupController extends ApplicationController +{ + function index () { + $this->redirectTo(array('action' => 'show')); + } + + function show () { + } +} + +?> Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-18 11:03:51 UTC (rev 94) +++ app/installers/user_installer.php 2008-03-18 19:16:07 UTC (rev 95) @@ -207,10 +207,30 @@ FOREIGN KEY (city_id) REFERENCES cities(id), INDEX user_idx (user_id) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `groups` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `parent_id` int(11) NOT NULL DEFAULT '0', + `en_name` char(100) NOT NULL DEFAULT '' + ) ENGINE=InnoDB"); + + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Business')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Common Interest')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Entertainment & Arts')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Geography')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Internet & Technology')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Just for Fun')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Music')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Organizations')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Sports & Recreation')"); + $this->execute("INSERT INTO `groups` (id, en_name) VALUES (0, 0, 'Student Group')"); + } function down_1() { + $this->dropTable('groups'); $this->dropTable('contact_profiles'); $this->dropTable('im_profiles'); $this->dropTable('ims'); Added: app/views/group/show.tpl =================================================================== --- app/views/group/show.tpl (rev 0) +++ app/views/group/show.tpl 2008-03-18 19:16:07 UTC (rev 95) @@ -0,0 +1 @@ +groups \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-19 19:16:57
|
Revision: 97 http://isocial.svn.sourceforge.net/isocial/?rev=97&view=rev Author: aguidrevitch Date: 2008-03-19 12:17:02 -0700 (Wed, 19 Mar 2008) Log Message: ----------- cities list is going to be extensible / votable Modified Paths: -------------- app/installers/user_installer.php app/models/city.php Modified: app/installers/user_installer.php =================================================================== --- app/installers/user_installer.php 2008-03-18 19:21:16 UTC (rev 96) +++ app/installers/user_installer.php 2008-03-19 19:17:02 UTC (rev 97) @@ -57,27 +57,43 @@ $this->execute( "CREATE TABLE `countries` ( - `id` int(11) PRIMARY KEY, - `oid` int(11), - `name` char(255), - UNIQUE name_idx (name), - INDEX oid_idx (oid) + `id` int(11) PRIMARY KEY, + `name` char(50), + INDEX name_idx (name) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `regions` ( + `id` int(11) PRIMARY KEY, + `country_id` int(11), + `parent_id` int(11), + `name` char(100), + FOREIGN KEY (country_id) REFERENCES countries(id), + FOREIGN KEY (parent_id) REFERENCES regions(id), + INDEX name_idx (name) + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `cities` ( `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, - `oid` int(11), `country_id` int(11), - `first_id` int(11), - `second_id` int(11), - `third_id` int(11), - `is_native` bool NOT NULL DEFAULT 0, + `region_id` int(11), `name` char(100) NOT NULL DEFAULT '', + `votes` int(11) NOT NULL DEFAULT 0, FOREIGN KEY (country_id) REFERENCES countries(id), - INDEX oid_idx (oid), - INDEX name_idx (name, first_id) + FOREIGN KEY (country_id) REFERENCES countries(id), + INDEX name_idx (name) ) ENGINE=InnoDB"); + + $this->execute( + "CREATE TABLE `city_votes` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `user_id` int(11), + `city_id` int(11), + FOREIGN KEY (user_id) REFERENCES users(id), + FOREIGN KEY (city_id) REFERENCES cities(id), + UNIQUE vote_idx (user_id, city_id) + ) ENGINE=InnoDB"); $this->execute( "CREATE TABLE `sexes` ( @@ -247,14 +263,15 @@ $this->dropTable('ims'); $this->dropTable('email_profiles'); $this->dropTable('basic_profiles'); - // triggers should be dropped automatically // http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html $this->dropTable('religious_view_votes'); $this->dropTable('religious_views'); $this->dropTable('political_views'); $this->dropTable('sexes'); + $this->dropTable('city_votes'); $this->dropTable('cities'); + $this->dropTable('regions'); $this->dropTable('countries'); $this->dropTable('messages'); $this->dropTable('friends'); Modified: app/models/city.php =================================================================== --- app/models/city.php 2008-03-18 19:21:16 UTC (rev 96) +++ app/models/city.php 2008-03-19 19:17:02 UTC (rev 97) @@ -1,8 +1,14 @@ <?php -class City extends ActiveRecord +class City extends VotableActiveRecord { var $belongs_to = array('Country'); + var $votes_model = 'ReligiousViewVote'; } +class CityVote extends ActiveRecord +{ + var $primary_key_name = 'city_id'; +} + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <agu...@us...> - 2008-03-20 15:57:49
|
Revision: 103 http://isocial.svn.sourceforge.net/isocial/?rev=103&view=rev Author: aguidrevitch Date: 2008-03-20 08:57:54 -0700 (Thu, 20 Mar 2008) Log Message: ----------- using filtering feature (postfiltering) to replace PROJECT_NAME Modified Paths: -------------- app/application_controller.php Removed Paths: ------------- app/vendor/ext_template/ Modified: app/application_controller.php =================================================================== --- app/application_controller.php 2008-03-20 15:43:18 UTC (rev 102) +++ app/application_controller.php 2008-03-20 15:57:54 UTC (rev 103) @@ -3,7 +3,6 @@ require_once(AK_LIB_DIR.DS.'AkActionController.php'); require_once(AK_VENDOR_DIR.DS.'phputf8'.DS.'ucfirst.php'); require_once(AK_APP_DIR.DS.'vendor'.DS.'utf8_to_ascii'.DS.'utf8_to_ascii.php'); -require_once(AK_APP_DIR.DS.'vendor'.DS.'ext_template'.DS.'ExtPhpTemplateHandler.php'); /** * This file is application-wide controller file. You can put all @@ -25,14 +24,13 @@ var $app_helpers = array('AutoComplete', 'City'); var $current_user; - function _loadActionView () { - $this->Template =& new AkActionView($this->_getTemplateBasePath(), $this->Request->getParameters(), $this->Request->getController()); - - $this->Template->_controllerInstance =& $this; - $this->Template->_registerTemplateHandler('tpl','ExtPhpTemplateHandler'); - - return parent::_loadActionView(); + function __construct () { + $this->afterFilter('_replaceProjectName'); } + + function _replaceProjectName (&$controller) { + $controller->Response->body = str_replace('PROJECT_NAME', PROJECT_NAME, $controller->Response->body); + } function beforeAction ( $method = '' ) { $this->_validateLoginStatus(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <di...@us...> - 2008-04-21 18:03:33
|
Revision: 126 http://isocial.svn.sourceforge.net/isocial/?rev=126&view=rev Author: dim0s77 Date: 2008-04-21 11:03:39 -0700 (Mon, 21 Apr 2008) Log Message: ----------- Added saving of changed group attributes Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/edit_customize.tpl app/views/groupapp/group/edit_info.tpl app/views/groupapp/group/edit_members.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-04-19 13:19:36 UTC (rev 125) +++ app/controllers/groupapp/group_controller.php 2008-04-21 18:03:39 UTC (rev 126) @@ -43,18 +43,28 @@ $this->importErrors( $this->GroupappGroup->getErrors() ); } - function edit_info () { - $this->step = 'edit_info'; - if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { + function edit_group () { + if (!empty($this->params['group']) && !empty($this->params['id'])){ + $group = $this->GroupappGroup->findFirst(array( 'id' => $this->params['id'] )); + $group->setAttributes($this->params['group']); + if ($this->Request->isPost() && $group->save()) { + $this->group = $group; + return; + } + } else if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { $this->group = $this->GroupappGroup->find($this->params['id']); } + $this->importErrors( $this->GroupappGroup->getErrors() ); } + function edit_info () { + $this->step = 'edit_info'; + $this->edit_group(); + } + function edit_customize () { $this->step = 'edit_customize'; - if (!empty($this->params['id']) && $this->GroupappGroup->find($this->params['id'])) { - $this->group = $this->GroupappGroup->find($this->params['id']); - } + $this->edit_group(); } function edit_moderators () { Modified: app/views/groupapp/group/edit_customize.tpl =================================================================== --- app/views/groupapp/group/edit_customize.tpl 2008-04-19 13:19:36 UTC (rev 125) +++ app/views/groupapp/group/edit_customize.tpl 2008-04-21 18:03:39 UTC (rev 126) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">_{Edit} {group_name?}</div> + <div class="name groupapp">_{Edit} {group.name?}</div> </div> </div> <div class="clearfix"></div> Modified: app/views/groupapp/group/edit_info.tpl =================================================================== --- app/views/groupapp/group/edit_info.tpl 2008-04-19 13:19:36 UTC (rev 125) +++ app/views/groupapp/group/edit_info.tpl 2008-04-21 18:03:39 UTC (rev 126) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">_{Edit} {group_name?}</div> + <div class="name groupapp">_{Edit} {group.name?}</div> </div> </div> <div class="clearfix"></div> Modified: app/views/groupapp/group/edit_members.tpl =================================================================== --- app/views/groupapp/group/edit_members.tpl 2008-04-19 13:19:36 UTC (rev 125) +++ app/views/groupapp/group/edit_members.tpl 2008-04-21 18:03:39 UTC (rev 126) @@ -1,6 +1,6 @@ <div class="title_bar"> <div class="head"> - <div class="name groupapp">_{Invite people to} {group_name?}</div> + <div class="name groupapp">_{Invite people to} {group.name?}</div> </div> </div> <div class="clearfix"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fsn...@us...> - 2008-04-30 14:14:43
|
Revision: 135 http://isocial.svn.sourceforge.net/isocial/?rev=135&view=rev Author: fsnobody Date: 2008-04-30 07:14:50 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Added Paths: ----------- app/installers/photoapp/ app/installers/photoapp/album_installer.php app/locales/photoapp/ app/locales/photoapp/album/ app/locales/photoapp/album/en.php app/locales/photoapp/album/ru.php app/models/photoapp_album.php Added: app/installers/photoapp/album_installer.php =================================================================== --- app/installers/photoapp/album_installer.php (rev 0) +++ app/installers/photoapp/album_installer.php 2008-04-30 14:14:50 UTC (rev 135) @@ -0,0 +1,28 @@ +<?php +class AlbumInstaller extends AkInstaller +{ + var $module = 'photoapp'; + + function up_1() + { + + $this->execute( + "CREATE TABLE `photoapp_albums` ( + `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, + `owner` int(11) NOT NULL , + `name` char(100) NOT NULL DEFAULT '', + `privacy` char(100) NOT NULL DEFAULT '', + `description` char(255) NOT NULL DEFAULT '', + `img` char(255) NOT NULL DEFAULT '' + + ) ENGINE=InnoDB"); + + } + + function down_1() + { + $this->dropTable('photoapp_albums'); + } +} + +?> \ No newline at end of file Added: app/locales/photoapp/album/en.php =================================================================== --- app/locales/photoapp/album/en.php (rev 0) +++ app/locales/photoapp/album/en.php 2008-04-30 14:14:50 UTC (rev 135) @@ -0,0 +1,21 @@ +<?php + +// File created on: 2008-04-25 08:58 + +$dictionary = array(); + +$dictionary['My Photos'] = 'My Photos'; +$dictionary['Photos'] = 'Photos'; +$dictionary['Photos of You'] = 'Photos of You'; +$dictionary['Create a Photo Album'] = 'Create a Photo Album'; +$dictionary['Welcome to PROJECT_NAME Photos'] = 'Welcome to PROJECT_NAME Photos'; +$dictionary['Name'] = 'Name'; +$dictionary['Location'] = 'Location'; +$dictionary['Description'] = 'Description'; +$dictionary['Privacy'] = 'Privacy'; +$dictionary['Create Album'] = 'Create Album'; + + + + +?> Added: app/locales/photoapp/album/ru.php =================================================================== --- app/locales/photoapp/album/ru.php (rev 0) +++ app/locales/photoapp/album/ru.php 2008-04-30 14:14:50 UTC (rev 135) @@ -0,0 +1,20 @@ +<?php + +// File created on: 2008-04-25 08:58 + +$dictionary = array(); + +$dictionary['My Photos'] = 'Мои Фото'; +$dictionary['Photos'] = 'Фото'; +$dictionary['Photos of You'] = 'Фото для Вас'; +$dictionary['Create a Photo Album'] = 'Создать фото альбом'; +$dictionary['Welcome to PROJECT_NAME Photos'] = 'Добро пожаловать в PROJECT_NAME Фото'; +$dictionary['Name'] = 'Название'; +$dictionary['Location'] = 'Локация'; +$dictionary['Description'] = 'Описание'; +$dictionary['Privacy'] = 'Доступ'; +$dictionary['Create Album'] = 'Создать альбом'; + + + +?> Added: app/models/photoapp_album.php =================================================================== --- app/models/photoapp_album.php (rev 0) +++ app/models/photoapp_album.php 2008-04-30 14:14:50 UTC (rev 135) @@ -0,0 +1,14 @@ +<?php + +class PhotoappAlbum extends ActiveRecord +{ + //var $has_one = array('group_member' => array('class_name' => 'GroupappMember','foreign_key' => 'group_id'), ); + + function validateOnCreate () + { + $this->validatesPresenceOf('name', 'Name is missing|please enter the name'); + $this->validatesPresenceOf('description', 'Description is missing|please enter the description'); + } +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |