linccce

HP Members

Mar 21st, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. function hp_members($params){
  2.     $current_site = get_blog_details();
  3.     $domain = str_replace('http://www.', '', $current_site->siteurl);
  4.  
  5.     $atts = shortcode_atts(array(
  6.             'count' => 6, //how many images per slide
  7.             'total_limit' => 10,
  8.             'partner_id' => 8696,
  9.             'url'=>"//members.$domain/",
  10.             'image_size'=>300,
  11.             'show_location'=>"true",
  12.             'enable_flip_effect'=>"true",
  13.             'paid_services_only'=>"false",
  14.             'show_username'=>"true",
  15.             'multy_user_types'=>"females,couples", //could be: males, females, tv, couples
  16.             'country_id'=>"193",
  17.             'control_type'=>"photosblock",
  18.     ), $params);
  19.  
  20.     ob_start();
  21.     ?>
  22.     <link type="text/css" rel="stylesheet" href="//members.<?php echo $domain ?>/application/panels/style/responsive.css?partnerId=<?php echo $atts['partner_id'] ?>">
  23.     <div id="usersList" class="photo_block">  </div>
  24.     <script type="text/javascript">
  25.         jQuery(document).ready(function ($) {
  26.             $.getScript('//members.<?php echo $domain ?>/application/panels/panels.js', function () {
  27.                 var hub_login_shrt = new HubPanel();
  28.                 hub_login_shrt.control_type = "<?php echo $atts['control_type'] ?>";
  29.                 hub_login_shrt.multy_user_types = "<?php echo $atts['multy_user_types'] ?>";
  30.                 hub_login_shrt.partnerId = <?php echo $atts['partner_id'] ?>;
  31.                 hub_login_shrt.url = "<?php echo $atts['url'] ?>";
  32.                 // link to signup form (if empty - your default signup link)
  33.                 hub_login_shrt.signup = "javascript:scrollSignup();";
  34.                 hub_login_shrt.image_size = <?php echo $atts['image_size'] ?>; // size of one image in photoblock
  35.                 hub_login_shrt.images_count = <?php echo $atts['count'] ?>;
  36.                 hub_login_shrt.images_total_count = <?php echo $atts['total_limit'] ?>; // total images count
  37.                 hub_login_shrt.liWidth = "";
  38.                 hub_login_shrt.showLocation = <?php echo $atts['show_location'] ?>;
  39.                 hub_login_shrt.enableFlipEffect = <?php echo $atts['enable_flip_effect'] ?>; // enable animation or no
  40.                 hub_login_shrt.placeholder = "usersList";
  41.                 hub_login_shrt.paidServicesOnly = <?php echo $atts['paid_services_only'] ?>;
  42.                 hub_login_shrt.showUsername = <?php echo $atts['show_username'] ?>;
  43.                 hub_login_shrt.countryId = <?php echo $atts['country_id'] ?>;
  44.                 hub_login_shrt.create();
  45.             });
  46.         });
  47.  
  48.         function scrollSignup() {
  49.             var offset = jQuery('.Registration').offset();
  50.             jQuery("body").animate({
  51.                 scrollTop: offset.top
  52.             }, "1000", "swing", function() {
  53.                 jQuery(".Registration #reg-form").focus()
  54.             })
  55.         }
  56.     </script>
  57.     <?php
  58.     $shortcode = ob_get_clean();
  59.     return $shortcode;
  60. }
  61.  
  62. add_shortcode('hp_members', 'hp_members');
Advertisement
Add Comment
Please, Sign In to add comment