1
MadFish
Make default block view = yes
  • 2007/5/23 4:17

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


Does anyone know how to change the default view in blocks administration to only show those that are online? (ie. 'yes' instead of 'all').

I have millions of unused blocks, and it is quite annoying to have to wait for the page to load/sort through it all.

2
JMorris
Re: Make default block view = yes
  • 2007/5/23 5:31

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


No, but I've figured out a work-a-round.

Go into Group permissions (Registered Users) and uncheck any block that is not enabled.

Since the default block view is for Registered members, the blocks you just unchecked will not display unless you select webmaster from the drop-down list box.

It's a pain in the butt at first, but in the long run, it saves a lot of time.

HTH
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

3
migoe
Re: Make default block view = yes
  • 2007/5/23 6:57

  • migoe

  • Just popping in

  • Posts: 68

  • Since: 2003/4/2 9


Quote:
Does anyone know how to change the default view in blocks administration to only show those that are online? (ie. 'yes' instead of 'all').


It is very easy:

Look for this code in /modules/system/admin/blockadmin/blocksadmin.php

function list_blocks()
    {
        global 
$xoopsUser$xoopsConfig;
        include_once 
XOOPS_ROOT_PATH.'/class/xoopslists.php';
        
//OpenTable();
        
$selmod = isset($_GET['selmod']) ? intval($_GET['selmod']) : 0;
        [
u][b]$selvis = isset($_GET['selvis']) ? intval($_GET['selvis']) : 2;[/b][/u]
        
$selgrp = isset($_GET['selgrp']) ? intval($_GET['selgrp']) : XOOPS_GROUP_USERS;
        echo 
"


the bold and underline piece of code is the secret. Chance "2" to "1" an you will be happy

migoe
whttp://www.liedermacher-forum.de | German Singers and Songwriters

http://www.weltladen-rothenburg.de | German Site about Fair trade Project

4
MadFish
Re: Make default block view = yes
  • 2007/5/23 7:16

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


It works! Thank you both - this will save me about 30 seconds per page load!

Edit: Submitted to XOOPSFAQ.

5
JMorris
Re: Make default block view = yes
  • 2007/5/23 11:42

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Great hack migoe! Thanks!
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

6
robstockley
Re: Make default block view = yes

I did the same thing a while back but I also wanted the default group to be anonymous users. This is just as easy to do. In the very next line you just have to change XOOPS_GROUP_USERS to XOOPS_GROUP_ANONYMOUS like this.
function list_blocks()
    {
        global 
$xoopsUser$xoopsConfig;
        include_once 
XOOPS_ROOT_PATH.'/class/xoopslists.php';
        
//OpenTable();
        
$selmod = isset($_GET['selmod']) ? intval($_GET['selmod']) : 0;
        
$selvis = isset($_GET['selvis']) ? intval($_GET['selvis']) : 1;
        [
b][u]$selgrp = isset($_GET['selgrp']) ? intval($_GET['selgrp']) : XOOPS_GROUP_ANONYMOUS;[/u][/b]

Both XOOPS_GROUP_USERS and XOOPS_GROUP_ANONYMOUS are defined in /mainfile.php.
Enjoy!
Rob

Login

Who's Online

312 user(s) are online (214 user(s) are browsing Support Forums)


Members: 0


Guests: 312


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