Список разделов › phpBBex 1.x (поддерживается) › Мастерская 1.x
Какие права доступа нужны?Sumanai:ссылка на форум с тестовым аккаунтом
Nailbuster:Какие права доступа нужны?
Форум: coalitionmax.ru/forumSumanai:Достаточные для воспроизведения ошибки
case 'logout':
Знаю, пишу на всякий случай во все форумы подряд. Нагуглить "ответ для чайников" сходу не получилось (в отличии от багов со всеми остальными плагинами).VEG:Но вообще у вас не phpBBex
Я предполагал, что проблема именно в этом. Я пробовал заменить файл на тот, что лежал в исходном дистрибутиве (то есть, грубо говоря, восстановил исходный код), но эффекта не было. Похоже, там толком ничего и не поменялось.VEG:Скорее всего какая-то ошибка в коде, следует в файле ucp.php внимательно изучить код
case 'logout':
if ($user->data['user_id'] != ANONYMOUS && isset($_GET['sid']) && !is_array($_GET['sid']) && $_GET['sid'] === $user->session_id)
{
$user->session_kill();
$user->session_begin();
$message = $user->lang['LOGOUT_REDIRECT'];
}
else
{
$message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED'];
}
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');
trigger_error($message);
break;
factotum:При активации wp-united для WP возникает конфликт одноименных функций
[quote]
styles/prosilver/template/overall_header.html
Find
<script type="text/javascript">
Add Before
<!-- IF WP_HEADERINFO_EARLY -->{WP_HEADERINFO_EARLY}<!-- ENDIF -->
The Find specified by the MOD could not be found[/quote]
У меня тоже ожил, а синхронизации нет. В админке wordpressa WP-United пишет: Текущий статус: Связь с форумом установлена, но не готова, либо отключена из-за ошибок.Ironsil:Решил эту проблему.
- Спойлер
- Скачал с другова своего форума (оригинального , не тестового) файл Function_Content.php -
1) Внес исправления согласно этому пункту
function make_clickable($text, $server_url = false, $class = 'postlink')
Заменить на
if (!function_exists('make_clickable'))
{
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return phpbb_make_clickable($text, $server_url, $class);
}
}
function phpbb_make_clickable($text, $server_url = false, $class = 'postlink')
Сохранил . перезаписал и форум ожил.
<open src="includes/functions_content.php">
<edit>
<find><![CDATA[function make_clickable($text, $server_url = false, $class = 'postlink')]]></find>
<action type="replace-with"><![CDATA[if (!function_exists('make_clickable'))
{
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return phpbb_make_clickable($text, $server_url, $class);
}
}
function phpbb_make_clickable($text, $server_url = false, $class = 'postlink')]]></action>
</edit>
</open>
function make_clickable( $text ) {
$r = '';
$textarr = preg_split( '/(<[^<>]+>)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // split out HTML tags
$nested_code_pre = 0; // Keep track of how many levels link is nested inside <pre> or <code>
foreach ( $textarr as $piece ) {
if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) )
$nested_code_pre++;
elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre )
$nested_code_pre--;
if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
$r .= $piece;
continue;
}
// Long strings might contain expensive edge cases ...
if ( 10000 < strlen( $piece ) ) {
// ... break it up
foreach ( _split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
if ( 2101 < strlen( $chunk ) ) {
$r .= $chunk; // Too big, no whitespace: bail.
} else {
$r .= make_clickable( $chunk );
}
}
} else {
$ret = " $piece "; // Pad with whitespace to simplify the regexes
$url_clickable = '~
([\\s(<.,;:!?]) # 1: Leading whitespace, or punctuation
( # 2: URL
[\\w]{1,20}+:// # Scheme and hier-part prefix
(?=\S{1,2000}\s) # Limit to URLs less than about 2000 characters long
[\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+ # Non-punctuation URL character
(?: # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character
[\'.,;:!?)] # Punctuation URL character
[\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]++ # Non-punctuation URL character
)*
)
(\)?) # 3: Trailing closing parenthesis (for parethesis balancing post processing)
~xS'; // The regex is a non-anchored pattern and does not have a single fixed starting character.
// Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
$ret = preg_replace_callback( $url_clickable, '_make_url_clickable_cb', $ret );
$ret = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret );
$ret = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret );
$ret = substr( $ret, 1, -1 ); // Remove our whitespace padding.
$r .= $ret;
}
}
// Cleanup of accidental links within links
$r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
return $r;
}
if (!function_exists('make_clickable'))
{
if (!function_exists('make_clickable'))
{
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return make_clickable($text, $server_url, $class);
}
}
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return make_clickable($text, $server_url, $class);
}
}
function make_clickable($text, $server_url = false, $class = 'postlink')
{
if ($server_url === false)
{
$server_url = generate_board_url(true);
}
static $magic_url_match;
static $magic_url_replace;
if (!is_array($magic_url_match))
{
$magic_url_match = $magic_url_replace = array();
// Be sure to not let the matches cross over. ;)
// matches a xxxx://aaaaa.bbb.cccc. ...
$magic_url_match[] = '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#ieu';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '$server_url')";
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
$magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#ieu';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '$server_url')";
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
$magic_url_match[] = '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/ie';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '$server_url')";
}
return preg_replace($magic_url_match, $magic_url_replace, $text);
}
function make_clickable($text, $server_url = false, $class = 'postlink')
if (!function_exists('make_clickable'))
{
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return phpbb_make_clickable($text, $server_url, $class);
}
}
function phpbb_make_clickable($text, $server_url = false, $class = 'postlink')
Cannot redeclare phpbb_make_clickable() (previously declared in /home/u613058276/public_html/forum/includes/functions_content.php:708) in /home/u613058276/public_html/forum/includes/functions_content.php on line 678
Sergiop:В functions_content.php оказалось 3 идентичных строки. Все 3 строки заменил и связь наладилась.
function make_clickable
после той, один раз.Sergiop:После правки только одной строчки, т.е. первой,
Sumanai:Так же важна последовательность. Посмотрите, где находится предыдущая правка, и ищите строку с function make_clickable после той, один раз.
/**
* make_clickable function
*
* Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx.
* Cuts down displayed size of link if over 50 chars, turns absolute links
* into relative versions when the server/script path matches the link
*/
function make_clickable($text, $server_url = false, $class = 'postlink')
{
if ($server_url === false)
{
$server_url = generate_board_url(true);
}
static $magic_url_match;
static $magic_url_replace;
if (!is_array($magic_url_match))
{
$magic_url_match = $magic_url_replace = array();
// Be sure to not let the matches cross over. ;)
// matches a xxxx://aaaaa.bbb.cccc. ...
$magic_url_match[] = '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#ieu';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '$server_url')";
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
$magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#ieu';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '$server_url')";
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
$magic_url_match[] = '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/ie';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '$server_url')";
}
return preg_replace($magic_url_match, $magic_url_replace, $text);
}
/**
* Censoring
*/
/**
* make_clickable function
*
* Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx.
* Cuts down displayed size of link if over 50 chars, turns absolute links
* into relative versions when the server/script path matches the link
*/
if (!function_exists('make_clickable'))
{
if (!function_exists('make_clickable'))
{
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return make_clickable($text, $server_url, $class);
}
}
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return make_clickable($text, $server_url, $class);
}
}
function make_clickable($text, $server_url = false, $class = 'postlink')
{
if ($server_url === false)
{
$server_url = generate_board_url(true);
}
static $magic_url_match;
static $magic_url_replace;
if (!is_array($magic_url_match))
{
$magic_url_match = $magic_url_replace = array();
// Be sure to not let the matches cross over. ;)
// matches a xxxx://aaaaa.bbb.cccc. ...
$magic_url_match[] = '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#ieu';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '$server_url')";
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
$magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#ieu';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '$server_url')";
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
$magic_url_match[] = '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/ie';
$magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '$server_url')";
}
return preg_replace($magic_url_match, $magic_url_replace, $text);
}
/**
* Censoring
*/
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--For security purposes, please check: http
://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
<header>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2</license>
<title lang="en">WP-UNITED: WordPress-phpBB Integration Package</title>
<description lang="en">Tightly integrates phpBB3 and WordPress.</description>
<author-notes lang="en">Make sure you follow the instructions in the DIY INSTRUCTIONS section, in order for this MOD to work properly!
Visit http://www.wp-united.com for more help or information.
</author-notes>
<author-group>
<author>
<realname>John Wells</realname>
<email>admin@wp-united.com</email>
<username>Jhong</username>
<homepage>www.wp-united.com</homepage>
<contributions />
</author>
</author-group>
<mod-version>0.9.2.2</mod-version>
<installation>
<level>intermediate</level>
<time>900</time>
<target-version>3.0.11</target-version>
</installation>
<link-group>
<link type="template" href="templates/subsilver2.xml" lang="en">subsilver2</link>
<link type="language" href="languages/de/install.xml" lang="de">Deutsch</link>
<link type="language" href="languages/fr/install.xml" lang="fr">Français</link>
<link type="language" href="languages/zh_cmn_hans/install.xml" lang="zh_cmn_hans">中文(简体)</link>
<link type="language" href="languages/ru/install.xml" lang="nl">русский</link>
<link type="language" href="languages/nl/install.xml" lang="nl">Nederlands</link>
<link type="contrib" href="contrib/upgrading_from_v0.9.1.x/upgrade.xml" lang="en">Upgrading from WP-United v0.9.1.x</link>
<link type="contrib" href="contrib/upgrading_from_v0.9.0.x/upgrade.xml" lang="en">Upgrading from WP-United v0.9.0.x</link>
<link type="contrib" href="contrib/upgrading_from_v0.8.x/upgrade.xml" lang="en">Upgrading from WP-United v0.8.x</link>
<link type="contrib" href="contrib/upgrading_from_v0.5.5_v0.6x_or_v0.7x/upgrade.xml" lang="en">Upgrading from WP-United v0.5.5, v0.6x or v0.7x</link>
<link type="contrib" href="contrib/upgrading_from_v0.5.0_or_v0.5.1/upgrade.xml" lang="en">Upgrading from WP-United v0.5.0 or v0.5.1</link>
</link-group>
</header>
<action-group>
<copy>
<file from="/root/includes/hooks/hook_wp-united.php" to="/includes/hooks/hook_wp-united.php" />
<file from="/root/language/" to="/language/" />
<file from="/root/styles/" to="/styles/" />
<file from="/root/wp-united/" to="/wp-united/" />
</copy>
<open src="includes/functions_content.php">
<edit>
<find><![CDATA[function make_clickable($text, $server_url = false, $class = 'postlink')]]></find>
<action type="replace-with"><![CDATA[if (!function_exists('make_clickable'))
{
function make_clickable($text, $server_url = false, $class = 'postlink')
{
return phpbb_make_clickable($text, $server_url, $class);
}
}
function phpbb_make_clickable($text, $server_url = false, $class = 'postlink')]]></action>
</edit>
</open>
<open src="memberlist.php">
<edit>
<find> if (!empty($profile_fields['row']))
{</find>
<action type="before-add"><![CDATA[ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
$GLOBALS['wpu_actions']->generate_profile_link($member['user_wpublog_id'], $template);]]></action>
</edit>
</open>
<open src="viewtopic.php">
<edit>
<find><![CDATA[}
$db->sql_freeresult($result);
// Load custom profile fields
if ($config['load_cpf_viewtopic'])]]></find>
<action type="before-add"><![CDATA[ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
$GLOBALS['wpu_actions']->generate_viewtopic_link($row['user_wpublog_id'], $user_cache[$poster_id]);
]]></action>
</edit>
<edit>
<find><![CDATA[ // Dump vars into template
$template->assign_block_vars('postrow', $postrow); ]]></find>
<action type="before-add"><![CDATA[ $GLOBALS['wpu_actions']->show_viewtopic_link($user_cache[$poster_id], $postrow);
]]></action>
<comment lang="en"> </comment>
</edit>
</open>
<open src="includes/functions.php">
<edit>
<find><![CDATA[function phpbb_check_hash($password, $hash)
{]]></find>
<action type="after-add"><![CDATA[ /**
* Modified by WP-United to allow portability between phpBB and other packages, as phpBB
* applies htmlentities to inbound passwords via it's request_var function.
*/
$result = wpu_original_phpbb_check_hash($password, $hash);
if($result)
{
return $result;
}
$portable_password = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
$portable_password = (!STRIP) ? addslashes($portable_password) : $portable_password;
if(empty($portable_password) || ($portable_password == $password))
{
return $result;
}
return wpu_original_phpbb_check_hash($portable_password, $hash);
}
function wpu_original_phpbb_check_hash($password, $hash)
{]]></action></edit>
</open>
<open src="includes/functions_user.php">
<edit>
<find><![CDATA[function validate_username($username, $allowed_username = false)]]></find>
<action type="replace-with"><![CDATA[if(!function_exists('validate_username') && (!defined('WPU_BLOG_PAGE')))
{
function validate_username($username, $allowed_username = false)
{
return phpbb_validate_username($username, $allowed_username);
}
}
function phpbb_validate_username($username, $allowed_username = false)]]></action></edit>
</open>
<open src="includes/acp/acp_main.php">
<edit>
<find><![CDATA[ $cache->purge();]]></find>
<action type="after-add"><![CDATA[ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
$GLOBALS['wpu_actions']->purge_cache();]]></action>
</edit>
</open>
<open src="style.php">
<edit>
<find><![CDATA[ echo $theme['theme_data']; ]]></find>
<action type="before-add"><![CDATA[ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
$theme['theme_data'] = $GLOBALS['wpu_actions']->css_magic($theme['theme_data']); ]]></action>
</edit>
</open>
<open src="styles/prosilver/template/overall_header.html">
<edit>
<find><![CDATA[<!DOCTYPE html>]]></find>
<action type="replace-with"><![CDATA[<!-- IF WP_DTD -->{WP_DTD}<!-- ELSE --><!DOCTYPE html><!-- ENDIF -->]]></action>
</edit>
<edit>
<find><![CDATA[<title><!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF --><!-- IF PAGE_TITLE and not S_ON_INDEX -->{PAGE_TITLE} - <!-- ENDIF --><!-- IF PAGE_NUMBER and ON_PAGE > 1 -->{PAGE_NUMBER} - <!-- ENDIF -->{SITENAME}<!-- IF S_ON_INDEX and SITE_DESCRIPTION --> - {SITE_DESCRIPTION}<!-- ENDIF --></title>]]></find>
<action type="after-add"><![CDATA[<!-- IF PHPBB_BASE --><base href="{PHPBB_BASE}" /><!-- ENDIF -->
]]></action>
</edit>
<edit>
<find><![CDATA[<script type="text/javascript">
]]></find>
<action type="before-add"><![CDATA[<!-- IF WP_HEADERINFO_EARLY -->{WP_HEADERINFO_EARLY}<!-- ENDIF -->
]]></action>
</edit>
<edit>
<find><![CDATA[</head>]]></find>
<action type="before-add"><![CDATA[<!-- IF WP_HEADERINFO_LATE -->{WP_HEADERINFO_LATE}<!-- ENDIF -->
]]></action>
</edit>
<edit>
<find><![CDATA[<li><a style="background-position: 0 -360px;" href="{U_FAQ}">{L_FAQ}</a></li>]]></find>
<action type="after-add"><![CDATA[<!-- IF S_BLOG --><li class="icon-members"><a href="{U_BLOG}" title="{L_BLOG}">{L_BLOG}</a></li><!-- ENDIF -->]]></action>
</edit>
</open>
<open src="styles/prosilver/template/memberlist_view.html">
<edit>
<find><![CDATA[ <dt>{PROFILE_FIELD1_NAME}:</dt> <dd>{PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->
]]></find>
<action type="after-add"><![CDATA[ <!-- IF U_BLOG_LINK -->
<dt>{L_BLOG}:</dt> <dd><a href="{U_BLOG_LINK}" title="{L_VISIT_BLOG}" >{L_VISIT_BLOG}</a></dd>
<!-- ENDIF -->]]></action>
</edit>
</open>
<open src="styles/prosilver/template/viewtopic_body.html">
<edit>
<find><![CDATA[ <dd><strong>{postrow.PROFILE_FIELD1_NAME}:</strong> {postrow.PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->]]></find>
<action type="after-add"><![CDATA[ <!-- IF postrow.U_BLOG_LINK -->
<dd><strong>{L_BLOG}:</strong> <a href="{postrow.U_BLOG_LINK}" title="{L_VISIT_BLOG}" >{L_VISIT_BLOG}</a></dd>
<!-- ENDIF -->]]></action>
</edit>
</open>
<open src="styles/prosilver/theme/common.css">
<edit>
<find>
h1 {
/* Forum name */
</find>
<action type="replace-with">
h1, #page-header h1 {
/* Forum name */
padding: 0;
text-align: left; </action>
<comment lang="en"> You only need to make this alteration if you will be using template integration. It is for compatibility with the default WordPress template.</comment>
</edit>
<edit>
<find>#site-description {</find>
<action type="after-add"> text-align: left;
</action>
<comment lang="en"> You only need to make this alteration if you will be using template integration. It is for compatibility with the default WordPress template.</comment>
</edit>
</open>
<diy-instructions lang="en"><![CDATA[
THEME CHANGES
-------------
If you need to install the template modifications for the subSilver2 template, use the subsilver2.xml file in the templates folder.
if you are using another theme based on prosilver, make the above prosilver changes to your theme now.
Remember to purge the phpBB template cache, and refresh your themes after making these changes.
IMPORTANT NEXT STEPS
--------------------
Most of the work of WP-United is done in the WordPress plugin. Please copy the plugin/wp-united folder to your wordpress plugins folder, and follow the instructions there.
REPORTING BUGS / GETTING HELP
-----------------------------
Please remember, 95% of reported bugs are user error. If you encounter any problems, re-read the above steps carefully, and make sure you have done everything as instructed, and try installing the mod using AutoMod.
Check that your phpBB server settings (especially "script path") and WordPress settings are correct, then try re-installing.
If it still fails, please:
(1) If you are getting blank pages, turn on PHP error reporting or look in your server log to find the underlying cause of the problem.
Post this information, together with full details of any error, and what you did to generate the error, on http://www.wp-united.com , after performing a search for similar issues.
]]></diy-instructions>
</action-group>
</mod>