View Single Post
  #455  
Old 09-08-2005, 04:00 PM
y2krazy y2krazy is offline
 
Join Date: Jun 2003
Location: Houston, Texas
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I changed the basic layout of the archive page and added a footer to the template, like I do with all the other hacks to make them look more streamlined with the forums. Screenshot is included.

Phrase Manager -> Add New Phrase
Varname: vbshout_footer
Text: Powered by <b>vBShout</b> v2.0 by <a href="http://www.infernotechnologies.net/" target="_blank">Zero Tolerance</a>

Style Manager -> Choose the Style to Edit -> "forumhome_vbshout_archive"
Replace entire template with:

Code:
<script type='text/javascript'>
<!--

postingShout = false

function _ShoutControl()
{
	this.shoutid      = -1
	this.active       = false
}

_ShoutControl.prototype.Delete = function (shoutid)
{
	if (!this.active)
	{
		if (confirm('Are you sure to want to delete this shout message?'))
		{
			return this.DoDelete(shoutid)
		}
	}

	return false
}

_ShoutControl.prototype.DoDelete = function (shoutid)
{
	this.active  = true
	this.shoutid = shoutid

	doDel = new vB_AJAX_Handler(true)
	doDel.onreadystatechange(DeleteDone)
	doDel.send('vbshout.php', 'do=deleteshout&id=' + this.shoutid)

	return false
}

_ShoutControl.prototype.Edit = function (shoutid)
{
	if (shoutid != this.shoutid)
	{
		if (this.active)
		{
			this.cancelActive(this.shoutid)
		}

		this.active       = true
		this.shoutid      = shoutid

		// Activate Editor
		fetch_object('shout_message_edit_' + this.shoutid).style.display  = ''
		fetch_object('shout_message_' + this.shoutid).style.display       = 'none'
	}
	
	return false
}

_ShoutControl.prototype.cancelActive = function (shoutid)
{
	// Deactivate Editor
	fetch_object('shout_message_edit_' + this.shoutid).style.display  = 'none'
	fetch_object('shout_message_' + this.shoutid).style.display       = ''
	return false
}

_ShoutControl.prototype.Save = function ()
{
	if (this.active)
	{
		doShout = new vB_AJAX_Handler(true)
		doShout.onreadystatechange(SaveDone)

		if (postingShout)
		{
			alert('Posting in progress..')
			return false
		}

		ShoutMsg = fetch_object('shout_message_editor_' + this.shoutid).value

		if (ShoutMsg.replace(/ /g, '') == '')
		{
			alert('You must enter a shout!')
			return false
		}

		doShout.send('vbshout.php', 'do=editshout&id=' + this.shoutid + '&shout=' + PHP.urlencode(ShoutMsg))
		postingShout = true
	}

	return false
}

Shout = new _ShoutControl

function SaveDone()
{
	if (doShout.handler.readyState == 4 && doShout.handler.status == 200)
	{
		postingShout  = false
		Shout.active  = false
		Shout.cancelActive(Shout.shoutid)
		fetch_object('shout_message_' + Shout.shoutid).innerHTML = doShout.handler.responseText
		Shout.shoutid = -1
	}
}

function DeleteDone()
{
	if (doDel.handler.readyState == 4 && doDel.handler.status == 200)
	{
		ShoutID       = Shout.shoutid
		postingShout  = false
		Shout.active  = false
		Shout.shoutid = -1

		if (doDel.handler.responseText == 'true')
		{
			fetch_object('shout_top_' + ShoutID).parentNode.removeChild(fetch_object('shout_top_' + ShoutID))
		}
	}
}

-->
</script>

<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
	<td width='175' valign='top'>
		<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="175" align="center">
		<thead>
		<tr>
			<td class="tcat">
				<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_vbshout_stat')"><img id="collapseimg_forumhome_vbshout_stat" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_vbshout_stat].gif" alt="" border="0" /></a>
				Statistics
			</td>
		</tr>
		</thead>
		<tbody id="collapseobj_forumhome_vbshout_stat" style="$vbcollapse[collapseobj_forumhome_vbshout_stat]">
		<tr>
			<td class="alt1" align="left">
				<span class="smallfont"><b>Total Shouts:</b> $TS</span>
			</td>
		</tr>
		<tr>
			<td class="alt1" align="left">
				<span class="smallfont"><b>Past 24 Hours:</b> $T4</span>		
			</td>
		</tr>
		<tr>
			<td class="alt1" align="left">
				<span class="smallfont"><b>Your Shouts:</b> $TY</span>
			</td>
		</tr>
		</tbody>
		</table>

		<br />

		<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="175" align="center">
		<thead>
		<tr>
			<td class="tcat">
				<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_vbshout_top')"><img id="collapseimg_forumhome_vbshout_top" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_vbshout_top].gif" alt="" border="0" /></a>
				Top 10 Shouters
			</td>
		</tr>
		</thead>
		<tbody id="collapseobj_forumhome_vbshout_stat" style="$vbcollapse[collapseobj_forumhome_vbshout_stat]">
		$TopTen
		</tbody>
		</table>
	</td>

<!-- Spacer Cell -->
<td width="15"><img alt="" src="$vboptions[bburl]/$vboptions[cleargifurl]" width="15" /></td>
<!-- / Spacer Cell -->

	<td width='100%' valign='top'>
		<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
		<tr>
			<td class="tcat" align="left">
				Shouts
			</td>
		</tr>
		$Output
		<tr>
			<td class="tcat" align="right"><span class="smallfont">$vbphrase[vbshout_footer]</span></td>
		</tr>
		</table>
	</td>
</tr>
</table>

$pagenav
Style Manager -> Choose the Style to Edit -> "forumhome_vbshout_archive_shout"
Replace entire template with:

Code:
<tbody id="shout_top_{$Shout['sid']}">
<tr>
			<td class="thead" align="left">
				<span style='float:right'>{$Shout['time']}</span>
				<a href="member.php?{$session['sessionurl_q']}u={$Shout['s_by']}">{$Shout['username']}</a>
			</td>
		</tr>
		<tr>
			<td class="alt1" width="1%" align="left" id="shout_{$Shout['sid']}">
				<if condition="$bbuserinfo[userid] == $Shout[s_by] OR can_moderate()">
					<span class="smallfont" style='float:right'>
						[<a href='#' onclick='return Shout.Edit({$Shout['sid']})'>Edit</a> | <a href='#' onclick='return Shout.Delete({$Shout['sid']})'>Delete</a>]
					</span>
				</if>
				<span class="smallfont" id="shout_message_edit_{$Shout['sid']}" style='display:none'><input type='text' id='shout_message_editor_{$Shout['sid']}' value='{$Shout['msg_safe']}' style="width: 50%" class="bginput" /> <input type='button' class='button' onclick='Shout.Save()' value='Save' /></span>
				<span class="smallfont" id="shout_message_{$Shout['sid']}">
				<if condition="!$Shout[s_me]">
					{$Shout['s_shout']}
				<else />
					<span class='highlight'>
						*{$Shout['username']} {$Shout['s_shout']}*
					</span>
				</if>
				</span>
			</td>
		</tr>
</tbody>
Style Manager -> Choose the Style to Edit -> "forumhome_vbshout_archive_topshouter"
Replace entire template with:

Code:
<tr>
			<td class="alt1" align="left">
				<span class="smallfont"><strong><a href="member.php?{$session['sessionurl_q']}u={$TTS['s_by']}">{$TTS['username']}</a>:</strong> {$TTS['TS']}</span>
			</td>
		</tr>
You can test the vBShout out yourself at my site if you wish, too(see my sig for a link).
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01147 seconds
  • Memory Usage 1,804KB
  • Queries Executed 11 (?)
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
  • (3)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_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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete