1
trspice
How can the BlockType order be re-arranged
  • 2007/4/4 21:11

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


I want to re-arrange the BlockType list of the Add New Block editor like this

Center-block center
Side-block left
Side-block right
Center-block left
Center-block right

I did some editing to
include/common.php
modules/admin/blocksadmin/blockform.php

and it did re-arrange the way I want but now the System admin > Groups display does not show center blocks and all blocks display in the right list.

Are there other files that need to be edited to make this change?
There's nothing but science....
The Reggae Album

2
trspice
Re: How can the BlockType order be re-arranged
  • 2007/4/6 5:28

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


Problem solved. I had to edit class/xoopsblock.php
There's nothing but science....
The Reggae Album

3
trspice
Re: How can the BlockType order be re-arranged - My solution
  • 2007/4/6 20:28

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


UPDATE: There is a bug with this that causes existing blocks to switch places when the changed files are uploaded. You just have to re position them. Still trying to figure a fix.

This mod rearranges the list as shown in the first post. Using the same method you can arrange them to suit. Also I removed the bottom blocks but you may need them.

If you are wondering why I did this well I have other people who add content and they, and myself most times just go straight to page selection and then the content area then submit and the block end up in the left column since it is set as default. We realized that most of our content is for the center so it was best for it to be default.

Edit include/common.php from line 115
[b]original[/b]
    
define("XOOPS_SIDEBLOCK_LEFT",0);
    
define("XOOPS_SIDEBLOCK_RIGHT",1);
    
define("XOOPS_SIDEBLOCK_BOTH",2);
    
define("XOOPS_CENTERBLOCK_LEFT",3);
    
define("XOOPS_CENTERBLOCK_RIGHT",4);
    
define("XOOPS_CENTERBLOCK_CENTER",5);
    
define("XOOPS_CENTERBLOCK_ALL",6);
    
define("XOOPS_CENTERBLOCK_BOTTOMLEFT",7);
    
define("XOOPS_CENTERBLOCK_BOTTOMRIGHT",8);
    
define("XOOPS_CENTERBLOCK_BOTTOM",9);

    [
b]the change[/b]
    [
color=ae0000]define("XOOPS_CENTERBLOCK_CENTER",0);
    
define("XOOPS_SIDEBLOCK_LEFT",1);
    
define("XOOPS_SIDEBLOCK_RIGHT",2);
    
define("XOOPS_SIDEBLOCK_BOTH",3);
    
define("XOOPS_CENTERBLOCK_LEFT",4);
    
define("XOOPS_CENTERBLOCK_RIGHT",5);
    
define("XOOPS_CENTERBLOCK_ALL",6);
   
/* define("XOOPS_CENTERBLOCK_BOTTOMLEFT",7); */
   /* define("XOOPS_CENTERBLOCK_BOTTOMRIGHT",8); */
   /* define("XOOPS_CENTERBLOCK_BOTTOM",9); */
[/color]


Edit class/xoopsblock.php lines 317, 319, 353, 355
[b]original[/b]
[
b]317[/b]    $side "(b.side=0 OR b.side=1)";
            } elseif ( 
$side == XOOPS_CENTERBLOCK_ALL ) {
[
b]319[/b]                $side "(b.side=3 OR b.side=4 OR b.side=5 OR b.side=7 OR b.side=8 OR b.side=9 )";

[
b]353[/b]    $side "(side=0 OR side=1)";
            } elseif ( 
$side == ) {
[
b]355[/b]                $side "(side=3 OR side=4 OR side=5 OR side=7 OR side=8 OR side=9)";

[
b]the change[/b]
  [
color=ae0000$side "(b.side=1 OR b.side=2)";
            } elseif ( 
$side == XOOPS_CENTERBLOCK_ALL ) {
                
$side "(b.side=0 OR b.side=4 OR b.side=5 OR b.side=7 OR b.side=8 OR b.side=9 )";

    
$side "(side=1 OR side=2)";
            } elseif ( 
$side == ) {
                
$side "(side=0 OR side=4 OR side=5 OR side=7 OR side=8 OR side=9)";[/color]


Edit modules/system/admin/blocksadmin/blockform.php line 34
[b]original[/b]
$side_select->addOptionArray(array(=> _AM_SBLEFT=> _AM_SBRIGHT=> _AM_CBLEFT=> _AM_CBRIGHT=> _AM_CBCENTER=> _AM_CBBOTTOMLEFT=> _AM_CBBOTTOMRIGHT=> _AM_CBBOTTOM, ));

[
b]the change[/b]
[
color=ae0000]
$side_select->addOptionArray(array(=> _AM_CBCENTER=> _AM_SBLEFT=> _AM_SBRIGHT=> _AM_CBLEFT=> _AM_CBRIGHT, ));[/color]


Note that you are corresponding numbers with each change. The number 3 is not used in blocksform.php because it is used in common.php for the define XOOPS_SIDEBLOCK_BOTH you can juggle the numbers anyway just as long as they correspond in all files.
There's nothing but science....
The Reggae Album

Login

Who's Online

398 user(s) are online (251 user(s) are browsing Support Forums)


Members: 0


Guests: 398


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits