Solved

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

Posted on 2010-11-22
7
681 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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

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.

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.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

803 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