{"id":938,"date":"2020-03-17T20:23:40","date_gmt":"2020-03-17T20:23:40","guid":{"rendered":"https:\/\/html5-chat.com\/blog\/?p=938"},"modified":"2020-03-17T20:29:59","modified_gmt":"2020-03-17T20:29:59","slug":"sngine-social-network-php-script","status":"publish","type":"post","link":"https:\/\/html5-chat.com\/blog\/sngine-social-network-php-script\/","title":{"rendered":"Sngine : Social Network PHP script"},"content":{"rendered":"\n<p><a href=\"https:\/\/codecanyon.net\/item\/sngine-the-ultimate-social-network-platform\/13526001\">Sngine &#8211; The Ultimate PHP Social Network Platform<\/a> is a cool php script. <br>How to integrate html5 chat into that script ?<\/p>\n\n\n\n<p>Edit the <strong>.htaccess<\/strong> file and add these lines:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Chat<br>RewriteRule ^chat\/?$ chat.php [L,QSA]<\/pre>\n\n\n\n<p>Create <strong>chat.php <\/strong>file and paste this code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n$webmasterid = xxxx; \/\/ your webmasterid html5chat account\n$password = 'yyyy'; \/\/ your html5 chat password\nrequire('bootloader.php');\nif (!isset($user) || !isset($user->_data) || !isset($user->_data) || !isset($user->_data['user_id'])) {\n    <em>header<\/em>('Location:\/');\n}\nif ($user->_is_admin) {\n    $role = 'admin';\n} else if ($user->_is_moderator) {\n    $role = 'moderator';\n} else {\n    $role ='user';\n}\n$user = $user->_data;\n$json = <em>json_encode<\/em>(array(\n        'id' => $user['user_id'],\n        'username' => $user['user_name'],\n        'password' => $password,\n        'gender' => $user['user_gender'],\n        'role' => $role,\n        'image' => <em>base64_encode<\/em>($user['user_picture']),\n        'profile' => \"https:\/\/yoursite.com\/{user['user_name']}\"\n    )\n);\n$encoded = <em>file_get_contents<\/em>(\"https:\/\/jwt.html5-chat.com\/protect\/\" . <em>base64_encode<\/em>($json));\n?>\n&lt;!doctype html>\n&lt;html lang<strong>=\"en\"<\/strong>>\n&lt;head>\n    &lt;meta charset<strong>=\"UTF-8\"<\/strong>>\n    &lt;meta name<strong>=\"viewport\" <\/strong>content<strong>=\"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0\"<\/strong>>\n    &lt;meta http-equiv<strong>=\"X-UA-Compatible\" <\/strong>content<strong>=\"ie=edge\"<\/strong>>\n    &lt;title><strong>Chat<\/strong>&lt;\/title>\n    &lt;style>\n        html, body, #chatContainer {\n            <em>width<\/em>: 100%;\n            <em>height<\/em>: 100%;\n            <em>margin<\/em>: 0;\n            <em>padding<\/em>: 0;\n        }\n    &lt;\/style>\n&lt;\/head>\n&lt;body>\n&lt;div id<strong>=\"chatContainer\"<\/strong>>\n    &lt;script src<strong>=\"https:\/\/html5-chat.com\/script\/<\/strong>&lt;?= $webmasterid ?><strong>\/<\/strong>&lt;?= $encoded ?><strong>\"<\/strong>>&lt;\/script>\n&lt;\/div>\n&lt;\/body>\n&lt;\/html><\/pre>\n\n\n\n<p>Edit the first lines and put your own data<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$webmasterid = xxxx;\n$password = 'yyyy'; <\/pre>\n\n\n\n<p>Then navigate to yourSite.com\/chat <\/p>\n\n\n\n<p>and you should see WHOLE page html5 chat<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sngine &#8211; The Ultimate PHP Social Network Platform is a cool php script. How to integrate html5 chat into that script ? Edit the .htaccess file and add these lines: # ChatRewriteRule ^chat\/?$ chat.php [L,QSA] Create chat.php file and paste this code: &lt;?php $webmasterid = xxxx; \/\/ your webmasterid html5chat account $password = &#8216;yyyy&#8217;; \/\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":940,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[159],"class_list":["post-938","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-sngine"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/comments?post=938"}],"version-history":[{"count":6,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/938\/revisions"}],"predecessor-version":[{"id":946,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/938\/revisions\/946"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/media\/940"}],"wp:attachment":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/media?parent=938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/categories?post=938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/tags?post=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}