News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Custom blocks

Started by davidhs, June 28, 2013, 03:02:05 PM

Previous topic - Next topic

davidhs

In Spanish support topic an user want install this mod over theme Immortality http://custom.simplemachines.org/themes/index.php?lemma=2670 but when install occurs two errors http://www.simplemachines.org/community/index.php?topic=503400.msg3822287#msg3822287

Copyright of this theme allow to do changes, so I write here manual modifications to do over this theme:

Quote
Mod: Custom blocks, 2.4
Theme: Immortality http://custom.simplemachines.org/themes/index.php?lemma=2670
Modifications to do:

1. File index.template.php:

1.1. Error #2:

Search (line 175)

<div id="header"><div class="frame">
<div id="headerlogo">
<div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div>
</div>

and replace by

<div id="header"><div class="frame">
';
if (empty($context['cb_header_above']))
{
echo '
<div id="headerlogo">
<div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div>
</div>';
}
echo '


1.2. Error #4:

Search (line 326)

<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><strong>Immortality</strong> by <a href="http://www.simplemachines.org/community/index.php?action=profile;u=304512" target="_blank">Misa95</a> &amp <a href="http://www.simplemachines.org/community/index.php?action=profile;u=270467" target="_blank">KaJzEr 283</a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

and replace by

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_footer_above']))
echo $context['cb_footer_above'];
if (!empty($context['cb_footer']))
echo $context['cb_footer'];
else
{
echo '
<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><strong>Immortality</strong> by <a href="http://www.simplemachines.org/community/index.php?action=profile;u=304512" target="_blank">Misa95</a> &amp <a href="http://www.simplemachines.org/community/index.php?action=profile;u=270467" target="_blank">KaJzEr 283</a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';
}
if (!empty($context['cb_footer_below']))
echo $context['cb_footer_below'];
// END MOD CustomBlocks


Notes:
If this mod is uninstalled, then these manual modifications must be undone.
The blocks in the forum header are not used (only above/below the forum header).

davidhs

Manual modifications to do over theme Thing:

Quote
Mod: Custom blocks, 2.4
Theme: Thing http://custom.simplemachines.org/themes/index.php?lemma=2038
Modifications to do:

1. File index.template.php:

1.1. Error #2:

Search (line 177)

<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';

// the upshrink image, right-floated
echo '
', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '

and replace by

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header']))
echo $context['cb_header'];
else
{
echo '
<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';

// the upshrink image, right-floated
echo '
', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>';
}
echo '
<!-- END MOD CustomBlocks -->


1.2. Error #4:

Search (line 345)

<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><a href="http://www.wizzi.pl" title="www.wizzi.pl" target="_blank"><b>Thing by Nolt</b></a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

and replace by

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_footer_above']))
echo $context['cb_footer_above'];
if (!empty($context['cb_footer']))
echo $context['cb_footer'];
else
{
echo '
<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><a href="http://www.wizzi.pl" title="www.wizzi.pl" target="_blank"><b>Thing by Nolt</b></a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';
}
if (!empty($context['cb_footer_below']))
echo $context['cb_footer_below'];
// END MOD CustomBlocks


Notes:
If this mod is uninstalled, then these manual modifications must be undone.

davidhs

Compatible with SMF 2.0.11.

davidhs

Compatible with SMF 2.0.12.

davidhs

Compatible with SMF 2.0.13.

davidhs

Compatible with SMF 2.0.14 and 2.0.15.

davidhs

Manual modifications to do in Actualism theme:

Quote
Mod: Custom blocks, 2.5
Theme: Actualism, 2.0.4
Manual modifications to do: (before, install this mod in this theme, with errors)

1. File /Themes/actualism_204/index.template.php:

1.1. Error #1:
Code (Search (line 175)) Select

<div id="wrapper"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>

Code (Replace) Select

<div id="wrapper"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>
  <!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header_above']))
echo $context['cb_header_above'];
echo '
  <!-- END MOD CustomBlocks -->


1.2. Error #2:
Code (Search (line 271)) Select

<a href="'.$scripturl.'" title=""></a>

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header']))
echo $context['cb_header'];
else
echo '
<a href="'.$scripturl.'" title=""></a>';
echo '
<!-- END MOD CustomBlocks -->


1.3. Errors #3 & #4:
Code (Search (line 282)) Select

<div id="toolbar">
',template_menu(),'
</div>

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';

if (!empty($context['cb_header_below']))
echo $context['cb_header_below'];

echo '
<div id="toolbar">
', !empty($context['cb_menu']) ? $context['cb_menu'] : template_menu(), '
</div>
<!-- END MOD CustomBlocks -->


1.4. Error #5:
Code (Search (line 303)) Select

<div class="sm_copy">
<span class="smalltext">', theme_copyright(), '</span>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p class="loadtime smalltext">', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>
</div>';
echo '
<div class="cz_copy">
<strong>Actualism</strong> by <a href="http://www.jpr62.com/theme/index.php" target="_blank"><strong>Crip</strong></a>
</div>
<div class="clear"></div>
</div>

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';

if (!empty($context['cb_footer_above']))
echo $context['cb_footer_above'];
if (!empty($context['cb_footer']))
echo $context['cb_footer'];
else
{
echo '
<div class="sm_copy">
<span class="smalltext">', theme_copyright(), '</span>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p class="loadtime smalltext">', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>
</div>';
echo '
<div class="cz_copy">
<strong>Actualism</strong> by <a href="http://www.jpr62.com/theme/index.php" target="_blank"><strong>Crip</strong></a>
</div>
<div class="clear"></div>
</div>';
}
if (!empty($context['cb_footer_below']))
echo $context['cb_footer_below'];

echo '
<!-- END MOD CustomBlocks -->


2. File /Themes/actualism_204/css/index.css:

2.1. Header forum need this:
Code (Search (line 3552)) Select

#logo a {
position: absolute;
top: 0.84em;
right: 25px;
display: block;
width: 207px!important;
height: 54px!important;
cursor: pointer;
background: url(../images/art/logo.png) no-repeat;
}

Code (Replace) Select

#logo a {
position: absolute;
top: 0.84em;
right: 25px;
display: block;
width: 207px!important;
height: 54px!important;
cursor: pointer;
background: url(../images/art/logo.png) no-repeat;
}
/* BEGIN MOD CustomBlocks */
#logo div.header {
position: absolute;
top: 0.84em;
right: 25px;
display: block;
}
/* END MOD CustomBlocks */


2.2. Footer forum need this:
Code (Search (line 3666)) Select

#footer { background: url(../images/art/botbg.png) repeat-x; height: 55px;}

Code (Replace) Select

/* BEGIN MOD CustomBlocks */
#footer { background: url(../images/art/botbg.png) repeat; min-height: 55px;}
/* END MOD CustomBlocks */


Notes:
If this mod is uninstalled, then these manual modifications must be undone.

davidhs

Manual modifications to do in Core Theme:

Quote
Mod: Custom blocks, 2.5
Theme: Core Theme, 2.0
Manual modifications to do: (before, install this mod in this theme, with errors)

1. File /Themes/core/index.template.php:

1.1. Errors #1 & #2:
Code (Search (line 182)) Select

<div class="catbg">
<img class="floatright" id="smflogo" src="', $settings['images_url'], '/smflogo.gif" alt="Simple Machines Forum" />
<h1 id="forum_name">';

if (empty($context['header_logo_url_html_safe']))
echo $context['forum_name_html_safe'];
else
echo '
<img src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" />';

echo '
</h1>
</div>';

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header_above']))
echo $context['cb_header_above'];
if (!empty($context['cb_header']))
echo $context['cb_header'];
else
{
echo '
<div class="catbg">
<img class="floatright" id="smflogo" src="', $settings['images_url'], '/smflogo.gif" alt="Simple Machines Forum" />
<h1 id="forum_name">';

if (empty($context['header_logo_url_html_safe']))
echo $context['forum_name_html_safe'];
else
echo '
<img src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" />';

echo '
</h1>
</div>';
}
// END MOD CustomBlocks


1.2. Error #3:
Code (Search (line 335)) Select

echo '
</div>
</div>';

Code (Replace) Select

echo '
</div>
<!-- END MOD CustomBlocks -->';
if (!empty($context['cb_header_below']))
echo $context['cb_header_below'];
echo '
<!-- END MOD CustomBlocks -->
</div>';


1.3. Error #5:
Code (Search (line 402)) Select

<ul class="reset smalltext">
<li class="copyright">', theme_copyright(), '</li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p class="smalltext" id="show_loadtime">', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_footer_above']))
echo $context['cb_footer_above'];
if (!empty($context['cb_footer']))
echo $context['cb_footer'];
else
{
echo '
<ul class="reset smalltext">
<li class="copyright">', theme_copyright(), '</li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p class="smalltext" id="show_loadtime">', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';
}
if (!empty($context['cb_footer_below']))
echo $context['cb_footer_below'];
// END MOD CustomBlocks


2. File /Themes/core/MessageIndex.template.php:

2.1. Error #1:
Code (Search (line 22)) Select

echo '
<div class="tborder marginbottom" id="childboards">

Code (Replace) Select

// BEGIN MOD CustomBlocks
if (!empty($context['cb_messageindex_abovecb']))
echo $context['cb_messageindex_abovecb'];
// END MOD CustomBlocks

echo '
<div class="tborder marginbottom" id="childboards">


2.2. Error #2:
Code (Search (line 152)) Select

echo '
<div id="modbuttons_top" class="modbuttons clearfix margintop">
<div class="floatleft middletext">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
', template_button_strip($normal_buttons, 'bottom'), '
</div>';

Code (Replace) Select

// BEGIN MOD CustomBlocks
if (!empty($context['cb_messageindex_abovemsg']))
echo $context['cb_messageindex_abovemsg'];
// END MOD CustomBlocks

echo '
<div id="modbuttons_top" class="modbuttons clearfix margintop">
<div class="floatleft middletext">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>
', template_button_strip($normal_buttons, 'bottom'), '
</div>';


2.3. Error #3:
Code (Search (line 386)) Select

echo '
<div id="modbuttons_bottom" class="modbuttons clearfix marginbottom">
', template_button_strip($normal_buttons, 'top'), '
<div class="floatleft middletext">' . $txt['pages'] . ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
</div>';

Code (Replace) Select

echo '
<div id="modbuttons_bottom" class="modbuttons clearfix marginbottom">
', template_button_strip($normal_buttons, 'top'), '
<div class="floatleft middletext">' . $txt['pages'] . ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
</div>';

// BEGIN MOD CustomBlocks
if (!empty($context['cb_messageindex_belowmsg']))
echo $context['cb_messageindex_belowmsg'];
// END MOD CustomBlocks


Notes:
If this mod is uninstalled, then these manual modifications must be undone.

davidhs

Manual modifications to do in Immortality theme:

Quote
Mod: Custom blocks, 2.5
Theme: Immortality, 2.0.2
Manual modifications to do: (before, install this mod in this theme, with errors)

1. File /Themes/Immortality/index.template.php:

1.1. Error #2:
Code (Search (line 181)) Select

<div id="headerlogo">
<div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div>
</div>

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header']))
echo $context['cb_header'];
else
{
echo '
<div id="headerlogo">
<div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div>
</div>';
}
echo '
<!-- END MOD CustomBlocks -->


1.2. Error #5:
Code (Search (line 350)) Select

<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><strong>Immortality</strong> by <a href="http://www.simplemachines.org/community/index.php?action=profile;u=304512" target="_blank">Misa95</a> &amp <a href="http://www.simplemachines.org/community/index.php?action=profile;u=270467" target="_blank">KaJzEr 283</a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

echo '

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_footer_above']))
echo $context['cb_footer_above'];
if (!empty($context['cb_footer']))
echo $context['cb_footer'];
else
{
echo '
<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><strong>Immortality</strong> by <a href="http://www.simplemachines.org/community/index.php?action=profile;u=304512" target="_blank">Misa95</a> &amp <a href="http://www.simplemachines.org/community/index.php?action=profile;u=270467" target="_blank">KaJzEr 283</a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';
}
if (!empty($context['cb_footer_below']))
echo $context['cb_footer_below'];

echo '
<!-- END MOD CustomBlocks -->


Notes:
If this mod is uninstalled, then these manual modifications must be undone.

davidhs

Manual modifications to do in Reseller theme:

Quote
Mod: Custom blocks, 2.5
Theme: Reseller, 2.0.8
Manual modifications to do: (before, install this mod in this theme, with errors)

1. File /Themes/Reseller/index.template.php:

1.1. Error #4:
Code (Search (line 189)) Select

<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>

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_menu']))
echo $context['cb_menu'];
else
{
echo'
<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>';
}
echo '
<!-- END MOD CustomBlocks -->


1.2. Error #1:
Code (Search (line 220)) Select

<header>
<div class="container">

Code (Replace) Select

<header>
<div class="container">
<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header_above']))
echo $context['cb_header_above'];
echo '
<!-- END MOD CustomBlocks -->


1.3. Error #2:
Code (Search (line 229)) Select

<a href="', $scripturl, '"><img src="' , !empty($context['header_logo_url_html_safe']) ? $context['header_logo_url_html_safe'] : $settings['images_url'] . '/logo.png' , '" alt="' . $context['forum_name'] . '" /></a>

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header']))
echo $context['cb_header'];
else
echo '
<a href="', $scripturl, '"><img src="' , !empty($context['header_logo_url_html_safe']) ? $context['header_logo_url_html_safe'] : $settings['images_url'] . '/logo.png' , '" alt="' . $context['forum_name'] . '" /></a>';
echo '
<!-- END MOD CustomBlocks -->


1.4. Error #3:
Code (Search (line 291)) Select

</div>
</header>';

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header_below']))
echo $context['cb_header_below'];
echo '
<!-- END MOD CustomBlocks -->
</div>
</header>';


1.5. Error #5:
Code (Search (line 326)) Select

<div class="row">
<div class="social_icons col-lg-12">';
if(!empty($settings['facebook_check']))
echo'
<a href="', !empty($settings['facebook_text']) ? $settings['facebook_text'] : 'http://www.facebook.com ' ,'"><img src="', $settings['images_url'], '/social_icons/facebook.png" alt="', $txt['rs_facebook'], '" /></a>';
if(!empty($settings['twitter_check']))
echo'
<a href="', !empty($settings['twitter_text']) ? $settings['twitter_text'] : 'http://www.twitter.com' ,'"><img src="', $settings['images_url'], '/social_icons/twitter.png" alt="', $txt['rs_twitter'], '" /></a>';
if(!empty($settings['youtube_check']))
echo'
<a href="', !empty($settings['youtube_text']) ? $settings['youtube_text'] : 'http://www.youtube.com' ,'"><img src="', $settings['images_url'], '/social_icons/youtube.png" alt="', $txt['rs_youtube'], '" /></a>';
if(!empty($settings['rss_check']))
echo'
<a href="', !empty($settings['rss_text']) ? $settings['rss_text'] : $scripturl .'?action=.xml;type=rss' ,'"><img src="', $settings['images_url'], '/social_icons/rss.png" alt="', $txt['rs_rss'], '" /></a>';
echo'
</div>
<div class="col-lg-12">
', theme_copyright(), '
</div>
<div class="col-lg-12">
Reseller by <a href="http://smftricks.com">Daniiel</a>. Designed by <a href="http://briancasillas.url.ph">Brian</a>
</div>
<div class="col-lg-12">
', !empty($settings['reseller_copyright']) ? $settings['reseller_copyright'] : $context['forum_name'] .' &copy;' ,'
</div>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

echo '
</div>

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_footer_above']))
echo $context['cb_footer_above'];
if (!empty($context['cb_footer']))
echo $context['cb_footer'];
else
{
echo '
<div class="row">
<div class="social_icons col-lg-12">';
if(!empty($settings['facebook_check']))
echo'
<a href="', !empty($settings['facebook_text']) ? $settings['facebook_text'] : 'http://www.facebook.com ' ,'"><img src="', $settings['images_url'], '/social_icons/facebook.png" alt="', $txt['rs_facebook'], '" /></a>';
if(!empty($settings['twitter_check']))
echo'
<a href="', !empty($settings['twitter_text']) ? $settings['twitter_text'] : 'http://www.twitter.com' ,'"><img src="', $settings['images_url'], '/social_icons/twitter.png" alt="', $txt['rs_twitter'], '" /></a>';
if(!empty($settings['youtube_check']))
echo'
<a href="', !empty($settings['youtube_text']) ? $settings['youtube_text'] : 'http://www.youtube.com' ,'"><img src="', $settings['images_url'], '/social_icons/youtube.png" alt="', $txt['rs_youtube'], '" /></a>';
if(!empty($settings['rss_check']))
echo'
<a href="', !empty($settings['rss_text']) ? $settings['rss_text'] : $scripturl .'?action=.xml;type=rss' ,'"><img src="', $settings['images_url'], '/social_icons/rss.png" alt="', $txt['rs_rss'], '" /></a>';
echo'
</div>
<div class="col-lg-12">
', theme_copyright(), '
</div>
<div class="col-lg-12">
Reseller by <a href="http://smftricks.com">Daniiel</a>. Designed by <a href="http://briancasillas.url.ph">Brian</a>
</div>
<div class="col-lg-12">
', !empty($settings['reseller_copyright']) ? $settings['reseller_copyright'] : $context['forum_name'] .' &copy;' ,'
</div>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

echo '
</div>';
}
if (!empty($context['cb_footer_below']))
echo $context['cb_footer_below'];
echo '
<!-- END MOD CustomBlocks -->


2. File /Themes/Reseller/MessageIndex.template.php:

2.1. Error #1:
Code (Search (line 22)) Select

echo '
<div class="tborder childboards contentboard" id="board_', $context['current_board'], '_childboards">

Code (Replace) Select

// BEGIN MOD CustomBlocks
if (!empty($context['cb_messageindex_abovecb']))
echo $context['cb_messageindex_abovecb'];
// END MOD CustomBlocks

echo '
<div class="tborder childboards contentboard" id="board_', $context['current_board'], '_childboards">


Notes:
If this mod is uninstalled, then these manual modifications must be undone.

davidhs

Manual modifications to do in Thing theme:

Quote
Mod: Custom blocks, 2.5
Theme: Thing, 2.0
Manual modifications to do: (before, install this mod in this theme, with errors)

1. File /Themes/Thing/index.template.php:

1.1. Error #2:
Code (Search (line 182)) Select

<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';

// the upshrink image, right-floated
echo '
', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_header']))
echo $context['cb_header'];
else
{
echo '
<h1 class="forumtitle">
<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>';

// the upshrink image, right-floated
echo '
', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>';
}
echo '
<!-- END MOD CustomBlocks -->


1.2. Error #5:
Code (Search (line 360)) Select

<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><a href="http://www.wizzi.pl" title="www.wizzi.pl" target="_blank"><b>Thing by Nolt</b></a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

echo '

Code (Replace) Select

<!-- BEGIN MOD CustomBlocks -->';
if (!empty($context['cb_footer_above']))
echo $context['cb_footer_above'];
if (!empty($context['cb_footer']))
echo $context['cb_footer'];
else
{
echo '
<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li class="copyright"><a href="http://www.wizzi.pl" title="www.wizzi.pl" target="_blank"><b>Thing by Nolt</b></a></li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';
}
if (!empty($context['cb_footer_below']))
echo $context['cb_footer_below'];

echo '
<!-- END MOD CustomBlocks -->


Notes:
If this mod is uninstalled, then these manual modifications must be undone.

davidhs

New version:
2.5     2018-08-12
------------------
! SMF 1.1.x: Theme of the generic form of displaying lists.
+ Upgrade code to the configuration variables from versions 2.3-2.4 to 2.5.
+ SMF 2.1.x: Uninstallation code to the configuration variables.
* In Administration panel, custom blocks are grouped by their position.
+ Custom blocks instead of the forum menu.
+ Custom blocks instead of the message index: Above the child boards, above the messages and below the messages.
* The variable to insert the copyright can be included in any block of the forum header, menu or footer.
+ Variable in content of a block of the forum header, menu or footer to insert the forum menu.
+ Variable in content of a block of the message index to insert the ID of the board.
+ Actions of Administration panel are logged to Administration log.
@ Administration log does not exists in SMF 1.1.x.
+ SMF compatibility: 2.0.11 to 2.0.15 and 2.1 Beta 3.
- SMF 2.0.x: Languages: spanish, spanish-utf8 (these are not used).
+ Languages: New language string in polish, polish-utf8, thanks to FishingManMatt.

davidhs

Quote from: FishingManMatt
Hi David!

I spotted two bugs after installing the new version.
The Quick Edit option doesn't work. When you click on the QE icon the red "Loading..." message appears at the top of the screen.
The Insert Quote option doesn't work either.
It seems they are both Ajax functions.
Take a look at my screenies -> [...]
I managed to reproduce this on two different servers. After uninstalling the mod the problems are gone.

I thought I would let you know since these are quite serious bugs affecting the forum. They were immediately reported by my moderators and users.

Best regards!
Matt
Fixed.




New version:
2.5.1   2018-12-06
------------------
! SMF 2.1.x: logAction is a deprecated function. Instead, logActions is used.
! Quick Edit and Insert Quote buttons did not work.
! Languages: Some language string in polish, polish-utf8.
+ Languages: New language string in polish, polish-utf8, thanks to FishingManMatt.

arielvered

I am getting errors trying to uninstall:
Quote1.   Execute Code   code-2.0.php   
2.   Adapt Database   database-upgrade-2.0.php   
*   3.   Execute Modification   ./Sources/ManageSettings.php   Test failed
   1.   Replace   ./Sources/ManageSettings.php   Test failed
*   4.   Execute Modification   ./Sources/Subs.php   Test successful
*   5.   Execute Modification   ./Sources/Who.php   Test failed
   1.   Replace   ./Sources/Who.php   Test failed
*   6.   Execute Modification   ./Themes/defa

Is it ok to proceed with uninstall?

I have version 2.3.2. Should I just install the newer version instead?

davidhs

Quote from: arielvered on May 10, 2019, 01:55:12 AM
I am getting errors trying to uninstall:
Quote1.   Execute Code   code-2.0.php   
2.   Adapt Database   database-upgrade-2.0.php   
*   3.   Execute Modification   ./Sources/ManageSettings.php   Test failed
   1.   Replace   ./Sources/ManageSettings.php   Test failed
*   4.   Execute Modification   ./Sources/Subs.php   Test successful
*   5.   Execute Modification   ./Sources/Who.php   Test failed
   1.   Replace   ./Sources/Who.php   Test failed
*   6.   Execute Modification   ./Themes/defa

Is it ok to proceed with uninstall?

I have version 2.3.2. Should I just install the newer version instead?
No, you need uninstall v2.3.2 before install newer version.

This error is usual in SMF 2.0.x: You installed other mods after Custom Blocks and these mods made changes in ManageSettings.php and Who.php.

There are two solutions:

1. More easy but complex. You should uninstall mods installed before mine (in inverse order), and then update my mod and install again mods.

or

2. More quick for user expert.

2.1. Before uninstall my mod you should edit these files:

2.1.1. Sources/ManageSettings.php
Code (Search (near line 188)) Select

// Load up all the tabs...
$context[$context['admin_menu_name']]['tab_data'] = array(
'title' => $txt['admin_modifications'],
'help' => 'modsettings',
'description' => $txt['modification_settings_desc'],
'tabs' => array(
'general' => array(
),
/* OTHER MOD WRITE HERE */
// BEGIN MOD CustomBlocks
'cb' => array(
'label' => $txt['cb'],
'description' => $txt['cb_desc'],
),
// END MOD CustomBlocks

Code (Replace by (move code of my mod to top)) Select

// Load up all the tabs...
$context[$context['admin_menu_name']]['tab_data'] = array(
'title' => $txt['admin_modifications'],
'help' => 'modsettings',
'description' => $txt['modification_settings_desc'],
'tabs' => array(
'general' => array(
),
// BEGIN MOD CustomBlocks
'cb' => array(
'label' => $txt['cb'],
'description' => $txt['cb_desc'],
),
// END MOD CustomBlocks
/* OTHER MOD WRITE HERE */


2.1.2. Sources/Who.php
Code (Search (near line 725)) Select

/* Modification Authors:  You may add a copyright statement to this array for your mods.
Copyright statements should be in the form of a value only without a array key.  I.E.:
'Some Mod by Thantos &copy; 2010',
$txt['some_mod_copyright'],
*/
'mods' => array(
/* OTHER MOD WRITE HERE */
// BEGIN MOD CustomBlocks
'<a href="https://custom.simplemachines.org/mods/index.php?mod=3703" target="_blank" class="new_win">Custom blocks</a>, 2.5.2 | &copy; 2013-2019, <a href="https://custom.simplemachines.org/mods/index.php?action=search;author=242014" target="_blank" class="new_win">davidhs</a> | <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" class="new_win">Creative Commons Attribution 3.0 Unported License</a>',
// END MOD CustomBlocks


Code (Replace by (move code of my mod to top)) Select

/* Modification Authors:  You may add a copyright statement to this array for your mods.
Copyright statements should be in the form of a value only without a array key.  I.E.:
'Some Mod by Thantos &copy; 2010',
$txt['some_mod_copyright'],
*/
'mods' => array(
// BEGIN MOD CustomBlocks
'<a href="https://custom.simplemachines.org/mods/index.php?mod=3703" target="_blank" class="new_win">Custom blocks</a>, 2.5.2 | &copy; 2013-2019, <a href="https://custom.simplemachines.org/mods/index.php?action=search;author=242014" target="_blank" class="new_win">davidhs</a> | <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" class="new_win">Creative Commons Attribution 3.0 Unported License</a>',
// END MOD CustomBlocks

/* OTHER MOD WROTE HERE */


2.2. Try uninstall my mod with not errors.



Wait some days before update this mod: I have ready another version and I will upload soon.

arielvered

The settings is now fine, but I'm still getting the error on ./sources/who.php:


Type   Action   Description
1.   Execute Code   code-2.0.php   
2.   Adapt Database   database-upgrade-2.0.php   
*   3.   Execute Modification   ./Sources/ManageSettings.php   Test successful
*   4.   Execute Modification   ./Sources/Subs.php   Test successful
*   5.   Execute Modification   ./Sources/Who.php   Test failed
   1.   Replace   ./Sources/Who.php   Test failed
*   6.   Execute Modification   ./Themes/default/index.template.php   Test successful


davidhs

Quote from: arielvered on May 10, 2019, 09:38:30 AM
The settings is now fine, but I'm still getting the error on ./sources/who.php:
Is there an empty line between
// END MOD CustomBlocks
and text?

Attach here your Who.php.

davidhs

New version:
2.5.2   2019-05-05
------------------
! SMF 2.1.x: Use HTML 5.
! SMF 2.x: The Quick Search of the Administration Center look for in settings variables of MOD.
+ SMF compatibility: 2.1 RC1 to RC2.

arielvered

Quote from: davidhs on May 10, 2019, 09:42:42 AM

Is there an empty line between
Attach here your Who.php.
there is a line.
I have attached the who.php file.
Many thanks.

davidhs

Quote from: arielvered on May 10, 2019, 10:18:54 AM
Quote from: davidhs on May 10, 2019, 09:42:42 AM

Is there an empty line between
Attach here your Who.php.
there is a line.
I have attached the who.php file.
Many thanks.
I do not understand. Your file is incorrect.
Code (Your Who.php (line 722)) Select

$context['copyrights'] = array(
'smf' => sprintf($forum_copyright, $forum_version),

/* Modification Authors:  You may add a copyright statement to this array for your mods.
Copyright statements should be in the form of a value only without a array key.  I.E.:
'Some Mod by Thantos &copy; 2010',
$txt['some_mod_copyright'],
*/
'mods' => array(
// BEGIN MOD CustomBlocks
'<a href="https://custom.simplemachines.org/mods/index.php?mod=3703" target="_blank" class="new_win">Custom blocks</a>, 2.5.2 | &copy; 2013-2019, <a href="https://custom.simplemachines.org/mods/index.php?action=search;author=242014" target="_blank" class="new_win">davidhs</a> | <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" class="new_win">Creative Commons Attribution 3.0 Unported License</a>',
// END MOD CustomBlocks

/* OTHER MOD WROTE HERE */

),
);


1. line 725 has 3 tab instead of 2 tab:

/* Modification Authors:  You may add a copyright statement to this array for your mods.

Perhaps other mod change this ??? If you added this tab, remove

/* Modification Authors:  You may add a copyright statement to this array for your mods.

This is not important for my mod.

2. line 735 has my example text (remove this line):

/* OTHER MOD WROTE HERE */


3. line 732 has copyright text of my example

'<a href="https://custom.simplemachines.org/mods/index.php?mod=3703" target="_blank" class="new_win">Custom blocks</a>, 2.5.2 | &copy; 2013-2019, <a href="https://custom.simplemachines.org/mods/index.php?action=search;author=242014" target="_blank" class="new_win">davidhs</a> | <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank" class="new_win">Creative Commons Attribution 3.0 Unported License</a>',

You are copy my example (v2.5.2) instead of move text of your Who.php (can be v.2.5 or other).

If you have your Who.php original, attach here.
Else tell me version of your Custom Block.

Advertisement: