Include last x posts from punBB Include last x posts from punBB
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Include last x posts from punBB

Started by Zyama, September 22, 2007, 09:14:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zyama

Hello, I've got question on integration last 10 posts from punBB.

In themes.inc.php file I put {FORUM} to pagefooter function

$template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
'{FORUM}' => cpg_get_custom_include_3(),


and also added to the same file themes.inc.php next code:
function cpg_get_custom_include_3()
{
echo "<ul>";
require("http://www.mysite.com/forum/extern.php?action=active&show=10");
echo "$cpg_get_custom_include_3";
echo "</ul>";
}


After all this I can see the the last 10 posts from my forum, but not in the part of template where I put {FORUM}, the posts appears just below the gallery.

How can I arrange them to be shown in place, where I put {FORUM} tag in my template.

Nibbler

You should concatenate and return what you want displayed, not echo it directly.

Tranz

I would suggest using include() instead of require(). If there are any issues, require() will result in a fatal error instead of an error message. I don't think the forum posts listing is vital to the functioning of your gallery so it's better to use include(), in my opinion.

Zyama

TranzNDance, thank You. I changed it to include().

Nibbler, how should I do it for example. I'am not familiar with PHP.

Joachim Müller

Don't edit include/themes.inc.php, but themes/yourtheme/theme.php