Announcement

Collapse
No announcement yet.

Change items in forum display.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change items in forum display.

    How do I change the way items are shown in forum display?

    I'm trying to do the same as offtopic.com has done:
    http://forums.offtopic.com/forumdisplay.php?f=119

    I'd like the forum information to be displayed as:


    Thread | Thread Starter | Last Post | Replies | Views

    Are there any mods to do this?
    What's Special About Ruby on Rails?

  • #2
    Change templates in admin cp will take care of that; no hacks required

    Admin CP > Style Editor > Forum Display Templates
    FIND in FORUMDISPLAY
    Code:
    <thead>
    	<tr align="center">
    	  <td class="thead">&nbsp;</td>
    	  <td class="thead" width="100%" align="$stylevar[left]">$vbphrase[forum]</td>
    	  <td class="thead" width="175">$vbphrase[last_post]</td>
    	  <td class="thead">$vbphrase[threads]</td>
    	  <td class="thead">$vbphrase[posts]</td>
    	  <if condition="$vboptions[showmoderatorcolumn]">
    	  <td class="thead">$vbphrase[moderator]</td>
    	  </if>
    	</tr>
    </thead>
    REPLACE with:
    Code:
    <thead>
    	<tr align="center">
    	  <td class="thead">&nbsp;</td>
    	  <td class="thead" width="100%" align="$stylevar[left]">$vbphrase[forum]</td>
    	  <td class="thead" width="120">Thread Starter</td>
    	  <td class="thead" width="175">$vbphrase[last_post]</td>
    	  <td class="thead">$vbphrase[threads]</td>
    	  <td class="thead">$vbphrase[posts]</td>
    	  <if condition="$vboptions[showmoderatorcolumn]">
    	  <td class="thead">$vbphrase[moderator]</td>
    	  </if>
    	</tr>
    </thead>
    FIND in FORUMDISPLAY
    Code:
    <tr>
    	<if condition="$show['threadicons']">
    		<td class="thead" colspan="2">&nbsp;</td>
    	<else />
    		<td class="thead">&nbsp;</td>
    	</if>	
    	<td class="thead" width="100%">
    		<if condition="$show['threadratings']"><span style="float:$stylevar[right]"><a href="$sorturl&amp;order=desc&amp;sort=voteavg">$vbphrase[rating]</a> $sortarrow[voteavg]</span></if>
    		<a href="$sorturl&amp;order=asc&amp;sort=title">$vbphrase[thread]</a> $sortarrow[title] /
    		<a href="$sorturl&amp;order=asc&amp;sort=postusername">$vbphrase[thread_starter]</a> $sortarrow[postusername]
    	</td>
    	<td class="thead" width="150" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&amp;order=desc&amp;sort=lastpost">$vbphrase[last_post]</a> $sortarrow[lastpost]</span></td>
    	<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&amp;order=desc&amp;sort=replycount">$vbphrase[replies]</a> $sortarrow[replycount]</span></td>
    	<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&amp;order=desc&amp;sort=views">$vbphrase[views]</a> $sortarrow[views]</span></td>
    </tr>
    REPLACE with
    Code:
    <tr>
    	<if condition="$show['threadicons']">
    		<td class="thead" colspan="2">&nbsp;</td>
    	<else />
    		<td class="thead">&nbsp;</td>
    	</if>	
    	<td class="thead" width="100%">
    		<if condition="$show['threadratings']"><span style="float:$stylevar[right]"><a href="$sorturl&amp;order=desc&amp;sort=voteavg">$vbphrase[rating]</a> $sortarrow[voteavg]</span></if>
    		<a href="$sorturl&amp;order=asc&amp;sort=title">$vbphrase[thread]</a> $sortarrow[title] 
    	</td>
    	<td class="thead" width="120" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&amp;order=asc&amp;sort=postusername">$vbphrase[thread_starter]</a> $sortarrow[postusername]</span></td>
    	<td class="thead" width="150" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&amp;order=desc&amp;sort=lastpost">$vbphrase[last_post]</a> $sortarrow[lastpost]</span></td>
    	<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&amp;order=desc&amp;sort=replycount">$vbphrase[replies]</a> $sortarrow[replycount]</span></td>
    	<td class="thead" align="center" nowrap="nowrap"><span style="white-space:nowrap"><a href="$sorturl&amp;order=desc&amp;sort=views">$vbphrase[views]</a> $sortarrow[views]</span></td>
    </tr>
    FIND in Threadbit:
    Code:
    		<div>
    			<span style="float:$stylevar[right]">
    				<if condition="$show['paperclip']"><img class="inlineimg" src="$stylevar[imgdir_misc]/paperclip.gif" alt="<phrase 1="$thread[attach]">$vbphrase[x_attachments]</phrase>" /></if>
    				<if condition="$show['subscribed']"><img class="inlineimg" src="$stylevar[imgdir_misc]/subscribed.gif" alt="$vbphrase[you_are_subscribed_to_this_thread]" /></if>
    				<if condition="$show['sticky']"><img class="inlineimg" src="$stylevar[imgdir_misc]/sticky.gif" alt="$vbphrase[sticky_thread]" /></if>
    			</span>
    			<if condition="$show['gotonewpost']"><a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a></if>
    			$thread[movedprefix]
    			$thread[typeprefix]
    			<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]"><if condition="$show['gotonewpost']"><strong>$thread[threadtitle]</strong><else />$thread[threadtitle]</if></a>
    			<if condition="$thread['pagenav']"><span class="smallfont" style="white-space:nowrap">( <img class="inlineimg" src="$stylevar[imgdir_misc]/multipage.gif" alt="$vbphrase[multipage_thread]" border="0" /> $thread[pagenav] <if condition="$show[pagenavmore]">... <a href="showthread.php?$session[sessionurl]t=$thread[threadid]&amp;goto=lastpost$thread[highlight]">$vbphrase[last_page]</a></if> )</span></if>
    		</div>
    	
    		<div class="smallfont">
    			<if condition="$show['threadratings'] AND $show['threadrating']"><span style="float:$stylevar[right]"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" border="0" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span></if>
    			<if condition="$show['guestuser']">
    				$thread[postusername]
    			<else />
    				<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]')">$thread[postusername]</span>
    			</if>
    		</div>
    		
    		<if condition="$show['unsubscribe']">
    			<div class="smallfont">
    				<a href="newreply.php?$session[sessionurl]do=newreply&amp;t=$thread[threadid]">$vbphrase[reply]</a> |
    				<a href="subscription.php?$session[sessionurl]do=removesubscription&amp;return=ucp&amp;t=$thread[threadid]">$vbphrase[unsubscribe]</a>
    			</div>
    		</if>
    		
    	</td>
    REPLACE with:
    Code:
    		<div>
    			<span style="float:$stylevar[right]">
    				<if condition="$show['paperclip']"><img class="inlineimg" src="$stylevar[imgdir_misc]/paperclip.gif" alt="<phrase 1="$thread[attach]">$vbphrase[x_attachments]</phrase>" /></if>
    				<if condition="$show['subscribed']"><img class="inlineimg" src="$stylevar[imgdir_misc]/subscribed.gif" alt="$vbphrase[you_are_subscribed_to_this_thread]" /></if>
    				<if condition="$show['sticky']"><img class="inlineimg" src="$stylevar[imgdir_misc]/sticky.gif" alt="$vbphrase[sticky_thread]" /></if>
    			</span>
    			<if condition="$show['gotonewpost']"><a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$thread[threadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/firstnew.gif" alt="$vbphrase[go_to_first_new_post]" border="0" /></a></if>
    			$thread[movedprefix]
    			$thread[typeprefix]
    			<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]"><if condition="$show['gotonewpost']"><strong>$thread[threadtitle]</strong><else />$thread[threadtitle]</if></a>
    			<if condition="$thread['pagenav']"><span class="smallfont" style="white-space:nowrap">( <img class="inlineimg" src="$stylevar[imgdir_misc]/multipage.gif" alt="$vbphrase[multipage_thread]" border="0" /> $thread[pagenav] <if condition="$show[pagenavmore]">... <a href="showthread.php?$session[sessionurl]t=$thread[threadid]&amp;goto=lastpost$thread[highlight]">$vbphrase[last_page]</a></if> )</span></if>
    		</div>
    	
    		<div class="smallfont">
    			<if condition="$show['threadratings'] AND $show['threadrating']"><span style="float:$stylevar[right]"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" border="0" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span></if>
    		</div>
    		
    		<if condition="$show['unsubscribe']">
    			<div class="smallfont">
    				<a href="newreply.php?$session[sessionurl]do=newreply&amp;t=$thread[threadid]">$vbphrase[reply]</a> |
    				<a href="subscription.php?$session[sessionurl]do=removesubscription&amp;return=ucp&amp;t=$thread[threadid]">$vbphrase[unsubscribe]</a>
    			</div>
    		</if>
    		
    	</td>
    	<td>
    		<if condition="$show['guestuser']">
    			$thread[postusername]
    		<else />
    			<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]')">$thread[postusername]</span>
    		</if>
    	</td>

    I haven't test this yet, but it should work... If not, you can always revert it and wait for a VB Dev to fix this above for me...
    Best Regards,
    Andy Huang

    Comment


    • #3
      Thanks I'll try it in a mo!

      Whilst I have your attention ( :-) ) I wonder if you could also help me with another problem...

      I am bascially trying to change the 'table headers' to show different heights for different pages. I am basically trying to skin vB to emulate my current forum: dogweb.co.uk/talk Do you know how I can change the size for the table headers for each page as in my current site?

      Ie as standard on the forum home (padding is 4px I think), Smaller at the top of view topic pages and smallest in between posts whilst viewing a thread (and to also get rid of the space between posts). I'd also like to (would have to) move the time posted and post number in the post bit somewhere. Finally the table footer would be twice as high as the table header.

      Sorry to ask so much! But I appreciate your help :-)
      What's Special About Ruby on Rails?

      Comment


      • #4
        If you meant for the categories, you can do so like they did by adding an extra <br /> right before the category header. This can be done either manually for each of the categories, or I think you can also do it like this:

        FIND in forumhome_level1_nopost
        Code:
        <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">$forum[title]</a>
        REPLACE with:
        Code:
        <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><br />$forum[title]</a>
        If that doesn't do the trick for you, you'd need to also poke around with forumhome_level2_nopost. I've modified my level2_nopost to do something else, so I can't really help you with that one. Sorry.

        Cheers.
        Best Regards,
        Andy Huang

        Comment


        • #5
          Thanks for replying again. First re your original solution!... It works, only thing is now the 'thread starter' column is not showing the 'second alternating colour', any ideas on how to fix this? Also, is it possible to change the order to:
          Thread Replies Thread Starter Views Last Post
          (As the other way doesnt look as nice - sorry to be a pain!).

          Re your second solution, sorry I should have explained clearer...
          I am referring to the grey bars as seen on http://www.dogweb.co.uk/talk/dog7946.html I am trying to emulate this pages style in my vB style. Basically the table header bar which contains the text:

          Author Message

          needs to be the same height as shown in that url and then the same coloured bars seperating each post would be around 2pixels high (again as seen in that url). Obviously for this to be possible I would need to remove the time of post and post number and place those items in the post bit (preferbally the same place is on my current forum). Finally the grey table footer bar needs to be about twice the size of the table header bar. The other thing it would need to duplicate the style would be no space between posts. I hope that makes a bit more sense. :-)

          Thanks again for replying so quickly!
          What's Special About Ruby on Rails?

          Comment


          • #6
            Oops, my bad on the first one. Please add class="alt2" to the newly introduced td.
            ADD the section in red in threadbit
            Code:
            	<td [color=red]class="alt2" title="Thread Starter"[/color]>
            		<if condition="$show['guestuser']">
            			$thread[postusername]
            		<else />
            			<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]')">$thread[postusername]</span>
            		</if>
            	</td>
            As to the second one, I don't know how to do that one... you'd need to play around on your own or wait for VB dev to answer that for you... sorry.

            Cheers.
            Best Regards,
            Andy Huang

            Comment


            • #7
              OK thanks for your help! Hopefully someone will be along to sort me second prob out.

              Also, can anyone modify the above so I can display as follows:

              Thread Replies | Views | Thread Starter | replies | Last Post

              thanks!
              What's Special About Ruby on Rails?

              Comment


              • #8
                Is there any quick way of having the sticky thread titles appear in red color?

                Tnx
                John Caradimas

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X