2016-02-02, 11:47 PM
I created a custom profile field. On my post bit, I have a button that when is clicked, I would like an on screen pop up window to open up and display the value of the custom profile field that I created. I was able to do this on MyBB 1.6 by doing this, but for some reason, 1.8 doesn't allow me:
Any suggestions on how to accomplish this or something similar?
Thank you.
*EDIT*
I've decided to clean up how I was retrieving the custom profile field with a better popup. Here is what I have:
HTML Code
CSS Code
My question is what it was before. How would I get each individual's custom profile field? Right now, it's only picking up MY custom profile field, if that makes sense. So for each post from a user, that user will have an 'Info' button linked to them on their post in the postbit. I want that button linked to their custom profile field and whatever they entered in it, so if I click on an individual's button, I'll see what they put in their custom profile field, so on and so forth.
<button onclick="myFunction()">Get Value</button>
<script>
function myFunction() {
alert({$post['fid4']});
}
</script>
Any suggestions on how to accomplish this or something similar?
Thank you.
*EDIT*
I've decided to clean up how I was retrieving the custom profile field with a better popup. Here is what I have:
HTML Code
<div class="box">
<a class="button" href="#popup1">Info</a>
</div>
<div id="popup1" class="overlay">
<div class="popup">
<h2>Info</h2>
<a class="close" href="#">×</a>
<div class="content">
<span style="color:#000000">{$post['fid4']}</span>
</div>
</div>
</div>
CSS Code
h1 {
text-align: center;
font-family: Tahoma, Arial, sans-serif;
color: orange;
margin: 100px 0;
}
.button {
font-size: 1em;
padding: 10px;
color: #fff;
border: 2px solid orange;
border-radius: 20px/50px;
text-decoration: none;
cursor: pointer;
transition: all 0.3s ease-out;
}
.button:hover {
background: orange;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.7);
transition: opacity 500ms;
visibility: hidden;
opacity: 0;
}
.overlay:target {
visibility: visible;
opacity: 1;
}
.popup {
margin: 70px auto;
padding: 20px;
background: #fff;
border-radius: 5px;
width: 30%;
position: relative;
transition: all 5s ease-in-out;
}
.popup h2 {
margin-top: 0;
color: #333;
font-family: Tahoma, Arial, sans-serif;
}
.popup .close {
position: absolute;
top: 20px;
right: 30px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #333;
}
.popup .close:hover {
color: orange;
}
.popup .content {
max-height: 30%;
overflow: auto;
}
My question is what it was before. How would I get each individual's custom profile field? Right now, it's only picking up MY custom profile field, if that makes sense. So for each post from a user, that user will have an 'Info' button linked to them on their post in the postbit. I want that button linked to their custom profile field and whatever they entered in it, so if I click on an individual's button, I'll see what they put in their custom profile field, so on and so forth.