it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ******************************************************/ require_once ISVIPI_PAGES_BASE . 'm_base.php'; require_once ISVIPI_CLASSES_BASE . 'global/getWall_cls.php'; require_once ISVIPI_CLASSES_BASE . 'global/getFriends_cls.php'; require_once ISVIPI_CLASSES_BASE . 'utilities/encrypt_decrypt.php'; $converter = new Encryption(); $friends = new get_friends(); //get the user id if (!isset($PAGE[1])) { exit; } $user = $PAGE[1]; //check if it is numeric if (!is_numeric($user)) { exit; } $getFeeds = new getFeeds(2); $feed = $getFeeds->allFeeds($user); include_once ISVIPI_ACT_THEME . 'wall.php';
public function allFeeds() { global $isv_db, $feed; $sqlAllFeeds = $isv_db->prepare("SELECT \r\n\t\tf.id,\r\n\t\tf.user_id,\r\n\t\tf.text_feed,\r\n\t\tf.shared_feed,\r\n\t\tf.img_feed,\r\n\t\tf.old_feed_id,\r\n\t\tf.time,\r\n\t\tfr.user1,\r\n\t\tu.username,\r\n\t\tp.fullname,\r\n\t\tp.profile_pic\r\n\t\tFROM feeds f\r\n\t\tLEFT JOIN friends fr ON f.user_id = fr.user1\r\n\t\tJOIN users u ON u.id = f.user_id\r\n\t\tJOIN user_profile p ON p.user_id = u.id\r\n\t\tWHERE f.user_id=? OR (fr.user1=? OR fr.user2=?) GROUP BY f.id ORDER BY f.id DESC LIMIT 0,?"); $sqlAllFeeds->bind_param('iiii', $this->user_id, $this->user_id, $this->user_id, $this->limit); $sqlAllFeeds->execute(); $sqlAllFeeds->store_result(); $resultCount = $sqlAllFeeds->num_rows(); $sqlAllFeeds->bind_result($this->feedID, $this->feedUser, $this->feedText, $this->feedSharedText, $this->feedImg, $this->old_feed_id, $this->feedTime, $this->friend_id, $this->f_username, $this->f_fullname, $this->f_profilePIC); while ($sqlAllFeeds->fetch()) { $this->feed[] = array('feed_id' => $this->feedID, 'feed_user' => $this->feedUser, 'feed_text' => $this->feedText, 'feed_shared_text' => $this->feedSharedText, 'feed_image' => $this->feedImg, 'old_feed_id' => $this->old_feed_id, 'feed_time' => $this->feedTime, 'feed_username' => $this->f_username, 'feed_fullname' => $this->f_fullname, 'feed_profilePIC' => $this->f_profilePIC); } return $this->feed; } } $getFeeds = new getFeeds(2); $feed = $getFeeds->allFeeds(); class getFeedProperties { private $f_id; private $user_id; public $total_likes; public $total_shares; public $total_comments; public function __construct($feedID) { $this->f_id = $feedID; $this->user_id = $_SESSION['isv_user_id']; } public function f_likes_count() {