MyBB Hacks

Full Version: Tab Forum question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(06-05-2011 01:46 AM)bxx Wrote: [ -> ]1. Its at the moment working in the portal

(06-05-2011 01:46 AM)bxx Wrote: [ -> ]I want to include it into the Tabs.


If you able to make it works for index page, you can add it to the new tabs.
Ok i will work on it now.

I will reply later Wink

Hope i can tell the solution Smile
Now got it working on index with ProStats.

When i include the code from prostats

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

var spinner=null;

function prostats_reload()
{
	if(spinner){return false;}
	this.spinner = new ActivityIndicator("body", {image: "images/spinner_big.gif"});
	new Ajax.Request('xmlhttp.php?action=prostats_reload&my_post_key='+my_post_key, {method: 'post',postBody:"", onComplete:prostats_done});
	return false;
}

function prostats_done(request)
{
	if(this.spinner)
	{
		this.spinner.destroy();
		this.spinner = '';
	}
	if(request.responseText.match(/<error>(.*)<\/error>/))
	{
		message = request.responseText.match(/<error>(.*)<\/error>/);
		alert(message[1]);
	}
	else if(request.responseText)
	{
		$("prostats_table").innerHTML = request.responseText;
	}
}
-->
</script>



		<div id="prostats_table">

		<table width="100%" border="0" cellspacing="{$theme[borderwidth]}" cellpadding="0" class="tborder">
		<thead>
		<tr><td colspan="{$num_columns}">
			<table border="0" cellspacing="0" cellpadding="{$theme[tablespace]}" width="100%">
			<tr class="thead">
			<td><strong>{$lang->prostats_prostats}</strong></td>
			<td style="text-align:{$ps_ralign};"><a href="" onclick="return prostats_reload();">{$lang->prostats_reload} <img src="{$mybb->settings['bburl']}/images/prostats/ps_reload.gif" style="vertical-align:middle;" alt="" /></a></td>
			</tr>
			</table>
		</td>
		</tr>
		</thead>
		<tbody>
		{$trow_message_top}
		<tr valign="top">
		{$prostats_content}
		</tr>
		{$trow_message_down}
		</tbody>
		</table>
		<br />
                </div>



with:

PHP Code:
<div id="latest_posts" class="content"> ...</div>


nothing happens.


Also I testet with the global Tag of ProStats:

PHP Code:
<div id="latest_posts" class="content">
<ProStats>
</div>



Is there anything wrong in my thinking?

Post your current index template here.

Is this a ProStats template?
(06-05-2011 03:28 AM)bxx Wrote: [ -> ]

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

var spinner=null;

function prostats_reload()
{
	if(spinner){return false;}
	this.spinner = new ActivityIndicator("body", {image: "images/spinner_big.gif"});
	new Ajax.Request('xmlhttp.php?action=prostats_reload&my_post_key='+my_post_key, {method: 'post',postBody:"", onComplete:prostats_done});
	return false;
}

function prostats_done(request)
{
	if(this.spinner)
	{
		this.spinner.destroy();
		this.spinner = '';
	}
	if(request.responseText.match(/<error>(.*)<\/error>/))
	{
		message = request.responseText.match(/<error>(.*)<\/error>/);
		alert(message[1]);
	}
	else if(request.responseText)
	{
		$("prostats_table").innerHTML = request.responseText;
	}
}
-->
</script>



		<div id="prostats_table">

		<table width="100%" border="0" cellspacing="{$theme[borderwidth]}" cellpadding="0" class="tborder">
		<thead>
		<tr><td colspan="{$num_columns}">
			<table border="0" cellspacing="0" cellpadding="{$theme[tablespace]}" width="100%">
			<tr class="thead">
			<td><strong>{$lang->prostats_prostats}</strong></td>
			<td style="text-align:{$ps_ralign};"><a href="" onclick="return prostats_reload();">{$lang->prostats_reload} <img src="{$mybb->settings['bburl']}/images/prostats/ps_reload.gif" style="vertical-align:middle;" alt="" /></a></td>
			</tr>
			</table>
		</td>
		</tr>
		</thead>
		<tbody>
		{$trow_message_top}
		<tr valign="top">
		{$prostats_content}
		</tr>
		{$trow_message_down}
		</tbody>
		</table>
		<br />
                </div>

Index Template:

PHP Code:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body id="tab2">
{$header}

<script type="text/javascript" src="jscripts/jquery-1.3.2.min.js"></script>

<script type="text/javascript">

$.noConflict();

</script>

<script type="text/javascript">

jQuery(document).ready(function($){

$('.tab').click(function(){

$('.at').removeClass('at');

$(this).addClass('at');

$('.content').slideUp();

var catshow = $(this).attr('rel');

$('#'+ catshow).slideDown();

});

});

</script>
<table border="0" width="100%" class="tborder" cellpadding="4" cellspacing="5" style="margin-bottom: 13px;">

<tr align="center">

<td class="tcat2 tab" title="Category 1" style="cursor: pointer;"rel="cat_1">Category 1</td>

<td class="tcat2 at tab" title="Category 4" style="cursor: pointer;" rel="cat_4">Category 4</td>

<td class="tcat2 tab" title="Category 9" style="cursor: pointer;" rel="cat_6">Category 6</td>
<td class="tcat2 tab" title="Last Posts" style="cursor: pointer;" rel="latest_posts">TestKAT</td>
</tr>
</table>
{$forums}


{$boardstats}


<dl class="forum_legend smalltext">
	<dt><img src="{$theme['imgdir']}/on.png" alt="{$lang->new_posts}" title="{$lang->new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/off.png" alt="{$lang->no_new_posts}" title="{$lang->no_new_posts}" style="vertical-align: middle; padding-bottom: 4px;" /></dt>
	<dd>{$lang->no_new_posts}</dd>

	<dt><img src="{$theme['imgdir']}/offlock.png" alt="{$lang->forum_locked}" title="{$lang->forum_locked}" style="vertical-align: middle;" /></dt>
	<dd>{$lang->forum_locked}</dd>
</dl>
<br style="clear: both" />
{$footer}
</body>
</html></template>



The Code I posted should be the right prostats template i got it from here:
[attachment=522]

OK. I've downloaded the ProStats plugin and try it. The plugin add this variable in index template:

Code:
{$ps_header_index}

before the {$forums} variable, and add this variable after the {$forums} variable:

Code:
{$ps_footer_index}


Change your code in line #53:

HTML Code
<td class="tcat2 tab" title="Last Posts" style="cursor: pointer;" rel="latest_posts">TestKAT</td>

to:

HTML Code
<td class="tcat2 tab" title="Last Posts" style="cursor: pointer;" rel="prostats_table">TestKAT</td>


And change the prostats template in line #36:

HTML Code
<div id="prostats_table">

to:

HTML Code
<div id="prostats_table" class="content">


If you hide some categories via CSS, hide the #prostats_table category too (I prefer to do this via jQuery to make it an unobtrusive tabs).

Thank you so much!Love

Now it's working Smile

Can I hide via jQuery direkt in the <script> ...</script> area?

Never worked so many times with it.
Testet now some time with the Tabs.

But I got a new question.

Is it with this system possible to show a forum like you do at your xthread demo?

I want do do it with one forum online.

The others should look like dissused here before.

Sorry for the bad english... Wink
If what you mean is like the tabs in the demo forum, it's CSS menu only.
The basic method for that:
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=613&pid=49

Each menu has a link to a specified forum id, and I hide the forum with XThreads (via XThreads forum setting). So, it means that it loads a different page.
The javascript tabs menu we discussed here is, basically, hide and display a specified area on the same page (in this case is index page).
Pages: 1 2 3 4
Reference URL's