Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
4 - 2 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Make default block view = yes
by robstockley on 2007/6/3 23:27:21

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.
le="color: #000000"><?php 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
Re: Make default block view = yes
by JMorris on 2007/5/23 11:42:15

Great hack migoe! Thanks!
Re: Make default block view = yes
by MadFish on 2007/5/23 7:16:12

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

Edit: Submitted to XOOPSFAQ.
Re: Make default block view = yes
by migoe on 2007/5/23 6:57:10

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

le="color: #000000"><?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
Re: Make default block view = yes
by JMorris on 2007/5/23 5:31:26

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

Who's Online

142 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits