Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2005, 04:22 PM
Snatch Snatch is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Sort Thread Hack

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.
Attached Images
File Type: jpg 214124.jpg (73.2 KB, 0 views)
Reply With Quote
  #2  
Old 06-25-2005, 04:46 PM
flup's Avatar
flup flup is offline
 
Join Date: Jan 2002
Location: Maastricht, NL
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 06-25-2005, 07:21 PM
Snatch Snatch is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

GreeTz
Snatch
Reply With Quote
  #4  
Old 07-22-2005, 05:59 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would like this as well.

Bump!
Reply With Quote
  #5  
Old 03-16-2006, 09:48 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09931 seconds
  • Memory Usage 2,245KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (1)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete