vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Sort Thread Hack (https://vborg.vbsupport.ru/showthread.php?t=91069)

Snatch 06-25-2005 04:22 PM

Sort Thread Hack
 
1 Attachment(s)
Hi,

I need this hack in VB3.5 It sorts the Threads to Thread start Date, Last answer date and most answere. But the Coder how has made this hack is not attainable. Can anybode port this gread hack. The Coder "USKA" ist a friend, it no problem if anybody do this.

Code:

http://www.vbulletin-germany.com/forum/showthread.php?t=11182



FIRST:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SQL->"ALTER TABLE `user` ADD `viewmode` SMALLINT DEFAULT '0' NOT NULL ;"
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

NEXT:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
file FORUMDISPLAY.php
line 522
find:
#####################################################################################################
        switch ($sortfield)
        {
                case 'title':
#####################################################################################################
before add:
#####################################################################################################
// VIEW MODE HAXX BY USKA
$view = $DB_site->query_first("SELECT viewmode FROM user WHERE userid='$bbuserinfo[userid]'");
$viewmode = $view['viewmode'];
if ($viewmode==2) {
        $sortby = "replycount";
}
else if ($viewmode==1) {
        $sortby = "dateline";
        }
else {
        $sortby = "lastpost";
        }
// ENDE OF VIEW MODE HAXX ...
#####################################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

NEXT:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
file FORUMDISPLAY.php
line 540
find:
#####################################################################################################
                        $sqlsortfield = 'lastpost';
                        $sortfield = 'lastpost';
#####################################################################################################
replace:
#####################################################################################################
                        $sqlsortfield = $sortby;
                        $sortfield = $sortby;
#####################################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

NEXT:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
file moderator.php
line 191
find:
#####################################################################################################
//setup redirects for other options in moderators cp
#####################################################################################################
before add:
#####################################################################################################
//################ VIEW MODE HAXX BY USKA ########################
// ANNOTATIONS :
//              VIEW MODE 0 == BY LASTPOST
//              VIEW MODE 1 == BY THREADSTARTER (HYBRID)
//              VIEW MODE 2 == BY NUMBER OF REPLIES
// END OF ANNOTATIONS ...

if ($_POST['do'] == 'starter')
{

        $DB_site->query("UPDATE user SET viewmode='1' WHERE userid='$bbuserinfo[userid]'");
        $_REQUEST['forceredirect'] = 1;
        $url = "forumdisplay.php?$session[sessionurl]f=$forumid";
        eval(print_standard_redirect('redirect_viewmode_threadstarter'));
}

if ($_POST['do'] == 'lastpost')
{

        $DB_site->query("UPDATE user SET viewmode='0' WHERE userid='$bbuserinfo[userid]'");
        $_REQUEST['forceredirect'] = 1;
        $url = "forumdisplay.php?$session[sessionurl]f=$forumid";
        eval(print_standard_redirect('redirect_viewmode_lastpostby'));
}       

if ($_POST['do'] == 'replycount')
{

        $DB_site->query("UPDATE user SET viewmode='2' WHERE userid='$bbuserinfo[userid]'");
        $_REQUEST['forceredirect'] = 1;
        $url = "forumdisplay.php?$session[sessionurl]f=$forumid";
        eval(print_standard_redirect('redirect_viewmode_maxposts'));
}

//################ ENDE ...
#####################################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

NEXT:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ADMINCP -> Styles & Templates -> Style Manager -> Choose your style -> Templates bearbeiten -> DoubleClick Forensansicht Templates -> DOUBLECLICK "FORUMDISPLAY" (<=open)

find:
#####################################################################################################
<!-- / controls above thread list -->

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">
<tr>
        <td class="tcat" width="100%">$vbphrase[threads_in_forum]<span class="normal">: $foruminfo[title]</span></td>
#####################################################################################################
after add:
#####################################################################################################
<!-- VIEW MODE HAXX BY USKA -->
        <td class="vbmenu_control" id="viewmode" nowrap><a href="#goto_viewmode">Sortier Optionen</a><script type="text/javascript"> vbmenu_register("viewmode"); </script></td>
<!-- ENDE VIEW MODE HAXX BY USKA -->

#####################################################################################################
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

NEXT:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

find:
#####################################################################################################
<!-- forum tools menu -->
<div class="vbmenu_popup" id="forumtools_menu" style="display:none">
#####################################################################################################
before add:
#####################################################################################################
<!-- VIEWMODE ADDITION HAXX BY USKA -->
<div class="vbmenu_popup" id="viewmode_menu" style="display:none">
<form action="moderator.php" method="post" name="threadadminform">
<table cellpadding="4" cellspacing="1" border="0">
        <tr>
                <td class="thead">Sortiere nach:<a name="goto_viewmode"></a></td>
        </tr>
        <tr>
                <td class="vbmenu_option" title="nohilite">
                        <div><label for="fa_sta"><input type="radio" name="do" id="fa_sta" value="starter" checked="checked" />Thread start</label></div>
                        <div><label for="fa_las"><input type="radio" name="do" id="fa_las" value="lastpost" />Letzter Beitrag</label></div>
                        <div><label for="fa_rep"><input type="radio" name="do" id="fa_rep" value="replycount" />Meisten Antworten</label></div>
                </td>
        </tr>
        <tr>
                <td class="vbmenu_option" title="nohilite" align="center">               
                        <input type="hidden" name="s" value="$session[sessionhash]" />
                        <input type="hidden" name="f" value="$forumid" />
                        <input type="submit" class="button" value="$vbphrase[perform_action]" />
                </td>
        </tr>
</table>
</form>
</div>
<!-- VIEWMODE HAXX ENDE BY USKA -->
##################################################################################################
Add Phrase viewmode_threadstarter
Themen wurden nach Start-Datum sortiert.

Add Phrase viewmode_lastpostby
Themen wurden nach "neuen Beitr?gen" sortiert.

Add Phrase viewmode_maxposts
Themen wurden nach den meisten Antworten sortiert.


flup 06-25-2005 04:46 PM

This feature is standard implented with vB3.5.0 if you browse your childforum, you can click on 'reply's' 'rating' etc. and it will be sorted with most reply's or best rating etc.


Good luck :)

Snatch 06-25-2005 07:21 PM

But i whant to sort about thread start date, so thath the newest Threads alway on top.

GreeTz
Snatch

Gary King 07-22-2005 05:59 PM

I would like this as well.

Bump!

Freesteyelz 03-16-2006 09:48 AM

This would be a great mod for forums such as Announcements. If I'm reading this thread correctly, replies to a thread will not bump it to the top in Forum Display and viewable in Forum Home. Only new threads created will be at the top. If this summary is correct, I too would love to have a modification to do it.


All times are GMT. The time now is 02:42 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01176 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete