Users list with Ajax Pagination inside each author profile for their follower and following users

I’m trying to create an followers/following users list for each user in their profile page with Ajax Pagination.

Someone here was helped me to make the Ajax pagination working, but i’m facing a big problem and i can’t fix it!

The problem i’m facing is inside all our users profile page when they click on load more button they are getting the users who followed the administrator id!!

Inside author.php i get the author information by using this line.

<?php     $  curauth = (isset($  _GET['author_name'])) ? get_user_by('slug', $  author_name) : get_userdata(intval($  author)); ?> 

So how to make them getting their followed users?

Here is all my code i have done.

author.php

<div id="following">      <div class="following-cont"> <?php  $  include = get_user_meta($  curauth->ID, '_pwuf_following', true);  if ( empty( $  include ) ) {       echo '<div class="no-follower">Not found followers yet <i class="fa fa-slack fa-1x" aria-hidden="true"></i></div>';      } else {  $  args = array (     'order' => 'DESC',     'include'  => $  include,     'number'  => 6,     'paged' => 1 );  $  wp_user_query = new WP_User_Query( $  args );  $  users = $  wp_user_query->get_results();      echo '<div id="top-artists-contributors-3">';     echo '<ul id="grid-contributors-4">';     echo '<li class="scroll-artists">';     foreach ( $  users as $  user ) {         $  avatar_size = 90;         $  avatar = get_avatar($  user->user_email, 200);         $  author_profile_url = get_author_posts_url($  user->ID);         $  profile = get_userdata($  user->ID);      echo '<div class="single-item-3">';     echo '<div class="author-gravatar-3"><a href="', $  author_profile_url, '">', $  avatar , '</a></div>';     echo '<div class="members-name"><a href="', $  author_profile_url, '">' . $  profile->first_name .'</a></div>';     echo '</div>';                }     echo '</li>';     echo '</ul>';     echo '</div>';     }  ?>  <?php // The variables tmp_author_name and tmp_author serve only as temporary storage. // They controls how the data should be determined on the server. $  tmp_author_name = ''; $  tmp_author = 0; if( isset($  _GET['author_name']) ) {     $  tmp_author_name = $  author_name; } else {     $  tmp_author = intval($  author);   } ?>  <script type="text/javascript"> var ajaxurl = "<?php echo admin_url( 'admin-ajax.php' ); ?>"; var page = 2; jQuery(function($  ) {     $  ('body').on('click', '.loadmoreartists', function() {             var data =              {                 'action': 'user_following_by_ajax',                 'page': page,                 'security': '<?php echo wp_create_nonce("user_more_following"); ?>',                 'author_name': '<?php echo esc_html($  tmp_author_name); ?>',                 'author': '<?php echo esc_html($  tmp_author); ?>'              };          $  .post(ajaxurl, data, function(response) {          $  ('.following-cont').append(response);         page++;          });     }); }); </script>  </div>  <div class="loadmoreartists">More</div>  </div><!-- #following --> 

function.php

add_action('wp_ajax_user_following_by_ajax', 'user_following_by_ajax_callback'); add_action('wp_ajax_nopriv_user_following_by_ajax', 'user_following_by_ajax_callback');  function user_following_by_ajax_callback() {      check_ajax_referer('user_more_following', 'security');     $  paged = $  _POST['page'];      $  curauth = NULL;      if( isset($  _POST['author_name']) AND trim($  _POST['author_name']) != '' )     {         $  curauth = get_user_by('slug', trim($  _POST['author_name']) );     }     elseif( isset($  _POST['author']) AND intval($  _POST['author']) > 0 )     {         $  curauth = get_userdata(intval($  _POST['author']));        }      if( !is_null($  curauth) ) {  $  include = get_user_meta($  curauth->ID, '_pwuf_following', true);  if ( empty( $  include ) ) {       echo '<div class="no-follower">Not found followers yet <i class="fa fa-slack fa-1x" aria-hidden="true"></i></div>';      } else {  $  args = array (     'order' => 'DESC',     'include'  => $  include,     'number'  => 6,     'paged' => $  paged );  $  wp_user_query = new WP_User_Query( $  args );  $  users = $  wp_user_query->get_results();      echo '<div id="top-artists-contributors-3">';     echo '<ul id="grid-contributors-4">';     echo '<li class="scroll-artists">';     foreach ( $  users as $  user ) {         $  avatar_size = 90;         $  avatar = get_avatar($  user->user_email, 200);         $  author_profile_url = get_author_posts_url($  user->ID);         $  profile = get_userdata($  user->ID);      echo '<div class="single-item-3">';     echo '<div class="author-gravatar-3"><a href="', $  author_profile_url, '">', $  avatar , '</a></div>';     echo '<div class="members-name"><a href="', $  author_profile_url, '">' . $  profile->first_name .'</a></div>';     echo '</div>';                }     echo '</li>';     echo '</ul>';     echo '</div>';     }     wp_die();     } } 

Ordering a list of elements as shortest euclidean distance between two points

I’ve got a list of points:

figdata = {{67.6769, -1.15057}, {67.9064, -1.30881}, {68.136, -1.01986}, {68.2508, -1.42347}, {68.5951, -1.5152}, {68.7098, -0.946475}, {69.2837, -1.63445}, {69.7428, -1.74453}, {69.9724, -0.905197}, {70.2019, -1.86378}, {70.8905, -0.850158}, {71.0053, -1.96009}, {71.6939, -0.836399}, {72.3826, -2.13438}, {72.6121, -0.822639}, {73.8746, -2.34995}, {73.9894, -0.891437}, {74.4485, -2.4004}, {75.1371, -0.951062}, {75.4815, -2.42792}, {76.1701, -0.987754}, {76.9735, -2.49672}, {77.4326, -1.03362}, {78.236, -2.52423}, {79.0394, -1.10242}, {80.4167, -2.54258}, {80.6462, -1.18039}, {82.2531, -1.26294}, {83.4008, -2.53799}, {84.319, -1.33633}, {85.5815, -1.40054}, {86.9588, -2.54258}, {87.1883, -1.48768}, {88.7951, -1.59317}, {90.0576, -2.54258}, {90.861, -1.67573}, {93.9599, -1.87295}, {92., -2.54258}, {93., -2.54258}, {95.7963, -2.54258}, {98., -2.54258}, {95.911, -1.95551}, {97.2883, -2.04265}, {99.469, -2.18483}, {100.502, -2.25363}, {100.732, -2.5013}, {101.305, -2.46002}, {101.42, -2.32702}, {101.879, -2.40499}} 

I need to plot this data using ListLinePlot so that two neighbouring appear connected with a line. I’ve tried using the following approach:

 Block[{data = figdata, nearel, datanew0 = {}, i = 1},  While[Length[data] > 1,   nearel =     Flatten[Nearest[Delete[data, i], data[[i]],       DistanceFunction -> "EuclideanDistance"]];   datanew0 = Append[datanew0, data[[i]]];   data = Delete[data, i];   i = Position[data, nearel][[1, 1]]   ];  datanew = datanew0  ] 

But, for a reason I don’t know, when I do:

p1 = ListLinePlot[datanew, Frame -> True,     PlotRange -> {{40, 108}, {-2.6, .8}}, AspectRatio -> 1,     FrameStyle -> 15]; p2 = ListPlot[datanew, Frame -> True,     PlotRange -> {{40, 108}, {-2.6, .8}}, AspectRatio -> 1,     FrameStyle -> 15, PlotStyle -> Red]; Show[p1, p2] 

The result i get is:

enter image description here

How would I write a code that solves this problem, and, what is wrong with my piece of code?

★★★★★ Daily Updated Link Lists by SeRocket ★★★★★ GSA Verified Link List

Stop Wasting Time and Money on Link Lists that are Burned after 2 Days
Get the Most from Your SEO Tools with SeRocket Link Lists
image
Daily Updated 
Identified and Verified Link List

☑ Fresh Daily Updates

Forget overpriced link lists that become burned after just a few days. Get new fresh link lists every day.

☑ Synced Directly to your GSA

Members of Premium plan are getting all new results synced in real time directly to the GSA using Search Engine feature.

☑ Contextual and Non-contextual Link Lists

You can use only non-contextual platform link lists for churn and burn projects, or choose only contextual for first layer campaigns.

☑ Links Sorted by Platforms

We sort all link list based on GSA platforms, so you can use only those that you need or import them in other SEO tools.

☑ Results Without Duplicates

We dedupe all results – you get only unique link lists.

☑ Ultra-Fast Custom Scrapper

Our custom-coded scraper is installed on a strong cloud server farm that works 24/7 building link lists for you.

☑ Clean Verified and Identified Link Lists

Get the best success rate – to ensure high quality, we verify each platform and check page load times for every site.

Don’t waste proxies, CPU or server time, or other resources for scraping. 
Be smart, and use them for link building.

image
>>> Click Here and take a look at Realtime Lists Statistics Saved Daily
*** Special Limited to First 50 Members Discounted Offer For GSA Members – Get $ 20 OFF Monthly ***
Simply post “Give me $ 20 Discount Coupon” in this thread 
and I will send you PM with discount code.

STARTER PACKAGE

Regular price: $ 39/mo
For GSA Members: $ 19/mo
Get non-contextual link lists Updated Daily.
Link Lists Downloadable from Member Area.
>> Click Here To Register Now

PREMIUM PACKAGE

Regular price: $ 49/mo
For GSA Members: $ 29/mo
Get both non-contextual & contextual link list Updated Daily.
Link Lists Downloadable from Member Area.
Directly Synced into Your GSA.
>> Click Here To Register Now

Free Bonus: GSA Best Practices Guide

image
In this guide you will learn how to most effectively setup GSA Search Engine Ranker campaigns for maximum SERP results.
>>> CLICK HERE TO ORDER NOW

removing commas from a list and just keeping the elements

I have the following list, I want to remove all commas and just be left with the elements of the set.

Tuples[{I, l}, 16]  {{I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I}, {I, I, I, I, I, I,        I, I, I, I, I, I, I, I, I, l}, {I, I, I, I, I, I, I, I, I, I, I, I,        I, I, l, I}, {I, I, I, I, I, I, I, I, I, I, I, I, I, I, l, l}, ....} 

EDIT: So what I want is something like:

{{IIIIIIIIIIIIIIII}, {IIIIIIIIIIIIIIIl}, {IIIIIIIIIIIIIIlI}, {IIIIIIIIIIIIIIll}, ....} 

Proxy List Gets Fewer?

The last time I set my (free) proxies on GSA SER was in September 2017. Just now I deleted all the free proxies on the list and tried to search the new ones. But to my surprise, there were only very few free proxies on the list now and none of them works so far. Is it just me or do you also experience the same thing? Please kindly help. Thank you in advance.