Fork me on GitHub

changing the look of center block only  Bottom

  • hi
    i am using AstroGreenA theme and have managed to activate center blocks (adding blocks(centre);) to themeheader function).

    now i need to change the looks for the center block (Admin Messages) only. i want it to be borderless, not display title and should only contain one image. i know i am supposed to do this in themes/AstroGreenA/blocks.php file, which currently contains this:

    Code

    function themesidebox($title, $content) {
    // block ._LOGIN.
    global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1;

    !!!!!!this is the part i have inserted but doesn't seem to work....
    if ($title == ""._ADMIN_MESSAGES."") {
    echo "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\"><tr valign=top>";
    echo "<td>$content</td></tr></table>";
    }
    !!!!!!!.......inserted up to here
    If ($title == ""._LOGIN."") {
    //echo "<table width=\"150\" cellpadding=\"2\" cellspacing=\"0\"><tr valign=\"top\">
    echo "<table width=\"150\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr>
            <td>
                <table background=\"themes/AstroGreenA/images/150_tab.gif\" width=\"150\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"></td></tr>
                    <tr>
                        <td align=\"absmiddle\">&nbsp;<img src=\"themes/AstroGreenA/images/blocks_pic.gif\" align=\"absmiddle\">&nbsp;<font color=\"$textcolor1\"><b>$title</b></font></td></tr>
                </table>
                <table width=\"100%\" border=\"1\" bordercolor=\"$bgcolor1\" cellspacing=\"0\" cellpadding=\"4\">
           
                    <tr valign=\"top\">
                        <td bgcolor=\"$bgcolor3\" border=\"1\" bordercolor=\"$bgcolor1\" cellspacing=\"0\" cellpadding=\"4\">$content</table></td>
                    </tr>
          </table>";
    }
    //                <tr><td width=\"100%\"><IMG SRC=\"themes/AstroGreenA/images/black.gif\" WIDTH=\"100%\" HEIGHT=\"1\" BORDER=0 ALT=\"\"></td></tr>
       else {
           If ($title == ""._SURVEY."")
           {
           echo "<table width=\"150\" cellpadding=\"2\" cellspacing=\"0\"><tr valign=\"top\">
            <td>
                <table border=\"0\" CELLPADDING=\"4\" CELLSPACING=\"0\" width=\"100%\">
                    <tr><td width=\"100%\"><IMG SRC=\"themes/AstroGreenA/images/black.gif\" WIDTH=\"100%\" HEIGHT=\"1\" BORDER=0 ALT=\"\"></td></tr>
                    <tr valign=\"top\">
                        <td bgcolor=\"$bgcolor1\" width=\"150\">&nbsp;<img src=\"themes/AstroGreenA/images/logout.gif\" align=\"absmiddle\">&nbsp;<b>$title</b></td></tr>
                    <tr><td width=\"100%\"><IMG SRC=\"themes/AstroGreenA/images/black.gif\" WIDTH=\"100%\" HEIGHT=\"1\" BORDER=0 ALT=\"\"></td></tr>
                    <tr valign=\"top\">
                        <td background=themes/AstroGreenA/images/survey.gif>$content</table>
                </td>
            </tr>
        </table>";
       
           }
       else {                 // ALL OTHER BLOCKS

       echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">
      <tr>
        <td>
          <table background=\"themes/AstroGreenA/images/150_tab.gif\" width=\"150\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
            <tr>
              <td align=\"absmiddle\">&nbsp;<img src=\"themes/AstroGreenA/images/blocks_pic.gif\" align=\"absmiddle\">&nbsp;<font color=\"$textcolor1\"><b>$title</b></font></td>
            </tr>
          </table>
          <table width=\"100%\" border=\"1\" bordercolor=\"$bgcolor1\" cellspacing=\"0\" cellpadding=\"4\">
            <tr>
              <td>$content</td>
            </tr>
          </table>
        </td>
      </tr>
    </table>";
           }
    } // LOGIN
    } // SURVEY
    ?>


    any clues as to what else i should do here?

    thanks
    urska
  • hi
    i did it. in case anyone is interested: in themes/AstroGreenA/blocks.php i inserted

    Code

    if ($title == ""._ADMIN_MESSAGES.") {
    echo "
    <table............and table formatting>$content</table>";
    }

    to display Admin_messages block (or any center block) only on the first page (homepage) I inserted global $index (which wasn't there before) in themeheader() function and the

    Code

    blocks(centre);
    .

    one problem, though, was that when i had collapsable blocks enabled (Administration-Blocks-Setup), this didn't work because it would not recognize the $title variable. the problem was that when collapsable blocks were enabled, its $title also included the icon for minimazing and maximizing blocks. when i deactivated the function, the block was recognized.
  • 0 users

This list is based on users active over the last 60 minutes.