Solved

Add a javascript code block on the user's profile pages of Buddypress.

Posted on 2010-11-22
7
692 Views
Last Modified: 2012-05-10
Hello,

On my web-site I'm running BuddyPress. In the screenshot I've attached,you can see the profile page of a registered user of my site. Under the profile pages of each user,I would add a specific javascript code block that enable the tinychat audio/video chat feature. It is :

<script type="text/javascript">var tinychat = { room: "marietto2008", colorbk: "0xffffff", join: "auto", api: "list"};</script><script src="http://tinychat.com/js/embed.js"></script><div id="client"><a href="http://tinychat.com">video chat</a>a</div>

the room name is the nickname that I used when I registered on the tinychat website.
I would like to change the nickname "marietto2008" with the specific variable name used in Buddypress.
22-11-2010-17-02-46.jpg
0
Comment
Question by:marietto2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 7

Accepted Solution

by:
dxdinh earned 500 total points
ID: 34190534

  can you inject javascript var tinychat on server side

  echo " <script type="text/javascript">var tinychat = { room: ""   + YOURUSERPROFILEHERE  + "", colorbk: "0xffffff", join: "auto", api: "list"};</script> "

that's way you can you pass the correct user profile to the script chat.
0
 
LVL 2

Author Comment

by:marietto2008
ID: 34190625
Can you tell me which file I need to edit to add the java script block and how ? thanks.
0
 
LVL 7

Expert Comment

by:dxdinh
ID: 34190914
I assume you want to put the <head> section of the page that include the link

<a href="http://tinychat.com">video chat</a>

and before this chat script
<script src="http://tinychat.com/js/embed.js"></script




0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 2

Author Comment

by:marietto2008
ID: 34191343
Do you see the screenshot I've attached ? I would like to add the java script code in a way that the java applet is displayed under the user's nickname. I don't know which file I have to modify. I'm using the default Buddypress theme.
0
 
LVL 2

Author Comment

by:marietto2008
ID: 34191866
I've studied a little how Buddypress work,I think that the file to modify to add the javascript code is here :

\BuddyPress\Buddypress\bp-themes\bp-default\members\single\profile

can you help me to understand which file I can modify and how ? thanks.
0
 
LVL 2

Author Comment

by:marietto2008
ID: 34192818
I don't understand what's --> YOURUSERPROFILEHERE
0
 
LVL 7

Expert Comment

by:dxdinh
ID: 34193647
Could you please post the file content or the code snippet?

- YOURUSERPROFILEHERE   : is where on the server side you insert your user's nickname or your user profile.
0

Featured Post

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question