1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Newest Members Sidebar [Deleted]

Discussion in 'Add-on Releases' started by borbole, Jan 30, 2012.

  1. borbole

    borbole Well-Known Member

  2. erich37

    erich37 Well-Known Member

    Hi Borbole,

    great add-on!

    question:
    was this block previously showing below the "top posters"-block (from the top posters add-on) ?
    Did you switch this order?

    Thanks!
     
  3. borbole

    borbole Well-Known Member

    If you use it in the combination with my other add on, sidebar higest-posting members, then the the order of showing up in the sidebar will depend on which add on you will install first.
     
    erich37 likes this.
  4. erich37

    erich37 Well-Known Member

    ahhhh.... O.K. thanks!
     
    borbole likes this.
  5. ArnyVee

    ArnyVee Well-Known Member

    I just posted on the other one ('daily' new members), but maybe it would be more appropriate within this one.

    Any chance for a 'random members' block?

    Best would be a combined 'newest' and 'random' separated by a line or something with the same block. :)
     
  6. borbole

    borbole Well-Known Member

    Yes, but I will not include it in this mod as it is better done as a new separate mod. I can code one for you but if it is a paid request as I do not have much free time to spend woking on free mods.
     
  7. ArnyVee

    ArnyVee Well-Known Member

    Thank you for the answer. I may reach out to you the closer I get to bringing my sites over to xF. I have a few custom mods being worked on right now, so I'll be sure to reach out to you if/when I need to. Thanks again :)
     
    borbole likes this.
  8. borbole

    borbole Well-Known Member

    No problem. Thank you for your reply :)
     
  9. ragtek

    ragtek Guest

    one small suggestion and i hope you'll not take it bad like some other devs...
    It's just a small share of my own experiance:)

    PHP:
    <?php
     
    class Borbole_NewestMembers_Listener
    {
        public static function 
    templateHook($hookName, &$contents, array $paramsXenForo_Template_Abstract $template)
        {
            if (
    $hookName == 'page_container_sidebar')
    {
                
    $options XenForo_Application::get('options');
                
    $newusersnumber $options->newusersnumber;
             
    $criteria = array(
    'user_state' => 'valid',
    'is_banned' => 0
      
    );
     
    $latestUsers XenForo_Model::create('XenForo_Model_User')->getLatestUsers($criteria,
                                                                                          array(
    'limit' => $newusersnumber));
                                                                                       
                
    $params = array(
                    
    'latestUsers' => $latestUsers
                
    );
     
                
    $search '<!-- end block: sidebar_online_users -->';
                
    $contents str_replace($search$search $template->create('borbole_newest_members'$params), $contents);
            }
        }
    }
    it's better if you change it to
    PHP:
    class Borbole_NewestMembers_Listener
    {
        public static function 
    templateHook($hookName, &$contents, array $paramsXenForo_Template_Abstract $template)
        {
            if (
    $hookName == 'page_container_sidebar') {
                
    $search '<!-- end block: sidebar_online_users -->';
                if (
    strpos($search$contents)) {
                    
    $options XenForo_Application::get('options');
                    
    $newusersnumber $options->newusersnumber;
                    
    $criteria = array(
                        
    'user_state' => 'valid',
                        
    'is_banned' => 0
                    
    );
                    
    $latestUsers XenForo_Model::create('XenForo_Model_User')->getLatestUsers($criteria,
                        array(
    'limit' => $newusersnumber));
                    
    $params = array(
                        
    'latestUsers' => $latestUsers
                    
    );
                    
    $contents str_replace($search$search $template->create('borbole_newest_members'$params), $contents);
                }
            }
        }
    }
    because then the query will only be run, if the search block is found in the template.
    There are some places, where the code will be run BUT not outputet (is it said so?, not really or?:D ).
    e.g. if somebody uses <xen:sidebar>my sidebar content</xen:sidebar> the code will be run, but the output won't be shown, because <!-- end block: sidebar_online_users --> isn't present, which means that the database query will be run + 1 additional query for the template if there are no other uncached templates ( i'm doing it like you,.. i also don't precache the template for the sidebar block..) but it's because of the other query => to grab the users
     
    erich37 and borbole like this.
  10. borbole

    borbole Well-Known Member

    First of all there is no reason as to why I should take your suggestion bad. All well meant suggestions and constractive chritisism are always welcome :)

    That said, atm I do not have much free time at all to spend on my free mods. But at the first chance I get I will look into this for sure. Thank you for your suggestion.
     
  11. Tommy

    Tommy Member

    Hello, great mod! How do i set the avatars to 32x32 px? Now their at 48x48.

    Regards.

    *edit*
    Nevermind, i got it. :)
     
  12. borbole

    borbole Well-Known Member

    This resource has been removed and is no longer available for download.
     

Share This Page