Advertisement:

Author Topic: Custom blocks  (Read 53643 times)

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks, 2.4 (SMF 1.1-1.1.21, 2.0-2.0.10)
« Reply #80 on: July 16, 2015, 07:06:14 AM »
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)
Code: [Select]
<div id="header"><div class="frame">
<div id="headerlogo">
<div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div>
</div>
and replace by
Code: [Select]
<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)
Code: [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>';
and replace by
Code: [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'];
// 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).

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks, 2.4 (SMF 1.1-1.1.21, 2.0-2.0.10)
« Reply #81 on: July 25, 2015, 07:16:46 AM »
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)
Code: [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>', '
and replace by
Code: [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 #4:

Search (line 345)
Code: [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>';
and replace by
Code: [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'];
// END MOD CustomBlocks

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

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #82 on: October 01, 2015, 04:19:56 PM »
Compatible with SMF 2.0.11.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #83 on: October 12, 2016, 01:26:48 PM »
Compatible with SMF 2.0.12.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #84 on: January 12, 2017, 04:00:57 PM »
Compatible with SMF 2.0.13.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #85 on: November 25, 2017, 12:28:46 PM »
Compatible with SMF 2.0.14 and 2.0.15.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #86 on: August 12, 2018, 12:57:18 PM »
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.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #87 on: August 12, 2018, 12:58:41 PM »
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.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #88 on: August 12, 2018, 01:01:00 PM »
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.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #89 on: August 12, 2018, 01:02:33 PM »
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.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #90 on: August 12, 2018, 01:04:06 PM »
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.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #91 on: August 12, 2018, 01:17:30 PM »
New version:
Code: [Select]
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.

Offline davidhs

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
Re: Custom blocks
« Reply #92 on: December 06, 2018, 02:06:32 PM »
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:
Code: [Select]
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.