https://www.icyphoenix.com/viewtopic.php?f=28&t=544
-----------------------------------
moreteavicar
Thu 02 Nov, 2006 17:14

Override block file title (for most blockfiles!)
-----------------------------------
I made this recently as I wanted to rename the displayed titles for some IMPortal block files, i.e. override the default block title that is given by a block file with the name entered for a block. This allows it to be done in ACP without need to change the /blocks/lang/lang_block_name.php files. Note, it doesn't work with every XS block file (they don't all use the /blocks/lang/lang_block_name.php method (standard in IMPortal) to give a title)- see Author Notes: Exceptions - Unless changes are made to the offending blocks to make them more standard in future releases... MG take note ;)
[code]
############################################################## 
## MOD Title: IMPortal Title Override option
## MOD Author: MoreTeaVicar < adrian.stannard@icps2007.org > 
## MOD Description: This gives the option in blocks management
##			  of Admin Control Panel >> IMPortal
##                  to override the default titlebar text of a 
##			  block file with the block title you have entered
##                  entered.
## MOD Version: 1.0.0
## 
## Installation Level: (Easy) 
## Installation Time: 5-10 Minutes
## Files To Edit: - templates/ca_aphrodite/admin/blocks_edit_body.tpl
##                - templates/ca_aphrodite/admin/blocks_list_body.tpl
##                - adm/admin_blocks.php
##                - includes/functions_portal.php
##                - language/lang_english/lang_admin.php
##			
## Included Files: n/a
##############################################################  
## Author Notes: Exceptions
## 	  For phpbbXS this will not override the titlebar 
##      on some files, for e.g. nav_links_block, this 
##      has the title hard-coded in:
##      templates/ca_aphrodite/blocks/nav_links_block.tpl
##      and the xs_news_block has its title hard-coded in:
##      templates/ca_aphrodite/blocks/xs_news_block.tpl     		  
## 
############################################################## 
[/code]

Configuring override:
[url=http://upload4.postimage.org/1548627/photo_hosting.html][img]http://upload4.postimage.org/1548627/ovveride1.jpg[/img]

Status of Block file title override in block listing:
[url=http://upload4.postimage.org/1548636/photo_hosting.html][img]http://upload4.postimage.org/1548636/ovveride2.jpg[/img]

In action - changing "Wordgraph" to "Popular Words"
[url=http://upload4.postimage.org/1548647/photo_hosting.html][img]http://upload4.postimage.org/1548647/ovveride3.jpg[/img]

NB: There may be other XS block files that don't use the IMPortal title naming method, besides those given in exceptions ;)


-----------------------------------
difus
Thu 02 Nov, 2006 17:46

Re: Override block file title (for most blockfiles!)
-----------------------------------
it is nice moreteavicar  :D 

but it is useful then using one language I think


-----------------------------------
moreteavicar
Thu 02 Nov, 2006 19:32

Re: Override block file title (for most blockfiles!)
-----------------------------------
Thanks ;)

Sorry, not sure what you mean about language - here you can call a block anything you want in any language, and have that name displayed instead of the default title block name, if that helps. 

And for example, as standard in IMPortal, suppose you are using a blockfile... you want to call it "Site updates" or something. And then, suppose you want to have another block using the same blockfile and call it "Latest developments". Under the default system both the titles would always be displayed as the default blockfile title ... (and if you edit the block language file, whatever you put in the language file would still be labelled to both titlebars). With this, once installed, you can easily override the default to display two unique titles "Site updates" and "Latest developments".

Hence adding this mod would be one more small step to make IMPortal a CMS ;)

The next step would be to modify the XS blocks... 
And after that, to have settings like "news forum id(s)" a unique property to a block, rather than a "global" configuration (e.g. portal config and news config)...


-----------------------------------
Mighty Gorgon
Sat 04 Nov, 2006 00:46

Re: Override block file title (for most blockfiles!)
-----------------------------------
Sorry, but I don't understand what this modification is for.

Currently you can assign your own name to any block... you need just to choose no on [b]Localize Titlebar[/b] and you are set... :roll:

Regarding News, all the settings are the ones in the news section.

Anyway I'll try to make them clearer.


-----------------------------------
moreteavicar
Sat 04 Nov, 2006 17:39

Re: Override block file title (for most blockfiles!)
-----------------------------------
Argggh... you're right! I always set localise titlebar to on, just test it off (normally I use my own blockfiles without default titles anyway!) - Its not clear from its name that it means to assign the default name of the title bar... the name "default title" is much more appropriate. 

Should have been obvious here:
includes/functions_portal.php

if(($lang_exist) && ($block_info[$b_counter]['local'] == 1))

Bah! And I created this mod for nothing! Oh well... it was fun...

That said... the xs block files are still not fully compatible with this system and require manual adjustment of the title name, as opposed simply setting localise titlebar to no.

[quote user="Mighty Gorgon" post="4410"]Regarding News, all the settings are the ones in the news section.

Anyway I'll try to make them clearer.[/quote]

What I had in mind was to move the blockfile configurations on the block add/edit page, and unique to each block. The news section and portal config are global, they make every block that displays a news item to have the same content. But suppose you want a forum news block on the centre of the page, and the rss news block elsewhere, e.g. on the left/right sidebar or header/footer... Or... one forum news block reading a specific topic in one postion, and another forum news block reading something else, positioned somewhere else... 

I was thinking of using javascript onchange in the option/select block file list to refresh the page on selection, and if the selection is a news block, a new config area appears on the add/edit block page to input the parameters. These then get saved in the block table as opposed to the portal config/news table. The block files are then changed to take the parameters from the block table... e.g. $block_info[$b_counter]['forum_id'] instead.


-----------------------------------
moreteavicar
Sat 04 Nov, 2006 18:29

Re: Override block file title (for most blockfiles!)
-----------------------------------
Hmmm... I tried to remove the attached file in my first post, but got 

SECURITY ALERT

CBACK CrackerTracker has detected a potential attack on this site with a worm or exploit script so the Security System stopped the script.

Seems also to affect posting as well as attachments  :roll: ...


-----------------------------------
Mighty Gorgon
Mon 06 Nov, 2006 03:08

Re: Override block file title (for most blockfiles!)
-----------------------------------
I think that now you should be able to remove your attachment... but you can also leave it... :wink:

Back on topic... I don't understand what you would like to add in the Block ADD/EDIT page.

I think that what is important is to add a new field for the Block Vars which is the Block ID: adding this feature you will be able to customize the Blocks Variable on a per Block basis. :wink:


I'll try to play with this soon and get back to you. :wink:


-----------------------------------
moreteavicar
Mon 06 Nov, 2006 13:51

Re: Override block file title (for most blockfiles!)
-----------------------------------
OK, another example... You want to create 2 xs news blocks. One for centre page, and one for sidebar. You want the sidebar to display RSS feed only, and the centre page to display xs news entries only. You cannot configure ACP>>News>>XS News on a per block basis. Every XS news block will then display the same contents, because they are based on a single news configuration, which does not assign to Block ID. 

The same applies to any news block. Example - You want to have a centre newsblock with one forum id, and another newsblock located somewhere else on the page (e.g. footer in A69) dedicated to another forum id... again, this can only be configured in the ACP>>News configuration, and is not unique to any Block ID. 

So what I am thinking is to change the config so that the variables are assigned within the block table - on a block id basis...


-----------------------------------
Mighty Gorgon
Wed 08 Nov, 2006 22:37

Re: Override block file title (for most blockfiles!)
-----------------------------------
[quote user="moreteavicar" post="4518"]OK, another example... You want to create 2 xs news blocks. One for centre page, and one for sidebar. You want the sidebar to display RSS feed only, and the centre page to display xs news entries only. You cannot configure ACP>>News>>XS News on a per block basis. Every XS news block will then display the same contents, because they are based on a single news configuration, which does not assign to Block ID. 

The same applies to any news block. Example - You want to have a centre newsblock with one forum id, and another newsblock located somewhere else on the page (e.g. footer in A69) dedicated to another forum id... again, this can only be configured in the ACP>>News configuration, and is not unique to any Block ID. 

So what I am thinking is to change the config so that the variables are assigned within the block table - on a block id basis...[/quote]
I'm working on it.

If you have the patience to wait me to complete the work, you'll have a brand new CMS... :wink:


