Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

These 2 files hold one time update to be made. This commit can be rev…

…erted after first run.
  • Loading branch information...
commit 9d33bfb21c7f3b7de77b7ec6804db57a5ebf06ef 1 parent 812fa7f
@pehmolelu pehmolelu authored
View
10 application/controllers/AjaxController.php
@@ -518,7 +518,6 @@ public function validaterssAction() {
}
public function getnotificationsAction() {
- return; //RC fix :)
$favouritesModel = new Default_Model_UserHasFavourites();
$auth = Zend_Auth::getInstance();
@@ -547,4 +546,13 @@ public function getnotificationsAction() {
$this->view->notifications = $notifications;
$this->view->ids = $jsonIds;
}
+
+ /**
+ * To be deleted after first use.
+ */
+ public function setdefaultfollowsAction() {
+ $db = new Default_Model_UserProfiles();
+ $db->setDefaultFollows();
+ $this->_helper->viewRenderer->setNoRender(true);
+ }
}
View
41 application/models/UserProfiles.php
@@ -1468,4 +1468,45 @@ public function getUsersWhoFollowContents($userIdList = null) {
return $result;
}
+ /**
+ * To be deleted after first use.
+ */
+ public function setDefaultFollows() {
+ $select = $this->_db->select()->from(array('usp' => 'usr_profiles_usp'),
+ array('id_usr_usp'))
+ ->where('usp.profile_key_usp = "own_follows" OR usp.profile_key_usp = "fvr_follows"')
+ ->where('usp.profile_value_usp != "" OR usp.profile_value_usp != "0"')
+ ;
+
+ $selectUsers = $this->_db->select()->from(array('usr' => 'users_usr'),
+ array('id_usr'))
+ ->where('id_usr NOT IN (?)', $select)
+ ;
+ $result = array_keys($this->_db->fetchAssoc($selectUsers));
+
+
+ $ownfollows = array(
+ 'profile_key_usp' => 'own_follows',
+ 'profile_value_usp' => 7,
+ 'public_usp' => 0,
+ 'modified_usp' => new Zend_Db_Expr('NOW()'),
+ 'created_usp' => new Zend_Db_Expr('NOW()')
+ );
+
+ $fvrfollows = array(
+ 'profile_key_usp' => 'fvr_follows',
+ 'profile_value_usp' => 23,
+ 'public_usp' => 0,
+ 'modified_usp' => new Zend_Db_Expr('NOW()'),
+ 'created_usp' => new Zend_Db_Expr('NOW()')
+ );
+
+
+ foreach($result as $id) {
+ $ownfollows['id_usr_usp'] = $id;
+ $fvrfollows['id_usr_usp'] = $id;
+ $this->insert($ownfollows);
+ $this->insert($fvrfollows);
+ }
+ }
} // end of class
Please sign in to comment.
Something went wrong with that request. Please try again.