Welcome Guest Search | Active Topics | Members | Log In | Register

2 Pages12>
Increasing Active Topic from 5 to 10?
yeppers Offline
#1 Posted : Monday, June 08, 2009 6:00:50 PM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Ive search the forum and found a old thread, but with no help.

How can I change my active topics from 5 to 10?

I would like to show the last 10 active topics instead of the last 5?

Ive looked thoroughly through forum.ascx and have found nothing, am I missing something?

Ive managed to get the active topics moved ontop of the forum now whats left is increasing the count of it. Really need this guys. Thanks in advance.

imukai Offline
#2 Posted : Monday, June 08, 2009 7:02:25 PM(UTC)
Rank: YAF Commander

Joined: 5/3/2009(UTC)
Posts: 112
Location: Tampa FL

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
1. Admin
2. Host Settings
3. Show/Display Items tab
4. Active Discussions Count (almost at the bottom)
yeppers Offline
#3 Posted : Tuesday, June 09, 2009 4:17:35 AM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Ive got version 1.9.1.8. and I do not have that option. With out updating is there anyway to change this?
yeppers Offline
#4 Posted : Tuesday, June 09, 2009 7:29:07 AM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
So I am so desperite to make 10 last topics vieable instead of 5 i even tried updating my forum and crashed in the process. I had my database backed up so its all ok now.

Can one of you guys please tell me how (if possible) to edit the active topics from 5 to 10 on version 1.9.1.8.

From what I understand I go into the fourum.ascx and edit that some where? Am I close? Here is my fourm.ascx page is it here where I edit?

Code:
<%@ Control Language="c#" CodeBehind="forum.ascx.cs" AutoEventWireup="True" Inherits="yaf.pages.forum" %>
<%@ Register TagPrefix="yaf" Namespace="yaf.controls" Assembly="yaf" %>
<%@ Register TagPrefix="yaf" TagName="ForumList" Src="../controls/ForumList.ascx" %>
<yaf:PageLinks runat="server" ID="PageLinks" />
<div id="Welcome" runat="server">
    <div id="divTimeNow">
        <asp:Label ID="TimeNow" runat="server" /></div>
    <div id="divTimeLastVisit">
        <asp:Label ID="TimeLastVisit" runat="server" /></div>
    <div id="divUnreadMsgs">
        <asp:HyperLink runat="server" ID="UnreadMsgs" Visible="false" /></div>
</div>
<br />
<table border="0" class="content" cellspacing="1" cellpadding="0" width="100%">
    <tr class="header1">
        <td colspan="2" class="header1">
            <asp:ImageButton runat="server" ID="expandActiveDiscussions" BorderWidth="0" ImageAlign="Baseline"
                OnClick="expandActiveDiscussions_Click" />&nbsp;&nbsp;<%= GetText("ACTIVE_DISCUSSIONS") %>
        </td>
    </tr>
    <asp:PlaceHolder ID="ActiveDiscussionHolder" runat="server">
        <tr>
            <td class="header2" colspan="2">
                <%= GetText("LATEST_POSTS") %>
            </td>
        </tr>
        <asp:Repeater runat="server" ID="LatestPosts">
            <ItemTemplate>
                <tr>
                    <td class="post">
                        &nbsp;<b><a href='<%#yaf.Forum.GetLink(yaf.Pages.posts,"m={0}#{0}",DataBinder.Eval(Container.DataItem, "LastMessageID"))%>'><%# yaf.Utils.BadWordReplace(Convert.ToString(DataBinder.Eval(Container.DataItem, "Topic"))) %></a></b>
                        <%# String.Format( GetText( "BY" ), HtmlEncode(DataBinder.Eval( Container.DataItem, "LastUserName" ).ToString()) )%>
                        (<a href='<%#yaf.Forum.GetLink(yaf.Pages.topics,"f={0}",DataBinder.Eval(Container.DataItem, "ForumID"))%>'><%# Convert.ToString( DataBinder.Eval( Container.DataItem, "Forum" ) )%></a>)
                    </td>
                    <td class="post" style="width: 25em; text-align: right;">
                        <%# FormatDateTimeTopic( Convert.ToDateTime( DataBinder.Eval( Container.DataItem, "LastPosted" ) ) )%>
                        <a href="<%#yaf.Forum.GetLink(yaf.Pages.posts,"m={0}#{0}",DataBinder.Eval(Container.DataItem, "LastMessageID"))%>">
                            <img src="<%# GetThemeContents("ICONS","ICON_LATEST") %>" border="0" alt=""></a>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </asp:PlaceHolder>
</table>
<asp:Repeater ID="CategoryList" runat="server" OnItemCommand="categoryList_ItemCommand"
    OnItemDataBound="CategoryList_ItemDataBound">
    <HeaderTemplate>
        <table class="content" cellspacing="1" cellpadding="0" width="100%">
            <tr class="header1">
                <td width="1%">
                    &nbsp;
                </td>
                <td align="left" class="header1">
                    <%# GetText("FORUM") %>
                </td>
                <td class="header1" align="center" width="7%">
                    <%# GetText("topics") %>
                </td>
                <td class="header1" align="center" width="7%">
                    <%# GetText("posts") %>
                </td>
                <td class="header1" align="center" width="25%">
                    <%# GetText("lastpost") %>
                </td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td class="header2" colspan="5">
                <asp:ImageButton runat="server" ID="expandCategory" BorderWidth="0" ImageAlign="Baseline"
                    CommandName="panel" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>'>
                </asp:ImageButton>
                &nbsp;&nbsp; <a href='<%# yaf.Forum.GetLink(yaf.Pages.forum,"c={0}",DataBinder.Eval(Container.DataItem, "CategoryID")) %>'>
                    <%# DataBinder.Eval(Container.DataItem, "Name") %>
                </a>
            </td>
        </tr>
        <yaf:ForumList runat="server" Visible="true" ID="forumList" DataSource='<%# ((System.Data.DataRowView)Container.DataItem).Row.GetChildRows("FK_Forum_Category") %>' />
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>
<table class="content" cellspacing="1" cellpadding="0" width="100%">
    <tr class="header1">
        <td colspan="2" class="header1">
            <asp:ImageButton runat="server" ID="expandInformation" BorderWidth="0" ImageAlign="Baseline"
                OnClick="expandInformation_Click" />&nbsp;&nbsp;<%= GetText("INFORMATION") %>
        </td>
    </tr>
    <asp:PlaceHolder ID="InformationHolder" runat="server">
        <tr>
            <td class="header2" colspan="2">
                <%= GetText("ACTIVE_USERS") %>
            </td>
        </tr>
        <tr>
            <td class="post" width="1%">
                <img src="<%# GetThemeContents("ICONS","FORUM_USERS") %>" alt="" />
            </td>
            <td class="post">
                <asp:Label runat="server" ID="activeinfo" /><br />
                <asp:Repeater runat="server" ID="ActiveList">
                    <ItemTemplate>
                        <a href='<%#yaf.Forum.GetLink(yaf.Pages.profile,"u={0}",DataBinder.Eval(Container.DataItem, "UserID"))%>'>
                            <%# Server.HtmlEncode(Convert.ToString(DataBinder.Eval(Container.DataItem, "Name"))) %>
                        </a>
                    </ItemTemplate>
                    <SeparatorTemplate>
                        ,
                    </SeparatorTemplate>
                </asp:Repeater>
            </td>
        </tr>
        <tr>
            <td class="header2" colspan="2">
                <%= GetText("STATS") %>
            </td>
        </tr>
        <tr>
            <td class="post" width="1%">
                <img src="<%# GetThemeContents("ICONS","FORUM_STATS") %>" alt="" />
            </td>
            <td class="post">
                <asp:Label ID="Stats" runat="server">Label</asp:Label>
            </td>
        </tr>
    </asp:PlaceHolder>
</table>
<table width="100%" class="iconlegend">
    <tr>
        <td>
            <img align="middle" src="<% =GetThemeContents("ICONS","FORUM_NEW") %>" alt="" />
            <%# GetText("ICONLEGEND","New_Posts") %>
            <img align="middle" src="<% =GetThemeContents("ICONS","FORUM") %>" alt="" />
            <%# GetText("ICONLEGEND","No_New_Posts") %>
            <img align="middle" src="<% =GetThemeContents("ICONS","FORUM_LOCKED") %>" alt="" />
            <%# GetText("ICONLEGEND","Forum_Locked") %>
        </td>
        <td align="right">
            <asp:LinkButton runat="server" OnClick="MarkAll_Click" ID="MarkAll" />
        </td>
    </tr>
</table>
<yaf:SmartScroller ID="SmartScroller1" runat="server" />
yeppers Offline
#5 Posted : Tuesday, June 09, 2009 9:00:19 AM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Nobody? Is it even possible with my version?
yeppers Offline
#6 Posted : Wednesday, June 10, 2009 4:17:24 AM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I cant believe anyone doesnt know how to do this.....Not even a hint? Jeeze!
yeppers Offline
#7 Posted : Wednesday, June 10, 2009 2:08:51 PM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Still cant believe nobody can even give me even a hint! Conspiracy I tell you!
imukai Offline
#8 Posted : Wednesday, June 10, 2009 5:30:35 PM(UTC)
Rank: YAF Commander

Joined: 5/3/2009(UTC)
Posts: 112
Location: Tampa FL

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I would think in the time it took you to complain about nobody helping you with this old version, you could have spent 2 seconds finding it in the code. I dug out the 1.9.1.8 code just to save you from repeatedly posting.

You see that the repeater has an ID of "LatestPosts"? Something has to populate that repeater. It's simply a matter of finding it. Since no datasource is specified in the control's markup, you have to look deeper.

If you look in the codebehind for forum.ascx (aka forum.ascx.cs) and do a simple text search you'll find an entry inside the BindData() method that populates LatestPosts:

Code:
        private void BindData()
        {

                  ---snipped first bit of code---

            // Latest forum posts
            // Shows the latest n number of posts on the main forum list page
            key = string.Format( "LatestPosts.{0}", PageBoardID );
            DataTable latestPosts = Cache [key] as DataTable;
            if ( latestPosts == null )
            {
                latestPosts = DB.topic_latest( PageBoardID, 5, PageUserID );
                Cache.Insert( key, latestPosts, null, DateTime.Now.AddSeconds( 60 ), TimeSpan.Zero );
            }
            LatestPosts.DataSource = latestPosts;

                   ---snipped last bit of code---        

The line you want is this one:

Code:
latestPosts = DB.topic_latest( PageBoardID, 5, PageUserID );

Change the 5 to a 10.

Prudence would say to doublecheck that the topic_latest() method of the DB.cs class is using that parameter to pull back that # of posts before you change it.

It is, btw, just saying for future changes it's good to make sure that what you're changing is what you're intending to change.
yeppers Offline
#9 Posted : Friday, June 12, 2009 12:43:25 PM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Thank you so much but how the heck you find the forum.ascx.cs. All I see in my files on my server are the forum.ascx code.

How do I look behind it I have Dream Weaver?
imukai Offline
#10 Posted : Sunday, June 14, 2009 11:39:19 PM(UTC)
Rank: YAF Commander

Joined: 5/3/2009(UTC)
Posts: 112
Location: Tampa FL

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I personally have never used Dreamweaver, but I'd presume you open it like you would any other file. It's in the /pages folder right next to forum.aspx, if you're looking at the sourcecode.
bertb Offline
#11 Posted : Friday, June 19, 2009 11:41:55 PM(UTC)
Rank: YAF Camper

Joined: 5/29/2008(UTC)
Posts: 16
Location: The Netherlands

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
For a quick fix, you can modify the stored proc [dbo].[yaf_topic_latest] so that it reads "SELECT TOP (10) ... ".
yeppers Offline
#12 Posted : Sunday, June 21, 2009 4:35:29 AM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
bertb wrote:
For a quick fix, you can modify the stored proc [dbo].[yaf_topic_latest] so that it reads "SELECT TOP (10) ... ".


Where would I find this?
reyou Offline
#13 Posted : Friday, July 03, 2009 5:31:00 PM(UTC)
Rank: Member

Joined: 12/8/2008(UTC)
Posts: 15

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
go to sql server and go to programming and stored procedures, and change it.
yeppers Offline
#14 Posted : Saturday, July 04, 2009 11:00:25 AM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Hey guys Ive tried all of these. Ive edited the forum.ascx.cs and overwrite the file on the server. Ive edited the stored procedures on my sql server to read 10. Ive done everything. is there something Im missing? Can I upload my forum.ascx.cs file so you guys can take a look at it see if its ok?

Or can someone upload a forum.ascx file with the correct edits. Im so lost.
yeppers Offline
#15 Posted : Sunday, July 05, 2009 1:33:17 PM(UTC)

Rank: YAF All-the-Time

Joined: 2/1/2009(UTC)
Posts: 154
Location: Dinuba

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Just a heads up for anyone reading this thread hoping it works....IT DOESNT! So dont waste your time! Ive tried! And if your reading this dont bother posting asking for help, you wont get it.
Users browsing this topic
Guest
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 RC4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.231 seconds.