Custom blocks

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

Previous topic - Next topic

davidhs

Link to Mod

Custom blocks

ABOUT...

Custom blocks, 2.5.2
© 2013-2020 by davidhs
© Polish language 2014-2018 by FishingManMatt


This work is licensed under a Creative Commons Attribution 3.0 Unported License.

DESCRIPTION

Allows to show custom blocks:

  • Forum header:

         
    • Above the forum header.
    • Instead of default header of forum.
    • Below the forum header.
  • Forum menu:

         
    • Instead of the forum menu.
  • Message index:

         
    • Above the child boards of the message index.
    • Above the messages of the message index.
    • Below the messages of the message index.
  • Forum footer:

         
    • Above the forum footer.
    • Instead of default footer of forum.
    • Below the forum footer.

Can be define any number of blocks through several parameters:

  • Frame: HTML code with attributes for DIV tag which skirts the content of the block. If left empty is not put DIV tag. Through style or class attributes (CSS styles and classes) may indicate position, size and others characteristics of the block.
  • Type: A block can contain HTML code (the default option), BBC or PHP.
  • Content: Content of the block. Position, size and others characteristics of the block may be indicated here or in frame. Can be used the following variables:

    • {BOARDURL} - URL to forum folder.
    • {SCRIPTURL} - Web address of forum.
    • {IMAGES_URL} - URL to the images folder in the users current theme.
    • {DEFAULT_IMAGES_URL} - URL to the images folder in the default theme.
    • {MENU} - Forum menu. Can be used only in blocks of the forum header, menu or footer. If it is not found, a block with the text of menu will be created in forum menu area.
    • {COPYRIGHT} - Copyright of the forum. Can be used only in blocks of the forum header, menu or footer. If it is not found, a block with the text of copyright will be created in forum footer area.
    • {ID_BOARD} - ID of the board. Can be used only in blocks of the message index.
  • Order: Position of the block in relation to the other blocks from left to right.
  • Permissions: Indicates the user group that can see the block. By default none.
  • Active: Indicates if a block is active. By default active.

    

EXAMPLE

QuoteBlocks above the forum header


Frame: style="height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block above the header[/size] [color=red]- Block above the header - Block above the header[/color]
Order: 1
Permissions: Guest:View, User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Blocks in the forum header


Frame: style="float: left; width: 250px; height: 50px; border: 5px solid red;"
Type: HTML
Content: <span style="font-size: 12pt;">Block header 1</span> <span style="color: red;">- Block header 1 - Block header 1</span>
Order: 1
Permissions: User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Frame: style="float: left; width: 10%; height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block header 2[/size] [color=red]- Block header 2[/color]
Order: 2
Permissions: User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Frame: style="float: center; height: 50px; border: 5px solid red;"
Type: PHP
Content: $bl = 'Block header 3';
echo '<span style="font-size: 12pt;">', $bl, '</span> <span style="color: red;">- ', $bl, ' - ', $bl, '</span>';

Order: 4
Permissions: User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Frame: style="float: right; width: 150px; height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block header 4[/size] [color=red]- Block header 4[/color]
Order: 3
Permissions: User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Frame: style="height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block header guest[/size] [color=red]- Block header guest - Block header guest[/color]
Order: 1
Permissions: Guest:View
Active: Yes


Blocks below the forum header


Frame: style="height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block below the header[/size] [color=red]- Block below the header - Block below the header[/color]
Order: 1
Permissions: Guest:View, User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Blocks above the forum footer


Frame: style="height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block above the footer[/size] [color=red]- Block above the footer - Block above the footer[/color]
Order: 1
Permissions: Guest:View, User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Blocks in the forum footer


Frame: style="float: left; width: 33%; height: 50px; border: 5px solid red;"
Type: HTML
Content: <span style="font-size: 12pt;">Block footer all</span> <span style="color: red;">- Block footer all - Block footer all</span>
Order: 1
Permissions: Guest:View, User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Frame: style="float: right; width: 50%; height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block footer user[/size] [color=red]- Block footer user - Block footer user[/color]
{COPYRIGHT}

Order: 2
Permissions: User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes


Frame: style="float: right; width: 200px; height: 50px; border: 5px solid red;"
Type: PHP
Content: $bl = 'Block footer guest';
echo '<span style="font-size: 12pt;">', $bl, '</span> <span style="color: red;">- ', $bl, ' - ', $bl, '</span>';

Order: 2
Permissions: Guest:View
Active: Yes


Blocks below the forum footer


Frame: style="height: 50px; border: 5px solid red;"
Type: BBC
Content: [size=12pt]Block below the footer[/size] [color=red]- Block below the footer - Block below the footer[/color]
Order: 1
Permissions: Guest:View, User:View, Local moderator:View, Global moderator:View, Administrator:View
Active: Yes

Users, moderators and administrators see this:

Guests see this:

SMF COMPATIBILITY


  • SMF 1.1 to 1.1.21.
  • SMF 2.0 to 2.0.17.
  • SMF 2.1 Beta 3 and RC1 to RC2.

This MOD is installed without errors in default theme and similars. For others themes is necessary to make changes at hand:

LANGUAGES


  • english, english_british.
  • polish.
  • spanish (SMF 1.1.x), spanish_es, spanish_latin.

DOWNLOAD

Link to MOD

MANUAL INSTALLATION

See https://wiki.simplemachines.org/smf/Manual_installation_of_mods

COLLABORATE WITH THIS MOD

This work is licensed under a Creative Commons Attribution 3.0 Unported License.

You are free to share and adapt this MOD. Also you can collaborate in different ways:

CHANGE LOG

Legend:   ! Fixed   + Added   - Removed   * Changed   @ Note

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.

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.

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.

2.4     2015-05-15
------------------
+ Field in administration panel to edit the position of the block.
+ SMF compatibility: 1.1.21 and 2.0.10.
+ Languages: polish, polish-utf8, thanks to FishingManMatt.

2.3.2   2014-10-08
------------------
+ SMF 1.1.x: Implemented a generic form of displaying lists, similar to SMF 2.0.x.
+ SMF compatibility: 1.1.20 and 2.0.9.

2.3.1   2014-06-24
------------------
! Use HTML entities in ISO-8859-1 languages.
+ Functions to get/update/delete data check the parameters before using them.
* Big multi-line text input fields are wider.
* Submit buttons have shortcut key to get focus.
+ SMF compatibility: 2.0.8.

2.3     2014-01-25
------------------
+ Upgrade code to the configuration variables from versions 2.1-2.2 to 2.3.
* Permissions for local moderator and global moderator instead of moderator.
+ Checkbox to select all users of permissions.
+ SMF compatibility: 2.0.7.

2.2     2013-12-20
------------------
! SMF 2.0.x: Functions of administration area must return settings variables for the Quick Search of the Administration Center.
+ SMF 2.0.x: The Quick Search of the Administration Center look for in settings variables of MOD.
+ Variable in content of the block to insert URL to forum folder.

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.

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.

1.0     2013-05-06
------------------
@ This work is licensed under a Creative Commons Attribution 3.0 Unported License https://creativecommons.org/licenses/by/3.0/
+ Custom blocks instead of default header and footer of forum.
+ Administration panel.
+ SMF compatibility: 1.1 to 1.1.18.
+ SMF compatibility: 2.0 to 2.0.4.
+ Languages: english, english-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8.

Biology Forums

Congratulations on your mod. I like how you've made it compatible with 1.1.18 as well ;)

4Kstore

Nice mod and great idea!
Thanks

¡¡NEW MOD: Sparkles User Names!!!

FrizzleFried

I'd love to see a DEMO site with a few ideas...

davidhs

Quote from: FrizzleFried on July 01, 2013, 11:45:57 AM
I'd love to see a DEMO site with a few ideas...
I am sorry, I have not DEMO site. You can copy example data of first post and write on content other data (i.e. profile user, unread posts, news, logo, advertisement,..)

Rudico

First, I would like to thank you for this mod. Custom Blocks is especially great for people who do not understand html/php and want to change/add there own top or footer menu. I'm new to SMF but I remember having the same problem with other forum software.

Before my question, my configuration first:
1) SimpleMachines (very new install)
2) SimplePortal (very new install)
3) Custom Blocks (very new install)

My question:
1) Is it possible to put my menu on top of everything on my web page , the first pixel so to speak (sorry, I can not show a link in this forum)?
2) Can I make Custom Blocks work with other themes than the default theme (got an error msg when I installed Custom Blocks about the other themes)? I also tried without SimplePortal, but same problem, no custom block to see in other themes than the default theme.

Thank you!


davidhs

Quote from: Rudico on July 19, 2013, 08:52:00 AM
I'm new to SMF
Welcome to SMF world! :)

Quote from: Rudico on July 19, 2013, 08:52:00 AM
1) Is it possible to put my menu on top of everything on my web page , the first pixel so to speak (sorry, I can not show a link in this forum)?
With my MOD this is not possible. I do not know if exists a MOD for this.
You need modify index.template.php of your theme.

Quote from: Rudico on July 19, 2013, 08:52:00 AM
2) Can I make Custom Blocks work with other themes than the default theme (got an error msg when I installed Custom Blocks about the other themes)? I also tried without SimplePortal, but same problem, no custom block to see in other themes than the default theme.
Custom Blocks only work with default theme and others themes that do not modify the header and footer of the forum.

S Mac

Hi, I've just downloaded this mod and it's not working properly. When it asks for the number of blocks, if I change the number from zero to '1', it adds a block but seems to delete the rest of the content from my forum. See attachment. The only way I can rectify it afterwards is by clicking back in the browser and re-entering a '0' value in the box. Please help!

davidhs

Quote from: S Mac on July 21, 2013, 12:57:27 PM
Hi, I've just downloaded this mod and it's not working properly. When it asks for the number of blocks, if I change the number from zero to '1', it adds a block but seems to delete the rest of the content from my forum. See attachment. The only way I can rectify it afterwards is by clicking back in the browser and re-entering a '0' value in the box. Please help!
You have not attachment but you do not worry, it work properly.

When you write a '1' (i.e on blocks of header) your default header is deleted and a empty block is displayed. If you write something on content of block and click on save button, new content is displayed on block of header.

S Mac

Hi, no it's still not working. Forgot to add the attachment before - here it is. This depicts the home page of my forum after entering a 1 value in the box. Thanks!

davidhs

Quote from: S Mac on July 22, 2013, 03:31:35 PM
Hi, no it's still not working. Forgot to add the attachment before - here it is. This depicts the home page of my forum after entering a 1 value in the box. Thanks!
On your image, I suppouse white box is your empty block, but I do not know why do not display your forum.

Perhaps my MOD do not work with your theme...

Can you attach index.template.php and index.css of your theme? And tell me your SMF version.

S Mac

Sorry, I have no idea how to attach the index.template.php and index.css of my template. Do I cut and paste? But I can tell you the forum version, sorry I forgot. It's 2.0.4 and the theme is curve. Does that help?

davidhs

Quote from: S Mac on July 23, 2013, 05:14:10 PM
...the forum version, sorry I forgot. It's 2.0.4 and the theme is curve. Does that help?
This MOD work on SMF 1.1.x and 2.0.x and default theme (curve is default theme on 2.0.x. This MOD should work on your forum.

Quote from: S Mac on July 23, 2013, 05:14:10 PM
Sorry, I have no idea how to attach the index.template.php and index.css of my template. Do I cut and paste?
You should download these files from the server of your forum (use FTP or SSH):
- DIR_FORUM/Themes/default/index.template.php
- DIR_FORUM/Themes/default/css/index.css
and attach on a reply.

If you forum is public you can tell me the url of forum (on a post or by PM) and then I will can see your  HTML code.

Also try do this on your custom blocks
QuoteBlocks in the forum header
Number of blocks: 1


Type: BBCode
Content: [html]<div style="height: 100px; border: 5px solid maroon;">[/html][size=14pt]Block header guest[/size] [color=maroon]- Block header guest - Block header guest - Block header guest - Block header guest[/color][html]</div>[/html]
Order: 0
Permissions: Guests
This create only one block on head and only for guest.

NOTE: I am not at home and I can only read forums once a day.

S Mac

Thanks, I came up with a temporary solution and added a logo url. Here's the url though, if that helps...www.blackbeautyhaircareforum.org.uk

davidhs

Quote from: S Mac on July 29, 2013, 04:35:02 PM
Thanks, I came up with a temporary solution and added a logo url. Here's the url though, if that helps...www.blackbeautyhaircareforum.org.uk
I see your forum and its HTML code.
- Your theme is not default theme of SMF (path: FORUM/Themes/default/). Your theme is "smf-curve" (path: FORUM/Themes/smf-curve/). I think code of header/footer are equal but I can not sure...
- I suppouse you had installed my MOD in your theme "smf-curve" (I can not know viewing only HTML code, I need php page), and you have defined 0 blocks.

I need see HTML code with 1 header block for help you.

S Mac

Thank you. Every time I try to change something, it takes days..and I'm very tired, so I'll wait until the weekend before I make any changes. If it's ok, I'll get that info for you to look at then. :)

S Mac

Hi, I've finally got round to getting the info you asked for on the support for custom blocks. Please find attached the files you requested. Is this what you need? I saved the info with the number of header blocks set to '1'. Thank you. :)

davidhs

Sorry, I see your files, I copied in my 2.0.4 forum test but I see my custom blocks. I do not found problems. :(

I do not know what is the problem. I am intrigued. Can you say to me your URL forum? (You can write here or by PM)

S Mac

Hi, link to the forum here. It probably won't help though, because custom blocks isn't enabled. It's only when I enter the value '1' in the Number of Blocks option. http://tinyurl.com/d8awp3m

DSystem

#19
Ola.

I installed this Mod and I haven't been able to use. I thought there was something wrong with my SMF. Then zeroed my these environments and put a clean install of SMF 2.0.5 and the problem persists.

When I click-> Admin-> Modification Settings-> Custom blocks

The menu does not appear. Nothing happens

Advertisement: