Adding new action and page for a mod, not working

Started by Zuma, May 21, 2007, 10:50:30 AM

Previous topic - Next topic

Zuma

Sorry for creating a new topic as there are many like mine out there, but I searched a lot before posting, tried out all tips found in other topics, but nothing seem to work for me. I'm about to finish and release an advanced awards mod but am stuck to this...

All I want is to make a custom tab and link that tab to a custom page.

I did add the action to the $actionArray in index.php:

'test' => array('Test.php', 'Test'),

I did add the link to it in index.template.php:

if ($context['current_action'] == 'test')
$current_action = 'test';


and

// The [Test] button!
echo ($current_action=='test' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'test' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=test">' , $txt['test'] , '</a>
</td>' , $current_action == 'test' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


And I did followed all steps to create test.php and test.template.php posted in here:

http://www.simplemachines.org/community/index.php?topic=23864.0

This is Test.php:

<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

function 
Test()
{
global 
$context;
$context['page_title'] = 'Test';
// This is gonna be needed...
loadTemplate('Test');
}
?>


And this is Test.template.php:

<?php

function template_main()
{
global 
$context$settings$options$txt$scripturl;

echo 
'


<table width="100%" border="0" cellspacing="0" cellpadding="3" >
<tr>
<td>'
theme_linktree(), '</td>
</tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td align="center" >Test</td>
</tr><tr>
<td class="windowbg">'
;

echo 
'<table border="0" cellpadding="0" cellspacing="3" width="100%">
         <tr>
           <td width="100%" valign="top">
  HELLO WORLD!
</td></tr></table>'
;
echo 
'
</td>
</tr>
</table><br /><br />
'
;
}

?>


The new tab DOES appear and it DOES link to the action, but instead of loading the custom page it just reloads the forum index.

For now I just want the custom page to say "HELLO WORLD!"......

I got no idea why it won't work, can anyone help me please?

SlammedDime

Do you have any errors in your error log relevant to these pages?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Zuma

No errors showing in the logs man... :/

Looks like I can't create any new action... unless there's an error in my code?

Zuma

I'm running TinyPortals... should it have something to do with it?

Here the link to my forum:

www.frclan.com.br

the TEST tab is there...

SlammedDime

Based on very simple limited testing, it doesn't look like you added the action in index.php, or not properly anyway.  I'm not sure if TP has something to do with it, but can you copy the action array from index.php here between code tags?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Zuma

Here, 'test' is in the first few lines:

// Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
$actionArray = array(
'activate' => array('Register.php', 'Activate'),
'awards' => array('ManageAwards.php', 'Awards'),
'awardsindex' => array('AwardsIndex.php', 'AwardsIndex'),
'test' => array('Test.php', 'Test'),
'admin' => array('Admin.php', 'Admin'),
'announce' => array('Post.php', 'AnnounceTopic'),
'ban' => array('ManageBans.php', 'Ban'),
'boardrecount' => array('Admin.php', 'AdminBoardRecount'),
'buddy' => array('Subs-Members.php', 'BuddyListToggle'),
'calendar' => array('Calendar.php', 'CalendarMain'),
'cleanperms' => array('Admin.php', 'CleanupPermissions'),
'collapse' => array('Subs-Boards.php', 'CollapseCategory'),
'convertentities' => array('Admin.php', 'ConvertEntities'),
'convertutf8' => array('Admin.php', 'ConvertUtf8'),
'coppa' => array('Register.php', 'CoppaForm'),
'deletemsg' => array('RemoveTopic.php', 'DeleteMessage'),
'detailedversion' => array('Admin.php', 'VersionDetail'),
'display' => array('Display.php', 'Display'),
'dlattach' => array('Display.php', 'Download'),
'dumpdb' => array('DumpDatabase.php', 'DumpDatabase2'),
'editpoll' => array('Poll.php', 'EditPoll'),
'editpoll2' => array('Poll.php', 'EditPoll2'),
'featuresettings' => array('ModSettings.php', 'ModifyFeatureSettings'),
'featuresettings2' => array('ModSettings.php', 'ModifyFeatureSettings2'),
'findmember' => array('Subs-Auth.php', 'JSMembers'),

'globalAnnouncementsAdmin' => array('GlobalAnnouncementsAdmin.php', 'GlobalAnnouncementsAdmin'),
'globalAnnouncements' => array('GlobalAnnouncements.php', 'GlobalAnnouncements'),

'globalAnnouncementsAdmin' => array('GlobalAnnouncementsAdmin.php', 'GlobalAnnouncementsAdmin'),
'globalAnnouncements' => array('GlobalAnnouncements.php', 'GlobalAnnouncements'),
'help' => array('Help.php', 'ShowHelp'),
'helpadmin' => array('Help.php', 'ShowAdminHelp'),
'im' => array('PersonalMessage.php', 'MessageMain'),
'jsoption' => array('Themes.php', 'SetJavaScript'),
'jsmodify' => array('Post.php', 'JavaScriptModify'),
'lock' => array('LockTopic.php', 'LockTopic'),
'lockVoting' => array('Poll.php', 'LockVoting'),
'login' => array('LogInOut.php', 'Login'),
'login2' => array('LogInOut.php', 'Login2'),
'logout' => array('LogInOut.php', 'Logout'),
'maintain' => array('Admin.php', 'Maintenance'),
'manageattachments' => array('ManageAttachments.php', 'ManageAttachments'),
'manageboards' => array('ManageBoards.php', 'ManageBoards'),
'managecalendar' => array('ManageCalendar.php', 'ManageCalendar'),
'managesearch' => array('ManageSearch.php', 'ManageSearch'),
'markasread' => array('Subs-Boards.php', 'MarkRead'),
'membergroups' => array('ManageMembergroups.php', 'ModifyMembergroups'),
'mergetopics' => array('SplitTopics.php', 'MergeTopics'),
'mlist' => array('Memberlist.php', 'Memberlist'),
'modifycat' => array('ManageBoards.php', 'ModifyCat'),
'modifykarma' => array('Karma.php', 'ModifyKarma'),
'modlog' => array('Modlog.php', 'ViewModlog'),
'movetopic' => array('MoveTopic.php', 'MoveTopic'),
'movetopic2' => array('MoveTopic.php', 'MoveTopic2'),
'news' => array('ManageNews.php', 'ManageNews'),
'notify' => array('Notify.php', 'Notify'),
'notifyboard' => array('Notify.php', 'BoardNotify'),
'optimizetables' => array('Admin.php', 'OptimizeTables'),
'packageget' => array('PackageGet.php', 'PackageGet'),
'packages' => array('Packages.php', 'Packages'),
'permissions' => array('ManagePermissions.php', 'ModifyPermissions'),
'pgdownload' => array('PackageGet.php', 'PackageGet'),
'pm' => array('PersonalMessage.php', 'MessageMain'),
'post' => array('Post.php', 'Post'),
'post2' => array('Post.php', 'Post2'),
'postsettings' => array('ManagePosts.php', 'ManagePostSettings'),
'printpage' => array('Printpage.php', 'PrintTopic'),
'profile' => array('Profile.php', 'ModifyProfile'),
'profile2' => array('Profile.php', 'ModifyProfile2'),
'quotefast' => array('Post.php', 'QuoteFast'),
'quickmod' => array('Subs-Boards.php', 'QuickModeration'),
'quickmod2' => array('Subs-Boards.php', 'QuickModeration2'),
'recent' => array('Recent.php', 'RecentPosts'),
'regcenter' => array('ManageRegistration.php', 'RegCenter'),
'register' => array('Register.php', 'Register'),
'register2' => array('Register.php', 'Register2'),
'reminder' => array('Reminder.php', 'RemindMe'),
'removetopic2' => array('RemoveTopic.php', 'RemoveTopic2'),
'removeoldtopics2' => array('RemoveTopic.php', 'RemoveOldTopics2'),
'removepoll' => array('Poll.php', 'RemovePoll'),
'repairboards' => array('RepairBoards.php', 'RepairBoards'),
'reporttm' => array('SendTopic.php', 'ReportToModerator'),
'reports' => array('Reports.php', 'ReportsMain'),
'requestmembers' => array('Subs-Auth.php', 'RequestMembers'),
'search' => array('Search.php', 'PlushSearch1'),
'search2' => array('Search.php', 'PlushSearch2'),
'sendtopic' => array('SendTopic.php', 'SendTopic'),
'serversettings' => array('ManageServer.php', 'ModifySettings'),
'serversettings2' => array('ManageServer.php', 'ModifySettings2'),
'smileys' => array('ManageSmileys.php', 'ManageSmileys'),
'smstats' => array('Stats.php', 'SMStats'),
'spellcheck' => array('Subs-Post.php', 'SpellCheck'),
'splittopics' => array('SplitTopics.php', 'SplitTopics'),
'stats' => array('Stats.php', 'DisplayStats'),
'sticky' => array('LockTopic.php', 'Sticky'), 'staff' => array('Staff.php', 'Staff'),
'theme' => array('Themes.php', 'ThemesMain'),
'trackip' => array('Profile.php', 'trackIP'),
'about:mozilla' => array('Karma.php', 'BookOfUnknown'),
'about:unknown' => array('Karma.php', 'BookOfUnknown'),
'unread' => array('Recent.php', 'UnreadTopics'),
'unreadreplies' => array('Recent.php', 'UnreadTopics'),
'viewErrorLog' => array('ManageErrors.php', 'ViewErrorLog'),
'viewmembers' => array('ManageMembers.php', 'ViewMembers'),
'viewprofile' => array('Profile.php', 'ModifyProfile'),
'verificationcode' => array('Register.php', 'VerificationCode'),
'vote' => array('Poll.php', 'Vote'),
'viewquery' => array('ViewQuery.php', 'ViewQuery'),
'who' => array('Who.php', 'Who'),
'.xml' => array('News.php', 'ShowXmlFeed'),
                'tpadmin' => array('TPortalAdmin.php', 'TPortalAdmin'),
                'forum' => array('BoardIndex.php', 'BoardIndex'),
                'tpmod' => array('TPmodules.php', 'TPmodules'),
);

Rudolf

Your code works fine in my test forums.
Probably you get redirected because of some security protection, maybe because of TP.
This could prove pretty hard to track down.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Rudolf

Do you get redirected always, or only as a guest?
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Zuma

Always, even as admin... I don't get it, few days ago I've installed the arcade mod (those flash games) and it adds a tab with an action in the main page as well. It works just fine, why wouldn't my new action work even if I copy and past the same code just changing the name of the functions/actions. =/

Rudolf

Check the permissions of the Test.php, the only thing I can think of is that SMF can't read it.
chmod it to 777
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

SlammedDime

See thats just it with this... is that he's not redirected so to speak... the URL remains the same in the address bar... the proper page isn't being loaded.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Zuma

I was thinking about chmod too, both test.php and test.template.php are already 777... still doesn't work...

arghhh lol..  :-[... I only need this to finish the mod........

Thx for your help btw guys...

ディン1031

Hmmm can you try something else than test as action only for a test use mytestaction? ;)

'mytestaction' => array('Test.php', 'Test'),

Only a idea that you can try :), it could be possible that tiny portal use this for something else :).

(On normal install, it work.)

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Rudolf

I see no option then to go with the plain old debugging to find what is redirecting and where.
For this you have to resort to trial and error, by adding some echo commands and see which one generates what type of output.
I would start with the index.php.
Here are some places I would put the echos:


Search for
// Special case: session keep-alive.
Add before:
echo  "echo 1:entry point - action=$_REQUEST[action]<br>";


Search for
// Do some logging, unless this is an attachment, avatar, theme option or XML feed.
add before
echo  "echo 2:before logging - action=$_REQUEST[action]<br>";


Search for
require_once($sourcedir . '/Subs-Auth.php');
return 'KickGuest';

Add before
echo  "echo 3:in kickguest block - action=$_REQUEST[action]<br>";


Search for
// Get the function and file to include - if it's not there, do the board index.
Add before
echo  "echo 4: after the actionArray - action=$_REQUEST[action]<br>";


Search for
// Catch the action with the theme?
Add before
echo  "echo 5: the action catch - action=$_REQUEST[action]<br>";


Search for
// Otherwise, it was set - so let's go to that action.
Add before
echo  "echo 6: calling the action - action=$_REQUEST[action]<br>";


Unfortunately, I can't even imagine the result you should get, but the output could give some clues to what's happening.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

RRasco

what are your actual filenames?

Test.php/Test.template.php

OR

test.php/test.template.php

I just tested with mine, gave me a fatal error with the source file at all lowercase, and the template seemed to not care.  Typical TP install does not use test as an action, and your code appears to be valid.
Vehicle Management System for SMF - SMFGarage.com

SlammedDime

#15
Quote from: RRasco on May 22, 2007, 02:03:43 PM
what are your actual filenames?

Test.php/Test.template.php

OR

test.php/test.template.php

I just tested with mine, gave me a fatal error with the source file at all lowercase, and the template seemed to not care.  Typical TP install does not use test as an action, and your code appears to be valid.
Punching in URL's on his site, I see a test.php in the Sources directory... and in the Themes directory, its test.template.php, rather than Test.template.php... I believe they are both supposed to have uppercase T's on them....
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Zuma

ディン1031, there's another custom action 'awardlist' that's not working too, it can't be the action name. =/

Rudolf, I modified index.php like you posted. Maybe a silly question but where should I see the output? Error log? There's nothing there...

RRasco and Matt's, I checked the file names with the action and functon names, it's not that too...

Rudolf

You should see it at the top of your pages. Raw text.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Hyronymus

I have the same problem as described here. I also made a test.php but instead of actually writing some test.php myself I just copied and renamed help.php. I did upload test.php to the proper directory and assumed it would load help.template.php anyhow (it's in the code after all).

I'm running SMF 1.1.2 with 2 mods:
  • 1.     Default Membergroup on Registration     1.0
  • 2.    Additional Membergroups on Profile    1.0

Zuma

#19
Quote from: Rudolf on May 23, 2007, 03:03:10 AM
You should see it at the top of your pages. Raw text.

It's not outputting anything then, this is my whole index.php:

<?php
/**********************************************************************************
* index.php                                                                       *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1.1                                           *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/


/* This, as you have probably guessed, is the crux on which SMF functions.
Everything should start here, so all the setup and security is done
properly.  The most interesting part of this file is the action array in
the smf_main() function.  It is formatted as so:

'action-in-url' => array('Source-File.php', 'FunctionToCall'),

Then, you can access the FunctionToCall() function from Source-File.php
with the URL index.php?action=action-in-url.  Relatively simple, no?
*/

$forum_version 'SMF 1.1.1';

// Get everything started up...
define('SMF'1);
@
set_magic_quotes_runtime(0);
error_reporting(E_ALL);
$time_start microtime();

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');

// And important includes.
require_once($sourcedir '/QueryString.php');
require_once(
$sourcedir '/Subs.php');
require_once(
$sourcedir '/Errors.php');
require_once(
$sourcedir '/Load.php');
require_once(
$sourcedir '/Security.php');
// TinyPortal include
require_once($sourcedir '/TPortal.php');

// Using an old version of PHP?
if (@version_compare(PHP_VERSION'4.2.3') != 1)
require_once($sourcedir '/Subs-Compat.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
if (!empty($maintenance) && $maintenance == 2)
db_fatal_error();

// Connect to the MySQL database.
if (empty($db_persist))
$db_connection = @mysql_connect($db_server$db_user$db_passwd);
else
$db_connection = @mysql_pconnect($db_server$db_user$db_passwd);

// Show an error if the connection couldn't be made.
if (!$db_connection || !@mysql_select_db($db_name$db_connection))
db_fatal_error();

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();
// Clean the request variables, add slashes, etc.
cleanRequest();
$context = array();

// Determine if this is using WAP, WAP2, or imode.  Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should.
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
$_REQUEST['wap2'] = 1;
elseif (isset(
$_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false)
$_REQUEST['imode'] = 1;
else
$_REQUEST['wap'] = 1;
}

if (!
defined('WIRELESS'))
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' '')));

// Some cellphones can't handle output compression...
$modSettings['enableCompressedOutput'] = '0';
// !!! Do we want these hard coded?
$modSettings['defaultMaxMessages'] = 5;
$modSettings['defaultMaxTopics'] = 9;

// Wireless protocol header.
if (WIRELESS_PROTOCOL == 'wap')
header('Content-Type: text/vnd.wap.wml');
}

// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent() && ob_get_length() == 0)
{
// If zlib is being used, turn off output compression.
if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler' || @version_compare(PHP_VERSION'4.2.0') == -1)
$modSettings['enableCompressedOutput'] = '0';
else
ob_start('ob_gzhandler');
}
// This makes it so headers can be sent!
if (empty($modSettings['enableCompressedOutput']))
ob_start();

// Register an error handler.
set_error_handler('error_handler');

// Start the session. (assuming it hasn't already been.)
loadSession();

// What function shall we execute? (done like this for memory's sake.)
call_user_func(smf_main());

// Call obExit specially; we're coming from the main area ;).
obExit(nullnulltrue);

// The main controlling function.
function smf_main()
{
global $modSettings$settings$user_info$board$topic$maintenance$sourcedir;

    echo  
"echo 1:entry point - action=$_REQUEST[action]<br>";

// Special case: session keep-alive.
if (isset($_GET['action']) && $_GET['action'] == 'keepalive')
die;

// Load the user's cookie (or set as guest) and load their settings.
loadUserSettings();

// Load the current board's information.
loadBoard();

// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
loadTheme();

// Check if the user should be disallowed access.
is_not_banned();

// Load the current user's permissions.
loadPermissions();

echo  "echo 2:before logging - action=$_REQUEST[action]<br>";

// Do some logging, unless this is an attachment, avatar, theme option or XML feed.
if (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], array('dlattach''jsoption''.xml')))
{
// Log this user as online.
writeLog();

// Track forum statistics and hits...?
if (!empty($modSettings['hitStats']))
trackStats(array('hits' => '+'));
}

        
// TinyPortal
        
TPortal_init();

// Is the forum in maintenance mode? (doesn't apply to administrators.)
if (!empty($maintenance) && !allowedTo('admin_forum'))
{
// You can only login.... otherwise, you're getting the "maintenance mode" display.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login2')
{
require_once($sourcedir '/LogInOut.php');
return 'Login2';
}
// Don't even try it, sonny.
else
{
require_once($sourcedir '/Subs-Auth.php');
return 'InMaintenance';
}
}
// If guest access is off, a guest can only do one of the very few following actions.
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('login''login2''register''register2''reminder''activate''smstats''help''.xml''verificationcode'))))
{
        echo  
"echo 3:in kickguest block - action=$_REQUEST[action]<br>";

require_once($sourcedir '/Subs-Auth.php');
return 'KickGuest';
}
elseif (empty($_REQUEST['action']))
{
// Action and board are both empty... maybe the portal page?
if (empty($board) && empty($topic) && $settings['TPortal_front_type']!='boardindex')
{
require_once($sourcedir '/TPortal.php');
return 'TPortal';
}
if (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex' && (isset($_GET['cat']) || isset($_GET['page'])))
{
require_once($sourcedir '/TPortal.php');
return 'TPortal';
}
// Action and board are still both empty...and no portal startpage - BoardIndex!
elseif (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex')
{
require_once($sourcedir '/BoardIndex.php');
return 'BoardIndex';
}
// Topic is empty, and action is empty.... MessageIndex!
elseif (empty($topic))
{
require_once($sourcedir '/MessageIndex.php');
return 'MessageIndex';
}
// Board is not empty... topic is not empty... action is empty.. Display!
else
{
require_once($sourcedir '/Display.php');
return 'Display';
}
}

// Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
$actionArray = array(
'activate' => array('Register.php''Activate'),
'awardlist' => array('AwardList.php''AwardListMain'),
'test' => array('Test.php''Test'),
'admin' => array('Admin.php''Admin'),
'announce' => array('Post.php''AnnounceTopic'),
'ban' => array('ManageBans.php''Ban'),
'boardrecount' => array('Admin.php''AdminBoardRecount'),
'buddy' => array('Subs-Members.php''BuddyListToggle'),
'calendar' => array('Calendar.php''CalendarMain'),
'cleanperms' => array('Admin.php''CleanupPermissions'),
'collapse' => array('Subs-Boards.php''CollapseCategory'),
'convertentities' => array('Admin.php''ConvertEntities'),
'convertutf8' => array('Admin.php''ConvertUtf8'),
'coppa' => array('Register.php''CoppaForm'),
'deletemsg' => array('RemoveTopic.php''DeleteMessage'),
'detailedversion' => array('Admin.php''VersionDetail'),
'display' => array('Display.php''Display'),
'dlattach' => array('Display.php''Download'),
'dumpdb' => array('DumpDatabase.php''DumpDatabase2'),
'editpoll' => array('Poll.php''EditPoll'),
'editpoll2' => array('Poll.php''EditPoll2'),
'featuresettings' => array('ModSettings.php''ModifyFeatureSettings'),
'featuresettings2' => array('ModSettings.php''ModifyFeatureSettings2'),
'findmember' => array('Subs-Auth.php''JSMembers'),
'globalAnnouncementsAdmin' => array('GlobalAnnouncementsAdmin.php''GlobalAnnouncementsAdmin'),
'globalAnnouncements' => array('GlobalAnnouncements.php''GlobalAnnouncements'),
'help' => array('Help.php''ShowHelp'),
'helpadmin' => array('Help.php''ShowAdminHelp'),
'im' => array('PersonalMessage.php''MessageMain'),
'jsoption' => array('Themes.php''SetJavaScript'),
'jsmodify' => array('Post.php''JavaScriptModify'),
'lock' => array('LockTopic.php''LockTopic'),
'lockVoting' => array('Poll.php''LockVoting'),
'login' => array('LogInOut.php''Login'),
'login2' => array('LogInOut.php''Login2'),
'logout' => array('LogInOut.php''Logout'),
'maintain' => array('Admin.php''Maintenance'),
'manageattachments' => array('ManageAttachments.php''ManageAttachments'),
'manageboards' => array('ManageBoards.php''ManageBoards'),
'managecalendar' => array('ManageCalendar.php''ManageCalendar'),
'managesearch' => array('ManageSearch.php''ManageSearch'),
'markasread' => array('Subs-Boards.php''MarkRead'),
'membergroups' => array('ManageMembergroups.php''ModifyMembergroups'),
'mergetopics' => array('SplitTopics.php''MergeTopics'),
'mlist' => array('Memberlist.php''Memberlist'),
'modifycat' => array('ManageBoards.php''ModifyCat'),
'modifykarma' => array('Karma.php''ModifyKarma'),
'modlog' => array('Modlog.php''ViewModlog'),
'movetopic' => array('MoveTopic.php''MoveTopic'),
'movetopic2' => array('MoveTopic.php''MoveTopic2'),
'news' => array('ManageNews.php''ManageNews'),
'notify' => array('Notify.php''Notify'),
'notifyboard' => array('Notify.php''BoardNotify'),
'optimizetables' => array('Admin.php''OptimizeTables'),
'packageget' => array('PackageGet.php''PackageGet'),
'packages' => array('Packages.php''Packages'),
'permissions' => array('ManagePermissions.php''ModifyPermissions'),
'pgdownload' => array('PackageGet.php''PackageGet'),
'pm' => array('PersonalMessage.php''MessageMain'),
'post' => array('Post.php''Post'),
'post2' => array('Post.php''Post2'),
'postsettings' => array('ManagePosts.php''ManagePostSettings'),
'printpage' => array('Printpage.php''PrintTopic'),
'profile' => array('Profile.php''ModifyProfile'),
'profile2' => array('Profile.php''ModifyProfile2'),
'quotefast' => array('Post.php''QuoteFast'),
'quickmod' => array('Subs-Boards.php''QuickModeration'),
'quickmod2' => array('Subs-Boards.php''QuickModeration2'),
'recent' => array('Recent.php''RecentPosts'),
'regcenter' => array('ManageRegistration.php''RegCenter'),
'register' => array('Register.php''Register'),
'register2' => array('Register.php''Register2'),
'reminder' => array('Reminder.php''RemindMe'),
'removetopic2' => array('RemoveTopic.php''RemoveTopic2'),
'removeoldtopics2' => array('RemoveTopic.php''RemoveOldTopics2'),
'removepoll' => array('Poll.php''RemovePoll'),
'repairboards' => array('RepairBoards.php''RepairBoards'),
'reporttm' => array('SendTopic.php''ReportToModerator'),
'reports' => array('Reports.php''ReportsMain'),
'requestmembers' => array('Subs-Auth.php''RequestMembers'),
'search' => array('Search.php''PlushSearch1'),
'search2' => array('Search.php''PlushSearch2'),
'sendtopic' => array('SendTopic.php''SendTopic'),
'serversettings' => array('ManageServer.php''ModifySettings'),
'serversettings2' => array('ManageServer.php''ModifySettings2'),
'smileys' => array('ManageSmileys.php''ManageSmileys'),
'smstats' => array('Stats.php''SMStats'),
'spellcheck' => array('Subs-Post.php''SpellCheck'),
'splittopics' => array('SplitTopics.php''SplitTopics'),
'stats' => array('Stats.php''DisplayStats'),
'sticky' => array('LockTopic.php''Sticky'),
'staff' => array('Staff.php''Staff'),
'theme' => array('Themes.php''ThemesMain'),
'trackip' => array('Profile.php''trackIP'),
'about:mozilla' => array('Karma.php''BookOfUnknown'),
'about:unknown' => array('Karma.php''BookOfUnknown'),
'unread' => array('Recent.php''UnreadTopics'),
'unreadreplies' => array('Recent.php''UnreadTopics'),
'viewErrorLog' => array('ManageErrors.php''ViewErrorLog'),
'viewmembers' => array('ManageMembers.php''ViewMembers'),
'viewprofile' => array('Profile.php''ModifyProfile'),
'verificationcode' => array('Register.php''VerificationCode'),
'vote' => array('Poll.php''Vote'),
'viewquery' => array('ViewQuery.php''ViewQuery'),
'who' => array('Who.php''Who'),
'.xml' => array('News.php''ShowXmlFeed'),
        
'tpadmin' => array('TPortalAdmin.php''TPortalAdmin'),
'forum' => array('BoardIndex.php''BoardIndex'),
'tpmod' => array('TPmodules.php''TPmodules'),
);

    echo  
"echo 4: after the actionArray - action=$_REQUEST[action]<br>";

// Get the function and file to include - if it's not there, do the board index.
if (!isset($_REQUEST['action']) || !isset($actionArray[$_REQUEST['action']]))
{
        echo  
"echo 5: the action catch - action=$_REQUEST[action]<br>";

        
// Catch the action with the theme?
if (!empty($settings['catch_action']))
{
require_once($sourcedir '/Themes.php');
return 'WrapAction';
}

// Fall through to the board index then...
require_once($sourcedir '/BoardIndex.php');
return 'BoardIndex';
}

    echo  
"echo 6: calling the action - action=$_REQUEST[action]<br>";
    
// Otherwise, it was set - so let's go to that action.
require_once($sourcedir '/' $actionArray[$_REQUEST['action']][0]);
return $actionArray[$_REQUEST['action']][1];
}

?>


Hmm.. I just noticed it says

$forum_version = 'SMF 1.1.1';

While in the bottom of the forum it says 'Powered by SMF 1.1.2'... Should this be an upgrading error and could cause these problems?

Rudolf

Well, if this doesn't outputs anything, then this is not the same index.php that you have online. It can't be.
Are you sure that you are not editing some backup version? Like the "index.php~".
Can you post the directory listing of your forum's root dir?

This is close to paranormal.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Zuma

Quote from: Rudolf on May 23, 2007, 12:51:47 PM
This is close to paranormal.

LMAO  ;D

o well, I thought the index.php file that loads the forum should be in the sources dir??? I've just found another index.php in the root, replaced it with the one I edited and the echo's are there. LOL...

Now that's the output after clicking TEST tab:

Quoteecho 1:entry point - action=test
echo 2:before logging - action=test
echo 4: after the actionArray - action=test
echo 6: calling the action - action=test

Fatal error: smf_main(): Failed opening required '/home/mfclanc/public_html/forum2/Sources/Test.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mfclanc/public_html/forum2/index.php on line 370

Zuma

Right, now I uppercased the T's and it works... LOL. I'm sorry for being stupid on this one guys, but really, the index.php that loads the forum shouldn't be in the sources dir instead of the root?

Rudolf

I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Zuma

lol... yeah but I thought it should work like a redirect, can I delete index.php in my sources dir then since it's pointless there?

Sorry for that and thanks a lot for all your help.

Rudolf

In the Sources the index.php should have this

<?php

// This file is here solely to protect your Sources directory.

// Look for Settings.php....
if (file_exists(dirname(dirname(__FILE__)) . '/Settings.php'))
{
// Found it!
require(dirname(dirname(__FILE__)) . '/Settings.php');
header('Location: ' $boardurl);
}
// Can't find it... just forget it.
else
exit;

?>


This is to redirect people who type the path I just posted above.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Hyronymus

I'm too tired to think straight now but I'm going to look into this tomorrow. If it works for Zuma then I'm dead certain I made a similar mistake (and thus it should work for me too).

Hyronymus

The tiredness has gone and I too was messing with the wrong index.php! So this topic deserves a sticky from my point of view as it clearly explains the efforts needed to get a new action to work!

RRasco

lol...oh how simple some things can be when done correctly.  no worries, i have gone several days trying to fix errors that were caused by the simplest errors.  glad you got it fixed.
Vehicle Management System for SMF - SMFGarage.com

Hyronymus

For someone with only profound BASIC knowledge I still look amazed when things do work out :D as I intended. But as you said: those simple errors are what every "programmer" dreads, regardless of any experience.

Advertisement: