Changeset 15604 for events

Show
Ignore:
Timestamp:
07/10/08 12:35:19 (5 years ago)
Author:
anatoo
Message:

added

Location:
events/phpframework/plain_php/trunk
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/plain_php/trunk/AcountService.php

    r15538 r15604  
    1313        $password = sha1($password); 
    1414         
    15         $smt = $this->pdo->prepare('insert into users(user_name, email, password, created_at, updated_at) values(:username, :email, :password, now(), now())'); 
     15        $smt = $this->pdo->prepare( 
     16            'insert into users(user_name, email, password, created_at, updated_at) ' . 
     17            'values(:username, :email, :password, now(), now())'); 
    1618        $smt->bindValue(':username', $username, PDO::PARAM_STR); 
    1719        $smt->bindValue(':email', $email, PDO::PARAM_STR); 
     
    2527         
    2628        $smt = $this->pdo->prepare( 
    27             'update users set email = :email, password = :password, private_flag = :private_flag, delete_flag = :delete_flag, updated_at = now() where user_name = :username '); 
     29            'update users set email = :email, password = :password, ' . 
     30            'private_flag = :private_flag, delete_flag = :delete_flag, ' . 
     31            'updated_at = now() where user_name = :username '); 
    2832        $smt->bindValue(':username', $username, PDO::PARAM_STR); 
    2933        $smt->bindValue(':email', $email, PDO::PARAM_STR); 
     
    3539    function updateImage($username, $image) 
    3640    { 
    37         $smt = $this->pdo->prepare('update users set image = :image where user_name = :username'); 
     41        $smt = $this->pdo->prepare( 
     42            'update users set image = :image where user_name = :username'); 
    3843        $smt->bindValue(':username', $username, PDO::PARAM_STR); 
    3944        if (is_null($image)) { 
  • events/phpframework/plain_php/trunk/FriendshipService.php

    r15538 r15604  
    1313         
    1414        $smt = $this->pdo->prepare( 
    15             'select users.* from users, followers where :user_id = followers.follow_id and followers.user_id = users.id limit :offset, :limit'); 
     15            'select users.* from users, followers where :user_id = ' . 
     16            'followers.follow_id and followers.user_id = users.id ' . 
     17            'limit :offset, :limit'); 
    1618        $smt->bindValue(':user_id', $user_id, PDO::PARAM_INT); 
    1719        $smt->bindValue(':offset', $offset, PDO::PARAM_INT); 
     
    2325    function fetchFollowerCount($user_id) 
    2426    { 
    25         $smt = $this->pdo->prepare('select count(users.id) from users, followers where :user_id = followers.follow_id and followers.user_id = users.id'); 
     27        $smt = $this->pdo->prepare( 
     28            'select count(users.id) from users, followers where ' . 
     29            ':user_id = followers.follow_id and followers.user_id = users.id'); 
    2630        $smt->bindValue(':user_id', $user_id, PDO::PARAM_INT); 
    2731        $smt->execute(); 
     
    3539        $count = $this->fetchFollowerCount($user_id); 
    3640         
    37         $smt = $this->pdo->prepare('select users.* from users, followers where :user_id = followers.user_id and followers.follow_id = users.id limit :offset, :limit'); 
     41        $smt = $this->pdo->prepare( 
     42            'select users.* from users, followers where :user_id = followers.user_id ' . 
     43            'and followers.follow_id = users.id limit :offset, :limit'); 
    3844        $smt->bindValue(':user_id', $user_id, PDO::PARAM_STR); 
    3945        $smt->bindValue(':offset', $offset, PDO::PARAM_INT); 
     
    4551    function fetchFollowingCount($user_id) 
    4652    { 
    47         $smt = $this->pdo->prepare('select count(users.id) from users, followers where :user_id = followers.user_id and followers.follow_id = users.id'); 
     53        $smt = $this->pdo->prepare( 
     54            'select count(users.id) from users, followers where ' . 
     55            ':user_id = followers.user_id and followers.follow_id = users.id'); 
    4856        $smt->bindValue(':user_id', $user_id, PDO::PARAM_INT); 
    4957        $smt->execute(); 
     
    5462    function follow($user_id, $follow_user_name) 
    5563    { 
    56         $smt = $this->pdo->prepare('insert into followers(user_id, follow_id, created_at) values(:user_id, (select id from users where user_name = :follow_user_name), now())'); 
     64        $smt = $this->pdo->prepare( 
     65            'insert into followers(user_id, follow_id, created_at) ' . 
     66            'values(:user_id, (select id from users where user_name = ' . 
     67            ':follow_user_name), now())'); 
    5768        $smt->bindValue(':user_id', $user_id, PDO::PARAM_INT); 
    5869        $smt->bindValue(':follow_user_name', $follow_user_name, PDO::PARAM_STR); 
     
    6273    function unfollow($user_id, $follow_user_name) 
    6374    { 
    64         $smt = $this->pdo->prepare('delete from followers where user_id = :user_id and follow_id = (select id from users where user_name = :follow_user_name)'); 
     75        $smt = $this->pdo->prepare( 
     76            'delete from followers where user_id = :user_id and ' . 
     77            'follow_id = (select id from users where user_name = :follow_user_name)'); 
    6578        $smt->bindValue(':user_id', $user_id, PDO::PARAM_INT); 
    6679        $smt->bindValue(':follow_user_name', $follow_user_name, PDO::PARAM_STR);