MyBB Community Forums

Full Version: Square theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2015-08-02, 03:33 AM)ecoo Wrote: [ -> ]
(2015-08-02, 03:15 AM)eNvy Wrote: [ -> ]
(2015-08-02, 02:43 AM)ecoo Wrote: [ -> ]Hey there, great theme! I have one questions, and is it, how do I add another sidebox below/above the current "Latest Activity" sidebar?

Thanks!

Look inside the index template, you will see this:

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
		<tr>
			<td class="thead">
				<div class="expcolimage"><img src="{$theme['imgdir']}/collapse.png" id="ths_img" class="expander" alt="[-]" title="[-]" /></div>
					<strong>{$lang->xstyled_latestactivity}</strong>
			</td>
		</tr>
		<tr>
			<td style="{$collapsed['ths_e']} padding: 0;" id="ths_e">
				<div class="latestthreads float_left"></div>
			</td>
		</tr>
	</table>
  	<div class="theadend"></div>

If you want to add another sidebox, just copy the same table, but before, adds a <br /> tag, and after paste the same table with the last <div class="theadend"> tag, and just change the title / content there.

The title is here:

[size=small][font=Monaco, Consolas, Courier, monospace]<strong>{$lang->xstyled_latestactivity}</strong>[/font][/size]

And the content is here:

[size=small][font=Monaco, Consolas, Courier, monospace]<div class="lates[/font][/size][size=small][font=Monaco, Consolas, Courier, monospace]tthreads float_left"></div>[/font][/size]

Cheers.

Hey there, thanks for the reply. What would the code be for if I want to put a specific thread in the sidebar, just like how the threads are formatted in the "Latest Activity" sidebar.

Thank you!

I started with one question, but now I have another! Undecided

Is there a way to disable the feature where when you put your mouse over a link a small black box appears that gives you a description of the link? I want to disable it because it causes mobile users to have to double tap a link to open it.

Thanks!

Well it's kinda hard, but you can "fake" it, writing in the table and put the link on the words you want, something like this:

<a style="font-weight: 700;" href="LINK TO THE THREAD">This is a fake thread</a><br />
<span class="small text">by <a href="LINK TO THE USER PROFILE">eNvy</a><br />
7 hours ago</span>

For the mouseover, that's the tipsy effect, you can put mor or less elements to have that effect, go to ACP > Templates & Styles > Square Templates > Ungrouped templates > headerinclude

Search this code:

<script type="text/javascript"> 
jQuery(function() {
	jQuery("a").tipsy({gravity: jQuery.fn.tipsy.autoNS});
	jQuery("title").tipsy({gravity: jQuery.fn.tipsy.autoNS});
	jQuery("img").tipsy({gravity: jQuery.fn.tipsy.autoNS});
	jQuery("i").tipsy({gravity: jQuery.fn.tipsy.autoNS});
	jQuery("span").tipsy({gravity: jQuery.fn.tipsy.autoNS});
	jQuery("div").tipsy({gravity: jQuery.fn.tipsy.autoNS});
	jQuery("label").tipsy({gravity: jQuery.fn.tipsy.autoNS});
	jQuery("input").tipsy({gravity: jQuery.fn.tipsy.autoNS});
});
</script>

If you saw there, you have multiple html tags, you can delete or add more as you like. In this case I think the problem is the "a" tag (the first one) and maybe the "title" tag (the second one), try removing only one of them and check if that works.
Thank you for the help, eNvy. I appreciate it immensely.
Hi eNvy. I have simple problem with a href titles, but i can't fix it. 


[Image: FMyPD9P.png]


Here it is good title.

[Image: kbJqU0m.png]

It's bad. I want to make this title like as above. I think this use Jquery but i can't fix that. Do you have any suggestions?
(2015-08-07, 04:16 PM)bekircem Wrote: [ -> ]Hi eNvy. I have simple problem with a href titles, but i can't fix it. 


[Image: 8GMU6y7.png]


Here it is good title.

[Image: Ap2g7Rm.png]

It's bad. I want to make this title like as above. I think this use Jquery but i can't fix that. Do you have any suggestions?

I can't see the images Sad
(2015-08-07, 04:52 PM)eNvy Wrote: [ -> ]I can't see the images Sad

Can you see now? (I updated images with Imgur)
It's the tipsy script. By default, it doesn't work on the latest activity, also, I'm gonna remove the script, because one team member of MyBB told me that script runs all the querys from the portal into the index (and that's bad).

Give me a few seconds, I will show you how to remove the script and after you can use a plugin to show the latest activity of your forum.

To remove manually the script:

ACP > Templates & Styles > Templates > Square Templates

Ungrouped templates > headerinclude

Search and remove this code

<script type="text/javascript">
jQuery(function($) {
    $(".clickedbuttons").hide();
    $(".buttons").click(function() {
        $(".sidebar").animate({height: "hide", opacity: 0}, 500,
            function() {
                $(".forums").animate({width: "984px"}, 500);
            });
        $(this).hide();
        $(".clickedbuttons").show();
        $.cookie("sidebar","collapsed", {expires: 365});
        return false;
    });
    $(".clickedbuttons").click(function() {
        $(".forums").animate({width: "724px"}, 500,
            function() {
                $(".sidebar").animate({height: "show", opacity: 1}, 500);
            });
        $(this).hide();
        $(".buttons").show();
        $.cookie("sidebar","expanded", {expires: 365});
        return false;
    });
    if($.cookie("sidebar") == "collapsed") {
        $(".buttons").hide();
        $(".clickedbuttons").show();
        $(".forums").css("width","984px");
        $(".sidebar").hide();
    };
});
</script>

Index Page Templates > index template

Replace your current index template with this new 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>
{$header}
{$forums}
<br class="clear" /><br />
{$boardstats}
{$footer}
</body>
</html>

Portal Templates > portal_latestthreads_thread

Click into the options button and then select "revert to the original".

If (for any reason you can't), the original MyBB code is this:

<tr>
<td class="{$altbg}">
<strong><a href="{$mybb->settings['bburl']}/{$thread['threadlink']}">{$thread['subject']}</a></strong>
<span class="smalltext"><br />
{$lang->forum} <a href="{$thread['forumlink']}">{$thread['forumname']}</a><br />
<a href="{$thread['lastpostlink']}">{$lang->latest_threads_lastpost}</a> {$lastposterlink}<br />
{$lastpostdate}<br />
<strong>&raquo; </strong>{$lang->latest_threads_replies} {$thread['replies']}<br />
<strong>&raquo; </strong>{$lang->latest_threads_views} {$thread['views']}
</span>
</td>
</tr>

Navigation templates > nav template

Remove this code

<a class="buttons" title="{$lang->xstyled_hidesidebar}" style="float: right;"><i style="font-size: 14px;" class="fa fa-compress fa-fw"></i></a>
<a class="clickedbuttons" title="{$lang->xstyled_showsidebar}" style="float: right;"><i style="font-size: 14px;" class="fa fa-expand fa-fw"></i></a>

To finish this, go to ACP > Templates & Styles > Styles > Square.css

Search and delete this classes

.buttons {
    cursor: pointer;
    color: #FFFFFF;
    width: 44px;
    height: 29px;
    padding-top: 15px;
    text-align: center;
    background: #005ea7;
    transition: all 0.5s ease;
}

.buttons:hover {
    cursor: pointer;
    color: #FFFFFF;
    background: #0076D1;
    transition: all 0.5s ease;
}

.clickedbuttons {
    cursor: pointer;
    color: #FFFFFF;
    width: 44px;
    height: 29px;
    padding-top: 15px;
    text-align: center;
    background: #005ea7;
    transition: all 0.5s ease;
}

.clickedbuttons:hover {
    cursor: pointer;
    color: #FFFFFF;
    background: #0076D1;
    transition: all 0.5s ease;
}

You can use this plugin made by dragonexpert to display the latest activity or post/threads on the index page.

-------------------------

Square theme updated to 1.8.5, and removed the sidebar with the latest activity script.
(2015-08-07, 06:11 PM)eNvy Wrote: [ -> ]It's the tipsy script. By default, it doesn't work on the latest activity, also, I'm gonna remove the script, because one team member of MyBB told me that script runs all the querys from the portal into the index (and that's bad).

Give me a few seconds, I will show you how to remove the script and after you can use a plugin to show the latest activity of your forum.

To remove manually the script:

ACP > Templates & Styles > Templates > Square Templates

Ungrouped templates > headerinclude

Search and remove this code

<script type="text/javascript">
jQuery(function($) {
    $(".clickedbuttons").hide();
    $(".buttons").click(function() {
        $(".sidebar").animate({height: "hide", opacity: 0}, 500,
            function() {
                $(".forums").animate({width: "984px"}, 500);
            });
        $(this).hide();
        $(".clickedbuttons").show();
        $.cookie("sidebar","collapsed", {expires: 365});
        return false;
    });
    $(".clickedbuttons").click(function() {
        $(".forums").animate({width: "724px"}, 500,
            function() {
                $(".sidebar").animate({height: "show", opacity: 1}, 500);
            });
        $(this).hide();
        $(".buttons").show();
        $.cookie("sidebar","expanded", {expires: 365});
        return false;
    });
    if($.cookie("sidebar") == "collapsed") {
        $(".buttons").hide();
        $(".clickedbuttons").show();
        $(".forums").css("width","984px");
        $(".sidebar").hide();
    };
});
</script>

Index Page Templates > index template

Replace your current index template with this new 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>
{$header}
{$forums}
<br class="clear" /><br />
{$boardstats}
{$footer}
</body>
</html>

Portal Templates > portal_latestthreads_thread

Click into the options button and then select "revert to the original".

If (for any reason you can't), the original MyBB code is this:

<tr>
<td class="{$altbg}">
<strong><a href="{$mybb->settings['bburl']}/{$thread['threadlink']}">{$thread['subject']}</a></strong>
<span class="smalltext"><br />
{$lang->forum} <a href="{$thread['forumlink']}">{$thread['forumname']}</a><br />
<a href="{$thread['lastpostlink']}">{$lang->latest_threads_lastpost}</a> {$lastposterlink}<br />
{$lastpostdate}<br />
<strong>&raquo; </strong>{$lang->latest_threads_replies} {$thread['replies']}<br />
<strong>&raquo; </strong>{$lang->latest_threads_views} {$thread['views']}
</span>
</td>
</tr>

Navigation templates > nav template

Remove this code

<a class="buttons" title="{$lang->xstyled_hidesidebar}" style="float: right;"><i style="font-size: 14px;" class="fa fa-compress fa-fw"></i></a>
<a class="clickedbuttons" title="{$lang->xstyled_showsidebar}" style="float: right;"><i style="font-size: 14px;" class="fa fa-expand fa-fw"></i></a>

To finish this, go to ACP > Templates & Styles > Styles > Square.css

Search and delete this classes

.buttons {
    cursor: pointer;
    color: #FFFFFF;
    width: 44px;
    height: 29px;
    padding-top: 15px;
    text-align: center;
    background: #005ea7;
    transition: all 0.5s ease;
}

.buttons:hover {
    cursor: pointer;
    color: #FFFFFF;
    background: #0076D1;
    transition: all 0.5s ease;
}

.clickedbuttons {
    cursor: pointer;
    color: #FFFFFF;
    width: 44px;
    height: 29px;
    padding-top: 15px;
    text-align: center;
    background: #005ea7;
    transition: all 0.5s ease;
}

.clickedbuttons:hover {
    cursor: pointer;
    color: #FFFFFF;
    background: #0076D1;
    transition: all 0.5s ease;
}

You can use this plugin made by dragonexpert to display the latest activity or post/threads on the index page.

-------------------------

Square theme updated to 1.8.5, and removed the sidebar with the latest activity script.

Thank you. It works. But i wonder, may i install plugin for sidebar lastest activity?
(2015-08-07, 07:05 PM)bekircem Wrote: [ -> ]
(2015-08-07, 06:11 PM)eNvy Wrote: [ -> ]It's the tipsy script. By default, it doesn't work on the latest activity, also, I'm gonna remove the script, because one team member of MyBB told me that script runs all the querys from the portal into the index (and that's bad).

Give me a few seconds, I will show you how to remove the script and after you can use a plugin to show the latest activity of your forum.

To remove manually the script:

ACP > Templates & Styles > Templates > Square Templates

Ungrouped templates > headerinclude

Search and remove this code

<script type="text/javascript">
jQuery(function($) {
    $(".clickedbuttons").hide();
    $(".buttons").click(function() {
        $(".sidebar").animate({height: "hide", opacity: 0}, 500,
            function() {
                $(".forums").animate({width: "984px"}, 500);
            });
        $(this).hide();
        $(".clickedbuttons").show();
        $.cookie("sidebar","collapsed", {expires: 365});
        return false;
    });
    $(".clickedbuttons").click(function() {
        $(".forums").animate({width: "724px"}, 500,
            function() {
                $(".sidebar").animate({height: "show", opacity: 1}, 500);
            });
        $(this).hide();
        $(".buttons").show();
        $.cookie("sidebar","expanded", {expires: 365});
        return false;
    });
    if($.cookie("sidebar") == "collapsed") {
        $(".buttons").hide();
        $(".clickedbuttons").show();
        $(".forums").css("width","984px");
        $(".sidebar").hide();
    };
});
</script>

Index Page Templates > index template

Replace your current index template with this new 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>
{$header}
{$forums}
<br class="clear" /><br />
{$boardstats}
{$footer}
</body>
</html>

Portal Templates > portal_latestthreads_thread

Click into the options button and then select "revert to the original".

If (for any reason you can't), the original MyBB code is this:

<tr>
<td class="{$altbg}">
<strong><a href="{$mybb->settings['bburl']}/{$thread['threadlink']}">{$thread['subject']}</a></strong>
<span class="smalltext"><br />
{$lang->forum} <a href="{$thread['forumlink']}">{$thread['forumname']}</a><br />
<a href="{$thread['lastpostlink']}">{$lang->latest_threads_lastpost}</a> {$lastposterlink}<br />
{$lastpostdate}<br />
<strong>&raquo; </strong>{$lang->latest_threads_replies} {$thread['replies']}<br />
<strong>&raquo; </strong>{$lang->latest_threads_views} {$thread['views']}
</span>
</td>
</tr>

Navigation templates > nav template

Remove this code

<a class="buttons" title="{$lang->xstyled_hidesidebar}" style="float: right;"><i style="font-size: 14px;" class="fa fa-compress fa-fw"></i></a>
<a class="clickedbuttons" title="{$lang->xstyled_showsidebar}" style="float: right;"><i style="font-size: 14px;" class="fa fa-expand fa-fw"></i></a>

To finish this, go to ACP > Templates & Styles > Styles > Square.css

Search and delete this classes

.buttons {
    cursor: pointer;
    color: #FFFFFF;
    width: 44px;
    height: 29px;
    padding-top: 15px;
    text-align: center;
    background: #005ea7;
    transition: all 0.5s ease;
}

.buttons:hover {
    cursor: pointer;
    color: #FFFFFF;
    background: #0076D1;
    transition: all 0.5s ease;
}

.clickedbuttons {
    cursor: pointer;
    color: #FFFFFF;
    width: 44px;
    height: 29px;
    padding-top: 15px;
    text-align: center;
    background: #005ea7;
    transition: all 0.5s ease;
}

.clickedbuttons:hover {
    cursor: pointer;
    color: #FFFFFF;
    background: #0076D1;
    transition: all 0.5s ease;
}

You can use this plugin made by dragonexpert to display the latest activity or post/threads on the index page.

-------------------------

Square theme updated to 1.8.5, and removed the sidebar with the latest activity script.

Thank you. It works. But i wonder, may i install plugin for sidebar lastest activity?

I really recommend to do what I wrote before and install the plugin.
Hi envy, you wrote in http://community.mybb.com/mods.php?actio...og&pid=172


Quote:Removed the latest activity sidebar, the code runs all the querys from portal.php and that's not good. It's better if you use a plugin instead.

Why is it not good?
(2015-08-08, 08:31 AM)zukro Wrote: [ -> ]Hi envy, you wrote in http://community.mybb.com/mods.php?actio...og&pid=172


Quote:Removed the latest activity sidebar, the code runs all the querys from portal.php and that's not good. It's better if you use a plugin instead.

Why is it not good?

Read again what I wrote... the script runs all the querys from the portal.php unnecesary, you only need one, that's why I removed the script. It's better if you use a plugin instead.