Solved

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

Posted on 2010-11-22
7
682 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

860 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