将 phpbb 用户名链接到 drupal 配置文件
我正在使用 drupal 和 phpbb 以及名为 phpbbforum 的桥。它工作得很好,用户信息在 drupal 和 phpbb 数据库之间同步。该论坛嵌入在 drupal 页面中,因此 page.tpl.php 附带的所有变量都应该可用。
我希望 drupal 成为唯一的配置文件处理程序,因此当有人单击 phpbb 用户名时,该人就会链接到 drupal 配置文件。在 phpbbs 模板文件中,配置文件的链接由函数 get_username_string
调用。我认为编辑它的正确位置是 /includes/functions_content.php
文件中的第 1178 行。在该行的正上方,写着“* 获取用于放入模板的用户名详细信息”。还有一个关于个人资料链接的部分。 我只是不知道如何编辑它,以便配置文件链接指向 drupal 配置文件。有人能解决这个问题吗?
I'm using drupal and phpbb with a bridge called phpbbforum. It works quite well, the user information is synched between the drupal and phpbb databases. The forum is embeded in a drupal page, so all variables that come with page.tpl.php should be avaliable.
I want drupal to be the only profile handler, so when someone clicks on a phpbb username, that person get's linked to the drupal profile. In phpbbs template files, the link to the profile is called by function get_username_string
. I think the right place to edit it is in the /includes/functions_content.php
file on line 1178. Right above that line it says "* Get username details for placing into templates." and there's a section about profile links.
I just can't figure out how to edit it so that the profile links lead to drupal profiles. Can anyone figure this one out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几天前我成功实现了这一目标!我必须说,我确实花了 30 分钟才找出需要编辑的文件,但在那之后,一切就变得轻而易举了!
基本上,您必须编辑 phpBB3 PHP Includes 文件,以便它们指向 Drupal 用户配置文件,而不是 phpBB 用户配置文件。这可以很容易地实现。首先,安装 Pathauto Drupal 模块。为所有用户配置文件创建一个自动别名,以便它们转到 yoursite.com/users/[用户名]。然后基本上,在 phpBB PHP Includes 文件中,将用户配置文件直接指向:yoursite.com/users/{USERNAME}。
在phpBB中,{USERNAME}表示用户的用户名。因此,当您添加 yoursite.com/users/{USERNAME} 时,它将定向到您使用 Pathauto 创建的 Drupal 配置文件。例如,我的 Drupal 个人资料页面是 mysite.com/users/admin,phpBB 将使用 {USERNAME} 标签来打印用户的用户名。因此,在 phpBB 中,如果您更改配置文件 URL,它们将转到相同的位置。
这非常简单,但需要一些 PHP 知识。我的现在可以无缝运行,在我搜索完 phpBB 文件后只花了大约 5 分钟。您必须记住的是 - 这些修改将针对 phpBB 本身进行,而不是针对 Drupal,因为您希望 phpBB 配置文件转到 Drupal 配置文件。如果您需要任何帮助,请告诉我,我会尽力帮助您。 :)
I managed to achieve this just a few days ago! I must say, it did take a good 30 minutes for me to figure the files that needed to be edited, but after that, it was a breeze!
Basically, you have to edit the phpBB3 PHP Includes files, so that they point to the Drupal user profile, instead of the phpBB one. This can be achieved very easily. Firstly, install the Pathauto Drupal module. Make an auto alias for all user profiles, so that they go to yoursite.com/users/[username]. Then basically, in the phpBB PHP Includes files, make the user profiles direct to: yoursite.com/users/{USERNAME}.
In phpBB, {USERNAME} means the user's username. So when you add yoursite.com/users/{USERNAME}, it will direct to the Drupal profiles that you created with Pathauto. For example, my Drupal profile pages are mysite.com/users/admin, and phpBB will use the {USERNAME} tag to print the user's username. So in phpBB, if you change the profile URLs, they'll go to the same place.
It's pretty easy, but will require a bit of PHP knowledge. Mine is working seamlessly now, and only took about 5 minutes after I'd searched through the phpBB files. What you must remember is - These modifications would be made to phpBB itself, and not Drupal, seeing as you want phpBB profiles to go to Drupal ones. If you need any help, let me know, I'll try to help you out. :)