Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user_id = 0;
- $table_prefix = 'elgg_'; // get from engine/settings.php
- if (! empty($_COOKIE['Elgg'])) {
- $session_id = mysql_real_escape_string($_COOKIE['Elgg']);
- $sql = ("SELECT `data` FROM `{$table_prefix}users_sessions` WHERE `session` = '{$session_id}'");
- $result = mysql_query($sql);
- if ($row = mysql_fetch_array($result)) {
- $data = explode('attributes";', $row[0]);
- if (!empty($data)) {
- $session = unserialize($data[1]);
- $user_id = $session['guid'];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement