1

Topic: Sort by views (descending)

Sorting by descending number of views is useful when you're using a forum to list resources (e.g. products, services). Sorting by view causes the more popular resources to float to the top.

Since punBB already counts views, there's no substantial overhead to adding this sort capability.

2

Re: Sort by views (descending)

If I'm not mistaken this is all it requires:

admin_forums.php
============
add after line 284:

<option value="2"<?php if ($cur_forum['sort_by'] == '2') echo ' selected="selected"' ?>>Views (desc)</option>

viewforum.php
=============
change ternary condition

(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post')

to

(($cur_forum['sort_by'] == '1') ? 'posted' : (($cur_forum['sort_by'] == '0') ? 'last_post' : 'num_views'))

in all places