vForums Support > Programming & Coding :: Code Requests & Support :: > [R] Category Name on Head Image

[R] Category Name on Head Image - Posted By dog199200 (dog199200) on 31st Mar 08 at 4:35am
{Smile} the name says it all {Smile} , also i already am using a code that centers the text, so if you were going to add that in you dont have to {Smile}

Re: Category Name on Head Image - Posted By Michael (wrighty) on 31st Mar 08 at 11:45am
So you want it in the center of the head image? {Smile}


<script>
/*Category Name in Head Image
by Wrighty
No Repost, Rip or Claiming*/

var row = 1; //Are you showing the 'Board Name' row? 1 = yes, 0 = no.

var r = get('tr','tag');
for(i=0;i<r.length;i++){
    if(r[i].cells[0].className == 'title2 categorytitle' && r[i].cells[0].innerHTML.match(/\/category\//)){
        r[i].cells[0].getElementsByTagName("a")[1].removeAttribute("href");
        r[i].cells[0].getElementsByTagName("font")[0].removeAttribute("size");
        var x = (row==1)? 1 : -1;
        var num = parseInt(2 + x);
        var a = r[i-num].insertCell(1);
        with(a){
            width="100%";
            align="center";
        }
        a.appendChild(r[i].cells[0].firstChild);
        r[i].style.display = 'none';
    }
}
</script>


Edit the part in red. That is the row that appears just above where the 'category' name normally is. If you're showing it, put a 1 otherwise, a 0 {Smile}

Any problems, post back.

Global Footer

Re: Category Name on Head Image - Posted By dog199200 (dog199200) on 31st Mar 08 at 10:14pm
{Smile} ok well the code works, but it doesn't work with the code i have to already center the text so can you please have the code center the text then?

Re: Category Name on Head Image - Posted By Michael (wrighty) on 31st Mar 08 at 10:16pm
It should do! {Smile}

Re: Category Name on Head Image - Posted By dog199200 (dog199200) on 31st Mar 08 at 10:19pm
it doesn't and do to the board mod you made me it messes up the forum when i set it to 1 and when i set it to 0 it puts the text on the left.


Edit: I think i know whats wrong is it possibly this code?

Code:
 
  1. <style type="text/css"/>
  2. #forum table.head {
  3.     width: 700px;
  4.     height: 30px;
  5.     display: block;
  6.     background-image: url('http://i25.photobucket.com/albums/c51/dog199200/FMA%20Images/head.png');
  7.     background-position: bottom center;
  8. }
  9. #forum table.base {
  10.     width: 700px;
  11.     height: 30px;
  12.     display: block;
  13.     background-image: url('http://i25.photobucket.com/albums/c51/dog199200/FMA%20Images/base.png');
  14.     background-position: top center;
  15. }
  16. #forum .slip_bg .border{
  17.    width: 700px !important;
  18.    margin: auto;
  19. }
  20.  
  21. #forum .slip_bg .border .border {
  22.     width: auto !important;
  23. }
  24.  
  25. #forum_table, #forum {
  26.     margin: auto;
  27. }
  28. </style>
 

Re: Category Name on Head Image - Posted By Michael (wrighty) on 31st Mar 08 at 10:27pm
Send me the forum link? {Smile}

Re: Category Name on Head Image - Posted By dog199200 (dog199200) on 31st Mar 08 at 10:41pm
http://fmaadvanced.virtualforums.co.uk


Edit: also why you are looking into the error can you please make the code so that it also removes the link from the text as well, because the one that does that in the datebase doesn't work with the code.

Re: Category Name on Head Image - Posted By Michael (wrighty) on 1st Apr 08 at 11:32am
Right, well I have modified the code to remove the category link. (Recopy it from above)

also, Why not just use the normal head/base method? Instead of this one? {Unsure}

Re: Category Name on Head Image - Posted By dog199200 (dog199200) on 1st Apr 08 at 11:52pm
because of how the images are made, it would be hard to redo them to have them fit right, but did you ever find out why the code doesn't center?

Re: Category Name on Head Image - Posted By Michael (wrighty) on 2nd Apr 08 at 12:07am
Sorry, but those head and base images are ripped from Pho's skin.

You will need to get new ones.

As of now this request is locked. If you feel this is wrong, PM me. Otherwise, change them!