• b2evo
  • Front Page
  • Contact
  • Login
  • reset page

Far Fields

  • Andromeda ¦ First Contact
  • Blush ¦ Private
  • Dad ¦ Private
  • Vyaj ¦ Immigration & Asylum Cases

Near Fields

  • My Bits
  • Behind the Sceanic
  • vOw ¦ Vegan Organic Wholefood

Old Fields

  • 1996 Site
  • Old Search Site

Blogs

  • b2Evo ¦ Blog techie stuff
  • eLf ¦ Updates on the land
  • blInk ¦ Some useless links
  • spAce ¦ Thoughts on being
  • j&j ¦ Prospectors of Kern
  • av0id ¦ How I Got Here

Sort Message PositionUpdated: May 7th, 2008

Created: 07/05/08

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 -->;
  roger
print   Print     
 
  •  Paged Index of 133 Posts

  • Last nineteen

    • Add html figure tag
    • Validation 7.2.5
    • elfgifs_plugin
    • Add sub text button
    • [autocorrect] validation
    • Versions & Database
    • Math Terms & Plugin
    • My Search Hack
    • figure tag
    • evobar toolbar
    • Front Page Collections #
    • Move to a new line using CSS not <br />
    • Version 6.10.6 & php 7
    • Stuck on Version 6.10.5
    • Limit Login Attempts
    • 6.10.5
    • Add Number to Comment
    • 6.10.4
    • v 6.10.*
  • Search


Valid HTML 5.0    ubuntu link    duckduckgo link    b2evolution link    firefox link    Creative Commons Licence    Valid CSS!