MyBB Community Forums
[Tutorial] jQuery collapsible sidebar - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Tutorials (https://community.mybb.com/forum-38.html)
+--- Thread: [Tutorial] jQuery collapsible sidebar (/thread-73062.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13


RE: [Tutorial] jQuery collapsible sidebar - Raffello - 2012-01-09

(2011-09-29, 10:51 PM)Philly Wrote: How do I add a login or register stuff in there. Than once a member signs in it shows like a link to, user cp, admin cp, mod cp, your threads, your posts.
I'll bump this for you Smile



RE: [Tutorial] jQuery collapsible sidebar - martec - 2012-01-10

(2011-11-21, 08:55 AM)balasankarc Wrote: How to make this hidden to guests???

try this...

first make all modification this tutorial http://community.mybb.com/thread-73062.html


in global.php find

// Set up some of the default templates

above add

if($mybb->user['usergroup']==1)
	{
	$gvs = 1;
	}
	else
	{
	$gvs = 0;
	}

In Templates & Style --> themes --> your theme --> global.css --> Edit Stylesheet: Advanced Mode

add after all

.guest_0, .guest_ {
	display: none;
}

.member_1, .member_ {
	display: none;
}

In Templates & Style --> templates --> your template--> Index Page Templates --> index

Replace all with this.

<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>
<span class="member_{$gvs}"><style type="text/css">
.buttons {
    background: url(images/arrowright.png) no-repeat;
    width: 16px;
    height: 16px;
    display: block;
    cursor: pointer;
}

.clickedbuttons {
    background: url(images/arrowleft.png) no-repeat;
    width: 16px;
    height: 16px;
    display: block;
    cursor: pointer;
}
</style></span>
</head>
<body>
{$header}
<span class="member_{$gvs}"><a class="buttons" style="float: right;"></a>
<a class="clickedbuttons" style="float: right;"></a>
<br class="clear" />
<div class="sidebar" style="float: right;width: 19%;">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>
Latest News
</strong></td>
</tr>
<tr>
<td class="trow1">
You can put some news stuff here
</td>
</tr>
</table>
</div></span>
<span class="member_{$gvs}"><div class="forums" style="float: left;width: 80%;">
{$forums}
</div></span>
<span class="guest_{$gvs}">{$forums}</span>
<br class="clear" />
{$boardstats}

<dl class="forum_legend smalltext">
    <dt><img src="{$theme['imgdir']}/on.gif" 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.gif" 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.gif" 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>



RE: [Tutorial] jQuery collapsible sidebar - Josh H. - 2012-01-11

You know - darkdesign is down, and petforums is using xF now, and using its sidebar.


RE: [Tutorial] jQuery collapsible sidebar - koz - 2012-01-12

You can find a demo of it at my forum http://www.diabolicgaming.com/

If you need any help setting up the sidebar, feel free to PM me.


RE: [Tutorial] jQuery collapsible sidebar - TheNova - 2012-01-13

I added this sidebar, but I'm struggling to find what I can put in it. Can anyone tell me exactly how to add latest threads or posts to this sidebar?

Regards.


RE: [Tutorial] jQuery collapsible sidebar - martec - 2012-01-14

(2012-01-13, 11:08 PM)TheNova Wrote: I added this sidebar, but I'm struggling to find what I can put in it. Can anyone tell me exactly how to add latest threads or posts to this sidebar?

Regards.

open index.php

find

// Build the birthdays for to show on the index page.

add above

//begin
// Latest forum discussions
if($mybb->settings['portal_showdiscussions'] != 0 && $mybb->settings['portal_showdiscussionsnum'])
{
	$altbg = alt_trow();
	$threadlist = '';
	$query = $db->query("
		SELECT t.*, u.username
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
		WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
		ORDER BY t.lastpost DESC 
		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
	);
	while($thread = $db->fetch_array($query))
	{
		$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
		$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
		// Don't link to guest's profiles (they have no profile).
		if($thread['lastposteruid'] == 0)
		{
			$lastposterlink = $thread['lastposter'];
		}
		else
		{
			$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
		}
		if(my_strlen($thread['subject']) > 25)
		{
			$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
		}
		$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
		$thread['threadlink'] = get_thread_link($thread['tid'], 0, "lastpost");
		$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
		eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
		$altbg = alt_trow();
	}
	if($threadlist)
	{ 
		// Show the table only if there are threads
		eval("\$elatestthreads = \"".$templates->get("portal_latestthreads")."\";");
	}
}
//end

in Index Templates --> index

find

<div class="sidebar" style="float: right;width: 19%;">

add after

{$elatestthreads}




RE: [Tutorial] jQuery collapsible sidebar - HBB - 2012-01-28

(2010-07-07, 11:04 PM)Joshee Wrote: I'm pretty sure that's all you will need. If you have any problems let me know!
Demos:
http://dark-design.tk
http://petforums.biz/index.php
links are not related to Mybb forums! isn't there any new demo?




RE: [Tutorial] jQuery collapsible sidebar - ranjani - 2012-01-29

^ here is the recent working demo ..
(2012-01-12, 02:03 AM)koz Wrote: You can find a demo of it at my forum http://www.diabolicgaming.com/




RE: [Tutorial] jQuery collapsible sidebar - HBB - 2012-01-29

(2012-01-29, 03:07 AM)ranjani Wrote: here is the recent working demo
http://www.diabolicgaming.com/
Blush

AND: Is there any plugin using JQuery for "login" and "register" buttons like this site( http://petforums.biz/index.php ) for myBB?




RE: [Tutorial] jQuery collapsible sidebar - ranjani - 2012-01-29

^ yes, that forum's side bar uses jQuery.. if you need help in adding it then you may PM me ..