Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 3 of 3 FirstFirst 123
Results 31 to 37 of 37
  1. #31
    Regular Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    939
    Thanks
    21
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by AndrewGSW View Post
    If your page displays ALL messages at once, rather than being paginated, then you could, as you suggest, just pass a yes/no value and execute a query against all the users messages in the database. But if they only check a selection of the messages then you still need to pass this information - that is, which messages were checked - to the other page, using the methods previously discussed.
    Sadly, someone pointed out something similar to me at work today, meaning my "great idea" was pretty lame...


    Yes, both your and Tango's suggestions seem to be the way to go.


    If the messages are paginated then, assuming they check ALL, you would need the actioning page to be aware of which page they are currently on. That is, to be able to identify which page/group of messages need to be actioned. Or, again, pass the (full) list of current message-ids to the page.

    But I'm not fully aware of your set up so the above information may not prove entirely relevant to your site.
    Well, I don't have any pagination currently built in. (Maybe in v3.0?!)

    Off topic, if you were on Page 3 of 10 pages in your Inbox, and you checked the Top Check-box - which might/might not then use JavaScript to check all of the boxes below - which would you expect...

    1.) Checking the Top Check-box means selecting only those Messages on that Page?

    2.) Checking the Top Check-box means selecting *every* Message in your Inbox (across 10 pages)?


    Thanks,


    Debbie

  2. #32
    Regular Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    939
    Thanks
    21
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    Ok, ignore the incoherent mumblings about passing by reference... I've found a hack

    This should be about right (it's late you might need to make minor adjustments but I've run tons of experiments and stuff before putting this together):
    Reminder to Tango... Debbie doesn't know OOP yet!!

    I had a rough day at work, and my back is killing me.

    Will try and re-read this entire thread when I have time this week, and then formulate some questions as to where I'm stuck.

    I do know - as AndrewGSW mentioned - that my "solution" last night turned out to be a dud. *sigh*

    Thanks for you guys sticking with me, though.


    Debbie

  3. #33
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Off topic, if you were on Page 3 of 10 pages in your Inbox, and you checked the Top Check-box - which might/might not then use JavaScript to check all of the boxes below - which would you expect...

    1.) Checking the Top Check-box means selecting only those Messages on that Page?

    2.) Checking the Top Check-box means selecting *every* Message in your Inbox (across 10 pages)?
    You would really have to stick to how Yahoo, GMail, etc., behave. That is, to only refer to the current page's messages: this is how the user would expect it to behave. Besides, there can possibly be hundreds/thousands of messages, so it could be risky to try and action them all at once.

    If the messages were paginated I suggest that you would probably still need to store all the message ids for the current page (when they select All): they may have two windows open and be modifying, or creating, a message in another window, so Page 3 would no longer identify the same collection of messages.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  4. #34
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,089
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by doubledee View Post
    1.) Checking the Top Check-box means selecting only those Messages on that Page?

    2.) Checking the Top Check-box means selecting *every* Message in your Inbox (across 10 pages)?
    Option 1. As Andrew says, only apply to the current page otherwise a user might think they're deleting just the first page worth of messages and wipe out everything - some of which they may of been intentionally saving.

    No worries about OOP, I don't know it either. Never been worried about using it and frankly I ain't worried about it either. I just get to grips with stuff as I go along.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  5. #35
    Regular Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    939
    Thanks
    21
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by AndrewGSW View Post
    You would really have to stick to how Yahoo, GMail, etc., behave. That is, to only refer to the current page's messages: this is how the user would expect it to behave.
    Yeah, I never thought about that until now.

    It doesn't help that I am not up to pagination yet. (Guess I better learn that quickly before people start having hundreds of messages piling up in their Inboxes?!)


    Besides, there can possibly be hundreds/thousands of messages, so it could be risky to try and action them all at once.
    Agreed!


    If the messages were paginated I suggest that you would probably still need to store all the message ids for the current page (when they select All): they may have two windows open and be modifying, or creating, a message in another window, so Page 3 would no longer identify the same collection of messages.
    You lost me there.


    What I am seeing, is that sticking all of the Messages for the current Page/View into something (e.g. an Array) is the thing I need to do.

    So I think a lot of your and Tango's advice will still apply.

    I have so little time during the week, and the next two will be crazy. But when I do have time, I hope to re-read this thread from the start, and see if I can put the pieces together and get this figured out...

    Sincerely,


    Debbie

  6. #36
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,089
    Thanks
    51
    Thanked 506 Times in 493 Posts
    Quote Originally Posted by rajdeep01 View Post
    In PHP you can return one and only one value from your user functions, but you are able to make that single value an array, thereby allowing you to return many values.

    <?php
    function dofoo() {
    $array["a"] = "Foo";
    $array["b"] = "Bar";
    $array["c"] = "Baz";
    return $array;
    }

    $foo = dofoo();
    ?>
    Perhaps if you read the opening post you would understand that this was about an array being passed by $_POST to a script not just returning a result from a php function.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  7. #37
    Banned
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $key_label = false;
    $key_label = '<span class="hl_reference"><u>key references:</u></span>';

    foreach($reference_keys as $value)
    {
    echo $value .'&nbsp;';
    }

    if(array($value => 1) && !$key_label)
    {
    $key_label = true;
    echo $key_label;
    };


 
Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •