ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Double View Count Incrementation

January 08, 2010 8:09pm

Subscribe [5]
  • #1 / Jan 08, 2010 8:09pm

    ian Pitts

    175 posts

    This question may be related to a resolved thread.

    Sue replied asking about my template code but the thread was closed by another support specialist.

    Here’s my template code:

    {exp:weblog:entries weblog="contest-entry" status="open" disable="pagination" track_views="one"}
    {embed="include/.header" bodyId="entries" pageTitle="Entry: {title}"}
    {embed="include/.primaryNav"}
    
    <dl id="secondaryNav">
        <dt class="oneLine">{if segment_2}<a href="/entry/">{/if}Entries{if segment_2}</a>{/if}</dt>
    {exp:weblog:categories weblog="contest-entry" snow_empty="yes" style="linear"}
    {if "{categories limit="1"}{category_url_title}{/categories}" == "{category_url_title}"}
        <dd class="active">{category_name}</dd>
    {if:else}
        <dd><a href="/entry/category/{category_url_title}/">{category_name}</a></dd>
    {/if}
    {/exp:weblog:categories}
    </dl>
    
    <div id="main" class="section">
    
        <h2>{title}</h2>
    <p>    <dl class="entry-details"><br />
            <dt>Submitted by:</dt><br />
                <dd>{screen_name}</dd><br />
        {if company}    <dt>Company:</dt><br />
                <dd>{company}</dd>{/if}<br />
                <dt>Submitted on:</dt><br />
                    <dd>{entry_date format="%d %M, %Y"}</dd><br />
        {if "{categories limit="1"}{category_name}{/categories}" != ""}<br />
                <dt>Category:</dt><br />
                    {categories limit="1"}<dd><a href="/entry/category/{category_url_title}/">{category_name}</a></dd>{/categories}<br />
        {/if}<br />
        <dt>Total Views:</dt><br />
                    <dd>{view_count_one}</dd><br />
        {exp:diggie:stats item_id="{entry_id}"}<br />
            <dt>Total Votes:</dt><br />
                <dd>{diggie:vote_value}<br />
                    {diggie:item_flags}<a href="http://{path=" class="thickbox">{diggie:flag_label}</a>{/diggie:item_flags}<br />
                </dd><br />
        {/exp:diggie:stats}<br />
        </dl></p>
    
    <p>    {if screenshot}<br />
        {screenshot}<br />
        {if "{row_count}" == "1"}<div class="photoCaption">{/if}<br />
            <a href="http://{screenshot-file}" rel="gallery-screenshots" title="{screenshot-caption}" class="thickbox">{exp:imgsizer:size src="/minisites/meridian-awards{screenshot-file}" width="200" alt="screenshot"}</a><br />
            {screenshot-caption}<br />
        {if "{row_count}" == "{total_rows}"}</div>{/if}<br />
        {/screenshot}<br />
        {/if}</p>
    
    <p>    <div id="entry-description">{entry-description}</div></p>
    
    <p>    {/exp:weblog:entries}<br />
        <div class="entryNavigation"><br />
            {exp:weblog:prev_entry}<a href="http://{path=%27entry/view%27}" class="previous">title}">← View Previous Entry</a>{/exp:weblog:prev_entry}</p>
    
    <p>        {exp:weblog:next_entry}<a href="http://{path=%27entry/view%27}" class="next">title}">View Next Entry →</a>{/exp:weblog:next_entry}<br />
        </div><br />
    </div><br />
    {embed="include/.footer"}

  • #2 / Jan 08, 2010 8:21pm

    Adam Dorsey

    1439 posts

    Hi - mSorry that was me 😊

    I saw that the author of the thread was all good, and I closed the thread 😊

    I see this line:

    /minisites/meridian-awards{screenshot-file}

    Is “minisites” a dir in the root? Is it not in the images folder? Thanks!

  • #3 / Jan 09, 2010 11:05am

    ian Pitts

    175 posts

    This is on a large MSM installation of our corporate server. /minisites is off the root and “meridian-awards” is a subfolder off of it. Because of how nGen File and FF-Matrix saves the file path, we must prefix our paths like this to work with IMGResizer.

    Is there something I’m missing?

    I can’t imagine how an image link within a weblog:entries tag could cause the count to be doubled… just doesn’t make sense. Smells like a bug! 😉

  • #4 / Jan 10, 2010 4:11pm

    Greg Salt

    3988 posts

    Hi iso100,

    I’m not able to replicate this on my local install. Which version and build is this occurring on? Have you tried temporarily disabling your 3rd party addons to see if one of them is affecting these variables?

    Cheers

    Greg

  • #5 / Jan 11, 2010 10:08am

    ian Pitts

    175 posts

    We are running 1.6.7 Build:  20090211. We have a complicated MSM site that currently hosts 13 sites… so disabling 3rd party extensions would adversely affect the other sites as well. If it’s not an easy fix I’ll just have to do without the view count feature… or create a dedicated template just to increment view count and embed it.

  • #6 / Jan 11, 2010 10:17am

    ian Pitts

    175 posts

    Ok, that didn’t work either. I created a template that only had the following:

    {exp:weblog:entries weblog="contest-entry" disable="member-data|comments|trackbacks|pagination" status="open" entry_id="{embed:entryid}" track_views="one" dynamic="off"}
    {/exp:weblog:entries}

    And it still incremented by two.

  • #7 / Jan 11, 2010 10:23am

    Sue Crocker

    26054 posts

    http://expressionengine.com/docs/modules/weblog/parameters.html#par_disable

    It should be member_data instead. Can you recheck?

  • #8 / Jan 11, 2010 12:09pm

    ian Pitts

    175 posts

    Thanks for catching that Sue. I need to go update my TextMate snippet now. Whoops.

    Even after fixing that it still increments by two.

  • #9 / Jan 11, 2010 12:27pm

    Sue Crocker

    26054 posts

    If you *temporarily* disable extensions by clicking the big green button, and try the template again, what happens?

  • #10 / Jan 12, 2010 5:48pm

    nolfranklin

    2 posts

    Hi ISO100, I noticed a small error within your contest-entry categories code. You have “snow_empty” instead of “show_empty”. Hope this helps.

    - Nol

  • #11 / Jan 12, 2010 9:20pm

    Adam Dorsey

    1439 posts

    nolfranklin - Welcome to the forums, and thanks for helping out.

    @iso100 - Did that help? Are you still having issues?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases