Support for SMF Tricks Themes & Mods

0 Members and 1 Guest are viewing this topic.

*
Porr
Sniffer
I have 3 questions

But first i want to complement you on the theme. And that its free. I run a non profit forum and i love it. Mabey in the future we have some more funds. I already made some small alterations to the forum but i am no programmer.

first question:

1 thing that is missing is a warning message about members that are waiting approval. Normaly when i had a theme i could easily put this code:


Code: [Select]
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
  }
in the indextemplate.php. I tried some stuff but nothing worked. The code of this theme is a little different then i am used to

The second. I saw on the SMF tricks site that the green + box was replaced with text (actions for example). I would like to do the same.

And three. I like the menu you use here (on the left). It is almost the same as on reseller when the page is scalled to mobile. I would love to have that menu in all views (mobile and desktop). Preferrable working the sameway as here on SMF tricks.
« Last Edit: November 06, 2014, 05:48:29 AM by Porr »






*
Daniel
#1
Webmaster
1. Search:
Code: [Select]
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>Replace with:
Code: [Select]
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';
// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
}
echo'

2. Search:
Code: [Select]
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
    +
  </button>

And change + for the word what you want.

3. When I have a little more of time, I will let the tutorial.
*
Porr
#2
Sniffer
Thx :-)

I have some problem with the code for question 1. My forum breaks. Maybe a small error. I am not at home so can not debug.

and awnser 2 works perfect  ;D
*
Daniel
#3
Webmaster
Thx :-)

I have some problem with the code for question 1. My forum breaks. Maybe a small error. I am not at home so can not debug.

and awnser 2 works perfect  ;D
Sorry, my mistake. The code is:
Code: [Select]
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';
// Are there any members waiting for approval?
if (!empty($context['unapproved_members'])){
echo '
<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
}
echo'
*
Porr
#4
Sniffer
It worked. Thank for the effort you put into it.

Those 2 things where really needed to be fixed before i can make the theme the default :-) The (3th)menu thing is more because of the cool factor. But i can test that later when you had time. I will make some minor changes to colors and then it can be the default :D

Have a nice weekend.
*
Daniel
#5
Webmaster
Index.template.php
Search:
Code: [Select]
<script type="text/javascript">
$(document).ready(function(){
$("input[type=button]").attr("class", "btn btn-default btn-sm");
$(".button_submit").attr("class", "btn btn-primary btn-sm");
$("#advanced_search input[type=\'text\'], #search_term_input input[type=\'text\']").removeAttr("size");
$(".table_grid").attr("class", "table table-striped");
$("img[alt=\'', $txt['new'], '\'], img.new_posts").replaceWith("<span class=\'label label-warning\'>', $txt['new'], '</span>");
$("#profile_success").removeAttr("id").removeClass("windowbg").addClass("alert alert-success");
$("#profile_error").removeAttr("id").removeClass("windowbg").addClass("alert alert-danger");
});
</script>

Replace with:
Code: [Select]
<script type="text/javascript">
$(document).ready(function(){
var $abrir = $(".abrir");
var $cerrar = $(".cerrar");
var $menu = $("#sidebar");
var $content = $("#main");
$abrir.click( function(){
$menu.css("left","0px");
$cerrar.css("display","block");
$abrir.css("display","none");
$content.css("margin-left","300px");
});
$cerrar.click( function(){
$menu.css("left","-300px");
$cerrar.css("display","none");
$abrir.css("display","block");
$content.css("margin-left","auto");
});
$("input[type=button]").attr("class", "btn btn-default btn-sm");
$(".button_submit").attr("class", "btn btn-primary btn-sm");
$("#advanced_search input[type=\'text\'], #search_term_input input[type=\'text\']").removeAttr("size");
$(".table_grid").attr("class", "table table-striped");
$("img[alt=\'', $txt['new'], '\'], img.new_posts").replaceWith("<span class=\'label label-warning\'>', $txt['new'], '</span>");
$("#profile_success").removeAttr("id").removeClass("windowbg").addClass("alert alert-success");
$("#profile_error").removeAttr("id").removeClass("windowbg").addClass("alert alert-danger");
});
</script>

Search:
Code: [Select]
echo'
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="row">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand visible-xs" href="', $scripturl, '">', $context['forum_name'] ,'</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">';

// Show the menu here, according to the menu sub template.
template_menu();

echo'
</ul>
</div>
</div>
</div>
</nav>

Replace with:
Code: [Select]
// Show the menu here, according to the menu sub template.
template_menu();

echo'
<div id="main">
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div>
<div class="navbar-header">
<div class="btn-sidebar">
<a href="javascript:void(0);" class="abrir">
<button type="button" class="navbar-toggle" style="display: block">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</a>
<a href="javascript:void(0);" class="cerrar">
<button type="button" class="navbar-toggle" style="display: block">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</a>
</div>
<a class="navbar-brand" href="', $scripturl, '">', $context['forum_name'] ,'</a>
</div>
</div>
</div>
</nav>

Search:
Code: [Select]
function template_html_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
</body></html>';
}
Replace with:
Code: [Select]
function template_html_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
</div>
</body></html>';
}

Search:
Code: [Select]
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '" class="', $button['sub_buttons'] ? 'dropdown ' : '', '', $button['active_button'] ? 'active ' : '', '">
<a ', $button['sub_buttons'] ? 'class="dropdown-toggle" ' : '', 'href="', $button['sub_buttons'] ? '#' : $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '', $button['sub_buttons'] ? ' data-toggle="dropdown"' : '', '>
', $button['title'], '
', $button['sub_buttons'] ? '<span class="caret"></span>' : '' ,'
</a>';
if (!empty($button['sub_buttons']))
{
echo '
<ul class="dropdown-menu" role="menu">';

foreach ($button['sub_buttons'] as $childbutton)
{
echo '
<li>
<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
', $childbutton['title'] , '
</a>
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}
}

Replace with:
Code: [Select]
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<aside id="sidebar">
<ul class="nav nav-list">';

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '#forum"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>
</li>';
}

echo '
</ul>
</aside>';
}

Reseller.css
Add to the end:
Code: [Select]
aside#sidebar{
    background: #222;
    width: 300px;
    height: 100%;
    position: fixed;
    top: 0;
    left: -300px;
    transition: 0.2s;
    -webkit-transition: 0.2s;
}
#wrapper
{
    transition: 0.2s;
    -webkit-transition: 0.2s;
}
.btn-sidebar
{
float: left;
}
#sidebar > .nav li
{
border-top: 1px solid rgba(95, 95, 95, 0.1);
}
#sidebar > .nav li:last-child
{
border-bottom: 1px solid rgba(95, 95, 95, 0.1);
}
#sidebar > .nav > li a
{
color: #d2c0c4;
}
#sidebar > .nav > li a:hover
{
color: #3498db;
background-color: #1b1516;
}
#sidebar > .nav > li a.active
{
color: #3498db;
}
.cerrar{
    display: none;
}

Regards!
*
Porr
#6
Sniffer
Works :D Looks  as a non SMF forum now ;D and thats a compliment. Just learning a lot by just looking at the code and changing small stuff. And breaking it sometimes hehe...

Greetings,
*
Porr
#7
Sniffer
How did you prevent the horizantal scroll bar when opening the menu? I tried it with the general code in the index.css

Code: [Select]
/* This division wraps the entire forum when a forum width is set. */
div#wrapper
{
margin: 0 auto;
width: 90%;
margin-top: 40px;
margin-bottom: 40px;
*
Porr
#8
Sniffer
Changed the way the menu reacts so now the forum does not changes horizantal. Perfect :D