Fork me on GitHub

Watch

GitHub Core

Show your support for Zikula! Sign up at Github account and watch the Core project!




GitHub Modules

Forum Activity

Forum feed

» Visit forum | » View latest posts

news/admin messages fix thread  Bottom

  • ok well jsut about evrybody i know is haveing this problem or will have it .. all the other threads are very confusing with evrybody asking questions and stuff (not that thats a bad thing thats what they're their for.. thats how i fix my problems} but i jsut descided it would be a good idea to have a thread where evryone posts jsut possible fixes for it .. .. so.. what im asking is for people to use the other threads on this topic to ask questions and ppeople who get their problem fixed please post/describe your fix ...

    hopefully in the end we will have created a 'guide' for this problem .. and save much forum space and time
  • ok well .. heres how i fixed mine .... ive found that it doesntr work on all themes, but seems to work on alot

    1) find

    Code

    function themeheader() {


    now go to the very end of the function ... the end is the very last ' } ' before the function
    ' themefooter '

    and add this if it isnt already there

    Code

    // If we have admin messages or blocks of 'centre' type, lets display them
        if ($GLOBALS['index']) {
            OpenTable();
            echo '<div class="message-centre">';
            blocks('centre');
            echo '</div>';
            CloseTable();
        }


    so that area should now look like this

    Code

    // If we have admin messages or blocks of 'centre' type, lets display them
        if ($GLOBALS['index']) {
            OpenTable();
            echo '<div class="message-centre">';
            blocks('centre');
            echo '</div>';
            CloseTable();
        }
    }

    function themefooter() {


    2)find ' function themesidebox ' and add to the end of it (if its not already in there)

    Code

    // Begin Center Block
        if ($block['position'] == 'c') {
            echo "$block[content]<br>";
        }


    its most likley that this is the end of the document if so it shoudl look like

    Code

    // Begin Center Block
        if ($block['position'] == 'c') {
            echo "$block[content]<br>";
        }
    }

    ?>


    if for some reason its not the end of the file jsut leave out the

    Code

    }

    ?>


    3) ok well it should work now .. but you may find that the size of the section is messed up .. its the same size as teh menu bars.. rite?

    now heres how I fixed that

    i go back up to the themeheader function and the last thing before what i added (it may or may not bee the last thing because all
    themes are different) wich is

    Code

    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"150\" valign=\"top\" align=\"right\">";


    it may not look at all like that .. all themes are different .. what matters is that we find the 'echo' that has the info we need ... now it may not bee exactly where it is on mine on yours so .. the way to tell is to find something SIMMILAR to this .. and edit the width value .. (on mine i edit the second width value in that code

    Code

    </td><td>&nbsp;&nbsp;</td><td width=\"150\" valign=\"top\" align=\"right\">";
    try changing that width to 100%
    ...

    try mine first then try fiddeling with other width values in that area till you find the right one to be editing)

    now you'll notice that it now pushes the right blocks out of the way .... if so

    youre going to have to change that width value down .. for mine i use 65%
    example:

    Code

    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"65%\" valign=\"top\" align=\"right\">";


    now that it looks right .. (note youll probably have to fiddle with all thes values to get it rite for you)


    ok well now try going to another page .. jsut use liek members list or something liek that as an example .. now if thats all messed up and pushed to the side go to step 4



    4) now since we have that problem what were going to have to do is tell it to only use thoes values we've gave it for the front page

    how you go about doing this is

    go back up to the 'themeheader' function and find that ligne with the ' width ' value you changed

    for me its

    Code

    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"65%\" valign=\"top\" align=\"right\">";


    now plase this infront of the echo (to keep it from getting all jumbled its better to plase this on a ligne abouve.

    Code

    if ($GLOBALS['index']) {
    you will have to close the 'if' statment too .. so after your 'echo' ligne add a blank ligne with jsut a } on it .. that should close that

    what we jstu said is if were on the index page then ... continue on to the echo... blah blah blah

    so it should now look somehting like this (keeping in mind mine will differ from yours unless you are also using the 0rion theme

    Code

    if ($GLOBALS['index']) {
        echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"65%\" valign=\"top\" align=\"right\">";
    }



    wel now it knows to do that on the index page .. we need to tell it what to do on other pages .. for his we will use an ' else ' statment

    on the next ligne add

    Code

    else {


    now copy the exact "echo" ligne ffrom abov e but change that width value (in my example its been 65%) change it to 100% and close the else statment with a }


    so that area should look similar to this

    Code

    if ($GLOBALS['index']) {
        echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"65%\" valign=\"top\" align=\"right\">";
    }
    else { 
    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"100%\" valign=\"top\" align=\"right\">";
    }


    except with ur info and stuff where mine are .. alwase keep in mind that these are sjtu examples yours will most ikley not look exactly liek that

    the whole end of the themeheader function should now look liek this

    Code

    if ($GLOBALS['index']) {
        echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"65%\" valign=\"top\" align=\"right\">";
    }
    else { 
    echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td>&nbsp;&nbsp;</td><td width=\"100%\" valign=\"top\" align=\"right\">";
    }
        // If we have admin messages or blocks of 'centre' type, lets display them
        if ($GLOBALS['index']) {
            OpenTable();
            echo '<div class="message-centre">';
            blocks('centre');
            echo '</div>';
            CloseTable();
        }
    }


    what we have jstu said is if index use these values(so as nto to mess up our right blocks) if not use different valuse .. if you have right blocks on other pages then 'index'
    then you will have to add tha to the list in

    Code

    if ($GLOBALS['index']) {






    Now that im done .. if anyone else did it liek this and sees a fault or something ive left out in my explanation of my way of doing it .. please message me
    dont reply because then people will get confused .. i will edit my post

    admin@kg-archives.com
  • That's a very confused way of explaining it, you seem to have some of your table cells mixed up.

    An example where the side blocks are 150pixels wide and use the same layout for left and right blocks, the layout of a theme looks like:

    Code

    opentable functions()

    themeheader() start
    |--------------------------------------------------------------------------|
    |                                  Head                                    |
    |-------150px------|---------------100%----------------|--------150px------|
    | $blocks('left'); | if ($index == 1){ // home page    | $blocks('right'); |
    |                  |     blocks('centre');             |                   |
    |                  | }                                 |                   |
    |                  | themeheader() end,                |                   |
    |                  | themefooter() start               |                   |
    |__________________|___________________________________|___________________|
    |                            footmsg();                                    |
    |__________________________________________________________________________|
    themefooter() end

    themeindex() {
    |----------------------------------------|
    |      $preformat['catandtitle']         |
    |----------------------------------------|
    | $preformat[searchtopic]; //topic image |
    | $preformat['hometext'];                |
    | $preformat['notes'];                   |
    |----------------------------------------|
    } // end themeindex

    themearticle() {
    |----------------------------------------|
    |      $preformat['catandtitle']         |
    |----------------------------------------|
    | $preformat[searchtopic]; //topic image |
    | $preformat['fulltext'];                |
    |----------------------------------------|
    } // end themearticle

    themesidebox($block) { // in the case where both sides are the same
    if ($block['position'] == 'l' or $block['position'] == 'r') {
    |-------150px-------|
    |  $block['title']  |
    |===================|
    | $block['content'] |
    |-------------------|
    } elseif ($block['position'] == 'c' { // This is where Admin messages are output
      echo "    <div class=\"AdminMsg\">$block[content]</div>";
      } // End centre Admin block
    } // End themesidebox

    Excluding the junk filler code of spacer cells often put under the header and between the columns, you've got a fixed-width left cell, a 100%-width cell with center blocks on the home page ($index==1), and right blocks on the home page ($index==1).
    Rendered in HTML for legibility:

    Code

    ?>
    <TABLE width="100%" border="0" cellspacing="2" cellpadding="2" align="center">
      <TR>
        <TD id="LeftCol" width="150px" valign="top">
        <!-- Left blocks -->
    <?php  blocks('left'); ?>
        </TD><!-- end left block -->
        <TD id="CenterCol" width="100%" align="center" valign="top">
    <?php
    if ($index == 1)  // If home page
          { blocks('centre'); } // Show Admin messages in center block  
    } // End of themeheader function

    /****************************************************************/
    /* function themefooter()                                       */
    I've set the styles, such as widths and padding etc in the stylesheet for convenience. It's the last part that's important here.

    The centre Admin message is formatted at the end of the themesidebox function, where otherwise the side blocks are. A check for $block['position'] determines if it's a left, right, or centre block (currently, if not left or right, must be centre by default). Usually in themes there's no fancy frames for it, but this is where you'd put it if you want the same frame around it.
    In a theme not designed for Admin messages, and where left and right blocks are the same, there may not be any checks for the type of block, so centre blocks are output the same width as a centre block.

    A general layout of the themesidebox function is something like this:

    Code

    function themesidebox($block) {
        global $thename;

    //Begin Left Block
        if ($block['position'] == 'l') {

    /* Left block goes here */

    }
    //Begin Right Block
        if ($block['position'] == 'r') {

    /* Right block goes here */

    }
    //Begin Center Block
        if ($block['position'] == 'c') {
        echo $block['content']."<br />";
         }
    }

    If left and right blocks are the same, you may combine them in the one IF statement:

    Code

    if ($block['position'] == 'l' || $block['position'] == 'r') {

    /* Identical left and right block goes here */

    } else {
        echo $block['content']."<br />";
      }

    The thing to watch out for is that the number of closing curly braces matches the number of opening ones, ie for every 'if (...) {' there is an ending '}'


    Martin :D

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