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

DSystem

I found the problem.

In the Admin-CustomBlocks.php file I changed the line 14 to:
function cb_admin_area(&$admin_areas)

and the line 22 to:
function cb_modify_modification(&$subActions)

Very good this mode. This of congratulations.

davidhs

Quote from: dsystem on August 23, 2013, 10:48:15 PM
I found the problem.

In the Admin-CustomBlocks.php file I changed the line 14 to:
function cb_admin_area(&$admin_areas)

and the line 22 to:
function cb_modify_modification(&$subActions)

Very good this mode. This of congratulations.
Thants! It is true. This MOD and others of my MODs have errors like this. In my test forum with PHP 4 works.

I will solve these soon.

Arantor

That's because the mod isn't compatible with PHP 5.4 and up yet.
Holder of controversial views, all of which my own.


crousti

I'm really interested in this model, rather than having to install a gate.

Can you tell me if the installation should still be going well ? Or should I directly change the theme to add additional blocks?


davidhs

Quote from: crousti on September 01, 2013, 07:41:47 PM
I'm really interested in this model, rather than having to install a gate.

Can you tell me if the installation should still be going well ? Or should I directly change the theme to add additional blocks?


The MOD install well but you have a problem on your /Themes/default/index.template.php. I suppouse you has another MOD that change this file.

You can to do this:
- Install the MOD
- Apply to source code of /Themes/default/index.template.php the changes that does not have been made in the installation.

S Mac

OK, I've tried this mod again and the footer seems to be working but not the header, but that's OK. So I want to place Google ad code in the footer. Do I paste the code into the box called Content?

davidhs

Quote from: S Mac on September 03, 2013, 04:02:44 PM
OK, I've tried this mod again and the footer seems to be working but not the header, but that's OK. So I want to place Google ad code in the footer. Do I paste the code into the box called Content?
Yes, you can copy Google ad code into Content box.

davidhs

New version:
2.0     2013-10-23
------------------
! SMF 2.0.x: Integration hooks functions parameters must be passed by reference.
! If user does not have permission to view any block of forum header (or footer), default forum header (or footer) must be displayed.
+ Upgrade code to the configuration variables from version 1.x to 2.0.
+ Variable in content of the block to insert web address of forum.
+ Variable in content of the block to insert url to the images folder in the users current theme.
+ Variable in content of the block to insert url to the images folder in the default theme.
* Permissions for user, moderator and administrator instead of user (not guest).
+ Parameter frame of block, where writing the block border characteristics.
+ SMF compatibility: 1.1.19, 2.0.5 and 2.0.6.

Padre gremista

You may help me install this Mod in theme "actualism"?
www.gremioemfoco.info - A comunidade gremista na internet.

davidhs

Quote from: Padre gremista on October 25, 2013, 05:53:18 PM
You may help me install this Mod in theme "actualism"?
I suppouse you use SMF 2.0.x and Actualism theme 2.0.4.

1. Install this MOD (without apply to Actualism theme).

2. Edit /Sources/Themes/actualism_204/index.template.php:

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

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

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

echo '
  <div id="header">


Search (line 293)
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer" style="border: 2px red solid">
<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>
</div>';

And replace by
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer">';

// BEGIN MOD CustomBlocks
if (!empty($context['cb_footer']))
echo $context['cb_footer'], '
<div class="clear"></div>';
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>';
}
// END MOD CustomBlocks

echo '
</div>';


3. Edit /Sources/Themes/actualism_204/css/index.css (need for footer forum):

Search (line 3658)
#footer { background: url(../images/art/botbg.png) repeat-x; height: 55px;}
And replace by
#footer { background: url(../images/art/botbg.png) repeat; min-height: 55px;}

S Mac

This is brilliant, it now works perfectly :) Is it possible to integrate an image gallery into the footer? How do I do this?

davidhs

Quote from: S Mac on October 27, 2013, 05:33:16 PM
Is it possible to integrate an image gallery into the footer? How do I do this?
I do not know... May be copied in footer block PHP code that displays images.

davidhs

New version:
2.1     2013-11-02
------------------
! There was a PHP error when the list of blocks was empty.
! Error in source code.
+ Upgrade code to the configuration variables from version 2.0.x to 2.1.
+ Field to indicate if a block is active.
+ Custom blocks above and below the forum header and above and below the forum footer.

S Mac

Hi, can you tell me how to add my logo to the header block? I uploaded my logo to a folder using FTP - how do I get it into the header?


davidhs

Quote from: S Mac on November 04, 2013, 03:52:35 PM
Hi, can you tell me how to add my logo to the header block? I uploaded my logo to a folder using FTP - how do I get it into the header?
You can create a header block with this BBC content
[img]url_to_your_logo[/img]
and check all permissions (Guest:View, User:View, Moderator:View, Administrator:View).

S Mac

Thank you, I've just tried this but it doesn't find the image. It just leaves a placeholder. Any ideas?

davidhs

Where do you uploaded the logo? I suppouse your forum directory/folder is FORUM.

If your logo is on FORUM/logo.gif, then write
[img]url_forum/logo.gif[/img]

If your logo is on FORUM/img/logo.gif, then write
[img]url_forum/img/logo.gif[/img]

S Mac

I sorted that, thanks. Now I want to give a credit at the bottom of the forum, underneath the SMF copyright part, for a logo and icons I've used on my forum. I want to say "icons by iconfinder.com", with a link to their website. Can you tell me how to do this please?

davidhs

Quote from: S Mac on November 09, 2013, 07:07:02 PM
Now I want to give a credit at the bottom of the forum, underneath the SMF copyright part, for a logo and icons I've used on my forum. I want to say "icons by iconfinder.com", with a link to their website. Can you tell me how to do this please?
If you create a footer block, you must copy SMF copyright on the block, so you can create a block below de forum footer (new feature on version 2.1 :) ) with only your copyright. For example:
QuoteFrame: ...
Type: HTML
Content:
<a href="...">icons by iconfinder.com</a>
Order: 1
Permissions: Guest:View, User:View, Moderator:View, Administrator:View
Active: Yes

Advertisement: