TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,234
  • Total Topics: 21,353
  • Online today: 565
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 499
  • Total: 499

HELP! Need a quick hack for block "access choices"

Started by peterstaley, February 14, 2007, 01:50:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

peterstaley

When creating or editing a block in TinyPortal, the bottom of the page includes bunch of options for restricting access to that block, like only showing it when in a specific board.

I need to impliment by TONIGHT an option to show certain blocks EVERYWHERE, EXCEPT in one board.  At this time, TP only lets me select a single board for SHOWING the block ("Show when inside this board:").  I need a "Show everywhere except when inside this board:" option.

We're launching this new board tonight on behave of a major TV series that wants the public to discuss an HIV-related plot line they're starting.  I run the leading HIV-related forums on the web.

Peter Staley
Founder
AIDSmeds.com (forums.poz.com)

IchBin

You will not get that option built into TP by tonight. The only thing you can do is put in some code to keep it from showing. But that would depend on where you "don't" want it to show. So if you could provide more details I might be able to hack something up, or one of our Team Coders will. But we need more details from you first.

peterstaley

I basically need 2 php blocks (one left side, and one center) to NOT appear when users are in board=18.0 -- whether they are viewing posts there, or creating threads or replying to threads in that board.

The block should appear anytime they are outside of that board (our forums home page, PM pages, other boards, etc.).

Does that help?

And yes, I'm only asking for some special coding to insert somewhere that will make this work.

Thanks,

Peter

IchBin

Well, I'm not sure how you could get it to identify when you're viewing posts or topics. I could do it while your in the board by checking the URL to see which board your in. But I don't know how to do it when viewing posts in the board because the board ID number is not present in the URL. You'll probably have to wait for one of the other guys to see if they know something.

peterstaley

Okay.  How does the current coding know to show a block using the "Show when inside this board" option, even if you are posting or viewing threads/messages within that board?  The current coding is able to ONLY show the block when in a specific board, regardless of what you are doing in that board.  I just need the opposite -- NOT showing the block when in a specific board.

Please show this to the "other guys" in case they can help.  And thanks for replying so fast thus far!

Peter

IchBin

#5
Put this in a block. (change X to the board ID you need)

if($context['current_board'] != X)
{

// All your code for the block goes in between these two brackets.

}


peterstaley

Very Cool!!  That works perfectly!

I'm can't thank you enough.  Watch CSI: NY tonight.  They'll be a plug at the end for knowhivaids.org, which will link to our forums for a discussion on the storyline that will play out over the next few months.  You've helped us make this special board exactly what CBS wants it to look like!

Peter

IchBin

Sweet. Now just give TinyPortal a plug at your site. ;)

Gourgi

Quote from: IchBinâ„¢ on February 14, 2007, 03:05:08 PM
Put this in a block. (change X to the board ID you need)

if($context['current_board'] != X)
{

// All your code for the block goes in between these two brackets.

}



Great !!!!
IchBin many thanks !!!!
i needed that too.

Flex

I reckon Ichbin should be on tv for the outstanding work done here :)

This website is proudly hosted on Crocweb Cloud Website Hosting.