Want to get involved in developing SMF, then why not lend a hand on our github!
//SMF Cookie autentication!!! list ($member_id, $password) = initCookies();
//SMF Cookie autentication!!! $member_id = initCookies();
function initCookies() { global $cookiename; if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~i', $_COOKIE[$cookiename]) == 1) { list ($member_id, $password) = @unserialize($_COOKIE[$cookiename]); $member_id = !empty($member_id) && strlen($password) > 0 ? (int) $member_id : 0; return array($member_id, $password); } elseif (isset($_COOKIE[$cookiename])) { list ($member_id, $password) = @unserialize(stripslashes($_COOKIE[$cookiename])); $member_id = !empty($member_id) && strlen($password) > 0 ? (int) $member_id : 0; return array($member_id, $password); } }
function initCookies() { global $cookiename; if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~i', $_COOKIE[$cookiename]) == 1) { list ($id_member, $password) = @unserialize($_COOKIE[$cookiename]); $id_member = !empty($id_member) && strlen($password) > 0 ? (int) $id_member : 0; return $id_member; } elseif (isset($_COOKIE[$cookiename])) { list ($id_member, $password, $login_span) = @unserialize($_SESSION['login_' . $cookiename]); $id_member = !empty($id_member) && strlen($password) > 0 ? (int) $id_member : 0; return $id_member; } }
$context['online_count'] = count(isset($context['friends']) ? $context['friends'] : null); } if ($type == 'list') { $data = buddy_list_template(); return $data; } if ($type == 'count') { return count(isset($context['friends']) ? $context['friends'] : null); }
$context['online_count'] = count(isset($context['friends']) ? $context['friends'] : []); } if ($type == 'list') { $data = buddy_list_template(); return $data; } if ($type == 'count') { return count(isset($context['friends']) ? $context['friends'] : []); }
So don't really know what I'm doing but to my understanding I couldn't find another instance or usage of $password in the index.php so I did the followingCode: (sachat/index.php) [Select]//SMF Cookie autentication!!! list ($member_id, $password) = initCookies();Code: (replace) [Select]//SMF Cookie autentication!!! $member_id = initCookies();Code: (sachat/Sources/Subs.php) [Select]function initCookies() { global $cookiename; if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~i', $_COOKIE[$cookiename]) == 1) { list ($member_id, $password) = @unserialize($_COOKIE[$cookiename]); $member_id = !empty($member_id) && strlen($password) > 0 ? (int) $member_id : 0; return array($member_id, $password); } elseif (isset($_COOKIE[$cookiename])) { list ($member_id, $password) = @unserialize(stripslashes($_COOKIE[$cookiename])); $member_id = !empty($member_id) && strlen($password) > 0 ? (int) $member_id : 0; return array($member_id, $password); } }Code: (replace) [Select]function initCookies() { global $cookiename; if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fA-F0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~i', $_COOKIE[$cookiename]) == 1) { list ($id_member, $password) = @unserialize($_COOKIE[$cookiename]); $id_member = !empty($id_member) && strlen($password) > 0 ? (int) $id_member : 0; return $id_member; } elseif (isset($_COOKIE[$cookiename])) { list ($id_member, $password, $login_span) = @unserialize($_SESSION['login_' . $cookiename]); $id_member = !empty($id_member) && strlen($password) > 0 ? (int) $id_member : 0; return $id_member; } }And seems to be working on SMF 2.0.17If anyone else with more knowledge about this can give the mod a look would be great and appreciated. AlsoCode: (sachat/Sources/User.php) [Select]$context['online_count'] = count(isset($context['friends']) ? $context['friends'] : null); } if ($type == 'list') { $data = buddy_list_template(); return $data; } if ($type == 'count') { return count(isset($context['friends']) ? $context['friends'] : null); }Code: (replace) [Select]$context['online_count'] = count(isset($context['friends']) ? $context['friends'] : []); } if ($type == 'list') { $data = buddy_list_template(); return $data; } if ($type == 'count') { return count(isset($context['friends']) ? $context['friends'] : []); }
Sources/SAchat...
It's in the root directory of the forum
I have version 0.1.5 Rev110 installed.I installed the newest version and your changes but no luck. Looks like I'm doomed top sit on 0.15 for the interim.
I have version 0.1.5 Rev110 installed.Interestingly, the new version of SA Chat failed even before any 2.0.16 changes were applied.I installed the newest version and your changes but no luck. Looks like I'm doomed top sit on 0.15 for the interim.
I've had this working on a forum in 2.0.15, but it disappears in .16/.17. Can it be fixed?