[How To] Seperate Sticky Topics from Normal Topics

How-to's, little tricks, tutorials, code examples (snippets) and read-me's.

[How To] Seperate Sticky Topics from Normal Topics

Postby Belak » 06 Mar 2007, 12:24

Within this How To I will show you how to seperate your sticky topics from your normal topics. If you want to see how it looks like, take a look at the attachment.

sticky.JPG


First, we need a new language variable. so open $phpbb_root_path/language/**/viewforum.php and add the following code:

Code: Select all
// FIND
?>

// BEFORE ADD:

$lang = array_merge($lang, array(
    'STICKY'                => 'Sticky topics'
));


then you have to open $phpbb_root_path/styles/subSilver/template/viewforum_body.html.
Code: Select all
// FIND:

        <!-- BEGIN topicrow -->

            <!-- IF topicrow.S_TOPIC_TYPE_SWITCH eq 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_ANNOUNCEMENTS}</b></td>
                </tr>
            <!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH eq 0 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_TOPICS}</b></td>
                </tr>
            <!-- ENDIF -->

// REPLACE WITH:

        <!-- DEFINE $TOPIC_NORMAL = 0 -->
        <!-- DEFINE $TOPIC_STICKY = 0 -->

        <!-- BEGIN topicrow -->

            <!-- IF topicrow.S_TOPIC_TYPE_SWITCH eq 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_ANNOUNCEMENTS}</b></td>
                </tr>
            <!-- ELSEIF topicrow.S_POST_STICKY and $TOPIC_STICKY eq 0 -->
                <!-- DEFINE $TOPIC_STICKY = 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_STICKY}</b></td>
                </tr>
            <!-- ELSEIF topicrow.S_TOPIC_TYPE eq 0 and $TOPIC_NORMAL eq 0 -->
                <!-- DEFINE $TOPIC_NORMAL = 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_TOPICS}</b></td>
                </tr>
            <!-- ENDIF -->



Thanks to Sniper E and Case for inspiring and testing :)
User avatar
Belak
Supporter
Supporter
 
Posts: 145
Joined: 17 Dec 2006, 15:16
Location: Kaiserslautern, Germany
Gender: Male


Re: [How To] Seperate Sticky Topics from Normal Topics

Postby saw » 11 Apr 2007, 10:17

can you tell me what shoul i Edit if in viewforum_body.html if I have prosilver?
saw
Cadet II
Cadet II
 
Posts: 28
Joined: 06 Apr 2007, 05:30
Gender: Male

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby Semi_Deus » 11 Apr 2007, 11:31

ProSilver was made without any tables, so that would be a lot more difficult..
Former Moderator & Styles team member
Image
User avatar
Semi_Deus
Admiral
Admiral
 
Posts: 2479
Joined: 13 Feb 2007, 13:53
Location: Netherlands
Favorite Team: Ajax
Gender: Male
phpBB Knowledge: 8

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby Sniper_E » 11 Apr 2007, 12:04

UPDATED.... Thanks Belak!

Now I just noticed that there is something wrong with the table width on the right side in this viewtopic.
It's only at the top with the ads.... I bet the ads has something to do with it but it shouldn't. More weird stuff....
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby Patricia » 23 May 2007, 05:10

Belak wrote:Within this How To I will show you how to seperate your sticky topics from your normal topics. If you want to see how it looks like, take a look at the attachment.

sticky.JPG


First, we need a new language variable. so open $phpbb_root_path/language/**/viewforum.php and add the following code:

Code: Select all
// FIND
?>

// BEFORE ADD:

$lang = array_merge($lang, array(
    'STICKY'                => 'Sticky topics'
));


then you have to open $phpbb_root_path/styles/subSilver/template/viewforum_body.html.
Code: Select all
// FIND:

        <!-- BEGIN topicrow -->

            <!-- IF topicrow.S_TOPIC_TYPE_SWITCH eq 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_ANNOUNCEMENTS}</b></td>
                </tr>
            <!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH eq 0 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_TOPICS}</b></td>
                </tr>
            <!-- ENDIF -->

// REPLACE WITH:

        <!-- DEFINE $TOPIC_NORMAL = 0 -->
        <!-- DEFINE $TOPIC_STICKY = 0 -->

        <!-- BEGIN topicrow -->

            <!-- IF topicrow.S_TOPIC_TYPE_SWITCH eq 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_ANNOUNCEMENTS}</b></td>
                </tr>
            <!-- ELSEIF topicrow.S_POST_STICKY and $TOPIC_STICKY eq 0 -->
                <!-- DEFINE $TOPIC_STICKY = 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_STICKY}</b></td>
                </tr>
            <!-- ELSEIF topicrow.S_TOPIC_TYPE eq 0 and $TOPIC_NORMAL eq 0 -->
                <!-- DEFINE $TOPIC_NORMAL = 1 -->
                <tr>
                    <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_TOPICS}</b></td>
                </tr>
            <!-- ENDIF -->

 


Thanks to Sniper E and Case for inspiring and testing :)


Tested; Works with RC1
User avatar
Patricia    
STG Moderator
STG Moderator
 
Posts: 833
Joined: 09 Feb 2007, 08:27
Location: latitude: 51.00 - longitude: 5.87
Gender: Female

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby rebornagain » 23 May 2007, 08:34

Prosilver Related Question.

This will concern topic listings.

You know how the 'Announcements' topic has its own section hovering over the other topics (being stickies and regular threads)? I was wondering if it were possible to me all Stickied threads hover-- or its own little section --right above the regular threads, and right underneath the hovering Announcements?

If this is possible and has been discussed already, can someone link me to the topic, for I couldn't find it if it exists.

Please and thank you.
User avatar
rebornagain
Cadet II
Cadet II
 
Posts: 24
Joined: 05 Feb 2007, 15:16
Gender: Male

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby Xabi » 24 May 2007, 02:22

I need the same info as rebornagain. I would like to separate stickies in prosilves in the same way as announcements.
Xabi
Supporter
Supporter
 
Posts: 50
Joined: 19 Feb 2007, 19:57
Location: Barcelona, Spain
Gender: Male

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby Belak » 24 May 2007, 07:05

sure there's a way to do it, but i currently have no time to look into the source code and find a solution. it should actually work the same way, i guess...

you just have to put the DEFINE an IF statements in the right position.
User avatar
Belak
Supporter
Supporter
 
Posts: 145
Joined: 17 Dec 2006, 15:16
Location: Kaiserslautern, Germany
Gender: Male

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby Mickroz » 25 May 2007, 08:34

this is the source code for prosilver:
Code: Select all
<!-- BEGIN topicrow -->
   
    <!-- IF not topicrow.S_TOPIC_TYPE_SWITCH and not topicrow.S_FIRST_ROW -->
        </ul>
        <span class="corners-bottom"><span></span></span></div>
    </div>
    <!-- ENDIF -->

    <!-- IF topicrow.S_FIRST_ROW or not topicrow.S_TOPIC_TYPE_SWITCH -->
        <div class="forumbg<!-- IF topicrow.S_TOPIC_TYPE_SWITCH --> announcement<!-- ENDIF -->">
        <div class="inner"><span class="corners-top"><span></span></span>
        <ul class="topiclist topics">
            <li class="header">
                <dl class="icon">
                    <dt><!-- IF S_DISPLAY_ACTIVE -->{L_ACTIVE_TOPICS}<!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH and topicrow.S_TOPIC_TYPE gt 1 -->{L_ANNOUNCEMENTS}<!-- ELSE -->{L_TOPICS}<!-- ENDIF --></dt>
                    <dd class="posts">{L_REPLIES}</dd>
                    <dd class="views">{L_VIEWS}</dd>
                    <dd class="lastpost"><span>{L_LAST_POST}</span></dd>
                </dl>
            </li>
        </ul>
        <ul class="topiclist topics">
    <!-- ENDIF -->
   
        <li class="row<!-- IF topicrow.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_POST_ANNOUNCE --> announce<!-- ENDIF --><!-- IF topicrow.S_POST_STICKY --> sticky<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
            <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC});">
                <dt style="<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS -->background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG});<!-- ENDIF -->" title="{topicrow.TOPIC_FOLDER_IMG_ALT}"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
                    <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
                    <!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
                    <!-- IF topicrow.PAGINATION --><strong class="pagination"><span>{topicrow.PAGINATION}</span></strong><!-- ENDIF -->
                    <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} {L_POSTED_ON_DATE} {topicrow.FIRST_POST_TIME}
                </dt>
                <dd class="posts">{topicrow.REPLIES} <dfn>{L_REPLIES}</dfn></dd>
                <dd class="views">{topicrow.VIEWS} <dfn>{L_VIEWS}</dfn></dd>
                <dd class="lastpost"><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
                    <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{L_POSTED_ON_DATE} {topicrow.LAST_POST_TIME}</span>
                </dd>
            </dl>
        </li>

    <!-- IF topicrow.S_LAST_ROW -->
            </ul>
        <span class="corners-bottom"><span></span></span></div>
    </div>
    <!-- ENDIF -->

<!-- BEGINELSE -->
    <!-- IF S_IS_POSTABLE -->
    <div class="panel">
        <div class="inner"><span class="corners-top"><span></span></span>
        <strong>{L_NO_TOPICS}</strong>
        <span class="corners-bottom"><span></span></span></div>
    </div>
    <!-- ENDIF -->
<!-- END topicrow -->
Forumer (n). 1) One who runs a forum or is an active member of one or more web forums.
Mickroz    
Supporter
Supporter
 
Posts: 263
Joined: 02 Feb 2007, 20:19
Location: The Netherlands
Favorite Team: Feyenoord
Gender: Male
phpBB Knowledge: 7

Re: [How To] Seperate Sticky Topics from Normal Topics

Postby Sniper_E » 25 May 2007, 14:22

That's Great Mickroz!

I'll post that in the prosilver fixes for you.
You saved me from having to do it also.... Thanks! :thumbsup:
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Next

Return to Tutorials and How-Tos

Who is online

Users browsing this forum: No registered users and 0 guests