You are running Tiki6 LTS?
You see some goodies in later versions of Tiki which you would like to benefit from?

Mixing and matching code from various versions is looking for trouble, but sometimes it works. In the case below, the code has changed (ex.: Smarty3) so code needs to be adjusted.


Here is an example with lib/wiki-plugins/wikiplugin_exercise.php

function wikiplugin_exercise($data, $params)
 {
        static $nextId = 1;
-       $smarty = TikiLib::lib('smarty');
+       global $smarty;

-       $smarty->loadPlugin('smarty_modifier_escape');
+       include_once('lib/smarty_tiki/modifier.escape.php');

        $params = new JitFilter($params);
        $answer = $params->answer->text();
@@ -133,14 +135,17 @@
 });
 JS;

-       $headerlib = TikiLib::lib('header');
+       global $headerlib;
        $headerlib->add_js($js);
 }

 function wikiplugin_exercise_finalize()
 {
-       $smarty = TikiLib::lib('smarty');
+       global $smarty;

-       $smarty->loadPlugin('smarty_function_icon');
+       include_once('lib/smarty_tiki/function.icon.php');

        $checkYourScore = smarty_modifier_escape(tr('Check your score'));
        $yourScoreIs = tr('You scored %0 out of %1', '~SCORE~', '~TOTAL~');
@@ -182,7 +187,8 @@
        });
 });;
 JS;
-       $headerlib = TikiLib::lib('header');
+       global $headerlib;
        $headerlib->add_js($js);

        return <<<HTML