0

in pligg adding new modules to the the main pligg template pligg.tpl is quite straight forward, however, i want to add a new module to the story. located in link_summary.tpl. the problem is that when the link summary template is created, a new variable $main_smarty is created with it's own local scope, not available to my modulename_main.php file. when I use the global $main_smarty variable, it refferences the main pligg template smarty object. So i have used to quick and somewhat dirty fix to the main architecture php code, to the link.php file I added a new call back:

$vars = '';
check_actions('add_to_summary', $vars);

and then created a new global variable refferencing the $main_smarty object in the link.php file, which i then used in my modulename_main.php

global $link_smarty;
global $link_variables;
$link_variables = $this;
$link_smarty = $main_smarty;

is there a more native, proper and cleaner way of doing this without tweaking the main architecture pligg code?

kamikazeOvrld
  • 914
  • 8
  • 9

1 Answers1

0

Not sure if this would be helpful.

An alternative way would be to write a new module and assign it to that particular page, in your case link_summary. As you know, each module has an init file, something like your_module_init.php. In your case the init file would be similar to:

<?php
if(defined('mnminclude')){
    include_once('your_module_settings.php');
    $include_in_pages = array('link_summary');
    $do_not_include_in_pages = array();
    if( do_we_load_module() ) {     
        module_add_action('');
        include_once(mnmmodules . 'your_module_name/your_module_main.php');
    }
}
?>

Cheers,

1453939
  • 242
  • 5
  • 14