{"id":2179,"date":"2017-07-25T22:14:05","date_gmt":"2017-07-25T20:14:05","guid":{"rendered":"https:\/\/www.axew3.com\/w3\/?p=2179"},"modified":"2025-05-15T23:16:05","modified_gmt":"2025-05-15T21:16:05","slug":"wordpress-shortcode-phpbb-posts-into-wp-post","status":"publish","type":"post","link":"https:\/\/www.axew3.com\/w3\/2017\/07\/wordpress-shortcode-phpbb-posts-into-wp-post\/","title":{"rendered":"WordPress Shortcode: phpBB posts into WP post"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">check all others shortcodes listed <a href=\"https:\/\/www.axew3.com\/w3\/wordpress-phpbb-integration-install\/#commonHowto\"><strong>under the &#8220;common how&#8221; to section<\/strong><\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span style=\"color: #003366;\"><strong>phpBB posts &#8211; WP post shortcode how to<\/strong><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To add a <strong>WP_w3all shortcode<\/strong>, and display a phpBB post into a WordPress post, choose a phpBB <strong>Post ID<\/strong> (note: post ID NOT Topic ID) to display, and add it into WordPress post, like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;w3allforumpost id=\"1202\"]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change the value <strong>1202<\/strong> with the post ID you need to display.<br><span style=\"color: #003366;\">( <strong>POST ID<\/strong> NOT TOPIC ID )<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you want display the post as plain text (so the bbcode will be removed by the output) use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;w3allforumpost id=\"1202\" plaintext=\"1\"]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to display with specified number of words, use the parameter\/attribute <strong><em>wordsnum<\/em><\/strong> (both <em>plaintext and wordsnum<\/em> can be used together) . Note that may you have to adjust <em>wordsnum<\/em> 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<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;w3allforumpost id=\"1202\" wordsnum=\"350\"]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The simple bbcode parser function, display all default bbcode tags, excluded <em>flash and email,<\/em> check the list on this phpBB help page, <a href=\"https:\/\/www.axew3.com\/w3\/forums\/app.php\/help\/bbcode\" target=\"_blank\" rel=\"noopener noreferrer\">phpBB bbcode how to<\/a><br>which are:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>[attachment] [b]<\/strong> <strong>[u] [i]&nbsp; [list] <\/strong>(all lists type)<strong> [size] [color] [url] [image] [code]<br><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">added: <strong><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">in this case the <em>[media]<\/em> bbcode <a href=\"https:\/\/www.axew3.com\/w3\/forums\/viewtopic.php?f=13&amp;t=566&amp;p=2249#p2249\" target=\"_blank\" rel=\"noopener noreferrer\">into the real phpBB post<\/a> will not be parsed (because the <em>Media Embed mod<\/em> has not been installed into this phpBB) <strong>but will be parsed into the WP post<\/strong>, because recognized by the plugin code, and parsed by WordPress.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It can be considered as 1.0 version, that work quite fine until bbcode tags structure is respected.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong><span style=\"color: #339966;\">Follow an output example for a phpBB postID<\/span> 2249<\/strong><br>which you can see here in phpBB:<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\"><a href=\"https:\/\/www.axew3.com\/w3\/forums\/viewtopic.php?f=13&amp;t=566&amp;p=2249#p2249\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.axew3.com\/w3\/forums\/viewtopic.php?f=13&amp;t=566&amp;p=2249#p2249<\/a><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">the <em>shortcode<\/em> used into this WP post to display the phpBB <strong>postID 2249<\/strong>, with bbcode formatted, will be this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;w3allforumpost id=\"2249\"]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Shortcode output for post id 2249 is right here:<\/h3>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-19afc361 wp-block-group-is-layout-flex\"><span style=\"color:#FF0000;\"><SIZE size=\"200\"><span style=\"font-size:200%;\">This is huge red text<\/span><\/SIZE><\/span><br\/>\nSo i want an image in <B><b>attach inline<\/b><\/B>\n<ATTACHMENT filename=\"southpcheers.jpg\" index=\"3\"><br \/><img decoding=\"async\" src=\"https:\/\/www.axew3.com\/w3\/forums\/download\/file.php?id=656\" alt=\"southpcheers.jpg\" \/><br \/>southpcheers.jpg <i>(21.54 kb)<\/i><br \/><\/ATTACHMENT>\n<br \/>then a file inline in attach\n<ATTACHMENT filename=\"phpseclib1.0.19.zip\" index=\"0\"><br \/><a style=\"font-weight:700\" href=\"https:\/\/www.axew3.com\/w3\/forums\/download\/file.php?id=661\">phpseclib1.0.19.zip<\/a> <i>(273.42 kb)<\/i><br \/><\/ATTACHMENT>\nthen i want <B><b>this text bold<\/b><\/B>,<br\/>\nand after i like to display a piece of code:<br\/>\n<br \/><code><i>\n<\/i>&lt;?php\nfunction test() {\n    $foo = \"local variable\";\n\n    echo '$foo in global scope: ' . $GLOBALS[\"foo\"] . \"\\n\";\n    echo '$foo in current scope: ' . $foo . \"\\n\";\n}\n\n$foo = \"Example content\";\ntest();\n?&gt;\n<\/code>\n<br \/>then i want display a big text without colorize it:<br\/>\n<SIZE size=\"150\"><span style=\"font-size:150%;\">WoW! i like it ... but could be better<\/span><\/SIZE><br\/>\nand i have some lists to display:\n<ul>\n<li>The first possible answer\n<li>The second possible answer\n<li>The third possible answer\n<\/ul>\nin different format\n<ol style=\"list-style-type: upper-roman\">\n<li>The first possible answer\n<li>The second possible answer\n<li>The third possible answer\n<\/ol>\n<U><span style=\"text-decoration:underline;\">but i like also to see the underline text<\/span><\/U><br\/>\nor quoted text:\n<QUOTE><blockquote style=\"font-style: italic;\">this text is quite quoted<\/blockquote><\/QUOTE>\nso a nice image:<br\/>\n<IMG src=\"https:\/\/www.phpbb.com\/theme\/images\/logos\/blue\/160x52.png\"><\/IMG><br\/>\nthen more bad code:\n<code>&lt;test  \/&gt;$find = array(\n\t\t '~\\[img\\].*?\\[\/img\\]~si', \/\/ if there links\/text for the image elsewhere, remove. Done above\n    '~(^(\\r\\n|\\r|\\n))|^\\s*$~m', .........\n\t);<\/code>\nand an url with text<br\/>\n<URL url=\"https:\/\/www.phpbb.com\/\"><a href=\"https:\/\/www.phpbb.com\/\">Visit phpBB!<\/a><\/URL><br\/>\nand an url<br\/>\n<URL url=\"https:\/\/www.wordpress.org\/\"><a href=\"https:\/\/www.wordpress.org\/\">https:\/\/www.wordpress.org\/<\/a><\/URL><br\/>\nand  more code for bbcode to be parsed:\n<code>\/\/ partial bbcode regex \n$find = array(\n\t\t'~\\[b\\](.*?)\\[\/b\\]~usi',\n\t\t'~\\[i\\](.*?)\\[\/i\\]~usi',\n\t\t'~\\[u\\](.*?)\\[\/u\\]~usi',\n\t\t'~\\[quote\\](.*?)\\[\/quote\\]~usi',\n\t\t'~\\[size=(.*?)\\](.*?)\\[\/size\\]~usi',\n\t);<\/code>\nand an image link also:<br\/>\n<br\/>\n<URL url=\"https:\/\/www.phpbb.com\/\"><a href=\"https:\/\/www.phpbb.com\/\"><IMG src=\"https:\/\/www.phpbb.com\/theme\/images\/logos\/blue\/160x52.png\"><\/IMG><\/a><\/URL><br\/>\n<br\/>\n<SIZE size=\"120\"><span style=\"font-size:120%;\">NOTE: on this phpBB example it is not installed the <URL url=\"https:\/\/www.phpbb.com\/customise\/db\/extension\/mediaembed\/\"><a href=\"https:\/\/www.phpbb.com\/customise\/db\/extension\/mediaembed\/\">phpBB Media Embed mod<\/a><\/URL>, to display video into phpBB posts, but if i add this bbcode into this phpBB post like this:<\/span><\/SIZE><br\/>\n<iframe loading=\"lazy\" title=\"The Most Beautiful Games of 2017\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/AYBrtFnHI6g?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><br\/>\n<SIZE size=\"120\"><span style=\"font-size:120%;\">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.<\/span><\/SIZE><br\/>\n<br\/>\n<SIZE size=\"120\"><span style=\"font-size:120%;\">you cannot add, expecting it will be parsed: <I><span style=\"font-style: italic;\">flash<\/span><\/I> or <I><span style=\"font-style: italic;\">email bbcode tag<\/span><\/I><\/span><\/SIZE>.<br\/>\nsee the result of this post parsed into a WordPress post via Shortcode here: <URL url=\"https:\/\/www.axew3.com\/w3\/2017\/07\/wordpress-shortcode-phpbb-posts-into-wp-post\/\"><a href=\"https:\/\/www.axew3.com\/w3\/2017\/07\/wordpress-shortcode-phpbb-posts-into-wp-post\/\">https:\/\/www.axew3.com\/w3\/2017\/07\/wordpress-shortcode-phpbb-posts-into-wp-post\/<\/a><\/URL><br\/>\n<br\/>\nyou need a more improved version of the function that do this? email me here: <EMAIL email=\"me@you.us\">me@you.us<\/EMAIL><br\/>\nAs you see was not so important to add email parsing .... (what?)<br\/>\n<br\/>\nCheers to all cool people!<div style=\"background:#F3F3F3;margin:10px 0;padding:10px\"><div><i>Attachments<\/i><hr style=\"margin:0;\" \/><\/div><div style=\"padding:5px 5px 0 5px;\"><a style=\"font-weight:900\" href=\"https:\/\/www.axew3.com\/w3\/forums\/download\/file.php?id=660\">phpBB-audio-video-to-post-1.0.4-alpha.zip<\/a> &nbsp;<i>(591.26 kb)<\/i><\/div><div style=\"padding:5px 5px 0 5px;\"><a style=\"font-weight:900\" href=\"https:\/\/www.axew3.com\/w3\/forums\/download\/file.php?id=659\">phpseclib-master-3.0.7.zip<\/a> &nbsp;<i>(553.16 kb)<\/i><\/div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>check all others shortcodes listed under the &#8220;common how&#8221; to section phpBB posts &#8211; 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: Change [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,234],"tags":[139,140,42,141,142,41],"class_list":["post-2179","post","type-post","status-publish","format-standard","hentry","category-wordpress-phpbb-integration","category-wordpress-phpbb-shortcodes","tag-bbcode","tag-parser","tag-phpbb","tag-post","tag-shortcode","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts\/2179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/comments?post=2179"}],"version-history":[{"count":3,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts\/2179\/revisions"}],"predecessor-version":[{"id":7797,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/posts\/2179\/revisions\/7797"}],"wp:attachment":[{"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/media?parent=2179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/categories?post=2179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.axew3.com\/w3\/wp-json\/wp\/v2\/tags?post=2179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}