Initial commit
This commit is contained in:
commit
43ad32700c
7085 changed files with 447606 additions and 0 deletions
44
modules/ajaxpm/ajaxpm.ajax.php
Normal file
44
modules/ajaxpm/ajaxpm.ajax.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
If (!defined("in_astat")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
$session->page_begin("PM Module", FALSE);
|
||||
|
||||
class ajaxpm extends ajax_module{
|
||||
|
||||
function ajax(){
|
||||
global $module,$config,$db,$cache, $session;
|
||||
if($session->userdata['uid']!=0){
|
||||
$this->tpl= new Smarty();
|
||||
$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->assign("path",$config["path"]."/");
|
||||
if(isset($config["theme"]) && is_dir($root . '/modules/ajaxpm/templates/'.$config["theme"])){
|
||||
$this->tpl-> template_dir = $root . '/modules/ajaxpm/templates/'.$config["theme"];
|
||||
}else{
|
||||
$this->tpl-> template_dir = $root . '/modules/ajaxpm/templates/default';
|
||||
}
|
||||
$mybb=$cache->read('mybbconfig');
|
||||
$result = $db->query("SELECT `unreadpms` as `count` FROM `" . $mybb["prefix"] . "users` WHERE `uid`='".$session->userdata['fuid']."'");
|
||||
$row = $db->fetch_array($result, MYSQL_ASSOC);
|
||||
if($row["count"]>1){
|
||||
$pmcount=$row["count"];
|
||||
$s="s";
|
||||
}elseif($row["count"]==1){
|
||||
$pmcount="one";
|
||||
$s="";
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
$this->tpl->assign('pmcount',$pmcount);
|
||||
$this->tpl->assign('s',$s);
|
||||
echo $this->tpl->fetch('ajaxpm.tpl');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue