Visit BoonEx Page at Facebook

Facebook

Join BoonEx group at LinkedIn

LinkedIn

Follow BoonEx on Twitter

Twitter

Subscribe to BoonEx Blog RSS feed

RSS

Changes between Version 2 and Version 3 of RayIntegration

Show
Ignore:
Author:
IgorL (IP: 213.145.154.57)
Timestamp:
09/18/08 05:53:42 (1 year ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RayIntegration

    v2 v3  
    55 
    66 
    7 First of all you need to customize some interface functions, collected in “'''ray/modules/global/inc/customFunctions.inc.php'''” (as at most these functions are used for generating XML replies “'''true'''” and “'''false'''” strings are defined as constants and used instead of Boolean values in some custom functions). All functions should consider to accept the defined number of arguments and return the defined answer (as in original functions): 
     7First of all you need to customize some interface functions, collected in "'''ray/modules/global/inc/customFunctions.inc.php'''" (as at most these functions are used for generating XML replies "'''true'''" and "'''false'''" strings are defined as constants and used instead of Boolean values in some custom functions). All functions should consider to accept the defined number of arguments and return the defined answer (as in original functions): 
    88 
    99    1. '''loginUser''' 
    2323 
    2424{{{ 
    25 $sResult = loginUser(“1”, “12345”); 
     25$sResult = loginUser("1", "12345"); 
    2626echo $sResult; 
    27 $sResult = loginUser(“nick”, “12345”, true); 
     27$sResult = loginUser("nick", "12345", true); 
    2828echo $sResult; 
    2929///////////////////// 
    4747 
    4848{{{ 
    49 $sResult = loginAdmin(“admin”, “dolphin”); 
     49$sResult = loginAdmin("admin", "dolphin"); 
    5050echo $sResult; 
    5151///////////////////// 
    6767 
    6868{{{ 
    69 $aInfo = getUserInfo(“1”); 
     69$aInfo = getUserInfo("1"); 
    7070print_r($aInfo); 
    7171///////////////////// 
    72 Array("nick" => “Macho”, "sex" => “Male”, "age" => 25, "desc" => “some description goes here”, "photo" => “http://[your_site]/[images_folder]/1.pg”, "profile" => “http://[your_site]/profile.php?ID=1”
     72Array("nick" => "Macho", "sex" => "Male", "age" => 25, "desc" => "some description goes here", "photo" => "http://[your_site]/[images_folder]/1.pg", "profile" => "http://[your_site]/profile.php?ID=1"
    7373}}} 
    7474 
    8585}}} 
    8686 
    87 Searches user by $sField field (“ID” by default) for $sValue value and returns user ID. 
    88  
    89 {{{ 
    90 $sId = searchUser(“Macho”, “Nick”); 
     87Searches user by $sField field ("ID" by default) for $sValue value and returns user ID. 
     88 
     89{{{ 
     90$sId = searchUser("Macho", "Nick"); 
    9191echo $sId; 
    9292///////////////////// 
    105105}}} 
    106106 
    107 Retrieves users friends by given user ID. 
    108  
    109 {{{ 
    110 $aFriends = getFriends(“1”); 
     107Retrieves user's friends by given user ID. 
     108 
     109{{{ 
     110$aFriends = getFriends("1"); 
    111111print_r($aFriends); 
    112112///////////////////// 
    113 Array(“2”, "3", "5", "10") 
     113Array("2", "3", "5", "10") 
    114114}}} 
    115115 
    118118 
    119119 
    120 Once youve made necessary changes in integration functions, you should install Ray Base. For this go to "'''http://[your_site]/ray/install/'''". Go through the Ray installation wizard, accurately filling out all necessary fields.  
     120Once you've made necessary changes in integration functions, you should install Ray Base. For this go to "'''http://[your_site]/ray/install/'''". Go through the Ray installation wizard, accurately filling out all necessary fields.  
    121121 
    122122After this is done, the first part of integration is done. Your Ray admin panel (the login and password you should have set during installation steps) is available at  
    134134}}} 
    135135 
    136 into every page of your site. Also every page of your site should include integration JavaScript script “'''global/js/integration.js'''”  
    137 {{{ 
    138 <script src="[url_to_ray]/modules/global/js/integration.js" type="text/javascript" language="javascript"></script> 
     136into every page of your site. 
     137 
     138Also every page of your site should include the result of the function '''getRayIntegrationJS()''' which is declared in the file '''[path_to_ray]/modules/global/inc/content.inc.php''' 
     139 
     140It usually looks like this (in the default Dolphin installation): 
     141{{{ 
     142<script type="text/javascript" language="javascript"> 
     143var sRayUrl = "http://www.boonex.us/ray/";var aRayApps = new Array(); 
     144 
     145//global begin 
     146aRayApps["global"] = new Array(); 
     147aRayApps["global"]["admin"] = {"params": new Array('nick', 'password'), "top": 0, "left": 0, "width": 800, "height": 600, "resizable": 0}; 
     148//global end 
     149//im begin 
     150aRayApps["im"] = new Array(); 
     151aRayApps["im"]["user"] = {"params": new Array('sender', 'password', 'recipient'), "top": 0, "left": 0, "width": 550, "height": 500, "resizable": 1}; 
     152//im end 
     153//mp3 begin 
     154aRayApps["mp3"] = new Array(); 
     155aRayApps["mp3"]["player"] = {"params": new Array('id', 'password', 'vId', 'song'), "top": 0, "left": 0, "width": 350, "height": 380, "resizable": 0}; 
     156aRayApps["mp3"]["editor"] = {"params": new Array('id', 'password'), "top": 0, "left": 0, "width": 480, "height": 640, "resizable": 1}; 
     157//mp3 end 
     158//presence begin 
     159aRayApps["presence"] = new Array(); 
     160aRayApps["presence"]["user"] = {"params": new Array('id', 'password'), "top": 0, "left": 0, "width": 220, "height": 600, "resizable": 1}; 
     161//presence end 
     162//video begin 
     163aRayApps["video"] = new Array(); 
     164aRayApps["video"]["recorder"] = {"params": new Array('id', 'password'), "top": 0, "left": 0, "width": 350, "height": 435, "resizable": 0}; 
     165aRayApps["video"]["player"] = {"params": new Array('id'), "top": 0, "left": 0, "width": 350, "height": 435, "resizable": 1}; 
     166aRayApps["video"]["admin"] = {"params": new Array('nick', 'password'), "top": 0, "left": 0, "width": 700, "height": 330, "resizable": 0}; 
     167//video end//mp3_as3 begin 
     168aRayApps["mp3_as3"] = new Array(); 
     169aRayApps["mp3_as3"]["editor"] = {"params": new Array('id', 'password'), "top": 0, "left": 0, "width": 480, "height": 640, "resizable": 1}; 
     170//mp3_as3 end\n</script><script src="http://www.boonex.us/ray/modules/global/js/integration.js" type="text/javascript" language="javascript"> 
     171</script> 
    139172}}} 
    140173 
    141174Some Ray widgets use information about online status of site users. So you should provide user online status updating. This can be done in two ways: 
    142175 
    143     1. By calling to “'''updateRayUserStatus([user_ID])'''” JavaScript function (“'''global/js/integration.js'''” should be included) for HTML pages (as a rule on body onLoad event). 
    144  
    145     2. By calling to “'''updateOnline([user_ID])'''” PHP function (“'''global/inc/apiFunctions.inc.php'''” should be required) for PHP scripts. 
     176    1. By calling to "'''updateRayUserStatus([user_ID])'''" JavaScript function ("'''global/js/integration.js'''" should be included) for HTML pages (as a rule on body onLoad event). 
     177 
     178    2. By calling to "'''updateOnline([user_ID])'''" PHP function ("'''global/inc/apiFunctions.inc.php'''" should be required) for PHP scripts. 
    146179 
    147180 
    153186    1. If you want to open the widget application in pop-up window you should set 
    154187{{{ 
    155 “$aModules[application_name][‘inline’]”  
    156 }}} 
    157 variable in “'''inc/constants.inc.php'''” of the widget to “'''false'''” and then install the widget.  
     188"$aModules[application_name]['inline']"  
     189}}} 
     190variable in "'''inc/constants.inc.php'''" of the widget to "'''false'''" and then install the widget.  
    158191 
    159192After installation you will be able to open the widget application by calling to JavaScript  
    161194function openRayWidget(module, application, [param1], [param2], …, [paramN]) 
    162195}}} 
    163 function (“'''global/js/integration.js'''” should be included to this page) with necessary set of parameters passed to this function. 
     196function ("'''global/js/integration.js'''" should be included to this page) with necessary set of parameters passed to this function. 
    164197 
    165198For example Ray chat (by Boonex) should be opened this way: 
    166199link to chat:  
    167200{{{ 
    168 <a href=”#” onClick=” openRayWidget(“chat”, “user”, “1”, “12345”)”>open chat</a> 
    169 }}} 
    170  
    171 Clicking on this link user will open Ray chat and login to it with “1”(user ID) and “12345”(user password) login information. 
    172  
    173 Here are two compulsory for any widget application parameters – widget name (“'''chat'''”) and widget application name (“'''user'''”).  
     201<a href="#" onClick=" openRayWidget("chat", "user", "1", "12345")">open chat</a> 
     202}}} 
     203 
     204Clicking on this link user will open Ray chat and login to it with "1"(user ID) and "12345"(user password) login information. 
     205 
     206Here are two compulsory for any widget application parameters – widget name ("'''chat'''") and widget application name ("'''user'''").  
    174207The rest of parameters depend on widget application and can be known from 
    175208{{{ 
    176 $aModules[application_name][‘parameters’]  
    177 }}} 
    178  
    179 variable in “'''inc/constants.inc.php'''” of the widget. 
     209$aModules[application_name]['parameters']  
     210}}} 
     211 
     212variable in "'''inc/constants.inc.php'''" of the widget. 
    180213 
    181214    2. If you want to integrate any widget application directly into your site page you should require on this page 
    194227function where the widget application should appear. 
    195228 
    196 For example to insert Ray chat (by Boonex) in some page (“'''chat_area.php'''”) of a site one should make the following changes to this page: 
     229For example to insert Ray chat (by Boonex) in some page ("'''chat_area.php'''") of a site one should make the following changes to this page: 
    197230 
    198231'''chat_area.php''' 
    199232{{{ 
    200233<?php 
    201         require_once(“[path_to_ray]/modules/global/inc/ header.inc.php”); 
    202         require_once(“[path_to_ray]/modules/global/inc/content.inc.php”); 
     234        require_once("[path_to_ray]/modules/global/inc/ header.inc.php"); 
     235        require_once("[path_to_ray]/modules/global/inc/content.inc.php"); 
    203236        //some code 
    204237………………….. 
    205238$aParamValues = array(); 
    206 $aParamValues[‘id’] = “1”;//defining user ID 
    207 $aParamValues[‘password’] = “12345”;//defining user password 
    208 echo getApplicationContent(“chat”, “user”, $aParamValues, true); 
     239$aParamValues['id'] = "1";//defining user ID 
     240$aParamValues['password'] = "12345";//defining user password 
     241echo getApplicationContent("chat", "user", $aParamValues, true); 
    209242………………….. 
    210243//some more code 
    212245}}} 
    213246 
    214 This will display Ray chat and login to it with “1”(user ID) and “12345”(user password) login information directly in the “'''chat_area.php'''” page. 
     247This will display Ray chat and login to it with "1"(user ID) and "12345"(user password) login information directly in the "'''chat_area.php'''" page. 
    215248 
    216249If you have questions, suggestions or feedbacks over this manual feel free to write them at [http://www.boonex.com/unity/forums/ Unity Forums for Ray].