{"id":1202,"date":"2021-03-24T08:59:24","date_gmt":"2021-03-24T08:59:24","guid":{"rendered":"https:\/\/html5-chat.com\/blog\/?p=1202"},"modified":"2021-03-24T08:59:25","modified_gmt":"2021-03-24T08:59:25","slug":"intergration-with-youdate-website","status":"publish","type":"post","link":"https:\/\/html5-chat.com\/blog\/intergration-with-youdate-website\/","title":{"rendered":"Intergration with youdate.website"},"content":{"rendered":"\n<p>Youdate.website is a small CRM for dating written with Yii framework<\/p>\n\n\n\n<p>Here is a quick way to integrate html5-chat with youdate<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\nrequire(<em>__DIR__ <\/em>. '\/application\/bootstrap.php');\nrequire(<em>__DIR__ <\/em>. '\/application\/vendor\/autoload.php');\nrequire(<em>__DIR__ <\/em>. '\/application\/environment.php');\nrequire(<em>__DIR__ <\/em>. '\/application\/vendor\/yiisoft\/yii2\/Yii.php');\nrequire(<em>__DIR__ <\/em>. '\/application\/controllers\/PhotoController.php');\n$config = require(<em>__DIR__ <\/em>. '\/application\/config\/web.php');\n$application = new yii\\web\\Application($config);\n$user = Yii::<em>$app<\/em>->user;\nif (!$user) {\n   exit();\n}\n$username = Yii::<em>$app<\/em>->user->identity->profile->name;\n$photo_id = Yii::<em>$app<\/em>->user->identity->profile->photo_id;\n$sex = Yii::<em>$app<\/em>->user->identity->profile->sex;\n$role = Yii::<em>$app<\/em>->user->identity->profile->status;\n$photo = (new \\yii\\db\\Query())\n->select(['id', 'source'])\n->from('photo')\n->where(['id' => $photo_id])\n->one();\n$image = ($photo) ? \"http:\/\/yoursitehere.com\/content\/photos\/{$photo['source']}\" : '';\n$webmasterid = XXXXXXX;\n$gender = 'male';\nswitch ($sex) {\n   case 2:\n      $gender = 'female';\n      break;\n   case 11:\n      $gender = 'couple';\n      break;\n   case 12:\n      $gender = 'trans';\n      break;\n}\n$myuser = [\n   'username' => $username,\n   'gender' => $gender,\n   'role' => 'user',\n   'image' => <em>base64_encode<\/em>($image),\n   'password' => 'YourHTML5ChatPassword',\n];\n$json = <em>json_encode<\/em>($myuser);\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>Webcam chat<\/strong>&lt;\/title>\n   &lt;style>\n      body, html, #chatContainer {\n         <em>width<\/em>: 100%;\n         <em>height<\/em>: 100%;\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","protected":false},"excerpt":{"rendered":"<p>Youdate.website is a small CRM for dating written with Yii framework Here is a quick way to integrate html5-chat with youdate &lt;?php require(__DIR__ . &#8216;\/application\/bootstrap.php&#8217;); require(__DIR__ . &#8216;\/application\/vendor\/autoload.php&#8217;); require(__DIR__ . &#8216;\/application\/environment.php&#8217;); require(__DIR__ . &#8216;\/application\/vendor\/yiisoft\/yii2\/Yii.php&#8217;); require(__DIR__ . &#8216;\/application\/controllers\/PhotoController.php&#8217;); $config = require(__DIR__ . &#8216;\/application\/config\/web.php&#8217;); $application = new yii\\web\\Application($config); $user = Yii::$app->user; if (!$user) { exit(); } $username [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1204,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-1202","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integration"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/1202","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=1202"}],"version-history":[{"count":12,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/1202\/revisions"}],"predecessor-version":[{"id":1215,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/posts\/1202\/revisions\/1215"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/media?parent=1202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/categories?post=1202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5-chat.com\/blog\/wp-json\/wp\/v2\/tags?post=1202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}