Solved

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

Posted on 2010-11-22
7
676 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
Comment Utility

  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
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 2

Author Comment

by:marietto2008
Comment Utility
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
Comment Utility
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
Comment Utility
I don't understand what's --> YOURUSERPROFILEHERE
0
 
LVL 7

Expert Comment

by:dxdinh
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 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

11 Experts available now in Live!

Get 1:1 Help Now