How Can I Hide Info Center From MEMBERS?

Started by robbinsnike, November 23, 2009, 06:51:16 PM

Previous topic - Next topic

Matthew K.


Matthew K.

#21
./Themes/default/Boardindex.template.php

Find:

// Here's where the "Info Center" starts...


Add Before:

if($context['user']['is_admin']) {


Find:

echo '
</div>
</div></div>


Replace with:

echo '
</div>
</div></div>';
}
echo '

That should work for you.

Labradoodle-360

Matthew K.

Sorry, left out the bottom. Ignore the second edit and do this edit in ./Themes/default/Boardindex.template.php as well as the first:

Find:

echo '
<span class="lowerframe"><span></span></span>';


Add After:

}

JasonDD


JasonDD

I've just noticed the bottom of the board is separated from the main part after applying the code, is it possible to fix this somehow?


Matthew K.

Can you screenshot the whole page please?
Quote from: JasonDD on December 09, 2009, 02:55:45 PM
I've just noticed the bottom of the board is separated from the main part after applying the code, is it possible to fix this somehow?




Matthew K.

I just tested the edits, again with SMF 2.0 RC2 and it works.

Just make sure you follow my second post for the second edit...here are the proper edits again:

./Themes/default/BoardIndex.template.php

Find: // Here's where the "Info Center" starts...
Add Before: if ($context['user']['is_admin']){

Find: // Info center collapse object.
Add Before }

Arantor

Can I make a simpler suggestion to all that?

In 2.0's BoardIndex.template.php, the info_center is a separate template entirely. Drop the call to it and add a div with appropriate styling in its place.
Holder of controversial views, all of which my own.


Matthew K.

I would think adding one line and one character to close the one line is more simple.

Arantor

I'd put the if in front of the call to template_info_center then fix the layout issues is simpler, since your method won't always do it correctly, but hey, what do I know.
Holder of controversial views, all of which my own.


Matthew K.

I just updated the edits for 2.0, following your edits from 1.1 earlier in this thread.

Arantor

And the layout is often still broken as a result because the divs that handle the edge are not covered - as indicated earlier.

* Arantor would point out he already published a mod somewhere in Coding Discussion to deal with this in 2.0 RC1.2 and didn't realise a 2.0 RC2 version for just this reason.
Holder of controversial views, all of which my own.


JasonDD

to Labradoodle-360

I followed your second post as well, unfortunately with no luck though. I even copied a fresh Boardindex file and edited it but that didn't solve it either  :-\

Quote from: Arantor on December 09, 2009, 05:16:50 PM
I'd put the if in front of the call to template_info_center then fix the layout issues is simpler, since your method won't always do it correctly, but hey, what do I know.

Could you please tell me Arantor how to do that ?


Matthew K.

Simply find:function template_info_center()
{


Add Before:if ($context['user']['is_admin']){

Find:}
?>

Add Before:}

Labradoodle-360

Arantor

NO. That will BREAK your index.template.php file.

Code (find) Select
template_info_center();

Code (add before it) Select
if ($context['user']['is_admin'])

As for fixing up the template as mentioned earlier, haven't done that in a while, not sure off hand how to do it as I don't have a copy of RC2 handy to try it on.
Holder of controversial views, all of which my own.


Matthew K.


Arantor

Yours stops the function being declared meaning that when it is called in template_main, PHP throws an undefined function error for non admins. Mine stops it being called - but it's still declared.

Try both - as an admin and non admin user.
Holder of controversial views, all of which my own.


JasonDD

Thanks guys,

I tried one more option - what Labradoodle-360 suggested in the first post - without the edit in the second post. It actually worked so that the board is not separated, although I'm not sure if it displays correctly (There seems to be more white space between those frames). Take a look :

http://img46.imageshack.us/img46/9549/92416762.png [nofollow]


Matthew K.

It isn't, exactly what I said in my next post. I left out the bottom slice spans. Take a look at the spans right below where you add } to.

Advertisement: