Jump to content
Sign in to follow this  

Erro estranho

Recommended Posts


Boas pessoal, para adicionar o header do meu blog ao meu fórum eu usei no index.php do fórum o seguinte código:

  require('/home/maisrede/public_html/wp-blog-header.php');    get_header();

porem depois o fórum deixa de funcionar algumas funções, o que fiz foi o seguinte coloquei o código no topo do código e tudo ok mas ao fazer loggin e loggout aparecia apenas o header do wordpress e nao passava dai, ao colocar o código no fim do código o header aparece no footer as funciona tudo bem, mas aparece no footer o que posso fazer para resolver  ?!

Share this post

Link to post
Share on other sites

É porque na função get_header() tens algo a terminar a execução do código. Verifica. Se não descobrires, põe aqui o código para te pudermos ajudar. :P

PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum.

Share this post

Link to post
Share on other sites

Boas o código do index.php onde está o requir é o seguinte

* index.php                                                                       *
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                    *
* =============================================================================== *
* Software Version:           SMF 2.0 RC4                                         *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2010 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 2.0 RC4';

// Get everything started up...
define('SMF', 1);
if (function_exists('set_magic_quotes_runtime'))
error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL);
$time_start = microtime();

// This makes it so headers can be sent!

// Do some cleaning, just in case.
foreach (array('db_character_set', 'cachedir') as $variable)
if (isset($GLOBALS[$variable]))

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

// Make absolutely sure the cache directory is defined.
if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir . '/cache'))
$cachedir = $boarddir . '/cache';

// 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');
require_once($sourcedir . '/Subs-Portal.php');

// Using an pre-PHP5 version?
if (@version_compare(PHP_VERSION, '5') == -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)

// Create a variable to store some SMF specific functions in.
$smcFunc = array();

// Initate the database connection and define some database functions to use.

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

// Seed the random generator.
if (empty($modSettings['rand_seed']) || mt_rand(1, 250) == 69)

// Before we get carried away, are we doing a scheduled task? If so save CPU cycles by jumping out!
if (isset($_GET['scheduled']))
require_once($sourcedir . '/ScheduledTasks.php');

// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent())
// 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';

// Register an error handler.

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

// 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($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']))
elseif (isset($_REQUEST['nowap']))
$_SESSION['nowap'] = true;
elseif (!isset($_SESSION['nowap']))
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;
		$_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.
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.
	header('Content-Type: text/vnd.wap.wml');

// Restore post data if we are revalidating OpenID.
if (isset($_GET['openid_restore_post']) && !empty($_SESSION['openid']['saved_data'][$_GET['openid_restore_post']]['post']) && empty($_POST))
$_POST = $_SESSION['openid']['saved_data'][$_GET['openid_restore_post']]['post'];

// What function shall we execute? (done like this for memory's sake.)
   require('/home/maisrede/public_html/wp-blog-header.php');     get_header();
// Call obExit specially; we're coming from the main area .
obExit(null, null, true);

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

// Special case: session keep-alive, output a transparent pixel.
if (isset($_GET['action']) && $_GET['action'] == 'keepalive')
	header('Content-Type: image/gif');

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

// Load the current board's information.

// Load the current user's permissions.

// Attachments don't require the entire theme to be loaded.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)

// Check if the user should be disallowed access.

// If we are in a topic and don't have permission to approve it then duck out now.
if (!empty($topic) && empty($board_info['cur_topic_approved']) && !allowedTo('approve_posts') && ($user_info['id'] != $board_info['cur_topic_starter'] || $user_info['is_guest']))
	fatal_lang_error('not_a_topic', false);

// Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed etc.
if (empty($_REQUEST['action']) || !($_REQUEST['action'] == 'portal' && isset($_GET['xml'])) && !in_array($_REQUEST['action'], array('dlattach', 'findmember', 'jseditor', 'jsoption', 'requestmembers', 'smstats', '.xml', 'xmlhttp', 'verificationcode', 'viewquery', 'viewsmfile')))
	// Log this user as online.

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

// Load SimplePortal.

// 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' || $_REQUEST['action'] == 'logout'))
		require_once($sourcedir . '/LogInOut.php');
		return $_REQUEST['action'] == 'login2' ? 'Login2' : 'Logout';
	// Don't even try it, sonny.
		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('coppa', 'login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn'))))
	require_once($sourcedir . '/Subs-Auth.php');
	return 'KickGuest';
elseif (empty($_REQUEST['action']))
	// Go catch it boy! Catch it!
	$sp_action = sportal_catch_action();
	if ($sp_action)
		return $sp_action;

	// Action and board are both empty... BoardIndex!
	if (empty($board) && empty($topic))
		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!
		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'),
	'admin' => array('Admin.php', 'AdminMain'),
	'announce' => array('Post.php', 'AnnounceTopic'),
	'attachapprove' => array('ManageAttachments.php', 'ApproveAttach'),
	'buddy' => array('Subs-Members.php', 'BuddyListToggle'),
	'calendar' => array('Calendar.php', 'CalendarMain'),
	'clock' => array('Calendar.php', 'clock'),
	'collapse' => array('BoardIndex.php', 'CollapseCategory'),
	'coppa' => array('Register.php', 'CoppaForm'),
	'credits' => array('Who.php', 'Credits'),
	'deletemsg' => array('RemoveTopic.php', 'DeleteMessage'),
	'display' => array('Display.php', 'Display'),
	'dlattach' => array('Display.php', 'Download'),
	'editpoll' => array('Poll.php', 'EditPoll'),
	'editpoll2' => array('Poll.php', 'EditPoll2'),
	'emailuser' => array('SendTopic.php', 'EmailUser'),
	'findmember' => array('Subs-Auth.php', 'JSMembers'),
	'forum' => array('BoardIndex.php', 'BoardIndex'),
	'portal' => array('PortalMain.php', 'sportal_main'),
	'groups' => array('Groups.php', 'Groups'),
	'help' => array('Help.php', 'ShowHelp'),		'globalhf' => array('globalhf2.php', 'globalhf'),
	'helpadmin' => array('Help.php', 'ShowAdminHelp'),
	'im' => array('PersonalMessage.php', 'MessageMain'),
	'jseditor' => array('Subs-Editor.php', 'EditorMain'),
	'jsmodify' => array('Post.php', 'JavaScriptModify'),
	'jsoption' => array('Themes.php', 'SetJavaScript'),
	'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'),
	'markasread' => array('Subs-Boards.php', 'MarkRead'),
	'mergetopics' => array('SplitTopics.php', 'MergeTopics'),
	'mlist' => array('Memberlist.php', 'Memberlist'),
	'moderate' => array('ModerationCenter.php', 'ModerationMain'),
	'modifycat' => array('ManageBoards.php', 'ModifyCat'),
	'modifykarma' => array('Karma.php', 'ModifyKarma'),
	'movetopic' => array('MoveTopic.php', 'MoveTopic'),
	'movetopic2' => array('MoveTopic.php', 'MoveTopic2'),
	'notify' => array('Notify.php', 'Notify'),
	'notifyboard' => array('Notify.php', 'BoardNotify'),
	'openidreturn' => array('Subs-OpenID.php', 'smf_openID_return'),
	'pm' => array('PersonalMessage.php', 'MessageMain'),
	'post' => array('Post.php', 'Post'),
	'post2' => array('Post.php', 'Post2'),
	'printpage' => array('Printpage.php', 'PrintTopic'),
	'profile' => array('Profile.php', 'ModifyProfile'),
	'quotefast' => array('Post.php', 'QuoteFast'),
	'quickmod' => array('MessageIndex.php', 'QuickModeration'),
	'quickmod2' => array('Display.php', 'QuickInTopicModeration'),
	'recent' => array('Recent.php', 'RecentPosts'),
	'register' => array('Register.php', 'Register'),
	'register2' => array('Register.php', 'Register2'),
	'reminder' => array('Reminder.php', 'RemindMe'),
	'removepoll' => array('Poll.php', 'RemovePoll'),
	'removetopic2' => array('RemoveTopic.php', 'RemoveTopic2'),
	'reporttm' => array('SendTopic.php', 'ReportToModerator'),
	'requestmembers' => array('Subs-Auth.php', 'RequestMembers'),
	'restoretopic' => array('RemoveTopic.php', 'RestoreTopic'),
	'search' => array('Search.php', 'PlushSearch1'),
	'search2' => array('Search.php', 'PlushSearch2'),
	'sendtopic' => array('SendTopic.php', 'EmailUser'),
	'sitemap' => array('Sitemap.php', 'ShowSiteMap'),
	'smstats' => array('Stats.php', 'SMStats'),
	'suggest' => array('Subs-Editor.php', 'AutoSuggestHandler'),
	'spellcheck' => array('Subs-Post.php', 'SpellCheck'),
	'splittopics' => array('SplitTopics.php', 'SplitTopics'),
	'stats' => array('Stats.php', 'DisplayStats'),
	'sticky' => array('LockTopic.php', 'Sticky'),
	'theme' => array('Themes.php', 'ThemesMain'),
	'trackip' => array('Profile-View.php', 'trackIP'),
	'trader' => array('Trader2.php', 'tradermain'),

	'about:mozilla' => array('Karma.php', 'BookOfUnknown'),
	'about:unknown' => array('Karma.php', 'BookOfUnknown'),
	'unread' => array('Recent.php', 'UnreadTopics'),
	'unreadreplies' => array('Recent.php', 'UnreadTopics'),
	'verificationcode' => array('Register.php', 'VerificationCode'),
	'viewprofile' => array('Profile.php', 'ModifyProfile'),
	'vote' => array('Poll.php', 'Vote'),
	'viewquery' => array('ViewQuery.php', 'ViewQuery'),
	'viewsmfile' => array('Admin.php', 'DisplayAdminFile'),
	'who' => array('Who.php', 'Who'),
	'.xml' => array('News.php', 'ShowXmlFeed'),
	'smfsocialnetwork' => array('SMFSocialNetwork.php', 'smfsocialnetwork_main'),
	'xmlhttp' => array('Xml.php', 'XMLhttpMain'),

// Allow modifying $actionArray easily.
call_integration_hook('integrate_actions', array(&$actionArray));

if (!empty($context['disable_sp']))
	unset($actionArray['portal'], $actionArray['forum']);

// Get the function and file to include - if it's not there, do the board index.
if (!isset($_REQUEST['action']) || !isset($actionArray[$_REQUEST['action']]))
	// 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';

// Otherwise, it was set - so let's go to that action.
require_once($sourcedir . '/' . $actionArray[$_REQUEST['action']][0]);
return $actionArray[$_REQUEST['action']][1];


procurem por require('/home/maisrede/public_html/wp-blog-header.php');    get_header(); que vão ver o local do código que falo,

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.