coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Zyama on September 22, 2007, 09:14:42 PM

Title: Include last x posts from punBB
Post by: Zyama on September 22, 2007, 09:14:42 PM
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.
Title: Re: Include last x posts from punBB
Post by: Nibbler on September 22, 2007, 09:33:37 PM
You should concatenate and return what you want displayed, not echo it directly.
Title: Re: Include last x posts from punBB
Post by: Tranz on September 22, 2007, 09:34:20 PM
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.
Title: Re: Include last x posts from punBB
Post by: Zyama on September 22, 2007, 09:51:17 PM
TranzNDance, thank You. I changed it to include().

Nibbler, how should I do it for example. I'am not familiar with PHP.
Title: Re: Include last x posts from punBB
Post by: Joachim Müller on September 23, 2007, 08:46:33 AM
Don't edit include/themes.inc.php, but themes/yourtheme/theme.php