HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Integrate Photo Chat

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#97549 (In Topic #19318)
Avatar

Community saint

Hi Guys, I want to integrade this very nice Proton Chat 5 into a page with only access for members.

I need some data to get the username and avatar, how?
For joomla is this needed:

Code

<?php
 $user =& JFactory::getUser();
 $retrieved_username = $user->username;
 ?>

So for ocPortal I search some same thing. Can some one of the programming goeroes help in this please?

Harry


http://digiflash.nl Photo community  (dutch)
Back to the top
 
Posted
Rating:
#97554
Avatar

Hi, so I assume the chat is in a miniblock or minimodule or something, and you just have to add a little code to give Proton Chat's code something to tie into.

Code

$user=get_member();
$retrieved_username=$GLOBALS['FORUM_DRIVER']->get_username($user);


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#97556
Avatar

Community saint

I have made a new zone for the chat, but the code you give is not working for this one.  See the picture how it looks now when I looged in as admin.



They use this code to integrade this into like drupal:

Code

DRUPAL CODE
 The top part of the code retrieves the member's username from Drupal. The bottom part places the chat client into your website. The username is passed to the chat.swf to to execute the member auto-login.<?php
 global $user;
 $retrieved_username = $user->name;
 ?>

 <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>

I use now in the page the code:

Code

[title]Your new zone[/title]
[semihtml]
<?php
$user=get_member();
$retrieved_username=$GLOBALS['FORUM_DRIVER']->get_username($user);
?>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle">
 <param name="allowScriptAccess" value="always">
 <param name="allowFullScreenInteractive" value="true">
 <param name="allowFullScreen" value="true">
 <param name="movie" value="/chat/chat.swf">
 <param name="menu" value="false">
 <param name="quality" value="best">
 <param name="bgcolor" value="#2D2D2D">
 <embed src="/chat/chat.swf" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="always" allowFullScreenInteractive="true" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer">
 </object>
[/semihtml]


http://digiflash.nl Photo community  (dutch)
Back to the top
 
Posted
Rating:
#97557
Avatar

Right, you can't put PHP code in a Comcode page for security reasons. Make a new miniblock… sources_custom/miniblocks/photochat.php, then include that block using [block]photochat[/block].


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#97558
Avatar

Community saint

Thanks Chris, have made that block, but if I use the object code into the mini block or in the page itself it doing nothing. I see the chat perfect, there is the login screen. I can type everything into it, but the code is not responding after that.

I missing the way how to retrieve the username…
like this:

Code

<?php
$user=get_member();
$retrieved_username=$GLOBALS['FORUM_DRIVER']->get_username($user);
?>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle">
 <param name="allowScriptAccess" value="always">
 <param name="allowFullScreenInteractive" value="true">
 <param name="allowFullScreen" value="true">
 <param name="movie" value="/chat/chat.swf">
 <param name="menu" value="false">
          <param src="chat.swf?username=<?php echo $retrieved_username ?>"
 <param name="quality" value="best">
 <param name="bgcolor" value="#2D2D2D">
 <embed src="/chat/chat.swf" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="always" allowFullScreenInteractive="true" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></object>

There is something wrong with it? I'am not a programmer sorry.


http://digiflash.nl Photo community  (dutch)
Back to the top
 
Posted
Rating:
#97564
Avatar

That mostly looks right. The only change I see that needs doing is:

Code

<?php echo $retrieved_username ?>
should really be:

Code

<?php echo urlencode($retrieved_username); ?>

as otherwise it is dumping a username direct onto the end of a URL, without encoding it.

I doubt this is your issue though. If you link me to where I can see it failing, I'll see if I can work out why.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#97565
Avatar

Community saint

i will send you a pm with details.

Thanks for the time.

Harry


http://digiflash.nl Photo community  (dutch)
Back to the top
 
Posted
Rating:
#97567
Avatar

Actually I can see quite a lot wrong when I look closer  :lol:. Bear with me.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#97568
Avatar

I think I got it working with this code…

Code

<?php
$user=get_member();
$retrieved_username=$GLOBALS['FORUM_DRIVER']->get_username($user);
?>
<object base="<?php echo get_base_url(); ?>/chat/" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="860" height="550" align="middle">
   <param name="allowScriptAccess" value="always" />
   <param name="allowFullScreenInteractive" value="true" />
   <param name="allowFullScreen" value="true" />
   <param name="movie" value="/chat/chat.swf?username=<?php echo urlencode($retrieved_username); ?>" />
   <param name="menu" value="false" />
   <param name="quality" value="best" />
   <param name="bgcolor" value="#2D2D2D" />
   <embed base="<?php echo get_base_url(); ?>/chat/" src="/chat/chat.swf?username=<?php echo urlencode($retrieved_username); ?>" menu="false" quality="best" bgcolor="#2D2D2D" width="860" height="550" align="middle" allowScriptAccess="always" allowFullScreenInteractive="true" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer">
</object>

Except the chat doesn't work. I think you need to configure some rooms still.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#97569
Avatar

Community saint

Thanks Chris, normally it works without making rooms. If I open the chat he says that there are no users in room. Also the data is not going to the main room.

My conclusion is that is not going to work within ocp. :(
But as a external chat its working with a link from ocp. Its in fact in very easy chat system without database thats why I wanted to use it.

Thanks for your time to look at it!.

Harry


http://digiflash.nl Photo community  (dutch)
Back to the top
 
Posted
Rating:
#97570
Avatar

You may want to talk to the developers. I can't see what would have been wrong with it there. The code had assumed it was running in the same directory as the page it was in (so /chatpro on your server), but I added 'base' attributes to try and change that. After I did this, a lot of errors in the browser console went away. However, maybe that was not enough.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#97571
Avatar

Community saint

I have already emailed them. But its a commercial business like ocPortal. But lets wait if I hear from them. :)


http://digiflash.nl Photo community  (dutch)
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: