Sort Message Position


Notice: Undefined variable: params in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 63

Warning: array_merge(): Expected parameter 2 to be an array, null given in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 63

Notice: Trying to access array offset on value of type null in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 70

Notice: Trying to access array offset on value of type null in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 80

Notice: Trying to access array offset on value of type null in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 85

Notice: Trying to access array offset on value of type null in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 91

Notice: Trying to access array offset on value of type null in /home/rogerlov/public_html/blog/skins/print/index.main.php on line 93

Sort Message Position 'messages generated from actions' box
6th May

  1. Skins > blood_wine > posts.main.php [lines 149 to 160]

  2. <?php
    // -----MESSAGES GENERATED FROM ACTIONS -----
    if (47 == 47)
    {
    messages( array(
    'block_start' => '<div class="action_messages">',
    'block_end' => '</div>' . $_GET['blog'] ,
    ) );
    }
    // --END OF MESSAGES GENERATED FROM ACTIONS --
    ?>
  3. The above code is my modified version in that
    a) it contains an if statement, so I know I can control the overall block and
    b) I have added the blog variable, again to confirm some that the content can be controlled.
  4. The block has been moved to the MetaData div and the problem arises in that ot now appears after every post rather than just the one that has been edited.
  5. The if statement needs to check that the post is the one that has been updated.
    There is a database value of the mod date and this could be compared to the previous date. ie. This would require reading the modified date before it is updated and comparing it. This would read all posts???
    Although the the post is updated that is not recorded other than in the modified date, so there is no way the caller can tell it is updated.
  6. So what instigates the message.
  7. An alternative solution is to bring up a single post after editing, which isn't a bad idea
  8. Anyway must search for messages( array(*,*)).It must be in the admin folder
  9. The only reference to messages( is in
    inc/_core_template.funcs.php [lines 555 to 560]

    function messages( $params = array() )
    {
    global $Messages;
    $Messages->disp( $params['block_start'],
    $params['block_end'] );
    }

    So now find $Messages Oops! 73 files . . .
    Ruled out
    _adminUI.class.php
    _resultsel.class.php

    In reading the above file I can see that I may search for something like:
    $Messages->add( T_(*),) so I could look for "Post has been updated"
    Found in inc/items/items.ctrl.php : lines 377 to 387]]

    // Execute or schedule notifications & pings:
    $edited_Item->handle_post_processing();
    $Messages->add( T_('Post has been updated.'), 'success' );
    // REDIRECT / EXIT
    header_redirect( $redirect_to );
    // Switch to list mode:
    // $action = 'list';
    // init_list_mode();
    break;

    At line 373 before the above there is a reference to edited_Item->ID maybe I can use that.

    echo ID as Instead of blog

    OK modify post.main.php :

    {if ($ItemCache->get_by_ID( $p ) == $edited_Item->ID}

  10. It could be possible to check that the update time is, for example, less than 10 seconds from now.
  11. The messages( array(*,*) )
  12. OK Got it so that it only shows on the edited post, but either the edited post should be at the top or it should show only the single_post.php??
    Here's the code:
    <!-- MESSAGES GENERATED FROM ACTIONS -->
    <?php
    $url = $_SERVER['HTTP_REFERER'];
    $start = strstr($url,'&p=');
    $part = substr($start,3);
    $end = strpos($part, '&');
    $edited = substr($start,3, $end);
    if ($Item->ID == $edited)
    {
    messages( array(
    'block_start' => '<div class="action_messages">',
    'block_end' => '</div>',
    //'block_end' => '' . "Post ID = " . $Item->ID . "<br /> Edited Post ID = " . $edited,
    ) );
    }
    ?>
    <!-- END OF MESSAGES GENERATED FROM ACTIONS -->;