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

Recent

Welcome to TinyPortal. Please login or sign up.

June 26, 2024, 09:25:45 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,280
  • Total Topics: 21,227
  • Online today: 319
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 287
  • Total: 287

Custom Action

Started by misfitmafia, May 13, 2008, 11:30:33 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

misfitmafia

I need some help using blocks with Custom Actions. When I create a center block and give it a custom action such as "aboutus", the link to show this block would be www.mysite.com/index.php?action=aboutus. The Block and content show up fine but so does the forum below the block. My problem is that I do not want the forum displayed below the block, is there anyway to keep the forum from displaying when using a custom action to display a center block?

JPDeni

I'm not sure if I understand what you're doing, but I think a better choice would be to use an article instead of a block.

misfitmafia

I originally used a article but articles so not use ?action= and I need this for the menu to work correctly. Also the block has built in membergroup permissions, I am writing some scipts for cetian users to use to make changes to the database and I do not want people randomly trying article numbers to access the scripts.

I know there has to be a way to disable the forum when viewing blocks via the ?action=. I just do not know what to modify. If someone could point me into the right direction I could figure out the code and fix it, thanks!!!

JPDeni

QuoteI know there has to be a way to disable the forum when viewing blocks via the ?action=.

Then I'll back out of the conversation, because you obviously know more about this than I do. :)

IchBin

misfit, there are several things you can do. You don't have to have something in an "action" to make the button work, as you can always add some PHP to make it work for articles.

if (isset($_GET['page']) && $_GET['page'] == 3)
     $current_action = 'page';


Then just set your button to use current action as page.

Then in your article you can always add code to check a membergroup. If the person is not in this member group they do not get to see or execute the block. I've posted the code for this many times, so a quick search of my posts you'll find out how.

misfitmafia

Thanks Ichbin, do i add that code in the template.index. The problem i was having with articles was adding them to the top menu, when adding the a link to an article the button did not work correctly because it was not an action.

But does anyone know why the forum shows up with blocks using custom actions. I have tried this on several of my forums and all of them act this same way, I just don't see why it always displays the forum under the block?

IchBin

You add that code to the template_menu function in the index.template.php file.

I don't quite get what you're saying in your last paragraph.

misfitmafia

If you visit the the site on working on www.inragecss.com/site/index.php and click the about us in the menu it will display the aboutus block but it also displays the forum right below it. I want to prevent the forum from displaying.

IchBin

action=aboutus ? Is that a mod or something that you've installed? TP doesn't have anything to do with action=aboutus.

misfitmafia

Its not a mod, I just created a center block and at the bottom under "custom action name" I put about us in the blank input box. I then edited the index template to create a new menu item with the link "?action=aboutus". Everything worked great except for the forum showing up under the block.