Page Index Toggle Pages: 1 [2] 3 4 ... 6 Send TopicPrint
Very Hot Topic (More than 25 Replies) Sticky Shimmy Shuffle 1.4a  YaBB2 (Read 50835 times)
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #15 - Jun 24th, 2005 at 10:08pm
Print Post  
Code
Select All
###############################################################################
# MessageIndex.pl										 #
###############################################################################
# YaBB: Yet another Bulletin Board							  #
# Open-Source Community Software for Webmasters					 #
# Version:	  YaBB 2 RC 3								 #
# Released:	 June 20, 2005							     #
# Distributed by: http://www.yabbforum.com						#
# =========================================================================== #
# Copyright (c) 2000-2005 YaBB (www.yabbforum.com) - All Rights Reserved.     #
# Software by: The YaBB Development Team						  #
#		  with assistance from the YaBB community.			     #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com		#
#		   Your source for web hosting, web design, and domains.	   #
###############################################################################

$messageindexplver = 'YaBB 2 RC 3 $Revision: 1.93 $';
if($action eq 'detailedversion') { return 1; }

LoadLanguage("quickreply");
LoadLanguage("MessageIndex");
require "$templatesdir/$usemessage/MessageIndex.template";
require "$sourcedir/Favorites.pl";
&ShowFav;

sub MessageIndex {
# Check if board was 'shown to all' - and whether they can view the board
	if (&AccessCheck($currentboard, '', $boardperms) ne "granted"){ &fatal_error("$maintxt{'1'}"); }

	my( $counter, $buffer, $pages, $showmods, $mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate, $dlp, $threadlength, $threaddate );
	my( @boardinfo, @threads, @anns, @stickythreadlist );
	BoardTotals("load",$currentboard);
	my $threadcount = ${$uid.$currentboard}{'threadcount'};
	my $messagecount = ${$uid.$currentboard}{'messagecount'};

# Load our dear announcements, if they exist.

	if($annboard && $annboard ne $currentboard) {
		chomp $annboard;
		fopen(ANN, "$boardsdir/$annboard.txt");
		@anns = <ANN>;
		fclose(ANN);
		$numanns = $#anns+1;
	} else {
		@anns=();
	}


	$threadcount=$threadcount+$numanns;
	my $maxindex = $INFO{'view'} eq 'all' ? $threadcount : $maxdisplay;

	# There are three kinds of lies: lies, darned lies, and statistics.
	# - Mark Twain

	# Construct the page links for this board.
	if (!$iamguest) {
		($usermessagepage, undef, undef) = split(/\|/, ${$uid.$username}{'pageindex'});
	}
	my($pagetxtindex, $pagetextindex, $pagedropindex1, $pagedropindex2, $all, $allselected);
	$indexdisplaynum = 3;	# max number of pages to display
	$dropdisplaynum = 10;
	$startpage = 0;
	$max = $threadcount;
	if ($INFO{'start'} eq "all") { $maxindex = $max; $all = 1; $allselected = qq~ selected="selected"~; $start = 0 }
	else { $start = $INFO{'start'} || 0; }
	if( $start > $threadcount-1 ) { $start = $threadcount-1; }
	elsif( $start < 0 ) { $start = 0; }
	$start = int( $start / $maxindex ) * $maxindex;
	$tmpa = 1;
	$pagenumb = int(($threadcount - 1) / $maxindex) + 1;
	if ($start >= (($indexdisplaynum-1) * $maxindex)) {
		$startpage = $start - (($indexdisplaynum-1) * $maxindex);
		$tmpa = int( $startpage / $maxindex ) + 1;
	}
	if ($threadcount >= $start + ($indexdisplaynum * $maxindex)) { $endpage = $start + ($indexdisplaynum * $maxindex); }
	else { $endpage = $threadcount }
	$lastpn = int(($threadcount - 1) / $maxindex) + 1;
	$lastptn = ($lastpn - 1) * $maxindex;
	$pageindex1 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="" style="vertical-align: middle;" /> $messageindex_txt{'139'}: $pagenumb</span>~;
	$pageindex2 = $pageindex1;
	if($pagenumb > 1 || $all) {
	if($usermessagepage == 1 || $iamguest) {
		$pagetxtindexst = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;">~;
		if(!$iamguest) { $pagetxtindexst .= qq~<a href="$scripturl?board=$INFO{'board'};start=$start;action=messagepagedrop"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" style="vertical-align: middle;" /></a> $messageindex_txt{'139'}: ~; }
		else { $pagetxtindexst .= qq~<img src="$imagesdir/index_togl.gif" border="0" alt="" style="vertical-align: middle;" /> $messageindex_txt{'139'}: ~; }
		if ($startpage > 0) { $pagetxtindex = qq~<a href="$scripturl?board=$currentboard/0" style="font-weight: normal;">1</a>&nbsp;...&nbsp;~; }
		if ($startpage == $maxindex) { $pagetxtindex = qq~<a href="$scripturl?board=$currentboard/0" style="font-weight: normal;">1</a>&nbsp;~;}
		for( $counter = $startpage; $counter < $endpage; $counter += $maxindex ) {
			$pagetxtindex .= $start == $counter ? qq~<b>$tmpa</b>&nbsp;~ : qq~<a href="$scripturl?board=$currentboard/$counter" style="font-weight: normal;">$tmpa</a>&nbsp;~;
			$tmpa++;
		}
		if ($endpage < $threadcount - $maxindex) {$pageindexadd = qq~...&nbsp;~;}
		if ($endpage != $threadcount) {$pageindexadd .= qq~<a href="$scripturl?board=$currentboard/$lastptn" style="font-weight: normal;">$lastpn</a>~;}

		$pagetxtindex .= qq~$pageindexadd~;
		$pageindex1 = qq~$pagetxtindexst$pagetxtindex</span>~;
		$pageindex2 = $pageindex1;
	}
	else {
		$pagedropindex1 = qq~<span style="float: left; width: 320px; margin: 0px; margin-top: 2px; border: 0px;">~;
		$pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0; margin-right: 4px;"><a href="$scripturl?board=$INFO{'board'};start=$start;action=messagepagetext"><img src="$imagesdir/index_togl.gif" border="0" alt="$messageindex_txt{'19'}" /></a></span>~;
		$pagedropindex2 = $pagedropindex1;
		$tstart = $start;
		if(substr($INFO{'start'},0,3) eq "all") { ($tstart, $start) = split(/\-/, $INFO{'start'}); }
		$d_indexpages = $pagenumb / $dropdisplaynum;
		$i_indexpages = int($pagenumb / $dropdisplaynum);
		if($d_indexpages > $i_indexpages) { $indexpages = int($pagenumb / $dropdisplaynum) + 1; }
		else { $indexpages = int($pagenumb / $dropdisplaynum) }
		$selectedindex = int(($start / $maxindex) / $dropdisplaynum);
		if($pagenumb > $dropdisplaynum) {
			$pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector1" id="decselector1" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~;
			$pagedropindex2 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector2" id="decselector2" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~;
		}
		for($i=0; $i<$indexpages; $i++) {
			$indexpage = ($i * $dropdisplaynum) * $maxindex;
			$indexstart = ($i * $dropdisplaynum) + 1;
			$indexend = $indexstart + ($dropdisplaynum - 1);
			if($indexend > $pagenumb) {$indexend = $pagenumb;}
			if($indexstart == $indexend) { $indxoption = qq~$indexstart~; }
			else { $indxoption = qq~$indexstart-$indexend~; }
			$selected = "";
			if($i == $selectedindex) {
				$selected = qq~ selected="selected"~;
				$pagejsindex = qq~$indexstart|$indexend|$maxindex|$indexpage~;
			}
			if($pagenumb > $dropdisplaynum) {
				$pagedropindex1 .= qq~<option \n~;
				$pagedropindex2 .= qq~<option \n~;
			}
		}
		if($pagenumb > $dropdisplaynum) {
			$pagedropindex1 .= qq~</select>\n</span>~;
			$pagedropindex2 .= qq~</select>\n</span>~;
		}
		$pagedropindex1 .= qq~<span id="ViewIndex1" class="droppageindex" style="height: 14px; visibility: hidden">&nbsp;</span>~;
		$pagedropindex2 .= qq~<span id="ViewIndex2" class="droppageindex" style="height: 14px; visibility: hidden">&nbsp;</span>~;
		$tmpmaxindex = $maxindex;
		if(substr($INFO{'start'},0,3) eq "all") { $maxindex = $maxindex * $dropdisplaynum; }
		$prevpage = $start - $tmpmaxindex;
		$nextpage = $start + $maxindex;
		$pagedropindexpvbl = qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~;
		$pagedropindexnxbl = qq~<img src="$imagesdir/index_right0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~;
		if($start < $maxindex) { $pagedropindexpv .= qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="display: inline; vertical-align: middle;" />~; }
		else { $pagedropindexpv .= qq~<img src="$imagesdir/index_left.gif" border="0" height="14" width="13" alt="$pidtxt{'02'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?board=$currentboard/$prevpage\\'" ondblclick="location.href=\\'$scripturl?board=$currentboard/0\\'" />~; }
		if($nextpage > $lastptn) { $pagedropindexnx .= qq~<img src="$imagesdir/index_right0.gif" border="0" height="14" width="13" alt="" style="display: inline; vertical-align: middle;" />~; }
		else { $pagedropindexnx .= qq~<img src="$imagesdir/index_right.gif" height="14" width="13" border="0" alt="$pidtxt{'03'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?board=$currentboard/$nextpage\\'" ondblclick="location.href=\\'$scripturl?board=$currentboard/$lastptn\\'" />~; }
		$pageindex1 = qq~$pagedropindex1</span>~;
		$pageindex2 = qq~$pagedropindex2</span>~;

$pageindexjs = qq~
<script language="JavaScript1.2" type="text/javascript">
<!--
	function SelDec(decparam, visel) {
		splitparam = decparam.split("|");
		var vistart = parseInt(splitparam[0]);
		var viend = parseInt(splitparam[1]);
		var maxpag = parseInt(splitparam[2]);
		var pagstart = parseInt(splitparam[3]);
		var allpagstart = parseInt(splitparam[3]);
		if(visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart';
		var pagedropindex = '<table border="0" cellpadding="0" cellspacing="0"><tr>';
		for(i=vistart; i<=viend; i++) {
			if(visel == pagstart) pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: bold;">' + i + '</td>';
			else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?board=$currentboard/' + pagstart + '">' + i + '</a></td>';
			pagstart += maxpag;
		}
		if (vistart != viend) {
			if(visel == 'all') pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: normal;"><b>$pidtxt{"01"}</b></td>';
			else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?board=$currentboard/all-' + allpagstart + '">$pidtxt{"01"}</a></td>';
		}
		if(visel != 'xx') pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpv$pagedropindexnx</td>';
		else pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpvbl$pagedropindexnxbl</td>';
		pagedropindex += '</tr></table>';
		document.getElementById("ViewIndex1").innerHTML=pagedropindex;
		document.getElementById("ViewIndex1").style.visibility = "visible";
		document.getElementById("ViewIndex2").innerHTML=pagedropindex;
		document.getElementById("ViewIndex2").style.visibility = "visible";
		~;
		if($pagenumb > $dropdisplaynum) {
		$pageindexjs .= qq~
		document.getElementById("decselector1").value = decparam;
		document.getElementById("decselector2").value = decparam;
		~;
		}
		$pageindexjs .= qq~
	}
	document.onload = SelDec('$pagejsindex', '$tstart');
	//-->
</script>
~;
	}
	}

	# Determine what category we are in.
	$catid = ${$uid.$currentboard}{'cat'};
	($cat, $catperms) = split(/\|/, $catinfo{"$catid"});

	fopen(BRDTXT, "$boardsdir/$currentboard.txt") || &fatal_error("300 $txt{'106'}: $txt{'23'} $currentboard.txt", 1);
	@threadlist = <BRDTXT>;
	fclose(BRDTXT);
	$threadcount = $#threadlist;

	if ($numanns){$countsticky = $numanns;} else {$countsticky = 0;}
	$countnosticky = 0;
	if ($numanns){ push (@stickythreadlist,@anns);}
	for ($i=0; $i<=$threadcount; $i++) {
		my @array = split( /\|/, $threadlist[$i] );
		my $threadstatus = pop(@array); #get only status
		my $mnum = shift(@array); # get only number
		undef @array;
		if($threadstatus =~ /s/i && $threadstatus !~ /h/i){
			$stickythreadlist[$countsticky] = $threadlist[$i]; $countsticky++;
		} else {
			$nostickythreadlist[$countnosticky] = $threadlist[$i]; $countnosticky++;
		}
	}
	# sort by date?? help me out here? I can't do it by the date provided because it is Date at Time
	#@stickythreadlist_sorted = map { $_->[0] } sort { YaBBsort ('4', '0', '1', '1') } map { [ $_, split /\|/ ] } @stickythreadlist;
	if ($countsticky) { @threadlist = (@stickythreadlist, @nostickythreadlist); }
	@threads = splice(@threadlist,$start,$maxindex);
	chomp @threads;
		###Next 2 lines Sticky Group mod
		$stkynum = '';
		if($start <= $#stickythreadlist){ $stkynum = scalar @stickythreadlist; }
	# Mark current board as seen.
	&dumplog($currentboard);

	# Build a list of the board's moderators.
	$iammod = 0;
	if( scalar keys %moderators > 0 ) {
		if( scalar keys %moderators == 1 ) { $showmods = qq~($messageindex_txt{'298'}: ~; }
		else { $showmods = qq~($messageindex_txt{'63'}: ~; }
		while( $_ = each(%moderators) ) {
			if($username eq $_) {$iammod = 1;}
			&FormatUserName($_);
			$showmods .= qq~<a a>, ~;
		}
		$showmods =~ s/, \Z/)/;
	}
	if( scalar keys %moderatorgroups > 0 ) {
		&LoadUser($username);
		if( scalar keys %moderatorgroups == 1 ) { $showmodgroups = qq~($messageindex_txt{'298a'}: ~; }
		else { $showmodgroups = qq~($messageindex_txt{'63a'}: ~; }
		while( $_ = each(%moderatorgroups) ) {
			if(${$uid.$username}{'position'} eq $_) {$iammod = 1;}
			foreach $memberaddgroups (split(/\, /, ${$uid.$username}{'addgroups'})) {
				chomp $memberaddgroups;
				if ($memberaddgroups eq $_) {$iammod = 1; last;}
			}
			$showmodgroups .= qq~$moderatorgroups{$_}, ~;
		}
		$showmodgroups =~ s/, \Z/)/;
	}
	if($showmodgroups ne "" && $showmods ne "") { $showmods .= qq~ - ~; }


	&LoadCensorList;	# Load Censor List

	# Print the header and board info.
	&ToChars($boardname);
	$curboardurl = $curposlinks ? qq~<a href="$scripturl?board=$currentboard" class="nav">$boardname</a>~ : $boardname;
	if((($iammod && $modview == 1) || ($iamadmin && $adminview == 1) || ($iamgmod && $gmodview == 1)) && $sessionvalid == 1) {
		$yymain .= qq~<script language="JavaScript1.2" src="$ubbcjspath" type="text/javascript"></script>~;
	}

	my $homelink = qq~<a href="$scripturl" class="nav">$mbname</a>~;
	my $catlink = qq~<a href="$scripturl?catselect=$catid" class="nav">$cat</a>~;
	my $boardlink = qq~<a href="$scripturl?board=$currentboard" class="nav">$boardname</a>~;
	my $modslink = qq~$showmods~;

	#check howmany col's must be spanned ;)
	if ((($iamadmin && $adminview >= 1) || ($iamgmod && $gmodview >= 1) || ($iammod && $modview >= 1)) && $sessionvalid == 1){
		$colspan = 8;
	}else{
		$colspan = 7;
	}

	if (!$iamguest) {
		$markalllink = qq~$menusep<a a>~;
		$notify_board = qq~$menusep<a href="$scripturl?action=boardnotify;board=$INFO{'board'}">$img{'notify'}</a>~;

	}

	if (&AccessCheck($currentboard, 1) eq "granted"){
		$postlink = qq~$menusep<a thread'}</a>~;
	}
	if (&AccessCheck($currentboard, 3) eq "granted"){
		$polllink = qq~$menusep<a poll'}</a>~;
	}

	if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3)) && $sessionvalid == 1){
		$adminlink = qq~<img src="$imagesdir/locked.gif" alt="$messageindex_txt{'104'}" border="0" /><img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'781'}" border="0" /><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" border="0" /><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" border="0" />~;

		$adminheader =~ s/<yabb admin>/$adminlink/g;
	}
	elsif ((($iamadmin && $adminview != 0) || ($iamgmod && $gmodview != 0) || ($iammod && $modview != 0)) && $sessionvalid == 1){
		$adminlink = qq~$messageindex_txt{'2'}~;

		$adminheader =~ s/<yabb admin>/$adminlink/g;
	}
	#check to display moderator column
	###Start Sticky Group mod
	my $tmpstickyheader;
	if($stkynum){
		$stickyheader =~ s/<yabb colspan>/$colspan/g;
		$tmpstickyheader = $stickyheader;
	}
	###End Sticky Group mod

	# Begin printing the message index for current board.
	$counter = $start;
	my @logthreads = @threads;
	push (@logthreads, "$curboard--mark");
	&getlog( @logthreads);
	foreach( @threads ) {
		($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split( /\|/, $_ );
		# Set thread class depending on locked status and number of replies.
		if ($mnum == ""){next;}
		$threadclass = 'thread';
		if( $mstate =~ /h/i ) { $threadclass = 'hide'; }
		elsif( $mstate =~ /l/i ) { $threadclass = 'locked'; }
		elsif( $mreplies >= $VeryHotTopic ) { $threadclass = 'veryhotthread'; }
		elsif( $mreplies >= $HotTopic ) { $threadclass = 'hotthread'; }
		elsif( $mstate == "" ) { $threadclass = 'thread'; }
		#$yydebug .= $threadclass . "\n";
		if ($threadclass eq "hide" && ((!$iamadmin && !$iamgmod && !$iammod) || $sessionvalid == 0)){next;}
		elsif($threadclass eq 'locked' && $mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'stickylock'; }
		elsif($mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'sticky'; }
		elsif($mstate =~ /a/i && $mstate !~ /h/i) { $threadclass = 'announcement'; }
		### Start Sticky Shimmy Shuffle mod
		my $stickdir;
		if ($iammod || $iamadmin || $iamgmod) {
		if ($threadclass eq "sticky" || $threadclass eq "stickylock"){$stickdir = qq~&nbsp;&nbsp;<a <font size="3"><b>&uarr;</b></font></a><a "><font size="3"><b>&darr;</b></font> </a>~;}
		unless ($iammod) {if ($threadclass eq "announcement"){$stickdir = qq~&nbsp;&nbsp;<a ldboard=$currentboard;"><font size="3"><b>&uarr;</b></font></a><a ;oldboard=$currentboard;"><font size="3"><b>&darr;</b></font> </a>~;}}}
		### End Sticky Shimmy Shuffle Mod

		if (!$iamguest && $max_log_days_old) {
			# Decide if thread should have the "NEW" indicator next to it.
			# Do this by reading the user's log for last read time on thread,
			# and compare to the last post time on the thread.
			$dlp = $yyuserlog{$mnum} ? $yyuserlog{$mnum} : 0;
			$dlpb = $yyuserlog{"$currentboard--mark"} ? $yyuserlog{"$currentboard--mark"} : 0;
			$dlp = $dlp > $dlpb ? $dlp : $dlpb;
			$threaddate = $mdate;
			if( $dlp < $threaddate && ($dlp>$max_log_days_old*86400 || $dlp eq 0)) {
				$new = qq~<a href="$scripturl?num=$mnum/new"><img src="$imagesdir/new.gif" alt="$messageindex_txt{'302'}" border="0"/></a>~;
			} else { $new = ''; }
		}

		$micon = qq~<img src="$imagesdir/$micon.gif" alt="" border="0" align="middle" />~;
		$mpoll = "";
		if (-e "$datadir/$mnum.poll") {
			$mpoll = qq~<b>$messageindex_polltxt{'15'}: </b>~;
			fopen (POLL, "$datadir/$mnum.poll");
			$poll_question = <POLL>;
			fclose (POLL);
			chomp $poll_question;
			(undef, $poll_locked, undef) = split(/\|/, $poll_question, 3);
			$micon = qq~$img{'pollicon'}~;
			if ($poll_locked) { $micon = $img{'polliconclosed'}; }
			elsif (!$iamguest && $max_log_days_old && $mdate > time-($max_log_days_old*86400)) {
				if( $dlp < $createpoll_date ) {
					$micon = qq~$img{'polliconnew'}~;
				} else {
					fopen(POLLED, "$datadir/$mnum.polled");
					$polled = <POLLED>;
					fclose(POLLED);
					(undef, undef, undef, $vote_date, undef) = split(/\|/, $polled);
					if( $dlp < $vote_date ) {$micon = qq~$img{'polliconnew'}~;}
				}
			}
		}

		# Load the current nickname of the account name of the thread starter.

		if( $musername ne 'Guest') {
			&LoadUser($musername);
			$registrationdate = ${$uid.$musername}{'regtime'};
			$threadstartdate = $mdate;

			if ((${$uid.$musername}{'regdate'} && $threadstartdate > $registrationdate) || ${$uid.$musername}{'status'} eq "Administrator" || ${$uid.$musername}{'status'} eq "Global Moderator") {
				$mname = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$musername}">$ {$uid.$musername}{'realname'}</a>~;
			} else {
				$mname .=  qq~ ($messageindex_txt{'470a'})~;
			}
		}
		$msub =~ s/\A\[m\]/$maintxt{'758'}/;
		# Censor the subject of the thread.
		$msub = &Censor($msub);
		&ToChars($msub);

		# Build the page links list.
		$pages = '';
		if (int( ($mreplies+1)/ $maxmessagedisplay ) > 6) {
			$pages = qq~ <a href="$scripturl?num=$mnum/0#0">1</a>~;
			$pages .= qq~ <a href="$scripturl?num=$mnum/$maxmessagedisplay#$maxmessagedisplay">2</a>~;
			$endpage = int(($mreplies) / $maxmessagedisplay) +1;
			$i = ($endpage-1) * $maxmessagedisplay;
			$j = $i - $maxmessagedisplay;
			$k = $endpage - 1;
			$tmpa = $endpage - 2;
			$tmpb = $j - $maxmessagedisplay;
			$pages .= qq~ <a href="$scripturl?action=pages;num=$mnum">...</a>~;
			$pages .= qq~ <a href="$scripturl?num=$mnum/$tmpb#$tmpb">$tmpa</a>~;
			$pages .= qq~ <a href="$scripturl?num=$mnum/$j#$j">$k</a>~;
			$pages .= qq~ <a href="$scripturl?num=$mnum/$i#$i">$endpage</a>~;
			$pages = qq~<br /><span class="small">&#171; $messageindex_txt{'139'} $pages <a href="$scripturl?num=$mnum;start=all">$pidtxt{'01'}</a> &#187;</span>~;
		} elsif( $mreplies+1 > $maxmessagedisplay ) {
			$tmpa = 1;
			for( $tmpb = 0; $tmpb < $mreplies+1; $tmpb += $maxmessagedisplay ) {
				$pages .= qq~<a href="$scripturl?num=$mnum/$tmpb#$tmpb">$tmpa</a>\n~;
				++$tmpa;
			}
			$pages =~ s/\n\Z//;
			$pages = qq~<br /><span class="small">&#171; $messageindex_txt{'139'} $pages <a href="$scripturl?num=$mnum;start=all">$pidtxt{'01'}</a> &#187;</span>~;
		}

		&MessageTotals("load",$mnum);
		$views = ${$mnum}{'views'};
		$lastposter = ${$mnum}{'lastposter'};
		if( $lastposter =~ m~\AGuest-(.*)~ ) {
			$lastposter = $1;
		}
		else {
			&LoadUser($lastposter);
			$registrationdate = ${$uid.$lastposter}{'regtime'};

# No Need to open every threadid.txt file Just to get the messagedate
# This is now stored in the .ctb files, that are opened anyway!
#			fopen (MNUM, "$datadir/$mnum.txt");
#			@threadlist = <MNUM>;
#			(undef, undef, undef, $messagedate, undef) =  split(/\|/, $threadlist[$mreplies],5);
#			fclose (MNUM);

			$messagedate = ${$mnum}{'lastpostdate'};

			if((${$uid.$lastposter}{'regdate'} && $messagedate > $registrationdate) || ${$uid.$lastposter}{'position'} eq "Administrator" || ${$uid.$lastposter}{'position'} eq "Global Moderator") { $lastposter = qq~<a ealname'}</a>~; }
			else { $lastposter .= qq~ - $messageindex_txt{'470a'}~; }
		}
		$lastpostername = $lastposter || $messageindex_txt{'470'};
		$views = $views ? $views - 1 : 0;
	###Start Sticky Group mod
	if(($stkynum && ($counter >= $stkynum)) && ($stkyshowed < 1)){
		$nonstickyheader =~ s/<yabb colspan>/$colspan/g;
		$tmptempbar .= $nonstickyheader;
		$stkyshowed = 1;
	}
	###End Sticky Group mod

	# Print the thread info.
	$mydate = &timeformat($mdate);
if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1){
	if ($currentboard ne $annboard && $counter<@anns) {
		$adminbar = qq~&nbsp;~;
 	} else {
		$adminbar = qq~
		<input type="checkbox" name="lockadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
		<input type="checkbox" name="stickadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
		<input type="checkbox" name="moveadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
		<input type="checkbox" name="deleteadmin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />
		  ~;
	}
	$admincol = $admincolumn;
	$admincol =~ s/<yabb admin>/$adminbar/g;
}
elsif ((($iamadmin && $adminview == 2) || ($iamgmod && $gmodview == 2) || ($iammod && $modview == 2 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1){
	if ($currentboard ne $annboard && $counter<@anns) {
		$adminbar = qq~&nbsp;~;
 	} else {
		$adminbar = qq~<input type="checkbox" name="admin$mcount" class="windowbg" style="border: 0px;" value="$mnum" />~;
	}
	$admincol = $admincolumn;
	$admincol =~ s/<yabb admin>/$adminbar/g;
}
elsif ((($iamadmin && $adminview == 1) || ($iamgmod && $gmodview == 1) || ($iammod && $modview == 1 && !$iamadmin && !$iamgmod)) && $sessionvalid == 1){
	if ($currentboard ne $annboard && $counter<@anns) {
		$adminbar = qq~&nbsp;~;
 	} else {
		$adminbar = qq~
		<a href="$scripturl?action=lock;thread=$mnum"><img src="$imagesdir/locked.gif" alt="$messageindex_txt{'104'}" border="0" /></a>&nbsp;
		<a href="$scripturl?action=sticky;thread=$mnum"><img src="$imagesdir/sticky.gif" alt="$messageindex_txt{'781'}" border="0" /></a>&nbsp;
		<a href="$scripturl?action=movethread;thread=$mnum"><img src="$imagesdir/admin_move.gif" alt="$messageindex_txt{'132'}" border="0" /></a>&nbsp;
		<a href="$scripturl?action=removethread;thread=$mnum" onclick="return confirm('$messageindex_txt{'162'}')"><img src="$imagesdir/admin_rem.gif" alt="$messageindex_txt{'54'}" border="0" /></a>
		  ~;
	}
	$admincol = $admincolumn;
	$admincol =~ s/<yabb admin>/$adminbar/g;
}
	my $threadpic = qq~<img src="$imagesdir/$threadclass.gif" alt=""/>~;
	my $msublink = qq~<a href="$scripturl?num=$mnum">$msub</a>$stickdir~;
	my $lastpostlink = qq~<a href="$scripturl?num=$mnum/$mreplies#$mreplies">$img{'lastpost'}$mydate</a>~;
	my $tempbar = $threadbar;

	$tempbar =~ s/<yabb admin column>/$admincol/g;
	$tempbar =~ s/<yabb threadpic>/$threadpic/g;
	$tempbar =~ s/<yabb icon>/$micon/g;
	$tempbar =~ s/<yabb new>/$new/g;
	$tempbar =~ s/<yabb poll>/$mpoll/g;
	$tempbar =~ s/<yabb favorite>/$favicon{$mnum}/g;
	$tempbar =~ s/<yabb subjectlink>/$msublink/g;
	$tempbar =~ s/<yabb pages>/$pages/g;
	$tempbar =~ s/<yabb starter>/$mname/g;
	$tempbar =~ s/<yabb replies>/$mreplies/g;
	$tempbar =~ s/<yabb views>/$views/g;
	$tempbar =~ s/<yabb lastpostlink>/$lastpostlink/g;
	$tempbar =~ s/<yabb lastposter>/$lastpostername/g;
	$tempbar =~ s/<yabb replies>/$mreplies/g;
	$tempbar =~ s/<yabb favorite>/$favicon{$mnum}/g;
	$tmptempbar .= $tempbar;
		++$counter;
		$mcount++;
	}

	my $multiview=0;
	my $tmptempfooter;
	if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3)) && $sessionvalid == 1){ $multiview=3; }
	elsif ((($iamadmin && $adminview == 2) || ($iamgmod && $gmodview == 2) || ($iammod && $modview == 2)) && $sessionvalid == 1){ $multiview=2; }

	if ($multiview>=2) {
		while (($catid, $listboards) = each(%cat)){
			(@bdlist) = split(/\,/, $listboards);
			($catname, $catperms) = split(/\|/, $catinfo{"$catid"});
			$cataccess = &CatAccess($catperms);
			#  if (!$iamadmin && $cataccess ne "granted" && $catperms ne ""){next;}
			if (!$cataccess){next;}

			foreach $curboard (@bdlist) {
				($curboardname, $curboardperms, $curboardview) = split(/\|/, $board{"$curboard"});
				&ToChars($curboardname);
				my $access = &AccessCheck($curboard, '', $curboardperms);
				#   if (!$iamadmin && $access ne "granted" &&  $curboardview != 1) {next;}
				if (!$access &&  $curboardview != 1) {next;}

				if($currentboard ne $curboard) {
					$boardlist .= "<option value=\"$curboard\">$curboardname</option>";
				}
			}
		}
		if ($multiview eq '3') {
			$tempfooter = $subfooterbar;
			$adminselector = qq~
				$messageindex_txt{'133'}: <select name="toboard">$boardlist</select><input type="submit" value="$messageindex_txt{'462'}" />
			~;
			$admincheckboxes = qq~
				<input type="checkbox" name="lockall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(1); else uncheckAll(1);" />
				<input type="checkbox" name="stickall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(2); else uncheckAll(2);" />
				<input type="checkbox" name="moveall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(3); else uncheckAll(3);" />
				<input type="checkbox" name="deleteall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(4); else uncheckAll(4);" />
				<input type="hidden" name="fromboard" value="$currentboard" />
			~;
			$tempfooter =~ s/<yabb admin selector>/$adminselector/g;
			$tempfooter =~ s/<yabb admin checkboxes>/$admincheckboxes/g;
		} elsif ($multiview eq '2') {
			$tempfooter = $subfooterbar;
			$adminselector = qq~
				<input type="radio" name="action" value="lock" class="titlebg" style="border: 0px;" checked="checked" /> $messageindex_txt{'104'}
				<input type="radio" name="action" value="stick" class="titlebg" style="border: 0px;" /> $messageindex_txt{'781'}
				<input type="radio" name="action" value="delete" class="titlebg" style="border: 0px;" /> $messageindex_txt{'31'}
				<input type="radio" name="action" value="move" class="titlebg" style="border: 0px;" /> $messageindex_txt{'133'}: <select name="toboard">$boardlist</select>
				<input type="hidden" name="fromboard" value="$currentboard" />
				<input type="submit" value="$messageindex_txt{'462'}" />
			~;
			$admincheckboxes = qq~
				<input type="checkbox" name="checkall" value="" class="titlebg" style="border: 0px;" onclick="if (this.checked) checkAll(0); else uncheckAll(0);" />
			~;
			$tempfooter =~ s/<yabb admin selector>/$adminselector/g;
			$tempfooter =~ s/<yabb admin checkboxes>/$admincheckboxes/g;
		}
	}
	$tmptempfooter .= $tempfooter;
&jumpto;

$yabbicons =qq~
	<img src="$imagesdir/thread.gif" alt="" /> $messageindex_txt{'457'}<br />
	<img src="$imagesdir/hotthread.gif" alt="" /> $messageindex_txt{'454'} $HotTopic $messageindex_txt{'454a'}<br />
	<img src="$imagesdir/veryhotthread.gif" alt="" /> $messageindex_txt{'455'} $VeryHotTopic $messageindex_txt{'454a'}<br />
	<img src="$imagesdir/locked.gif" alt="" /> $messageindex_txt{'456'}
~;
if (($iamadmin || $iamgmod  || $iammod) && $sessionvalid == 1 ) {
	$yabbadminicons =qq~<img src="$imagesdir/hide.gif" alt="" /> $messageindex_txt{'458'}<br />~;
}
$yabbadminicons .=qq~
	<img src="$imagesdir/announcement.gif" alt="" /> $messageindex_txt{'779a'}<br />
	<img src="$imagesdir/sticky.gif" alt="" /> $messageindex_txt{'779'}<br />
	<img src="$imagesdir/stickylock.gif" alt="" /> $messageindex_txt{'780'}
~;
&LoadAccess;


#template it

	$messageindex_template =~ s/<yabb home>/$homelink/g;
	$messageindex_template =~ s/<yabb category>/$catlink/g;
	$messageindex_template =~ s/<yabb board>/$boardlink/g;
	$messageindex_template =~ s/<yabb moderators>/$modslink$showmodgroups/g;
	if($ShowBDescrip && $bdescrip ne "") {
		&ToChars($bdescrip);
		$boarddescription =~ s/<yabb boarddescription>/$bdescrip/g;
		$messageindex_template =~ s/<yabb description>/$boarddescription/g;
	}
	else {
		$messageindex_template =~ s/<yabb description>//g;
	}
	$messageindex_template =~ s/<yabb colspan>/$colspan/g;

	$topichandellist =~ s/<yabb notify button>/$notify_board/g;
	$topichandellist =~ s/<yabb markall button>/$markalllink/g;
	$topichandellist =~ s/<yabb new post button>/$postlink/g;
	$topichandellist =~ s/<yabb new poll button>/$polllink/g;
	$topichandellist =~ s/\Q$menusep//i;
	$messageindex_template =~ s/<yabb topichandellist>/$topichandellist/g;

	$messageindex_template =~ s/<yabb pageindex top>/$pageindex1/g;
	$messageindex_template =~ s/<yabb pageindex bottom>/$pageindex2/g;

	if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3)) && $sessionvalid == 1){

	$messageindex_template =~ s/<yabb admin column>/$adminheader/g;

	} elsif ((($iamadmin && $adminview != 0) || ($iamgmod && $gmodview != 0) || ($iammod && $modview != 0)) && $sessionvalid == 1){
	$messageindex_template =~ s/<yabb admin column>/$adminheader/g;
	} else { $messageindex_template =~ s/<yabb admin column>//g; }

	if ((($iamadmin && $adminview >= 2) || ($iamgmod && $gmodview >= 2) || ($iammod && $modview >= 2)) && $sessionvalid == 1){
		$formstart = qq~<form name="multiadmin" action="$scripturl?board=$currentboard;action=multiadmin" method="post" style="display: inline">~;
		$formend = qq~<input type="hidden" name="allpost" value="$INFO{'start'}" /></form>~;
		$messageindex_template =~ s/<yabb modupdate>/$formstart/g;
		$messageindex_template =~ s/<yabb modupdateend>/$formend/g;
	}
	else {
		$messageindex_template =~ s/<yabb modupdate>//g;
		$messageindex_template =~ s/<yabb modupdateend>//g;
	}
	if($tmpstickyheader) {
		$messageindex_template =~ s/<yabb stickyblock>/$tmpstickyheader/g;
	}
	else {
		$messageindex_template =~ s/<yabb stickyblock>//g;
	}
	$messageindex_template =~ s/<yabb threadblock>/$tmptempbar/g;
	if($tmptempfooter) {
		$messageindex_template =~ s/<yabb adminfooter>/$tmptempfooter/g;
	}
	else {
		$messageindex_template =~ s/<yabb adminfooter>//g;
	}
	$messageindex_template =~ s/<yabb forumjump>/$selecthtml/g;
	$messageindex_template =~ s/<yabb icons>/$yabbicons/g;
	$messageindex_template =~ s/<yabb admin icons>/$yabbadminicons/g;
	$messageindex_template =~ s/<yabb access>/$accesses/g;
	$yymain .= qq~
	$messageindex_template
	$pageindexjs
	~;

	if ((($iamadmin && $adminview >= 2) || ($iamgmod && $gmodview >= 2) || ($iammod && $modview >= 2)) && $sessionvalid == 1) {
		if ((($iamadmin && $adminview == 3) || ($iamgmod && $gmodview == 3) || ($iammod && $modview == 3)) && $sessionvalid == 1) { $offset="7"; }
		else { $offset="8"; }
		if ($sessionvalid == 1){
			$yymain .= qq~
<script language="JavaScript1.2" type="text/javascript">
	<!-- Begin
		function checkAll(j) {
			  for (var i = 0; i < document.multiadmin.elements.length - $offset; i++) {
				  if(document.multiadmin.elements[i].name != "subfield" && document.multiadmin.elements[i].name != "msgfield") {
					if (j == 0 ) {document.multiadmin.elements[i].checked = true;}
					if (j != 0 && (i % 4) == (j - 1))  {document.multiadmin.elements[i].checked = true;}
			    }
			  }
		}
		function uncheckAll(j) {
			  for (var i = 0; i < document.multiadmin.elements.length - $offset; i++) {
				  if(document.multiadmin.elements[i].name != "subfield" && document.multiadmin.elements[i].name != "msgfield") {
					if (j == 0 ) {document.multiadmin.elements[i].checked = false;}
					if (j != 0 && (i % 4) == (j - 1))  {document.multiadmin.elements[i].checked = false;}
			    }
			  }
		}
	//-->
</script>
			~;
		}
	}

### Quick Reply Box ###
LoadLanguage("Post");
	# MBCO2 Post access check
	if ($start_users{$currentboard} || $start_groups{$currentboard}) {
		my $access = &AccessCheck($currentboard, 1) || "";
		if ($access eq "denied") {$enable_quickpost = 0;}
	}

	if ($username ne "Guest" && $enable_quickpost == 1) {
$yymain .= qq~
<script language="JavaScript1.2" src="$ubbcjspath" type="text/javascript"></script>
<form action="$scripturl?board=$currentboard;action=post2" method="post" name="postmodify" onsubmit="postmodify.post.disabled=true; postmodify.clear.disabled=true;">
<input type="hidden" name="threadid" value="">
<input type="hidden" name="icon" value="xx">
<table border=0 width="80%" cellspacing="1" cellpadding="4" bgcolor="$color{'bordercolor'}" class="bordercolor" align="center">
  <tr>
    <td align="center" class="titlebg" bgcolor="$color{'titlebg'}"><font size="2" class="text1" color="$color{'titletext'}"><b>$qrb_txt{'1'}</b></font></td>
  </tr>
  <tr>
    <td class="windowbg2" bgcolor="$color{'windowbg2'}">
	<table width="100%" cellpadding="4" cellspacing="0">
	  <tr>
	    <td valign="top" width="23%"><font size="2"><b>$post_txt{'70'}:</b></font></td>
	    <td><font size="2"><input type="text" name="subject" value="" size="40" style="width:100%"></td>
	  </tr>~;
		if ($enable_quicksmilies == 1) {
			if ($smiliestyle eq 1){$smiliewinlink = "$scripturl?action=smilieput";} else { $smiliewinlink = "$scripturl?action=smilieindex";}
			$moresmilieslist = "";
			$more_smilie_array = "";
			$i=0;
			if ($showadded eq 1){ # show added smilies on smiley bar
				while($SmilieURL[$i]) {
					if ($SmilieURL[$i]=~ /\//i) {$tmpurl = $SmilieURL[$i];} else {$tmpurl = qq~$defaultimagesdir/$SmilieURL[$i]~;}
					$moresmilieslist .= qq~	document.write("<img src='$tmpurl' align='bottom' alt="+'"'+"$SmilieDescription[$i]"+'"'+" border='0' onclick='javascript:MoreSmilies($i)' style='cursor:hand'>$SmilieLinebreak[$i] ");\n~;
					$tmpcode = $SmilieCode[$i];
					$tmpcode =~ s/\&quot;/"+'"'+"/g;
					&FromHTML($tmpcode);
					$tmpcode =~ s/&#36;/\$/g;
					$tmpcode =~ s/&#64;/\@/g;
					$more_smilie_array .= qq~" $tmpcode", ~;
					$i++;
				}
			}
			if ($showsmdir eq 1){ # show auto smilies on smiley bar
				opendir(DIR, "$smiliesdir");
				@contents = readdir(DIR);
				closedir(DIR);
				foreach $line (sort {uc($a) cmp uc($b)} @contents){
					($name, $extension) = split (/\./, $line);
					if ($extension =~ /gif/i || $extension =~ /jpg/i || $extension =~ /jpeg/i || $extension =~ /png/i ){
						if ($line !~ /banner/i) {
							$moresmilieslist .= qq~	document.write("<img src='$smiliesurl/$line' align='bottom' alt='$name' border='0' onclick='javascript:MoreSmilies($i)' style='cursor:hand'> ");\n~;
							$more_smilie_array .= qq~" [smiley=$line]", ~;
							$i++
						}
					}
				}
			}
			$more_smilie_array .= qq~""~;
			$yymain .= qq~
				  <tr><td valign="top" width="23%">&nbsp;</td>
			<td><table><tr><td>
			<script language="JavaScript1.2" type="text/javascript">
			document.write("<img src='$defaultimagesdir/url.gif' onclick='hyperlink();' align=top width=23 height=22 alt='$post_txt{'257'}' title='$post_txt{'257'}' border='0'>");
			document.write("<img src='$defaultimagesdir/ftp.gif' onclick='ftp();' align=top width=23 height=22 alt='$post_txt{'434'}' title='$post_txt{'434'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/img.gif' onclick='image();' align=top width=23 height=22 alt='$post_txt{'435'}' title='$post_txt{'435'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/email2.gif' onclick='emai1();' align=top width=23 height=22 alt='$post_txt{'258'}' title='$post_txt{'258'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/flash.gif' onclick='flash();' align=top width=23 height=22 alt='$post_txt{'433'}' title='$post_txt{'433'}' border='0'>");
		  document.write("<img src='$defaultimagesdir/table.gif' onclick='table();' align=top width=23 height=22 alt='$post_txt{'436'}' title='$post_txt{'436'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/tr.gif' onclick='trow();' align=top width=23 height=22 alt='$post_txt{'449'}' title='$post_txt{'449'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/td.gif' onclick='tcol();' align=top width=23 height=22 alt='$post_txt{'437'}' title='$post_txt{'437'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/hr.gif' onclick='hr();' align=top width=23 height=22 alt='$post_txt{'531'}' title='$post_txt{'531'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/tele.gif' onclick='teletype();' align=top width=23 height=22 alt='$post_txt{'440'}' title='$post_txt{'440'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/code.gif' onclick='showcode();' align=top width=23 height=22 alt='$post_txt{'259'}' title='$post_txt{'259'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/quote2.gif' onclick='quote();' align=top width=23 height=22 alt='$post_txt{'260'}' title='$post_txt{'260'}' border='0'>");
		  document.write("<img src='$defaultimagesdir/sup.gif' onclick='superscript();' align=top width=23 height=22 alt='$post_txt{'447'}' title='$post_txt{'447'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/sub.gif' onclick='subscript();' align=top width=23 height=22 alt='$post_txt{'448'}' title='$post_txt{'448'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/move.gif' onclick='move();' align=top width=23 height=22 alt='$post_txt{'439'}' title='$post_txt{'439'}' border='0'></b><br />");
		  document.write("<img src='$defaultimagesdir/bold.gif' onclick='bold();' align=top width=23 height=22 alt='$post_txt{'253'}' title='$post_txt{'253'}' border=0>");
	    document.write("<img src='$defaultimagesdir/italicize.gif' onclick='italicize();' align=top width=23 height=22 alt='$post_txt{'254'}' title='$post_txt{'254'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/underline.gif' onclick='underline();' align=top width=23 height=22 alt='$post_txt{'255'}' title='$post_txt{'255'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/strike.gif' onclick='strike();' align=top width=23 height=22 alt='$post_txt{'441'}' title='$post_txt{'441'}' border='0'>");
		  document.write('<select name="fontface" id="fontface" onchange="if(this.options[this.selectedIndex].value) fontfce(this.options[this.selectedIndex].value);" style="width: 93px; margin-top: 2px; margin-left: 2px; margin-right: 1px; font-size: 9px;">');
	    document.write('<option value="">Verdana</option>');
	    document.write('<option value="">-----</option>');
		  document.write('<option value="Sans-Serif" style="font-family: Sans-Serif">Sans-Serif</option>');
	    document.write('<option value="Verdana" style="font-family: Verdana" selected="selected">Verdana</option>');
		  document.write('<option value="Arial" style="font-family: Arial">Arial</option>');
		  document.write('<option value="Serif" style="font-family: Serif">Serif</option>');
	    document.write('<option value="Courier" style="font-family: Courier">Courier</option>');
	    document.write('<option value="Courier New" style="font-family: Courier New">Courier New</option>');
		  document.write('<option value="Fantasy" style="font-family: Fantasy">Fantasy</option>');
		  document.write('<option value="monospace" style="font-family: monospace">Monospace</option>');
	    document.write('</select>');
	    document.write('<select name="fontsize" id="fontsize" onchange="if(this.options[this.selectedIndex].value) fntsize(this.options[this.selectedIndex].value);" style="width: 39px; margin-top: 2px; margin-left: 1px; margin-right: 2px; font-size: 9px;">');
	    document.write('<option value="">11</option>');
	    document.write('<option value="">--</option>');
	    document.write('<option value="6">6</option>');
	    document.write('<option value="7">7</option>');
	    document.write('<option value="8">8</option>');
	    document.write('<option value="9">9</option>');
	    document.write('<option value="10">10</option>');
	    document.write('<option value="11" selected="selected">11</option>');
	    document.write('<option value="12">12</option>');
	    document.write('<option value="14">14</option>');
	    document.write('<option value="16">16</option>');
	    document.write('<option value="18">18</option>');
	    document.write('<option value="20">20</option>');
	    document.write('<option value="22">22</option>');
	    document.write('<option value="24">24</option>');
	    document.write('<option value="36">36</option>');
	    document.write('<option value="48">48</option>');
	    document.write('<option value="56">56</option>');
	    document.write('<option value="72">72</option>');
	    document.write('</select>');
		  document.write("<img src='$defaultimagesdir/pre.gif' onclick='pre();' align=top width=23 height=22 alt='$post_txt{'444'}' title='$post_txt{'444'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/left.gif' onclick='left();' align=top width=23 height=22 alt='$post_txt{'445'}' title='$post_txt{'445'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/center.gif' onclick='center();' align=top width=23 height=22 alt='$post_txt{'256'}' title='$post_txt{'256'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/right.gif' onclick='right();' align=top width=23 height=22 alt='$post_txt{'446'}' title='$post_txt{'446'}' border='0'>");
	    document.write("<img src='$defaultimagesdir/list.gif' onclick='list();' align=top width=23 height=22 alt='$post_txt{'261'}' title='$post_txt{'261'}' border='0'>");
	    document.write("</td><td>");
	    img1 = new Image();
	    img1.src = "$defaultimagesdir/palette.gif";
		 		   </script>

	  <div style="height: 42px; width: 86px; overflow: auto; border: 1px; border-style: outset; float: right;">
	  ~;
	  for($z=0; $z<256; $z+=51) {
	    $c3 = sprintf ("%02x", $z);
	    for($y=0; $y<256; $y+=51) {
		$c2 = sprintf ("%02x", $y);
		for($x=0; $x<256; $x+=51) {
		  $c1 = sprintf ("%02x", $x);
		  $selcolor = qq~#$c1$c2$c3~;
if($ENV{'HTTP_USER_AGENT'} =~ /Safari/) {$yymain .= qq~<span style="background-color: $selcolor; width: 11px; height: 11px;"><img src="$defaultimagesdir/palette.gif" border="0" hspace="0" vspace="0" alt="" style="height: 11px; width: 11px; margin: 0px;" onclick="showcolor('$selcolor')" /></span>~;}
else {$yymain .= qq~<span style="float: left; background-color: $selcolor; width: 9px; height: 9px; border: 1px outset; font-size: 5px;" onclick="showcolor('$selcolor')">&nbsp;</span>~;}
		}
if($ENV{'HTTP_USER_AGENT'} =~ /Safari/) {$yymain .= qq~<br />~;}
	    }
	  }
	  $yymain .= qq~
	  </div>
	  </td></tr></table>

	    </td>
	  </tr>
<tr>
	    <td valign="top" width="23%"><font size="2"><b>$post_txt{'297'}:</b></font></td>
	    <td valign="middle">
	    <script language="JavaScript1.2" type="text/javascript">
	    <!--
		moresmiliecode = new Array($more_smilie_array)

		function MoreSmilies(i) {
		  AddTxt=moresmiliecode[i];
		  AddText(AddTxt);
		}

		function smiliewin() {
		  window.open("$smiliewinlink", 'list', 'width=$winwidth,height=$winheight, scrollbars=yes');
		}

		if((navigator.appName == "Netscape" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.charAt(0) >= 4) || (navigator.appName == "Opera" && navigator.appVersion.charAt(0) >= 4)) {
		  document.write("<img style='cursor:hand' onclick='javascript:smiley()' src='$defaultimagesdir/smiley.gif' align='bottom' alt='$post_txt{'287'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:wink()' src='$defaultimagesdir/wink.gif' align='bottom' alt='$post_txt{'292'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:cheesy()' src='$defaultimagesdir/cheesy.gif' align='bottom' alt='$post_txt{'289'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:grin()' src='$defaultimagesdir/grin.gif' align='bottom' alt='$post_txt{'293'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:angry()' src='$defaultimagesdir/angry.gif' align='bottom' alt='$post_txt{'288'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:sad()' src='$defaultimagesdir/sad.gif' align='bottom' alt='$post_txt{'291'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:shocked()' src='$defaultimagesdir/shocked.gif' align='bottom' alt='$post_txt{'294'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:cool()' src='$defaultimagesdir/cool.gif' align='bottom' alt='$post_txt{'295'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:huh()' src='$defaultimagesdir/huh.gif' align='bottom' alt='$post_txt{'296'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:rolleyes()' src='$defaultimagesdir/rolleyes.gif' align='bottom' alt='$post_txt{'450'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:tongue()' src='$defaultimagesdir/tongue.gif' align='bottom' alt='$post_txt{'451'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:embarassed()' src='$defaultimagesdir/embarassed.gif' align='bottom' alt='$post_txt{'526'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:lipsrsealed()' src='$defaultimagesdir/lipsrsealed.gif' align='bottom' alt='$post_txt{'527'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:undecided()' src='$defaultimagesdir/undecided.gif' align='bottom' alt='$post_txt{'528'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:kiss()' src='$defaultimagesdir/kiss.gif' align='bottom' alt='$post_txt{'529'}' border='0'> ");
		  document.write("<img style='cursor:hand' onclick='javascript:cry()' src='$defaultimagesdir/cry.gif' align='bottom' alt='$post_txt{'530'}' border='0'> ");
$moresmilieslist
		}
		else { document.write("<font size='1'>$post_txt{'215'}</font>"); }
	    //-->
	    </script>~;
		if ($showadded == 3 || ($showadded == 2 && $detachblock == 1) || $showsmdir == 3 || ($showsmdir == 2 && $detachblock == 1)){
			$yymain .= qq~
	    <a href=javascript:smiliewin()>$smiltxt{'1'}</a>~;
		}
		$yymain .= qq~
	    <noscript>
		<font size="1">$post_txt{'215'}</font>
	    </noscript>
	    </td>
	  </tr>~;
		}
	$yymain .= qq~
	  <tr>
	    <td valign="top" width="23%"><font size="2"><b>$post_txt{'72'}:</b></font></td>
	    <td><textarea name="message" rows="5" cols="60" wrap="soft" ONCLICK="javascript:storeCaret(this);" ONKEYUP="javascript:storeCaret(this);" ONCHANGE="javascript:storeCaret(this);" style="width:100%"></textarea></td>
	  </tr>
	</table>
    </td>
  </tr>
  <tr>
    <td align="center" class="catbg" bgcolor="$color{'catbg'}"><input type="submit" name="post" value="$post_txt{'105'}" accesskey="s"> &nbsp; <input type="reset" name="clear" value="$post_txt{'278'}" accesskey="r"></td>
  </tr>
</table>
</form>
~;
	}

### Quick Reply Box ###

	$yytitle = $boardname;
	&template;
	exit;
}

sub MarkRead {
	# Mark all threads in this board as read.
	&dumplog("$currentboard--mark");
	$yySetLocation = qq~$scripturl?board=$currentboard~;
	&redirectexit;
}

sub ListPages {
	my $testthread = $INFO{'num'};
	$mreplies = ${$testthread}{'replies'};
	$mviews = ${$testthread}{'views'};
	$lastposter = ${$testthread}{'lastposter'};
	$tmpa = 1;
	for( $tmpb = 0; $tmpb < $mreplies; $tmpb += $maxmessagedisplay ) {
		$pages .= qq~<a href="$scripturl?num=$INFO{'num'}/$tmpb#$tmpb">$tmpa</a>\n~;
		++$tmpa;
	}
	$pages =~ s/\n\Z//;
	$yymain = qq~<p align="center">&#171; $messageindex_txt{'139'} $pages &#187;</p><br />~;
	$yytitle = "$messageindex_txt{'139'} $messageindex_txt{'18'}";
	&template;
}

sub MessagePageindex {
	my($msindx, $trindx, $mbindx);
	($msindx, $trindx, $mbindx) = split(/\|/, ${$uid.$username}{'pageindex'});
	if($INFO{'action'} eq "messagepagedrop") {
		${$uid.$username}{'pageindex'} = qq~0|$trindx|$mbindx~;
	}
	if($INFO{'action'} eq "messagepagetext") {
		${$uid.$username}{'pageindex'} = qq~1|$trindx|$mbindx~;
	}
	&UserAccount($username,"update");
	&redirectinternal;
	exit;
}

1;

 

  

greetings
Jeff
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #16 - Jun 24th, 2005 at 10:12pm
Print Post  
Also make sure "admin" is not listed as one of the moderators of the Global Announcements board.
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #17 - Jun 24th, 2005 at 10:23pm
Print Post  
I have test it. Administrator have only arrows in Sticky.
Only Global moderator have arrow in sticky and in Global ANnouncements. Moderator is normal without arrows.

I think. Administrator and Global Moderator have in sticky and in Global ANnouncements arrows.
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #18 - Jun 24th, 2005 at 10:25pm
Print Post  
You could try replacing the folowing code in MessageIndex.pl
Code
Select All
unless ($iammod) {if ($threadclass eq "announcement"){$stickdir = qq~&nbsp;&nbsp;<a ldboard=$currentboard;"><font size="3"><b>&uarr;</b></font></a><a ;oldboard=$currentboard;"><font size="3"><b>&darr;</b></font> </a>~;}}} 



with

Code
Select All
elsif (($threadclass eq "announcement") && ($iamadmin || $iamgmod)){$stickdir = qq~&nbsp;&nbsp;<a href="$scripturl?action=rearrsticky;board=announcements;num=$mnum;direct ion=up;oldboard=$currentboard;"><font size="3"><b>&uarr;</b></font></a><a href="$scripturl?action=rearrsticky;board=announcements;num=$mnum;direct ion=down;oldboard=$currentboard;"><font size="3"><b>&darr;</b></font> </a>~;}} 

  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #19 - Jun 24th, 2005 at 10:34pm
Print Post  
thnx works now for Administrator

i have one suggestion. I think arrows look like beter on the right side.
  

stickyarrow.jpg ( 7 KB | Downloads )
stickyarrow.jpg

greetings
Jeff
Back to top
WWW  
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #20 - Jun 24th, 2005 at 10:36pm
Print Post  
here a screenshot of sticky sort in yabb 1.4.
  

stickyarrow2.JPG ( 14 KB | Downloads )
stickyarrow2.JPG

greetings
Jeff
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #21 - Jun 24th, 2005 at 10:37pm
Print Post  
Jeff wrote on Jun 24th, 2005 at 10:34pm:
thnx works now for Administrator

i have one suggestion. I think arrows look like beter on the right side.

Yeah, me too.  I've tried doing it without busting out the tables or making the threads get bigger, without success.  But I am still working on that part.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.1  YaBB2
Reply #22 - Jun 24th, 2005 at 10:40pm
Print Post  
ok. I have to sleep now.

You have made some good usefully mods.  8)
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.2  YaBB2
Reply #23 - Jun 25th, 2005 at 7:34am
Print Post  
Hi
i got this error, if I want sort Global ANnouncements. Because i haven't this file.

Code
Select All
An Error Has Occurred!

300 An Error Has Occurred!: Unable to open announcements.txt 



Edit:

I have renamend my Global ANnouncements Board the ID to announcements.
I think it would beter, it sorted by id in Gloabal ANnouncements.
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.2  YaBB2
Reply #24 - Jun 25th, 2005 at 11:27am
Print Post  
Jeff wrote on Jun 25th, 2005 at 7:34am:
Hi
i got this error, if I want sort Global ANnouncements. Because i haven't this file.

Code
Select All
An Error Has Occurred!

300 An Error Has Occurred!: Unable to open announcements.txt 



Edit:

I have renamend my Global ANnouncements Board the ID to announcements.
I think it would beter, it sorted by id in Gloabal ANnouncements.


In MessgaeIndex.pl, replace the word "announcements" in two places in the following line of code with the name of the files that holds your global announcemts

Code
Select All
elsif (($threadclass eq "announcement") && ($iamadmin || $iamgmod)){$stickdir = qq~&nbsp;&nbsp;<a ldboard=$currentboard;"><font size="3"><b>&uarr;</b></font></a><a ;oldboard=$currentboard;"><font size="3"><b>&darr;</b></font> </a>~;}}  



I see your unique problem, but also see it be a bigger problem to, I will see if there is a place in YaBB2 that designates the file as the global announcement board.

Thanks for bringing this up.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.2  YaBB2
Reply #25 - Jun 25th, 2005 at 11:41am
Print Post  
Hi
thnx for reply.

i had my id news in Gloabal ANnouncement. That I have to change to announcements for working.

I ll wait for your next release.  Wink
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.2  YaBB2
Reply #26 - Jun 25th, 2005 at 8:35pm
Print Post  
Jeff wrote on Jun 25th, 2005 at 11:41am:
Hi
thnx for reply.

i had my id news in Gloabal ANnouncement. That I have to change to announcements for working.

I ll wait for your next release.  Wink

I'm not following you.  what is the name of the file where you are storing your global announcements?
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.2  YaBB2
Reply #27 - Jun 25th, 2005 at 8:49pm
Print Post  
Hi
my Gloabal ANnouncement board id is news. But in your mod is announcements.  Wink

  

greetings
Jeff
Back to top
WWW  
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.3  YaBB2
Reply #28 - Jun 25th, 2005 at 8:58pm
Print Post  
Okay made a small change in the mod, but warranted a 1.3 ver.

If you don't want to remod, here is how you change things.

In MessageIndex.pl find this 

Code
Select All
elsif (($threadclass eq "announcement") && ($iamadmin || $iamgmod)){$stickdir = qq~&nbsp;&nbsp;<a ldboard=$currentboard;"><font size="3"><b>&uarr;</b></font></a><a ;oldboard=$currentboard;"><font size="3"><b>&darr;</b></font> </a>~;}} 



And replace with this

Code
Select All
elsif (($threadclass eq "announcement") && ($iamadmin || $iamgmod)){$stickdir = qq~&nbsp;&nbsp;<a ard=$currentboard;"><font size="3"><b>&uarr;</b></font></a><a board=$currentboard;"><font size="3"><b>&darr;</b></font> </a>~;}} 



This allows the mod to work even if your global announcements folder is not called "announcements."

Hope this is the last change needed.  Let me know.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
astropilot
God Member
*****
Offline



Posts: 828
Location: Louisville
Joined: Jun 18th, 2003
Gender: Male
Re: Sticky Shimmy Shuffle beta 1.3  YaBB2
Reply #29 - Jun 25th, 2005 at 9:05pm
Print Post  
Note:  This board is messing up the code such that there is a space between "=" and the word "up" and "down" in the replace code above.  Make sure to remove those spaces.

ap
  

"For I am not ashamed of the gospel of Christ..."
Romans 1:16
---
http://www.ssflynn.com
www.flynnfarmsofkentucky.com
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 4 ... 6
Send TopicPrint