Skip to content

Instantly share code, notes, and snippets.

@marcroberts
Created July 6, 2010 15:17
Show Gist options
  • Save marcroberts/465514 to your computer and use it in GitHub Desktop.
Save marcroberts/465514 to your computer and use it in GitHub Desktop.
Modifications needed to phpBB 3.0.7 for WP-United
diff --git a/includes/acp/acp_main.php b/includes/acp/acp_main.php
index b8712b2..cf456db 100644
--- a/includes/acp/acp_main.php
+++ b/includes/acp/acp_main.php
@@ -337,7 +337,12 @@ class acp_main
}
global $cache;
+
$cache->purge();
+
+ require_once($phpbb_root_path . 'wp-united/cache.' . $phpEx);
+ $wpuCache = WPU_Cache::getInstance();
+ $wpuCache->purge();
// Clear permissions
$auth->acl_clear_prefetch();
diff --git a/includes/acp/acp_users.php b/includes/acp/acp_users.php
index 4905840..8a3bd59 100644
--- a/includes/acp/acp_users.php
+++ b/includes/acp/acp_users.php
@@ -906,6 +906,9 @@ class acp_users
// Let the users permissions being updated
$auth->acl_clear_prefetch($user_id);
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $GLOBALS['wpu_actions']->profile_update('reg_details', $user_id, $user_row['user_wpuint_id'], $sql_ary);
+
add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']);
trigger_error($user->lang['USER_OVERVIEW_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id));
@@ -1389,6 +1392,9 @@ class acp_users
WHERE user_id = $user_id";
$db->sql_query($sql);
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $GLOBALS['wpu_actions']->profile_update('profile_info', $user_id, $user_row['user_wpuint_id'], $sql_ary);
+
// Update Custom Fields
$cp->update_profile_field_data($user_id, $cp_data);
diff --git a/includes/functions_content.php b/includes/functions_content.php
index faff9dd..186c3c1 100644
--- a/includes/functions_content.php
+++ b/includes/functions_content.php
@@ -638,8 +638,16 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
* 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'))
+{
function make_clickable($text, $server_url = false, $class = 'postlink')
{
+ global $IN_WORDPRESS;
+ if ($IN_WORDPRESS)
+ {
+ return wp_make_clickable($text); //WP version
+ } else {//phpBB version
+
if ($server_url === false)
{
$server_url = generate_board_url();
@@ -677,6 +685,7 @@ function make_clickable($text, $server_url = false, $class = 'postlink')
return preg_replace($magic_url_match, $magic_url_replace, $text);
}
+}
+}
/**
* Censoring
diff --git a/includes/functions_user.php b/includes/functions_user.php
index 21e8203..f5c69fb 100644
--- a/includes/functions_user.php
+++ b/includes/functions_user.php
@@ -2408,6 +2408,10 @@ function avatar_process_user(&$error, $custom_userdata = false)
if (sizeof($sql_ary))
{
$ext_new = $ext_old = '';
+
+ require_once($GLOBALS['phpbb_root_path'] . 'wp-united/wpu-actions.' . $GLOBALS['phpEx']);
+ $GLOBALS['wpu_actions']->profile_update('avatar', ($custom_userdata === false) ? $user->data['user_id'] : $custom_userdata['user_id'], ($custom_userdata === false) ? $user->data['user_wpuint_id'] : $custom_userdata['user_wpuint_id'], $sql_ary);
+
if (isset($sql_ary['user_avatar']))
{
$userdata = ($custom_userdata === false) ? $user->data : $custom_userdata;
diff --git a/includes/ucp/ucp_profile.php b/includes/ucp/ucp_profile.php
index f4f4aba..8983169 100644
--- a/includes/ucp/ucp_profile.php
+++ b/includes/ucp/ucp_profile.php
@@ -130,9 +130,13 @@ class ucp_profile
{
add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);
}
-
+
$message = 'PROFILE_UPDATED';
-
+
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $GLOBALS['wpu_actions']->profile_update('reg_details', $user->data['user_id'], $user->data['user_wpuint_id'], $sql_ary);
+
+
if ($auth->acl_get('u_chgemail') && $config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
{
$message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
@@ -378,7 +382,10 @@ class ucp_profile
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
-
+
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $GLOBALS['wpu_actions']->profile_update('profile_info', $user->data['user_id'], $user->data['user_wpuint_id'], $sql_ary);
+
// Update Custom Fields
$cp->update_profile_field_data($user->data['user_id'], $cp_data);
diff --git a/memberlist.php b/memberlist.php
index b46230b..3f1ac5a 100644
--- a/memberlist.php
+++ b/memberlist.php
@@ -643,6 +643,8 @@ switch ($mode)
'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '',
));
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $GLOBALS['wpu_actions']->generate_profile_link($member['user_wpublog_id'], $template);
if (!empty($profile_fields['row']))
{
$template->assign_vars($profile_fields['row']);
diff --git a/style.php b/style.php
index fa77815..13a5d37 100644
--- a/style.php
+++ b/style.php
@@ -282,6 +282,9 @@ if ($id)
$theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']);
}
}
+
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $theme['theme_data'] = $GLOBALS['wpu_actions']->css_magic($theme['theme_data']);
echo $theme['theme_data'];
diff --git a/styles/prosilver/template/memberlist_view.html b/styles/prosilver/template/memberlist_view.html
index 031bfec..dc445c7 100644
--- a/styles/prosilver/template/memberlist_view.html
+++ b/styles/prosilver/template/memberlist_view.html
@@ -33,6 +33,9 @@
<!-- IF INTERESTS --><dt>{L_INTERESTS}:</dt> <dd>{INTERESTS}</dd><!-- ENDIF -->
<!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}:</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
<!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
+ <!-- IF U_BLOG_LINK -->
+ <dt>{L_BLOG}:</dt> <dd><a href="{U_BLOG_LINK}" title="{L_VISIT_BLOG}" >{L_VISIT_BLOG}</a></dd>
+ <!-- ENDIF -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<!-- IF U_REMOVE_FRIEND -->
<dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
diff --git a/styles/prosilver/template/overall_footer.html b/styles/prosilver/template/overall_footer.html
index 4da1308..d1b8306 100644
--- a/styles/prosilver/template/overall_footer.html
+++ b/styles/prosilver/template/overall_footer.html
@@ -32,6 +32,7 @@
<div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
+ <!-- IF WP_CREDIT --><br />{WP_CREDIT}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
<!-- IF U_ACP --><br /><strong><a href="{U_ACP}">{L_ACP}</a></strong><!-- ENDIF -->
</div>
diff --git a/styles/prosilver/template/overall_header.html b/styles/prosilver/template/overall_header.html
index 8f4ac19..f00a89f 100644
--- a/styles/prosilver/template/overall_header.html
+++ b/styles/prosilver/template/overall_header.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!-- IF WP_DTD -->{WP_DTD}<!-- ELSE --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><!-- ENDIF -->
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
@@ -14,6 +14,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
+<!-- IF PHPBB_BASE --><base href="{PHPBB_BASE}" /><!-- ENDIF -->
<!-- IF S_ENABLE_FEEDS -->
<!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
@@ -35,7 +36,7 @@
The phpBB Group is not responsible for the content of this page and forum. For more information
about phpBB please visit http://www.phpbb.com
-->
-
+<!-- IF WP_HEADERINFO_EARLY -->{WP_HEADERINFO_EARLY}<!-- ENDIF -->
<script type="text/javascript">
// <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:';
@@ -99,6 +100,8 @@
<link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->
+<!-- IF WP_HEADERINFO_LATE -->{WP_HEADERINFO_LATE}<!-- ENDIF -->
+
</head>
<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
@@ -162,6 +165,7 @@
<ul class="linklist rightside">
<li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
+ <!-- IF S_BLOG --><li class="icon-members"><a href="{U_BLOG}" title="{L_BLOG}">{L_BLOG}</a></li><!-- ENDIF -->
<!-- IF not S_IS_BOT -->
<!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
<!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
diff --git a/styles/prosilver/template/viewtopic_body.html b/styles/prosilver/template/viewtopic_body.html
index 24c57b9..194759c 100644
--- a/styles/prosilver/template/viewtopic_body.html
+++ b/styles/prosilver/template/viewtopic_body.html
@@ -190,6 +190,9 @@
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
<dd><strong>{postrow.PROFILE_FIELD1_NAME}:</strong> {postrow.PROFILE_FIELD1_VALUE}</dd>
<!-- ENDIF -->
+ <!-- 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 -->
<!-- BEGIN custom_fields -->
<dd><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}:</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
diff --git a/styles/prosilver/theme/common.css b/styles/prosilver/theme/common.css
index a86f723..0cb8ae8 100644
--- a/styles/prosilver/theme/common.css
+++ b/styles/prosilver/theme/common.css
@@ -24,8 +24,10 @@ body {
padding: 12px 0;
}
-h1 {
+h1, #page-header h1 {
/* Forum name */
+ padding: 0;
+ text-align: left;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
margin-right: 200px;
color: #FFFFFF;
@@ -172,6 +174,7 @@ a#logo:hover {
/* Site description and logo */
#site-description {
+ text-align: left;
float: left;
width: 70%;
}
diff --git a/ucp.php b/ucp.php
index 994fe06..f07ab36 100644
--- a/ucp.php
+++ b/ucp.php
@@ -95,6 +95,10 @@ switch ($mode)
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> ');
+
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $GLOBALS['wpu_actions']->do_logout();
+
trigger_error($message);
break;
diff --git a/viewtopic.php b/viewtopic.php
index 29c4e5c..686620b 100644
--- a/viewtopic.php
+++ b/viewtopic.php
@@ -1187,6 +1187,10 @@ while ($row = $db->sql_fetchrow($result))
}
}
}
+
+ require_once($phpbb_root_path . 'wp-united/wpu-actions.' . $phpEx);
+ $GLOBALS['wpu_actions']->generate_viewtopic_link($row['user_wpublog_id'], $user_cache[$poster_id]);
+
}
$db->sql_freeresult($result);
@@ -1567,6 +1571,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{
$postrow = array_merge($postrow, $cp_row['row']);
}
+
+ $GLOBALS['wpu_actions']->show_viewtopic_link($user_cache['poster_id'], $postrow);
// Dump vars into template
$template->assign_block_vars('postrow', $postrow);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment