Solved

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

Posted on 2010-11-22
7
677 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now