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

Need help with Template Modifications

Discussion in 'Styling and Customization Questions' started by Matthew Hawley, Jun 23, 2013.

  1. Matthew Hawley

    Matthew Hawley Well-Known Member

    So this template modifications isn't working. Can someone tell me what's wrong with it. When I apply this, none of the mod links show except the admin link.

    Find:

    Code:
    <xen:require css="moderator_bar.css" />
    
    <xen:if hascontent="true">
    <fieldset id="moderatorBar">
        <div class="pageWidth">
            <div class="pageContent">
            <xen:contentcheck>
                <xen:if is="{$visitor.is_admin}">          
                    <a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel_short}</span></a>
                  
                    <xen:if is="{$session.permissionTest}">
                        <a href="{xen:link misc/reset-permissions}" class="permissionTest adminLink OverlayTrigger">
                            <span class="itemLabel">{xen:phrase permissions_from_x, 'name={$session.permissionTest.username}'}</span>
                        </a>
                    </xen:if>
                </xen:if>
              
                <xen:if is="{$visitor.is_moderator} AND {$session.moderationCounts.total}">
                    <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                        <span class="itemLabel">{xen:phrase moderation_queue_short}:</span>
                        <span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span>
                    </a>
                </xen:if>
              
                <xen:if is="!{$xenOptions.reportIntoForumId}">
                    <a href="{xen:link reports}" class="reportedItems modLink">
                        <span class="itemLabel">{xen:phrase reported_items_short}:</span>
                        <span class="itemCount {xen:if '({$session.reportCounts.total} AND {$session.reportCounts.lastUpdate} > {$session.reportLastRead}) OR {$session.reportCounts.assigned}', 'alert'}" title="{xen:if $session.reportCounts.lastUpdate, '{xen:phrase last_report_update}: {xen:datetime $session.reprotCounts.lastUpdate}'}"><xen:if is="{$session.reportCounts.assigned}">{$session.reportCounts.assigned} / {$session.reportCounts.total}<xen:else />{$session.reportCounts.total}</xen:if></span>
                    </a>
                </xen:if>
              
                <xen:if is="{$visitor.is_admin} AND {$session.canAdminUsers} AND {$session.userModerationCounts.total}">
                    <a href="admin.php?users/moderated" class="userModerationQueue modLink">
                        <span class="itemLabel">{xen:phrase users_awaiting_approval_short}:</span>
                        <span class="itemCount {xen:if {$session.userModerationCounts.total}, 'alert'}">{$session.userModerationCounts.total}</span>
                    </a>
                </xen:if>
                <xen:hook name="moderator_bar" />
            </xen:contentcheck>
              
                <span class="helper"></span>
            </div>
        </div>
    </fieldset>
    </xen:if>
    Replace:

    Code:
    <xen:require css="moderator_bar.css" />
    <xen:if hascontent="true">
    <fieldset id="moderatorBar">
        <div class="pageWidth">
            <div class="pageContent">
            <xen:contentcheck>
                <xen:if is="{$visitor.is_admin}">      
                    <a href="admin.php" class="acp adminLink"><span class="itemLabel">{xen:phrase admin_control_panel_short}</span></a>
              
                    <xen:if is="{$session.permissionTest}">
                        <a href="{xen:link misc/reset-permissions}" class="permissionTest adminLink OverlayTrigger">
                            <span class="itemLabel">{xen:phrase permissions_from_x, 'name={$session.permissionTest.username}'}</span>
                        </a>
                    </xen:if>
                </xen:if>
          
                <xen:if is="{$visitor.is_moderator} AND {$session.moderationCounts.total}">
                    <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                            <div class="Popup" style="float:left;">
                                <a rel="Menu"><span class="itemLabel">{xen:phrase moderation_queue_short}:</span><xen:set var="$totalCounts">{xen:calc '{$session.userModerationCounts.total} + {$session.reportCounts.total} + {$session.moderationCounts.total}'}</xen:set><span class="itemCount {xen:if {$totalCounts}, 'alert'}">{$totalCounts}</span></a>              
                                                            <div class="Menu">
                                                                <span class="arrowWidget"></span>
                                                                    <ul class="secondaryContent blockLinksList">
                                                                        <li><span class="itemLabel">Moderation Queue:</span><span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span></li>
                                                                                <xen:if is="!{$xenOptions.reportIntoForumId}">
                                                                                                            <li><a href="{xen:link reports}"><span class="itemLabel">{xen:phrase reported_items_short}:</span><span class="itemCount {xen:if '({$session.reportCounts.total} AND {$session.reportCounts.lastUpdate} > {$session.reportLastRead}) OR {$session.reportCounts.assigned}', 'alert'}" title="{xen:if $session.reportCounts.lastUpdate, '{xen:phrase last_report_update}: {xen:datetime $session.reprotCounts.lastUpdate}'}"><xen:if is="{$session.reportCounts.assigned}">{$session.reportCounts.assigned} / {$session.reportCounts.total}<xen:else />{$session.reportCounts.total}</xen:if></span></a></li>
                                                                                                    </xen:if>                                                                                
                                                                                                    <xen:if is="{$visitor.is_admin} AND {$session.canAdminUsers} AND {$session.userModerationCounts.total}">
                                                                                        <li><a href="admin.php?users/moderated"><span class="itemLabel">Users Needing Approval:</span><span class="itemCount {xen:if {$session.userModerationCounts.total}, 'alert'}">{$session.userModerationCounts.total}</span></a></li>
                                                                                </xen:if>
                                                                    </ul>
                                                            </div>
                                          </div>
                  
                    </a>
              </xen:if>
          
                <xen:hook name="moderator_bar" />
            </xen:contentcheck>
          
                <span class="helper"></span>
            </div>
        </div>
    </fieldset>
    </xen:if>
    @Chris Deeming
     
    Last edited: Jun 23, 2013
  2. Chris D

    Chris D XenForo Developer Staff Member

    I'm too busy right now to go through and work out what you're trying to do. But basically doing a find and replace on that amount of code is always going to be problematic.

    You can't always guarantee that block of code you're finding won't be changed. All it would take is for Mike to change one character in that template and the template modification will stop working.

    Even if it means using several modifications, but finding and replacing smaller chunks of text, that should be less problematic.

    Ultimately, using regular expressions might work better but there's a very steep learning curve potentially.
     
  3. Matthew Hawley

    Matthew Hawley Well-Known Member

    Okay i changed it to this, and it still didn't work.

    Find:

    Code:
    <xen:if is="{$visitor.is_moderator} AND {$session.moderationCounts.total}">
                    <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                        <span class="itemLabel">{xen:phrase moderation_queue_short}:</span>
                        <span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span>
                    </a>
                </xen:if>
              
                <xen:if is="!{$xenOptions.reportIntoForumId}">
                    <a href="{xen:link reports}" class="reportedItems modLink">
                        <span class="itemLabel">{xen:phrase reported_items_short}:</span>
                        <span class="itemCount {xen:if '({$session.reportCounts.total} AND {$session.reportCounts.lastUpdate} > {$session.reportLastRead}) OR {$session.reportCounts.assigned}', 'alert'}" title="{xen:if $session.reportCounts.lastUpdate, '{xen:phrase last_report_update}: {xen:datetime $session.reprotCounts.lastUpdate}'}"><xen:if is="{$session.reportCounts.assigned}">{$session.reportCounts.assigned} / {$session.reportCounts.total}<xen:else />{$session.reportCounts.total}</xen:if></span>
                    </a>
                </xen:if>
              
                <xen:if is="{$visitor.is_admin} AND {$session.canAdminUsers} AND {$session.userModerationCounts.total}">
                    <a href="admin.php?users/moderated" class="userModerationQueue modLink">
                        <span class="itemLabel">{xen:phrase users_awaiting_approval_short}:</span>
                        <span class="itemCount {xen:if {$session.userModerationCounts.total}, 'alert'}">{$session.userModerationCounts.total}</span>
                    </a>
                </xen:if>

    Replace:

    Code:
    <xen:if is="{$visitor.is_moderator} AND {$session.moderationCounts.total}">
                    <a href="{xen:link moderation-queue}" class="moderationQueue modLink">
                            <div class="Popup" style="float:left;">
                                <a rel="Menu"><span class="itemLabel">{xen:phrase moderation_queue_short}:</span><xen:set var="$totalCounts">{xen:calc '{$session.userModerationCounts.total} + {$session.reportCounts.total} + {$session.moderationCounts.total}'}</xen:set><span class="itemCount {xen:if {$totalCounts}, 'alert'}">{$totalCounts}</span></a>               
                                                            <div class="Menu">
                                                                <span class="arrowWidget"></span>
                                                                    <ul class="secondaryContent blockLinksList">
                                                                        <li><span class="itemLabel">Moderation Queue:</span><span class="itemCount {xen:if {$session.moderationCounts.total}, 'alert'}">{$session.moderationCounts.total}</span></li>
                                                                                <xen:if is="!{$xenOptions.reportIntoForumId}">
                                                                                                            <li><a href="{xen:link reports}"><span class="itemLabel">{xen:phrase reported_items_short}:</span><span class="itemCount {xen:if '({$session.reportCounts.total} AND {$session.reportCounts.lastUpdate} > {$session.reportLastRead}) OR {$session.reportCounts.assigned}', 'alert'}" title="{xen:if $session.reportCounts.lastUpdate, '{xen:phrase last_report_update}: {xen:datetime $session.reprotCounts.lastUpdate}'}"><xen:if is="{$session.reportCounts.assigned}">{$session.reportCounts.assigned} / {$session.reportCounts.total}<xen:else />{$session.reportCounts.total}</xen:if></span></a></li>
                                                                                                    </xen:if>                                                                                 
                                                                                                    <xen:if is="{$visitor.is_admin} AND {$session.canAdminUsers} AND {$session.userModerationCounts.total}">
                                                                                        <li><a href="admin.php?users/moderated"><span class="itemLabel">Users Needing Approval:</span><span class="itemCount {xen:if {$session.userModerationCounts.total}, 'alert'}">{$session.userModerationCounts.total}</span></a></li>
                                                                                </xen:if>
                                                                    </ul>
                                                            </div>
                                          </div>
                    </a>
              </xen:if>
     

Share This Page