Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member sukrut51's Avatar
    Joined
    Dec 2010
    Posts
    156
    Thanks
    Received:1
    Given: 7

    Question how to decrease no. of related stories from 10 to 5??

    on the story page by default 10 related stories are shown, is there any way we can decrease it to 5 stories???

    and these related stories also show the stories which i have discarded. any solution to show the stories which are only on database???

    my pligg version : 1.1.4
    my pligg template : bluestandard

    thanks in advance..

  2. #2
    Senior Member sukrut51's Avatar
    Joined
    Dec 2010
    Posts
    156
    Thanks
    Received:1
    Given: 7
    no solution???

  3. #3
    Pligg Developer/Coder/Designer ChuckRoast's Avatar
    Joined
    Dec 2005
    Location
    Pliggville USA
    Posts
    9,118
    Thanks
    Received:395
    Given: 73
    Version
    SVN Build
    Site
    http://Pligg.com/chuckroast
    Read the forum rules again. Bumping your own thread in less than 2 hours?
    Now your answer will have to wait from other users and not directly from a developer.
    Next time please follow the rules.
    Thanks
    Help Keep ChuckRoast Home
    Today's Pligg Blog Post


  4. #4
    Pligg Founder/Coder/Designer Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,511
    Thanks
    Received:85
    Given: 14
    Site
    http://pligg.com/demo/
    I just had to do this while working on a new template. I am going to paste my entire code here, even though the formatting will differ from Wistie. Hopefully it will demonstrate to you what you need to do. You would basically just have to change 10 to 5.

    Code:
        {if count($related_story) neq 0}
            <div class="tab-pane fade" id="related">
                <h3>{#PLIGG_Visual_Story_RelatedStory#}</h3>
                {checkActionsTpl location="tpl_pligg_story_related_start"}
                <ol>
                    {* The next line checks how many related stories there are.  If there are fewer than 10 it will set the return loop to a smaller number. *}
                    {if count($related_story) > 10}{assign var="related_count" value="10"}{else}{assign var="related_count" value=$related_story}{/if}
                    {section name=nr loop=$related_count}
                        <li><a href = "{$related_story[nr].url}">{$related_story[nr].link_title}</a></li> 
                    {/section}
                </ol>
                {checkActionsTpl location="tpl_pligg_story_related_end"}
            </div>
        {/if}
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  5. #5
    Senior Member sukrut51's Avatar
    Joined
    Dec 2010
    Posts
    156
    Thanks
    Received:1
    Given: 7
    @ chuckroast

    sorry for that

    and thanks for the solution.....

    but in which file i can find this code?????? or you just written a totally new code then where i have to paste this??

  6. #6
    Member supertramp's Avatar
    Joined
    Mar 2012
    Posts
    94
    Thanks
    Received:5
    Given: 19
    Version
    1.2.0
    go to libs/html1.php

  7. #7
    Senior Member sukrut51's Avatar
    Joined
    Dec 2010
    Posts
    156
    Thanks
    Received:1
    Given: 7
    thanks @supertramp

    i'll try it

  8. #8
    Senior Member sukrut51's Avatar
    Joined
    Dec 2010
    Posts
    156
    Thanks
    Received:1
    Given: 7
    Fixed it,,,.. thx all for help

  9. #9
    Pligg Founder/Coder/Designer Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,511
    Thanks
    Received:85
    Given: 14
    Site
    http://pligg.com/demo/
    Wait a second!

    My example code was for story_center.tpl. Don't apply changes to libs/html1.php because you will simply overwrite those changes with any Pligg upgrade.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

  10. #10
    Senior Member sukrut51's Avatar
    Joined
    Dec 2010
    Posts
    156
    Thanks
    Received:1
    Given: 7
    @Yankidank

    i modified the code below

    // Select 10 stories that share tags with the current story and order them by number of tags they share
    $sql = "SELECT tag_link_id, COUNT(tag_link_id) AS relevance
    FROM ".table_tags."
    WHERE tag_words IN ($related_tags) AND tag_link_id!=$storyid
    GROUP BY tag_link_id
    ORDER BY relevance DESC
    LIMIT 10";
    i changed the value 10 to 5, and it's showing now 5 stories

    but will this create any other problems??

    as i'm having the problem with my pligg site since yesterday as posted here...is this caused by this change?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg