axew3.com

WordPress Shortcode: phpBB posts into WP post

by

check all others shortcodes listed under the “common how” to section

phpBB posts – WP post shortcode how to

To add a WP_w3all shortcode, and display a phpBB post into a WordPress post, choose a phpBB Post ID (note: post ID NOT Topic ID) to display, and add it into WordPress post, like this:

[w3allforumpost id="1202"]

Change the value 1202 with the post ID you need to display.
( POST ID NOT TOPIC ID )

If you want display the post as plain text (so the bbcode will be removed by the output) use:

[w3allforumpost id="1202" plaintext="1"]

If you want to display with specified number of words, use the parameter/attribute wordsnum (both plaintext and wordsnum can be used together) . Note that may you have to adjust wordsnum parameter to a number of words to be retrieved that will output exactly what you want, because the count of words will include html tags

[w3allforumpost id="1202" wordsnum="350"]

The simple bbcode parser function, display all default bbcode tags, excluded flash and email, check the list on this phpBB help page, phpBB bbcode how to
which are:

[attachment] [b] [u] [i]  [list] (all lists type) [size] [color] [url] [image] [code]

added:

in this case the [media] bbcode into the real phpBB post will not be parsed (because the Media Embed mod has not been installed into this phpBB) but will be parsed into the WP post, because recognized by the plugin code, and parsed by WordPress.

It can be considered as 1.0 version, that work quite fine until bbcode tags structure is respected.

Follow an output example for a phpBB postID 2249
which you can see here in phpBB:

https://www.axew3.com/w3/forums/viewtopic.php?f=13&t=566&p=2249#p2249

the shortcode used into this WP post to display the phpBB postID 2249, with bbcode formatted, will be this:

[w3allforumpost id="2249"]

Shortcode output for post id 2249 is right here:

This is huge red text
So i want an image in attach inline
southpcheers.jpg
southpcheers.jpg (21.54 kb)

then a file inline in attach
phpseclib1.0.19.zip (273.42 kb)
then i want this text bold,
and after i like to display a piece of code:

<?php function test() { $foo = "local variable"; echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n"; echo '$foo in current scope: ' . $foo . "\n"; } $foo = "Example content"; test(); ?>
then i want display a big text without colorize it:
WoW! i like it … but could be better
and i have some lists to display:
  • The first possible answer
  • The second possible answer
  • The third possible answer
in different format
  1. The first possible answer
  2. The second possible answer
  3. The third possible answer
but i like also to see the underline text
or quoted text:
this text is quite quoted
so a nice image:

then more bad code: <test />$find = array( '~\[img\].*?\[/img\]~si', // if there links/text for the image elsewhere, remove. Done above '~(^(\r\n|\r|\n))|^\s*$~m', ......... ); and an url with text
Visit phpBB!
and an url
https://www.wordpress.org/
and more code for bbcode to be parsed: // partial bbcode regex $find = array( '~\[b\](.*?)\[/b\]~usi', '~\[i\](.*?)\[/i\]~usi', '~\[u\](.*?)\[/u\]~usi', '~\[quote\](.*?)\[/quote\]~usi', '~\[size=(.*?)\](.*?)\[/size\]~usi', ); and an image link also:



NOTE: on this phpBB example it is not installed the phpBB Media Embed mod, to display video into phpBB posts, but if i add this bbcode into this phpBB post like this:

it will not be parsed into this phpBB post, because the mod has not been installed in phpBB, but will be parsed into the WP post because recognized and parsed by the WP_w3all plugin code.

you cannot add, expecting it will be parsed: flash or email bbcode tag.
see the result of this post parsed into a WordPress post via Shortcode here: https://www.axew3.com/w3/2017/07/wordpress-shortcode-phpbb-posts-into-wp-post/

you need a more improved version of the function that do this? email me here: me@you.us
As you see was not so important to add email parsing …. (what?)

Cheers to all cool people!
Attachments