We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Forum Background posts - Help.
Topic Started: May 10 2013, 11:21 AM (291 Views)
ScapeWise
Member Avatar
Member
[ * ]
Board Address: http://scapewise.co.uk
Board Software: ZetaBoards
Description:

So for the last day or so I have been adding code to my forums to make the background colour of a certain user groups post. Here is the code I have added:

Code:
 
<script type='text/javascript'>
//Add Background Color for Posts Based on Your Group
//By Reid and Minato of Zathyus Networks Resources

//Changes
//To add more, do the following:
//, ["group name (Be exact)", "class name"]
var group = [
["Admin", "Admin"], ["Leadership", "Leadership"],
];

$('dl.user_info > dt:contains(Group:) + dd').each(function () {
for (var k = group.length, x = 0; x < k; x++) {
if (this.innerHTML.indexOf(group[x][0]) !== -1) {
$(this).closest('tr').find('td.c_post').addClass(group[x][1]); // add what class? y isn't defined in your code
}
}
});
</script>

<script type='text/javascript'>
//Add Background Color for Posts Based on Your Group
//By Reid and Minato of Zathyus Networks Resources

//Changes
//To add more, do the following:
//, ["group name (Be exact)", "class name"]
var group = [
["Admin", "Admin"], ["Leadership", "Leadership"],
];

$('dl.user_info > dt:contains(Group:) + dd').each(function () {
for (var k = group.length, x = 0; x < k; x++) {
if (this.innerHTML.indexOf(group[x][0]) !== -1) {
$(this).closest('tr').find('td.c_user').addClass(group[x][1]); // add what class? y isn't defined in your code
}
}
});
</script>


and for some reason it hasn't been working the way I wanted it to, I want it to look exactly the same as shown in this image apart from the green boarder colour.

Posted Image

What should I add/ change or maybe even remove? This is what my posts look like at the moment:

Posted Image

Notice as it only colours certain parts and not every like I want it too in the other image? How do I go about to fix this please?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
$(this).closest('tr').find('td.c_post').addClass(group[x][1]); // add what class? y isn't defined in your code
Change that to this:
Code:
 
$(this).closest('tr').find('td').addClass(group[x][1]);
$(this).closest('tr').prev('tr[id*="post-"]').find('td').addClass(group[x][1]);
$(this).closest('tr').next('tr:has(td[class*="sig"])').find('td').addClass(group[x][1]);
Offline Profile Goto Top
 
ScapeWise
Member Avatar
Member
[ * ]
How do I add colour to the area where it says "Ashley" and the part on the right of it where it has "Yesterday, 11:01pm"? What is the code for that please?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
$(this).closest('tr').prev('tr[id*="post-"]').find('td').addClass(group[x][1]);
That's what controls it, you just need to use !important:
Code:
 
.Admin {
background: #4d461c !important;
}
.Leadership {
background: #4d461c !important;
}
Offline Profile Goto Top
 
ScapeWise
Member Avatar
Member
[ * ]
Cory, you are a genius. I would advice you ask to be on the Admin Team or something for ZetaBoards. You are seriously that good.

Thanks so much!
Offline Profile Goto Top
 
Moonface
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic