Advertisement:

Author Topic: Custom blocks  (Read 60766 times)

Offline DSystem

  • Jr. Member
  • **
  • Posts: 238
  • Gender: Male
  • EletronicaBR - Admin
    • eletronicaBR.com
Re: Custom blocks, 1.0 (SMF 1.1-1.1.18, 2.0-2.0.4)
« Reply #20 on: August 23, 2013, 10:48:15 PM »
I found the problem.

In the Admin-CustomBlocks.php file I changed the line 14 to:
Code: [Select]
function cb_admin_area(&$admin_areas)
and the line 22 to:
Code: [Select]
function cb_modify_modification(&$subActions)
Very good this mode. This of congratulations.

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 1.0 (SMF 1.1-1.1.18, 2.0-2.0.4)
« Reply #21 on: August 28, 2013, 07:37:36 AM »
I found the problem.

In the Admin-CustomBlocks.php file I changed the line 14 to:
Code: [Select]
function cb_admin_area(&$admin_areas)
and the line 22 to:
Code: [Select]
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Custom blocks, 1.0 (SMF 1.1-1.1.18, 2.0-2.0.4)
« Reply #22 on: August 28, 2013, 08:50:21 AM »
That's because the mod isn't compatible with PHP 5.4 and up yet.
No good deed goes unpunished
All helpful urges should be circumvented

Offline crousti

  • Newbie
  • *
  • Posts: 3
Re: Custom blocks, 1.0 (SMF 1.1-1.1.18, 2.0-2.0.4)
« Reply #23 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?


Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 1.0 (SMF 1.1-1.1.18, 2.0-2.0.4)
« Reply #24 on: September 02, 2013, 08:33:03 AM »
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.

Offline S Mac

  • Jr. Member
  • **
  • Posts: 311
Re: Custom blocks, 1.0 (SMF 1.1-1.1.18, 2.0-2.0.4)
« Reply #25 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?

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 1.0 (SMF 1.1-1.1.18, 2.0-2.0.4)
« Reply #26 on: September 18, 2013, 08:47:19 AM »
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.

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 2.0 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #27 on: October 23, 2013, 06:32:02 PM »
New version:
Code: [Select]
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.

Offline Padre gremista

  • Jr. Member
  • **
  • Posts: 236
  • Gender: Male
Re: Custom blocks, 2.0 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #28 on: October 25, 2013, 05:53:18 PM »
You may help me install this Mod in theme "actualism"?
www.gremioemfoco.info - A comunidade gremista na internet.

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 2.0 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #29 on: October 26, 2013, 06:52:10 AM »
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)
Code: [Select]
<div id="wrapper"', !empty($settings['forum_width']) ? ' style="width: ' . $settings['forum_width'] . '"' : '', '>
  <div id="header">
And replace by
Code: [Select]
<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)
Code: [Select]
// 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
Code: [Select]
// 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)
Code: [Select]
#footer { background: url(../images/art/botbg.png) repeat-x; height: 55px;}And replace by
Code: [Select]
#footer { background: url(../images/art/botbg.png) repeat; min-height: 55px;}

Offline S Mac

  • Jr. Member
  • **
  • Posts: 311
Re: Custom blocks, 2.0 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #30 on: October 27, 2013, 05:33:16 PM »
This is brilliant, it now works perfectly :) Is it possible to integrate an image gallery into the footer? How do I do this?

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 2.0 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #31 on: October 28, 2013, 06:20:57 AM »
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.

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #32 on: November 03, 2013, 07:23:12 AM »
New version:
Code: [Select]
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.

Offline S Mac

  • Jr. Member
  • **
  • Posts: 311
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #33 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?

Offline Antros22

  • Semi-Newbie
  • *
  • Posts: 55
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #34 on: November 04, 2013, 04:03:12 PM »
very nice mod  ;)

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #35 on: November 04, 2013, 04:23:55 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
Code: [Select]
[img]url_to_your_logo[/img]and check all permissions (Guest:View, User:View, Moderator:View, Administrator:View).

Offline S Mac

  • Jr. Member
  • **
  • Posts: 311
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #36 on: November 04, 2013, 04:34:28 PM »
Thank you, I've just tried this but it doesn't find the image. It just leaves a placeholder. Any ideas?

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #37 on: November 04, 2013, 06:26:57 PM »
Where do you uploaded the logo? I suppouse your forum directory/folder is FORUM.

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

Offline S Mac

  • Jr. Member
  • **
  • Posts: 311
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #38 on: November 09, 2013, 07:07:02 PM »
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?

Offline davidhs

  • Sophist Member
  • *****
  • Posts: 1,135
  • Gender: Male
Re: Custom blocks, 2.1 (SMF 1.1-1.1.19, 2.0-2.0.6)
« Reply #39 on: November 10, 2013, 08:37:41 AM »
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:
Quote
Frame: ...
Type: HTML
Content:
Code: [Select]
<a href="...">icons by iconfinder.com</a>Order: 1
Permissions: Guest:View, User:View, Moderator:View, Administrator:View
Active: Yes