Page 4 of 32

Posted: Mon Jan 08, 2007 10:58 pm
by No_Mercy
I am using metaBB. The phpBB premod.

Here is my usercp_register


http://www.gcwrestling.shockv2.com/GCW/ ... gister.txt

Posted: Tue Jan 09, 2007 9:06 am
by Etherfast
Hey there,

Would your MOD help me do the following?

- Show a few of the latest forum discussions on the blog's frontpage (Latest forum posts, or something like that)
- Inside the forum, show a table with the latest Wordpress posts (perhaps this ain't the right place for that, so I'll get into a bit more detail). I have a XML sitemap located at http://www.blog.com/sitemap.xml . Is there any way I can make phpBB fetch those titles from the sitemap and display them in a column, left from my board?

Supposing WP will upgrade soon, will I be able to upgrade the installation without any conflicts (like I would update a regular installation of WP)?
Original post, here.


Thank you,

Posted: Tue Jan 09, 2007 11:51 am
by Jhong
No_Mercy wrote: I am using metaBB. The phpBB premod.

Here is my usercp_register


http://www.gcwrestling.shockv2.com/GCW/ ... gister.txt


Hi again -- that explains a few things. Now I see your website, it's systemic., not just with usercp.

After poring over the (hefty) MetaBB files, it looks like it's the calendar mod including phpBB's bbcode.php late on every page.

On normal phpBB installations, this wouldn't happen.

Anyway, the fix is easy...

Find the following code in includes/bbcode.php

Code: Select all

function make_clickable($text)

before, add:

Code: Select all

if ( !function_exists(make_clickable) ) { 

then find

Code: Select all

return ($ret)

after, add

Code: Select all

} 
The two functions do exactly the same thing, so this should be just fine. The only difference is that, if you have the phpBB calendar at the top of the blog page, links posted by users will open in the same window.

Posted: Tue Jan 09, 2007 12:29 pm
by Jhong
@EtherFast...

Is your blog on the same domain? If so, It couldn't hurt -- all phpBB functions and global variables will be available from within WordPress, however, they are "on ice", so to speak, and are restored back to their original state once the WordPress portion of the page has been generated. This is to guard against any WordPress variables overwriting phpBB variables.

So the best way to do it would be to (waiting for version 0.8.7.0, to be released tonight, if I get the time)

Add whatever code you want in blog.php, before ->enter_wordpress is called, putting stuff you want to appear in WordPress into unique variable names. If you want rows of posts you could just stick them into an array. Any stuff that will pull from the phpBB database must go here.

Then you can just reference the variables in your WordPress template. You'll need to reference them as <?php global $your_var; echo $your_var ?> or <?php $_GLOBALS['your_var']; ?> .

I will likely add the ability to put common phpBB tags into WordPress templates about the same time I add avatars, and the above would definitely be good in a contrib.

For the second question, if you want to use the XML, then no -- but it is definitely possible to include the latest posts in your phpBB - you can just include a portion of your index page. Have a look at the latest library posts here as an example. The code I'm using for this ain't portable enough yet to use as a contrib, but I will definitely release it in the future.

Posted: Tue Jan 09, 2007 12:36 pm
by Etherfast
Thank you, I will follow up your further releases.

Good luck :)

Posted: Tue Jan 09, 2007 3:18 pm
by No_Mercy
It works!

Thanks man!

Posted: Tue Jan 09, 2007 5:20 pm
by Jhong
v 0.8.7.0 released, and a name-change of the Mod to WP-United.

The launch coincides with a new website - http://www.wp-united.com, which will hopefully be a convenient place to showcase successful integrations, and a few demos.

There's no upgrade path yet -- so if you're upgrading, you should delete the 'wordpress integration mod' tables from your phpBB database, remove any changes made by the previous version, and delete any of the files previous version's files, beore applying this version. The re-install process should not harm the user tables in WordPress - the integration will continue to work where you left off.

Happy Modding,

John

Posted: Wed Jan 10, 2007 1:19 am
by brokenantimatter
Jhong I have been doing a lot of digging through your code I am pretty sure it is possible without a great deal of expense but I am not willing to do it because I lack the proficiency to code in php through any means other than trial and error.

Perhaps have wordpress be able to run outside of phpbb folder

Example:
[phpbb]
http://localhost/forum/

[wordpress]
http://localhost/

or maybe.... not sure

I would like to see an implementation that would allow a person to run blog.php in its own folder rather than the phpbb folder, perhaps have it run as the root index.

I think this would be easily capable of being done by yourself; as you being more knowledgeable in your coding and phpbb itself than me.

If I am not making any sense I would like to say I am pretty fucked up on scotch right now and not liable for my actions.

Posted: Wed Jan 10, 2007 4:07 am
by No_Mercy
Actually, that's how I have it set up. With wordpress outside of the phpBB folder.

Posted: Wed Jan 10, 2007 4:15 pm
by Jhong
@brokenantimatter:

Sure you can. However, if you want to move blog.php out of the phpbb root, you'll have to change the line at the top of the file that says $phpbb_root_path = xxxxx, to the correct path, and prepend forum/ to any other include statements.

I wouldn't recommend this, as conceptually the file is "in" phpBB. If you are using Apache, why not instead redirect from your site root to /forum, and then either rename blog.php to index.php (and rename all instances of "blog.php" or "blog." . $pepEx, or similar iin the entire package and mod file to the new name).. or.. easier, set apache to look for blog.php before index.php.

Posted: Wed Jan 10, 2007 5:32 pm
by blsimpson
Hello Jhong, I have put all the files in the right places, and made the changes to the file(s) that the DIY says to make, and when I go to run the setup Wizard on the WordPress Integration MOD page, I get this error:

Code: Select all

An Error Occurred

DEBUG MODE

SQL Error : 1146 Table 'dicrosi_phpbb.wp_int_table' doesn't exist

Line : \wwwroot\Dicrosi\wp-united\mod-settings.php
File : SELECT * FROM WP_INT_TABLE LIMIT 1
I havent seen anything stating that I needed to create this table. Is this supossed to be in the setup script that I cant get to? I am not really familiar with creating tables and such in MySQL, but any help would be great.

Thanks,

ben

Posted: Wed Jan 10, 2007 5:53 pm
by Jhong
Hi blsimpson,

You need to run the SQL statement toward the top of the mod file against your phpBB database, changing the prefix "phpbb_" if you elected to use a different table prefix when setting up phpBB>

You can do this using phpMyAdmin - there is a how-to at the top of this forum.

If you'vce done all that, then you should check that you have applied the changes correctly in includes/constants.php. Specifically, check that the line:

Code: Select all

define('WP_INT_TABLE', $table_prefix.'wpu_integration');
is in there.

John

Posted: Wed Jan 10, 2007 6:21 pm
by blsimpson
That did it. now running through the wizard, I enter the URL of the wordpress install, and click Test URL. How long is supposed to take?I can click on Detect Path, and it comes up immediatly, but the Test URL just keeps spinnig.

Also, when I click on continue to step 2, I get a "The settings could not be saved in the database. Your settings were not saved." The database settings are correct for both phpbb and Wordpress, so I have no idea where to go for this...

Sorry for being such a pain..

ben

Posted: Wed Jan 10, 2007 6:23 pm
by Jhong
Another day... another update. This just rounds off a few loose ends in the v0.8.7 release...

New in v.0.8.7.1:

-- Fixed: Some of the new Setup Wizard options were missing from the settings page.
-- Fixed: In the Wizard, if JavaScript is disabled, when running the setup tests, some options typed in text boxes were not remembered when the page refreshed.
-- Fixed: Incorrect version number in Admin Panel
-- New: Now, no changes are needed to ANY WordPress files!

For a full list of changes, please look at the mod file.

To upgrade from v0.8.7.0, just copy over all the package files to your phpBB install, on top of the previous versions. Then, you only need to reverse and then re-apply the mod changes to:
usercp_register.php, bbcode.php and language/lang_english/lang_main.php .

Download link in the first post.

Happy modding!

Posted: Wed Jan 10, 2007 6:34 pm
by Jhong
blsimpson wrote: That did it. now running through the wizard, I enter the URL of the wordpress install, and click Test URL. How long is supposed to take?I can click on Detect Path, and it comes up immediatly, but the Test URL just keeps spinnig.

Also, when I click on continue to step 2, I get a "The settings could not be saved in the database. Your settings were not saved." The database settings are correct for both phpbb and Wordpress, so I have no idea where to go for this...

Sorry for being such a pain..

ben


No worries...

The Ajax URL tester doesn't "time out" if the return information from the server gets lost. But if you're confident about the setting, it shouldn't matter.

Something's obviously wrong with your database settings... can you try running the "settings" page instead, and, after clicking "submit", copying and pasting the full message r.e. any errors?

You'll still need to run the wizard afterwards, but at least we'll have some idea of what's wrong with your database.