I wanted to use a script using instant messaging and found this.
The instruction said that to Make sure that in blab_im/config.php you've set properly $site_to_bim and $bim_to_site:
$site_to_bim='localhost/ThesisDB/blab_im/'; // URL or relative path from your main site to BLAB!IM, default:> $site_to_bim='./blab_im/'; [must end > with a trailing slash]
$bim_to_site='../'; // URL or relative path from BLAB!IM to you开发者_运维知识库r > main site, default: $bim_to_site='../'; [must end with a > trailing slash]
i was able to understand a little bit the first part(Correct me if I am wrong) the second part I do not understand which is bim_to_site.
Thanks/Salamat in advance!
The second variable is asking for the path to take from the directory that the im client script is in to the www root.
So, for instance if the im client is here:
www.example.com/files/imclient
that would give you:
$site_to_bim = '/files/imclient/;
$bim_to_site = '../../';
because you go up 2 levels from the im directory to the main site directory.
Update
When you are specifying a relative path, you can start a few different ways:
- with a slash:
/files/
. That will tell the parser (or browser) to try to find the target beginning from the main directory, then into the files directory. - with simply the directory name:
files/
. That means begin looking where you currently are and look for the files directory. So if the script resides in the imclient directory from the above example, this would mean "look for the files directory inside the imclient directory. - with a dot slash:
./files/
. This means the same as the above. Start in the current working directory. - with two dots and a slash:
../files
. This means start in the current working directory and move up out of it to the parent directory. So in the example, if the script was in imclient, using../
would say "look for things in the files directory and../../
would say "look for things in the main directory (the parent of files).
Does that flesh it out a bit?
精彩评论