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

Main Menu

Custom Action Mod

Started by Norv, May 09, 2006, 08:35:29 PM

Previous topic - Next topic


Well, I'm certainly not an expert on this stuff, but I can attempt to help you by saying...

Usually when tests fail (at least for me), it's because the mod does not work on the version of SMF that you have. Not entirely sure if that's your problem, though...


when i try to put php code page like a custm action i got this error
QuoteParse error: parse error, unexpected '<' in c:\program files\easyphp1-7\www\novo\Sources\Load.php(1735) : eval()'d code(9) : eval()'d code on line 1


I'm using a php 301 redirect for my custom action... and it works...

header("HTTP/1.1 301 Moved Permanently");

Now, my question is regarding the SSI action that creates the menu bar.

<?php ssi_menubar(); ?>

In index.template.php, I have created an additional link for this custom action. Say, for example that the custom action is titled "mall".

// Show the [mall] button.
echo ($current_action=='mall' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mall' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">Mall</a>
</td>' , $current_action == 'mall' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Now when someone visits the "mall" I would like the "Mall Button" in the menubar to indicate that they are indeed in the mall.

Is there anything I'm missing in index.template.php that would prevent the change in the background for the active mall tab?

affiliate blog


Quote from: Farmacija on August 14, 2007, 09:14:00 AM
when i try to put php code page like a custm action i got this error
QuoteParse error: parse error, unexpected '<' in c:\program files\easyphp1-7\www\novo\Sources\Load.php(1735) : eval()'d code(9) : eval()'d code on line 1

Make sure when you enter the php code you remove the php tags. they are added automatically for you.
If it aint broke, break it.


yes i figure it. :)
for other members-there isn't need to put <?php for the start of php file in custom action field :)

King Steph1

I need to align something to the center of the page on a php page but it gives this error:
Parse error: syntax error, unexpected '<' in /home/sk8erdud/public_html/da/Sources/Load.php(1726) : eval()'d code(9) : eval()'d code on line 1


Ok, php/smf newbie with a question....

I'd like to create BBC tag(s) that will access the public mimetex server....let's call the tags [math] & [/math]....

[math]  ~LaTex code~  [/math]

will get automagically translated into

[ img ] [nonactive] code~ [ /img ]

I'm not sure how to fill in the fields to create this kind of action.  Any help is appreciated.



Just wondering...

To what kind of "actions" do you usually use this MOD for? Just trying to realise the potential and gather some fresh and interesting ideas to develop. ;D


Quote from: Monniemoo on August 13, 2007, 02:12:40 PM
I've really been wanting to make more actions, and this mod really helped ^_^

One problem: I have links to all the sub-actions in the main actions, and when I click them, it says in the top URL of the web page that it went to the sub-action, but the page didn't change like it's supposed to. Anyone know how to fix this?

((click here [nofollow] and click one of the things under Navigation if you have no idea what I'm talking about))

Really, I need this ASAP. I have a credits link page in this, and until I solve this problem I'm technically not giving all needed credit. (still giving SMF credit, but not other credit)


SMF Developer
My Mods
Please do not PM me for support.


hi, i got a center block (using tinyportal) that redirects to my custom action under certain circumstances (user is logged in and a custom profile field is not set when visiting the forum index).
Im using redirectexit($scripturl.'/index.php?action=myaction'); to redirect.
When i visit my action by directly accessing the url it works like a charm, however when the user is redirected by the center block code the user is not logged in anymore when reaching my action.
Heres my center block code:
problem solved: dont use full url in redirectexit() just redirectexit('action=myaction')


Hi @ all,

first : its a great mod ;)

I want to integrate a foreign script, its a small link directory. I'd did it before using the custom action mod by making the changes by hand (index.php). But i got some ugly errors ;) So i decided to try it with the custom action mod. I copied the script named xlinks into the boarddir and created a new action with on line of php in it.

require ('xlinks/index.php');

i also tried it with include() but if i try to open the custom page there are serval errors. I think because of the include path but im unable to fix this. If i run the script by opening it directly in the browser, there are no errors.
The error is this one :

Fatal error: require() [function.require]: Failed opening required './config.php' (include_path='.;\xampp\php\pear\') in E:\xampp\htdocs\smf\xlinks\include\head.php on line 59

Line 59 of head.php is :


I also tried to change the path to ./xlinks/config.php and i got the same error on another line number. After a changed all includes() or require() paths i will get a blank site with no errors. What im gonna do now ??
SMF Rulez ;) | Meet me home ! | My Mods


I have read through the 13 pages of this thread.........

I am also a newbie at this. My question is how do I install the mod?

I have index.php action array with 'customaction' => array('CustomAction.php', 'CustomAction'),

I have put CustomAction.php into Sources

I have put customaction.template.php into Themes/default

What do I do with modification.xml, movemodsettings.xml and package-info.xml?


how to make custom action


Ok i solved the problem by using an iframe with no borders, so im able to display the forum header and the other script below the menu.
SMF Rulez ;) | Meet me home ! | My Mods

John S

I have Google Adsense search on my smf forum.

I created a page through 'Action Mod':

I've followed the wizard from Google Adsense.

I get this code, which i inserted into action mod page HTML:

<!-- Google Search Result Snippet Begins -->
<div id="googleSearchUnitIframe"></div>

<script type="text/javascript">
   var googleSearchIframeName = 'googleSearchUnitIframe';
   var googleSearchFrameWidth = 700;
   var googleSearchFrameborder = 0 ;
   var googleSearchDomain = '';
<script type="text/javascript"
<!-- Google Search Result Snippet Ends -->

When I try the Google Search function It doesn't work it redirects me to the same page?


Fatal error: Cannot redeclare template_main() (previously declared in C:\Documents and Settings\dark\Bureaublad\Nieuwe map (2)\Sources\Load.php(1726) : eval()'d code:7) in C:\Documents and Settings\dark\Bureaublad\Nieuwe map (2)\Sources\Load.php(1726) : eval()'d code(9) : eval()'d code on line 417

I get this when I place a code in it (it is nou running on a server on my pc (wampserver)
Could you help me?


Does this work with 1.1.4?


 I'm trying to create a "portal" type page. I'm using HTML for the layout and SSI PHP for stuff like "Recent Post". My question is there way to use HTML and PHP to create a custom action?