Massive upgrade

This commit is contained in:
genuineparts 2025-06-02 22:38:25 +02:00
parent 99a9ed919e
commit c1a3437f9b
396 changed files with 29083 additions and 31939 deletions

View file

@ -2,8 +2,10 @@
If (!defined("in_astat")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
class plugins_mybbnews{
use Smarty\Smarty;
class plugins_mybbnews{
function register_plugins($plugin){
$plugin->use_hook('frontpage_mybbnews',array($this,"newsview"));
$plugin->use_hook('navigation_mainmodule',array($this,"frontpage_nav"));
@ -14,15 +16,17 @@ class plugins_mybbnews{
$this->tpl= new Smarty();
$parser=new textparser(true);
$root = $_SERVER['DOCUMENT_ROOT'] . $config["path"];
$this->tpl->compile_dir = $root . '/core/template/templates_c';
$this->tpl->cache_dir = $root . '/core/template/cache';
$this->tpl->config_dir = $root . '/core/template/config';
$this->tpl->caching = $config["caching"];
$this->tpl->setCompileDir($root . '/core/template/templates_c');
$this->tpl->setCacheDir($root . '/core/template/cache');
$this->tpl->setConfigDir($root . '/core/template/config');
If($config["caching"]==1){
$this->tpl->setCaching(Smarty::CACHING_LIFETIME_SAVED);
}
$this->tpl->assign("path",$config["path"]."/");
if(isset($config["theme"]) && is_dir($root . '/modules/mybbnews/templates/'.$config["theme"])){
$this->tpl-> template_dir = $root . '/modules/mybbnews/templates/'.$config["theme"];
$this->tpl-> setTemplateDir($root . '/modules/mybbnews/templates/'.$config["theme"]);
}else{
$this->tpl-> template_dir = $root . '/modules/mybbnews/templates/default';
$this->tpl-> setTemplateDir($root . '/modules/mybbnews/templates/default');
}
$result=$db->query("SELECT n.*,t.*,( SELECT COUNT(`pid`) FROM `ab_posts` c WHERE c.`replyto`=n.`pid` AND c.`visible`='1') as count FROM `ab_posts` n LEFT JOIN `ab_threads` t ON t.`tid`=n.`tid` WHERE n.`fid`='2' AND n.`replyto`='0' AND n.`visible`='1' ORDER BY n.`dateline` DESC LIMIT 10");
while($row=$db->fetch_array($result)){