What's up guys. I purchased a chat script that allows CMS integration But I just dont know how to get this done. They seem to support quite a few CMS platforms but I'm dolphin to the core so how would I go about doing this?
Per instructions:
Every CMS, forum, dating script or other system with a member database, stores the member's username and profile picture (if available) data in a temporary session array or global variable after the member has successfully logged into the website with their account. This member data needs to be retrieved and passed to the chat client to execute the member auto-login procedure.
1) WORDPRESS CODE
The top part of the code retrieves the member's username from Wordpress. The bottom part places the chat client into your website. The username is passed to the chat.swf to execute the member auto-login.
<?php global $current_user; get_currentuserinfo(); $retrieved_username = $current_user->user_login; ?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object>
Any help would be greatly appreciated.
|
You will have to include a few things on the page so that you can get the information needed.
I am not sure of all the includes/requires that are needed for what you are going to do. Will the chat be in an iframe on a page or sitting outside of the regular Dolphin pages? I think there is some code from HL that will include the Dolphin menu on any page even if it is sitting outside of Dolphin.
Geeks, making the world a better place |
geek_girl; I wanted to create a page within dolphin to keep with the look and function of the template but I guess I would need to create a php block within that page. |
What you can do is to create a page using the page builders. For the code, yes I am guessing a php block would be needed in order to retrieve the current logged in member. The chat is just an <object></object> tag that will create the chat window within the page.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object>
Geeks, making the world a better place |
Do you have some of the tools that make it easy to add php blocks instead of doing it through the database directly? Geeks, making the world a better place |
You would need a php block on a page.
Code for php block.
$iMemberID = (int)$_COOKIE['memberID']; $retrieved_username = getNickName($iMemberID); ?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object>
<?php
https://www.deanbassett.com |
There you go, I was looking up what the code was and Deano popped in and gave the answer. I can not remember all the functions and what not; I have to look them up, I should start making a reference file. This would be useful on one of the other support sites like Newton27's site. We should do that. Geeks, making the world a better place |
I've used Deanos back on 7.09. I havent set it up yet on 7.1.4 |
Aww Deano you got me while I was typing.
Thanks
|
What about the avatar? If the avatar module is installed. Can we pull out the member's avatar to use?
@octoma : I don't see anything in the WordPress about avatar and don't know anything about WorldPress. What about some of the other CMS code they provided? It would be nice if the member's avatar could be passed to your Chat Room.
Geeks, making the world a better place |
They have the same object code for all of the other CMS none of which include code for Avatar.
ex - Joomla
<?php $user =& JFactory::getUser(); $retrieved_username = $user->username; ?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object>
|
Hey Deano I'm getting this error in the php block
Parse error: syntax error, unexpected '<' in /home/celebdir/public_html/inc/classes/BxDolPageView.php(698) : eval()'d code on line 1
Thanks
|
the php code inside will not work
Yes, I tired and got an unexpected end of code. Let's try it with heredoc.
$iMemberID = (int)$_COOKIE['memberID']; $retrieved_username = getNickName($iMemberID);
$output = <<<BLOCK <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object>
BLOCK;
echo $output;
so much to do.... |
The the < on eval line 1 meand a <?php was added to line 1 which my code did not include. There is no < on line one of my code.
I just tested it on my site, and got no errors. https://www.deanbassett.com |
Try this
$iMemberID = (int)$_COOKIE['memberID']; $retrieved_username = getNickName($iMemberID); ob_start(); ?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object> <?php echo ob_get_clean();
so much to do.... |
Check your code, you could have cut and pasted wrong. Geeks, making the world a better place |
Normally with a PHP Block,
Thats correct. However you can switch a php block in and out of php and html quite easily. Example.
echo 'PHP Test.'; ?> <div>Now we are in html mode. Done by closing php on the line above.</div> <?php echo 'Now we are back in php mode.';
Your heredoc won't work because it contains a php tag.
If the heredoc is to be used than this.
<?php echo $retrieved_username ?>
Needs to be replaced with this.
{$retrieved_username}
https://www.deanbassett.com |
OK, copied again, pasted into a text editor to be sure I was not picking up something else. I got the same end of file error:
Parse error: syntax error, unexpected end of file in /inc/classes/BxDolPageView.php(729) : eval()'d code on line 15
Geeks, making the world a better place |
Normally with a PHP Block,
Thats correct. However you can switch a php block in and out of php and html quite easily. Example.
echo 'PHP Test.'; ?> <div>Now we are in html mode. Done by closing php on the line above.</div> <?php echo 'Now we are back in php mode.';
Your heredoc won't work because it contains a php tag.
If the heredoc is to be used than this.
<?php echo $retrieved_username ?>
Needs to be replaced with this.
{$retrieved_username}
Yes, I know. Not sure what Dolphin sees though when it sends it to the parser; so...
Geeks, making the world a better place |
OK, copied again, pasted into a text editor to be sure I was not picking up something else. I got the same end of file error:
Parse error: syntax error, unexpected end of file in /inc/classes/BxDolPageView.php(729) : eval()'d code on line 15
It may be your version of PHP.
Try adding a echo ''; after <?php
Or try prashanks code which includes buffering.
https://www.deanbassett.com |
Try this
$iMemberID = (int)$_COOKIE['memberID']; $retrieved_username = getNickName($iMemberID); ob_start(); ?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object> <?php echo ob_get_clean();
No error, although can not test since I don't have the chat application.
Geeks, making the world a better place |
OK, copied again, pasted into a text editor to be sure I was not picking up something else. I got the same end of file error:
Parse error: syntax error, unexpected end of file in /inc/classes/BxDolPageView.php(729) : eval()'d code on line 15
It may be your version of PHP.
Try adding a echo ''; after <?php
Or try prashanks code which includes buffering.
Yes, php 5.4 is on the server.
Yes, the echo ''; worked; guess php 5.4 did not like the empty code block
Geeks, making the world a better place |
Yes, I know. Not sure what Dolphin sees though when it sends it to the parser; so...
Well actually dolphin does not see anything. Dolphin just passes it to the php eval function which actually processes the code. Dolphin has nothing to do with it.
https://www.deanbassett.com |
Prashank's code did away with the error but the block just shows a grey out of the app. |
Yes, I know. Not sure what Dolphin sees though when it sends it to the parser; so...
Well actually dolphin does not see anything. Dolphin just passes it to the php eval function which actually processes the code. Dolphin has nothing to do with it.
Deano LOL, I call all the bits and pieces that make up the platform Dolphin. Dolphin is the php eval function, the isAdmin(), and all the other parts. Every little function in the platform is Dolphin, including the third party plugins that have been added and integrated. Dolphin is the sum of the parts and the parts of the sum. Dolphin is the yin and the yang. Be one with the Dolphin.
Geeks, making the world a better place |
Then it not finding the chat.swf file thats specified in the embed code.
Most likely you will need to specify the full path or url to that file instead of just chat.swf which is in two locations.
https://www.deanbassett.com |
My mistake it was calling to chat.swf instead chat/chat.swf |
Prashank's code did away with the error but the block just shows a grey out of the app.
Check your path
<embed src="chat.swf?
Geeks, making the world a better place |
thats because your chat.swf is not in the relative path of the page. Whats the exact folder chat.swf is stored?
Prashank's code did away with the error but the block just shows a grey out of the app.
EDIT: nvm
so much to do.... |
So close... its running, im logged in but not showing up in app. the chat room is empty. |
Try this update...
$iMemberID = (int)$_COOKIE['memberID']; $retrieved_username = getNickName($iMemberID); ob_start(); ?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="allowFullScreenInteractive" value="true"> <param name="movie" value="<?php echo BX_DOL_URL_ROOT ?>chat/chat.swf?username=<?php echo $retrieved_username ?>"> <param name="menu" value="false"> <param name="quality" value="best"> <param name="bgcolor" value="#2D2D2D"> <embed src="<?php echo BX_DOL_URL_ROOT ?>chat/chat.swf?username=<?php echo $retrieved_username ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="sameDomain" allowFullScreenInteractive="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </object> <?php echo ob_get_clean();
EDIT: Another update. PM me your site address if that doesn't work.
EDIT 2: One more update
so much to do.... |
its still not showing logged member |
*Solved
Thanks guys for the help. Prashank's last code did the trick.
|
This would be useful on one of the other support sites like Newton27's site. We should do that.
I did have a chat using http://wibiya.conduit.com/ but the went under!
So your thinking I should have a chat page there too?
ManOfTeal.COM a Proud UNA site, six years running strong! |
For clarification, It was looking for its files in root location for some weird reason. So moving all the chat files to root did the trick. Weird flash, it sucks.
*Solved
Thanks guys for the help. Prashank's last code did the trick.
so much to do.... |
Off topic, but a follow up to GG
This is a chat page we can gather at to discuss things quickly if needed.
http://www.boonexsupport.com/misc.php?page=boonexsupportchat
ManOfTeal.COM a Proud UNA site, six years running strong! |
Newton, I just tried to register for your site and it kept saying my password wasn't long or complex enough, but for the life of me I couldn't see the password field. What am I missing? |
Newton, I just tried to register for your site and it kept saying my password wasn't long or complex enough, but for the life of me I couldn't see the password field. What am I missing?
You must have found it, I see you joined.
ManOfTeal.COM a Proud UNA site, six years running strong! |
Hello, sorry for the delay on getting back to the avatar question. The people from the company sent me this information which I am passing along:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860"
height="550" align="middle">
<param name="allowScriptAccess" value="sameDomain">
<param name="allowFullScreenInteractive" value="true">
<param name="movie" value="chat.swf?username=<?php echo "John";
?>&picture=<?PHP echo
"http://www.yourdomain.com/yourimages/wolverine.gif"; ?>">
<param name="menu" value="false">
<param name="quality" value="best">
<param name="bgcolor" value="#2D2D2D">
<embed src="chat.swf?username=<?php echo "John"; ?>&picture=<?PHP echo
"http://www.yourdomain.com/yourimages/wolverine.gif"; ?>" menu="false"
quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle"
allowScriptAccess="sameDomain" allowFullScreenInteractive="true"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</object>
Geeks, making the world a better place |
The question here is how do we return the current avatar of a member? Once we get the avatar number, then we can generate the URL to the avatar; in this case I think the OP wanted the 32x32 avatar which is the one with the i added to the number, xxxxi.jpg. Geeks, making the world a better place |
Thanks GG. I'll test and report soon. |
The question here is how do we return the current avatar of a member? Once we get the avatar number, then we can generate the URL to the avatar; in this case I think the OP wanted the 32x32 avatar which is the one with the i added to the number, xxxxi.jpg.
You don't need to get a avatar number. You have the members ID. Which is needed to get the nickname. Now all you need is the url of that members avatar. Dolphin has a function built in to do that.
This one will return the url to the members 64x64 avatar.
getMemberAvatar($iMemberID, $sType = 'medium');
This one is the same, but returns the url to the 32x32 avatar
getMemberAvatar($iMemberID, $sType = 'small')
https://www.deanbassett.com |
The question here is how do we return the current avatar of a member? Once we get the avatar number, then we can generate the URL to the avatar; in this case I think the OP wanted the 32x32 avatar which is the one with the i added to the number, xxxxi.jpg.
You don't need to get a avatar number. You have the members ID. Which is needed to get the nickname. Now all you need is the url of that members avatar. Dolphin has a function built in to do that.
This one will return the url to the members 64x64 avatar.
getMemberAvatar($iMemberID, $sType = 'medium');
This one is the same, but returns the url to the 32x32 avatar
getMemberAvatar($iMemberID, $sType = 'small')
Something to add here
You have to call it like this
$GLOBALS['oFunctions']->getMemberAvatar($iMemberId);
so much to do.... |