• Resolved TxFig

    (@txfig)


    I think I am *almost* where I want to be on this page. My last thing is that when someone searches for one of our members, the list is sorted randomly (so we don’t give any preferential treatment to any member over another). Here is the shortcode I am using on this page:
    [connections enable_pagination=false order_by='id|RANDOM' show_image=false image=none image_fallback=none image_single_fallback=none image_single=none enable_search=false enable_category_select=false str_select_all=''? enable_map=TRUE?enable_category_by_root_parent=FALSE?show_addresses=TRUE card_width=370 card_height=180 str_seperator=''? str_image='' str_contact='' str_home_addr='' str_work_addr='' str_school_addr='' str_other_addr='' str_home_phone='' str_home_fax='' str_cell_phone='' str_work_phone='' str_work_fax='' str_personal_email='' str_work_email='']

    It does change the order if I leave out the order_by='id|RANDOM', but I can’t tell if it’s really random or if it’s using some other key. Specifically, I would have expected the order to be different every time I refresh the page. But I am getting the same order every time.

    Is there a way I can test to see if it’s actually random and changes for each visit?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Steven

    (@shazahm1hotmailcom)

    Randomization occurs every hour on the hour (according to the time set on the server, not necessarily the time on your clock) for every user based on IP address.

    For example, let’s say user A and user B both visit the site simultaneously; they would both see the entries in a different random order for the remainder of the hour in which they visited. After the remainder of the hour has expired, they would see a different random order.

    One way to test is to simultaneously view the directory page on your local computer and your phone (not connected to your local wifi network [mobile data only]). Due to both devices being on separate networks, they will have different IP addresses and will see different random results.

    Another way to check is to view the directory once an hour.

    Note, if you are using page caching via a plugin or webhost service, you may see the same results on all devices regardless of the time passed, as the cache will be serving the page and not WordPress/Connections. In this case, you should either exclude the page from the cache or set the cache time for that page to expire once an hour.

    I hope this helps; please let me know.

    Thread Starter TxFig

    (@txfig)

    That is not what I was expecting, but it works good ‘nough for me. I have verified that it is doing what you describe. Thanks

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Were you expecting random on every page load? If yes, it doesn’t;t work that way due to needing to support paginated results.

    Thread Starter TxFig

    (@txfig)

    Yes, that is what I was expecting. But as I said, the way it actually works is perfectly acceptable. I consider this “solved”. ??

    Plugin Author Steven

    (@shazahm1hotmailcom)

    Thanks for letting me know. I thought that might have been the case. Great to hear it is working acceptably. Have a great day!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘sort order doesn’t change w/ “random”’ is closed to new replies.