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

[suggestion] List of Xenforo.com custom edits

Discussion in 'General XenForo Discussion and Feedback' started by Brett Peters, Jun 19, 2011.

  1. Brett Peters

    Brett Peters Well-Known Member

    Can we have a thread that includes any XenForo.com custom edits, Well at least the edits you are willing to share ?

    Reason for asking is because I have noticed that videos do not overlay content on Xf.com but do on my install.. So has to be something different right ? (Several XF updates have not reflected this change)

    Other reason is that over at the other forum software this actually drove me nuts, As a purchaser of forum software I personally feel that any custom edits on the forum suppliers site should be documented for easy implementation, A big one for me was new tabs (its not fair to have new tabs but then not share how it was done)

    Maybe I am wrong in my thinking that forum software suppliers should either have a default install of said forum software or supply their custom edits.

    Just a thought
     
    Digital Doctor likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    You need to add the wmode to the Media BB Code to fix the overlay provblem.

    Code:
    <object width="640" height="385" data="http://www.youtube.com/v/{$id}&amp;fs=1" type="application/x-shockwave-flash">
    <param name="movie" value="http://www.youtube.com/v/{$id}&amp;fs=1" />
    <param name="allowFullScreen" value="true" />
    <param name="wmode" value="transparent" />
    <embed src="http://www.youtube.com/v/{$id}&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" wmode="transparent" width="640" height="385" />
    </object>
    Code:
    <iframe class="youtube-player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/{$id}?wmode=opaque" frameborder="0"></iframe>
    This thread explains how to add new tabs: http://xenforo.com/community/threads/how-to-add-a-new-tab-in-the-navbar.7781/
     
    Fusion and Brett Peters like this.
  3. Brett Peters

    Brett Peters Well-Known Member

    Fantastic ;)

    __Edit__
    I have managed to include custom tabs thanks to the helpful crowd here at XF, Thought it would be good for an official XF.com edits thread though.
     
  4. dieketzer

    dieketzer Well-Known Member

    i have always felt it was somewhat... hypocritical? arrogant?.
    'we need a custom nav tab/frontpage/etc to do our business, but you dont need that functionality cos youre just a customer'.
    it may not be intended like that, but its certainly how ive always read it.
     
  5. Brett Peters

    Brett Peters Well-Known Member

    I personally wouldn't go as far as that but I do personally believe that many new starters could benefit from buying software that either reflects the sellers site or the option to have the customization edits available to the buyer.

    After all subway are unable to show a picture of a sandwich to a customer but then supply a different version, Basically my train of thought on this one.
     
  6. Kier

    Kier XenForo Developer Staff Member

    PHP:
    <?php

    class XFComForums_Listener
    {
        
    /**
         * User group ID of the licensed user group
         *
         * @var integer
         */
        
    const LICENSED_USER_GROUP 6;

        
    /**
         * If user is staff, overwrite the normal user title template helper
         *
         * @param XenForo_Visitor $visitor
         */
        
    public static function visitorSetup(XenForo_Visitor &$visitor)
        {
            if (
    $visitor->is_admin || $visitor->is_moderator)
            {
                
    XenForo_Template_Helper_Core::$helperCallbacks['usertitle'] = array('XFComForums_Listener''helperUserTitle');
            }
        }

        
    /**
         * Extended version of the normal user title template helper
         *
         * @param array $user
         * @param boolean $allowCustomTitle
         *
         * @return string|XenForo_Phrase
         */
        
    public static function helperUserTitle($user$allowCustomTitle true)
        {
            
    $userTitle XenForo_Template_Helper_Core::helperUserTitle($user$allowCustomTitle);

            if (
    XenForo_Model::create('XenForo_Model_User')->isMemberOfUserGroup($userself::LICENSED_USER_GROUP))
            {
                return new 
    XenForo_Phrase('licensed_usertitle', array('usertitle' => $userTitle));
            }

            return 
    $userTitle;
        }

        
    /**
         * Add the 'Buy XenForo' navigation tab
         *
         * @param array $extraTabs
         * @param string $selectedTabId
         */
        
    public static function navigationTabs(array &$extraTabs$selectedTabId)
        {
            
    $extraTabs['buy'] = array(
                
    'title' => 'Buy XenForo',
                
    'href' => '/purchase/',
            );
        }

        
    /**
         * Pre-cache the xfcom_page_wrapper template.
         * Listens to 'template_create' code event.
         *
         * @param string $templateName
         * @param array $params
         * @param XenForo_Template_Abstract $template
         */
        
    public static function templateCreate($templateName, array &$paramsXenForo_Template_Abstract $template)
        {
            if (
    $templateName == 'PAGE_CONTAINER')
            {
                
    $template->preloadTemplate('xfcom_page_wrapper');
            }
        }

        
    /**
         * Wrap the xfcom_page_wrapper template around the page.
         * Listens to 'template_hook' code event.
         *
         * @param string $hookName
         * @param string $content
         * @param string $hookParams
         * @param XenForo_Template_Abstract $template
         */
        
    public static function templateHook($hookName, &$content, array $hookParamsXenForo_Template_Abstract $template)
        {
            if (
    $hookName == 'body')
            {
                
    $params $template->getParams();
                
    $params['HTML'] = $content;

                
    $content $template->create('xfcom_page_wrapper'$params);
            }
        }
    }
     
  7. Kier

    Kier XenForo Developer Staff Member

    As you can see, no great secrets, and nothing very complex.
     
  8. Forsaken

    Forsaken Well-Known Member

    Navigation tabs = available in the form of an add-on and tutorials (template based and add-on based).

    Footer = available as an add-on.

    Front Page = afaik its a plain page and has nothing really unique about it.

    I dread how you're going to feel when they start running the 1.1 alpha/beta's before they release, you're going to feel betrayed and go back to vBulletin :rolleyes:.
     
  9. dieketzer

    dieketzer Well-Known Member

    every release that i know of has been run here before the release, and ive never felt that way about it.
    i suppose my point is that, for example, if it is necessary to have a custom tab on xf.com, why is it assumed i wouldnt want one myself?
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    I don't think that has been assumed by anyone.

    You can add a custom tab using an add-on, in exactly the same way it has been done here.

    Or you can do it the much simpler way with a template edit.
     
  11. Forsaken

    Forsaken Well-Known Member

    The ability to add a tab has been available since the first month of XenForo (by using an addon or template edit).

    Its not like the information isn't freely available.
     
  12. Ryan Kent

    Ryan Kent Well-Known Member

    I very much appreciate your sharing this information Kier.

    You may say it is not complex, but it is also not the way I would have imagined it. If I was asked to add a "Buy Xenforo" tab to the navigation bar, I would have modified the navigation template. If I was asked to only show the tab to the licensed user group, I would have wrapped a conditional around the code in the template.

    Sharing this information helps me better understand how XF works and move me a step forward towards making add-ons. Thanks again.
     
  13. Kier

    Kier XenForo Developer Staff Member

    Yes, but our time is at a ludicrous premium, so if there is a way to change something that will remain fully automatic for the future, we will use that method rather than one that may require checking with every new release.
     
    Ryan Kent and Forsaken like this.
  14. ragtek

    ragtek Guest

Share This Page