Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Include last x posts from punBB  (Read 3305 times)

0 Members and 1 Guest are viewing this topic.

Zyama

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Include last x posts from punBB
« 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

Code: [Select]
$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:
Code: [Select]
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.
Logged

Nibbler

  • Guest
Re: Include last x posts from punBB
« Reply #1 on: September 22, 2007, 09:33:37 pm »

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

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Include last x posts from punBB
« Reply #2 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.
Logged

Zyama

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Include last x posts from punBB
« Reply #3 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Include last x posts from punBB
« Reply #4 on: September 23, 2007, 08:46:33 am »

Don't edit include/themes.inc.php, but themes/yourtheme/theme.php
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 19 queries.