Changeset 2272018
- Timestamp:
- 03/31/2020 07:44:22 PM (6 years ago)
- Location:
- html5-chat/trunk
- Files:
-
- 2 edited
-
index.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
html5-chat/trunk/index.php
r2249006 r2272018 33 33 */ 34 34 static function pluginActivated() { 35 35 36 $user = wp_get_current_user(); 36 37 $roles = $user->roles; … … 39 40 $username = $user->user_login;; 40 41 $domain = get_site_url(null, '', ''); 41 42 42 if (!$domain) { 43 43 $domain = get_home_url(null, '', ''); … … 51 51 52 52 $params = array ( 53 'a' =>'createAccountWP', 54 'username' =>$username, 55 'email' =>$email, 56 'isAdmin' =>$isAdmin, 57 'url' =>$domain, 58 'wp_register_url' =>$wp_register_url, 59 'wp_login_url' =>$wp_login_url); 53 'a' =>'createAccountWP', 54 'username' =>$username, 55 'email' =>$email, 56 'isAdmin' =>$isAdmin, 57 'url' =>$domain, 58 'wp_register_url' =>$wp_register_url, 59 'wp_login_url' =>$wp_login_url); 60 60 61 $query = http_build_query ($params); 61 62 $contextData = array ( … … 64 65 'content'=> $query 65 66 ); 66 $context = stream_context_create (array ( 'http' => $contextData )); 67 $result = file_get_contents (self::$registerAccountUrl, false, $context); 67 68 function file_get_contents2($url, $data){ 69 $ch = curl_init(); 70 curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); 71 curl_setopt($ch, CURLOPT_HEADER, 0); 72 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 73 curl_setopt($ch, CURLOPT_URL, $url); 74 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 75 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 3); 76 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 77 curl_setopt($ch, CURLOPT_POST, true); 78 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); 79 $res = curl_exec($ch); 80 curl_close($ch); 81 return $res; 82 } 83 if( !ini_get('allow_url_fopen') ) { 84 $result = file_get_contents2(self::$registerAccountUrl, $params); 85 } else { 86 $context = stream_context_create (array ( 'http' => $contextData )); 87 $result = file_get_contents (self::$registerAccountUrl, false, $context); 88 } 68 89 set_transient( self::$noticeName, $result, 5 ); 69 90 } -
html5-chat/trunk/readme.txt
r2249006 r2272018 19 19 == Installation == 20 20 21 * activate the plugin21 * just activate the plugin 22 22 * insert the [HTML5CHAT width=100% height=640px] short code into your page or post 23 23 * you can configure your chat look&feel through your "configure chat" link
Note: See TracChangeset
for help on using the changeset viewer.