View Single Post
  #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
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01282 seconds
  • Memory Usage 1,834KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete