News:

Wondering if this will always be free?  See why free is better.

Main Menu

$current_action Tab

Started by tyty1234, August 16, 2008, 01:27:16 PM

Previous topic - Next topic

tyty1234

Hi!

I am using Daniel15's smf integration method, and I have tabs that are not part of the "?action" context.

From what I understand, $current_action is coming from the Load.php file like so.


$context['current_action'] = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;


I am trying to figure out how to do the same method with $current_action, but for links that are outside of the action context.
An example would be on Daniel15's website.

And ideas?
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

tyty1234

My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

metallica48423

you'd have to come up with another way to set $context['current_action'], with the proper data then. 
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

tyty1234

Will this work?


$context['current_action'] = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : null;
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

metallica48423

depends.  what is $_SERVER['PHP_SELF'] set to?  I'm not sure if this data can be considered clean either, however, so i'd reccommend cleaning it just in case
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

tyty1234

Well,  I was thinking of just setting $current_action to my board url. Or as I defined it as $home. And then when I click on another tab, the tab doesn't turn on.
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

[SiNaN]

If you have SSI.php included, defining the action would also change $current_action.

$_GET['action'] = 'test';

require(
'SSI.php');

// $context['current_action'] equal to 'test'
Former SMF Core Developer | My Mods | SimplePortal

tyty1234

umm, I don't understand.
Can you clarify that more please?
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

[SiNaN]

You are using SSI on your custom pages, right?
Former SMF Core Developer | My Mods | SimplePortal

tyty1234

yes, but the site menu I have is back in it's index.template.php
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

[SiNaN]

Yeah, I know. You must be using $ssi_layers = array('main');. As I understand, you want to set the current action in a custom page. To do this, before including SSI.php, add this code:

$_GET['action'] = 'custom';

When you are on that custom page, the $context['current_action'] will be equal to 'custom'.
Former SMF Core Developer | My Mods | SimplePortal

tyty1234

Oh, I see.

Thanks, it works.
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

[SiNaN]

Former SMF Core Developer | My Mods | SimplePortal

Advertisement: