Changeset 9


Ignore:
Timestamp:
Apr 1, 2007, 4:59:26 PM (11 years ago)
Author:
julian
Message:
  • PPicsBox.tpl => TopicPicsBox?.tpl
  • Fast Edit is working again
  • Continued refactoring (Posting)
  • Updated databse structure
Location:
trunk
Files:
18 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/core/Functions.class.php

    r8 r9  
    237237    }
    238238
    239     public static function getPPicsBox($CheckedID = 0) {
     239    public static function getTopicPicsBox($CheckedID = 0) {
    240240        $Template = Factory::singleton('Template');
    241241        $Cache = Factory::singleton('Cache');
    242242
    243         $PPicsData = $Cache->getPPicsData();
    244 
    245         $Template->assign('PPicsData',$PPicsData);
    246 
    247         return $Template->fetch('PPicsBox.tpl');
     243        $topicPicsData = $Cache->getTopicPicsData();
     244
     245        $Template->assign('topicPicsData',$topicPicsData);
     246
     247        return $Template->fetch('TopicPicsBox.tpl');
    248248    }
    249249
     
    252252        $Template = Factory::singleton('Template');
    253253
    254         $SmiliesData = array_slice($Cache->getSmiliesData('read'),0,24);
    255 
    256         $Template->assign('SmiliesData',$SmiliesData);
     254        $smiliesData = array_slice($Cache->getSmiliesData('read'),0,24);
     255
     256        $Template->assign('smiliesData',$smiliesData);
    257257
    258258        return $Template->fetch('SmiliesBox.tpl');
  • trunk/docs/dbstructure.sql

    r7 r9  
    2626
    2727CREATE TABLE `tbb2_avatars` (
    28   `avatar_id` smallint(5) unsigned NOT NULL auto_increment,
    29   `avatar_address` varchar(255) NOT NULL default '',
    30   PRIMARY KEY  (`avatar_id`)
     28  `avatarID` smallint(5) unsigned NOT NULL auto_increment,
     29  `avatarAddress` varchar(255) NOT NULL default '',
     30  PRIMARY KEY  (`avatarID`)
    3131) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    3232
     
    131131
    132132CREATE TABLE `tbb2_pms` (
    133   `PMID` mediumint(8) unsigned NOT NULL auto_increment,
    134   `FolderID` smallint(5) unsigned NOT NULL default '0',
    135   `PMFromID` mediumint(8) unsigned NOT NULL default '0',
    136   `PMToID` mediumint(8) unsigned NOT NULL default '0',
    137   `PMIsRead` tinyint(1) unsigned NOT NULL default '0',
    138   `PMType` tinyint(1) unsigned NOT NULL default '0',
    139   `PMSubject` varchar(255) NOT NULL default '',
    140   `PMMessageText` text NOT NULL,
    141   `PMSendTimestamp` int(10) unsigned NOT NULL default '0',
    142   `pm_enable_bbcode` tinyint(1) unsigned NOT NULL default '0',
    143   `pm_enable_smilies` tinyint(1) unsigned NOT NULL default '0',
    144   `pm_enable_htmlcode` tinyint(1) unsigned NOT NULL default '0',
    145   `pm_show_sig` tinyint(1) unsigned NOT NULL default '0',
    146   `PMRequestReadReceipt` tinyint(1) unsigned NOT NULL default '0',
    147   `PMGuestNick` varchar(255) NOT NULL default '',
    148   `PMIsReplied` tinyint(1) unsigned NOT NULL default '0',
    149   PRIMARY KEY  (`PMID`),
    150   KEY `folder_id` (`FolderID`),
    151   KEY `pm_from_id` (`PMFromID`),
    152   KEY `pm_to_id` (`PMToID`)
     133  `pmID` mediumint(8) unsigned NOT NULL auto_increment,
     134  `folderID` smallint(5) unsigned NOT NULL default '0',
     135  `pmFromID` mediumint(8) unsigned NOT NULL default '0',
     136  `pmToID` mediumint(8) unsigned NOT NULL default '0',
     137  `pmIsRead` tinyint(1) unsigned NOT NULL default '0',
     138  `pmType` tinyint(1) unsigned NOT NULL default '0',
     139  `pmSubject` varchar(255) NOT NULL default '',
     140  `pmMessageText` text NOT NULL,
     141  `pmSendTimestamp` int(10) unsigned NOT NULL default '0',
     142  `pmEnableBBCode` tinyint(1) unsigned NOT NULL default '0',
     143  `pmEnableSmilies` tinyint(1) unsigned NOT NULL default '0',
     144  `pmEnableHtmlCode` tinyint(1) unsigned NOT NULL default '0',
     145  `pmShowSignature` tinyint(1) unsigned NOT NULL default '0',
     146  `pmRequestReadReceipt` tinyint(1) unsigned NOT NULL default '0',
     147  `pmGuestNick` varchar(255) NOT NULL default '',
     148  `pmIsReplied` tinyint(1) unsigned NOT NULL default '0',
     149  PRIMARY KEY  (`pmID`),
     150  KEY `folder_id` (`folderID`),
     151  KEY `pm_from_id` (`pmFromID`),
     152  KEY `pm_to_id` (`pmToID`)
    153153) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    154154
     
    158158
    159159CREATE TABLE `tbb2_pms_folders` (
    160   `FolderID` smallint(5) unsigned NOT NULL default '0',
    161   `UserID` mediumint(8) unsigned NOT NULL default '0',
    162   `FolderName` varchar(255) NOT NULL default '',
    163   KEY `folder_id` (`FolderID`),
    164   KEY `user_id` (`UserID`)
     160  `folderID` smallint(5) unsigned NOT NULL default '0',
     161  `userID` mediumint(8) unsigned NOT NULL default '0',
     162  `folderName` varchar(255) NOT NULL default '',
     163  KEY `folder_id` (`folderID`),
     164  KEY `user_id` (`userID`)
    165165) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    166166
     
    227227  `postGuestNick` varchar(15) NOT NULL default '',
    228228  `postEditedCounter` smallint(5) unsigned NOT NULL default '0',
    229   `postLastEditorID` mediumint(8) unsigned NOT NULL default '0',
     229  `postLastEditorNick` varchar(255) NOT NULL default '',
    230230  `postTitle` varchar(255) NOT NULL default '',
    231231  `postText` text NOT NULL,
     
    241241
    242242CREATE TABLE `tbb2_profile_fields` (
    243   `FieldID` smallint(5) unsigned NOT NULL auto_increment,
    244   `FieldName` varchar(255) NOT NULL default '',
    245   `FieldType` tinyint(1) unsigned NOT NULL default '0',
    246   `FieldIsRequired` tinyint(1) unsigned NOT NULL default '0',
    247   `FieldShowRegistration` tinyint(1) unsigned NOT NULL default '0',
    248   `FieldShowMemberlist` tinyint(1) unsigned NOT NULL default '0',
    249   `FieldLink` varchar(255) NOT NULL default '',
    250   `FieldData` text NOT NULL,
    251   `FieldRegexVerification` varchar(255) NOT NULL default '',
    252   PRIMARY KEY  (`FieldID`)
     243  `fieldID` smallint(5) unsigned NOT NULL auto_increment,
     244  `fieldName` varchar(255) NOT NULL default '',
     245  `fieldType` tinyint(1) unsigned NOT NULL default '0',
     246  `fieldIsRequired` tinyint(1) unsigned NOT NULL default '0',
     247  `fieldShowRegistration` tinyint(1) unsigned NOT NULL default '0',
     248  `fieldShowMemberlist` tinyint(1) unsigned NOT NULL default '0',
     249  `fieldLink` varchar(255) NOT NULL default '',
     250  `fieldData` text NOT NULL,
     251  `fieldRegexVerification` varchar(255) NOT NULL default '',
     252  PRIMARY KEY  (`fieldID`)
    253253) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    254254
  • trunk/modules/Ajax.class.php

    r6 r9  
    1818        $error = '';
    1919
    20         switch(@$_GET['Mode']) {
     20        switch(@$_GET['mode']) {
    2121            case 'EditPost':
    22                 $postID = isset($_GET['PostID']) ? intval($_GET['PostID']) : 0;
    23                 $postText = isset($_GET['PostText']) ? $_GET['PostText'] : '';
     22                $postID = isset($_GET['postID']) ? intval($_GET['postID']) : 0;
     23                $postText = isset($_GET['postText']) ? $_GET['postText'] : '';
    2424                $mode = 'EditPost';
    2525
    2626                if($this->modules['Auth']->isLoggedIn() != 1) $error = 'Kann Beitrag nicht laden: Nicht eingeloggt';
    2727                elseif(!$postData = Functions::getPostData($postID)) $error = 'Kann Daten nicht laden: Beitrag';
    28                 elseif(!$forumData = Functions::getForumData($postData['ForumID'])) $error = 'Kann Daten nicht laden: Forum';
     28                elseif(!$forumData = Functions::getForumData($postData['forumID'])) $error = 'Kann Daten nicht laden: Forum';
    2929                else {
    30                     $authData = Functions::getAuthData($forumData,array('AuthIsMod','AuthEditPosts'));
    31                     if($authData['AuthEditPosts'] != 1) $error = 'Kann Beitrag nicht bearbeiten: Kein Zugriff';
     30                    $authData = Functions::getAuthData($forumData,array('authIsMod','authEditPosts'));
     31                    if($authData['authEditPosts'] != 1) $error = 'Kann Beitrag nicht bearbeiten: Kein Zugriff';
    3232                    else {
    3333                        $this->modules['DB']->query("
    34                             UPDATE ".TBLPFX."posts
     34                            UPDATE
     35                                ".TBLPFX."posts
    3536                            SET
    36                                 PostText='$postText',
    37                                 PostEditedCounter=PostEditedCounter+1,
    38                                 PostLastEditorNick='".addslashes($this->modules['Auth']->getValue('UserNick'))."'
     37                                postText='$postText',
     38                                postEditedCounter=postEditedCounter+1,
     39                                postLastEditorNick='".addslashes($this->modules['Auth']->getValue('userNick'))."'
    3940                            WHERE
    40                                 PostID='$postID'
     41                                postID='$postID'
    4142                        ");
    4243
    4344                        $postText = Functions::stripSlashes($postText);
    4445                        $postTextHTMLReady = $postText;
    45                         if($postData['PostEnableHtmlCode'] != 1 || $forumData['ForumEnableHtmlCode'] == FALSE) $postTextHTMLReady = Functions::HTMLSpecialChars($postTextHTMLReady);
    46                         if($postData['PostEnableSmilies'] == 1 && $forumData['ForumEnableSmilies'] == TRUE) $postTextHTMLReady = strtr($postTextHTMLReady,$this->modules['Cache']->getSmiliesData('write'));
     46                        if($postData['postEnableHtmlCode'] != 1 || $forumData['ForumEnableHtmlCode'] != 1) $postTextHTMLReady = Functions::HTMLSpecialChars($postTextHTMLReady);
     47                        if($postData['postEnableSmilies'] == 1 && $forumData['forumEnableSmilies'] == 1) $postTextHTMLReady = strtr($postTextHTMLReady,$this->modules['Cache']->getSmiliesData('write'));
    4748                        $postTextHTMLReady = nl2br($postTextHTMLReady);
    48                         //if($postData['PostEnableBBCode'] == 1 && $forumData['ForumEnableBBCode'] == TRUE) $postTextHTMLReady = Functions::BBCode($postTextHTMLReady);
     49                        //if($postData['postEnableBBCode'] == 1 && $forumData['forumEnableBBCode'] == TRUE) $postTextHTMLReady = Functions::BBCode($postTextHTMLReady);
    4950
    5051                        $values = array(
    51                             array('Name'=>'PostID','Value'=>$postID),
    52                             array('Name'=>'PostTextRaw','Value'=>Functions::XMLEscapeString($postText)),
    53                             array('Name'=>'PostTextHTMLReady','Value'=>Functions::XMLEscapeString($postTextHTMLReady))
     52                            array('name'=>'postID','value'=>$postID),
     53                            array('name'=>'postTextRaw','value'=>Functions::XMLEscapeString($postText)),
     54                            array('name'=>'postTextHTMLReady','value'=>Functions::XMLEscapeString($postTextHTMLReady))
    5455                        );
    5556
     
    6465        }
    6566
    66         $values[] = array('Name'=>'Error','Value'=>$error);
     67        $values[] = array('name'=>'error','value'=>$error);
    6768
    6869        $this->modules['Template']->assign(array(
    69             'Status'=>$status,
    70             'Mode'=>$mode,
    71             'Values'=>$values
     70            'status'=>$status,
     71            'mode'=>$mode,
     72            'values'=>$values
    7273        ));
    7374        $this->modules['Template']->display('AjaxResult.xml');
  • trunk/modules/Cache.class.php

    r8 r9  
    33class Cache extends ModuleTemplate {
    44    protected $requiredModules = array(
    5         'DB'
     5        'DB',
     6        'Constants'
    67    );
    78    protected $isWritable = FALSE;
     
    1314    public function setSmiliesData() {
    1415        $toWrite1 = $toWrite2 = array();
    15         $this->modules['DB']->query("SELECT SmileyID,SmileyType,SmileyFileName,SmileySynonym,SmileyStatus FROM ".TBLPFX."smilies WHERE SmileyType='".SMILEY_TYPE_SMILEY."' OR SmileyType='".SMILEY_TYPE_ADMINSMILEY."'");
     16        $this->modules['DB']->query("SELECT smileyID,smileyType,smileyFileName,smileySynonym,smileyStatus FROM ".TBLPFX."smilies WHERE smileyType='".SMILEY_TYPE_SMILEY."' OR smileyType='".SMILEY_TYPE_ADMINSMILEY."'");
    1617        while($curSmiley = $this->modules['DB']->fetchArray()) {
    17             if($curSmiley['SmileyType'] != SMILEY_TYPE_ADMINSMILEY)
    18                 $toWrite1[] = 'array(\'SmileyID\'=>\''.$curSmiley['SmileyID'].'\',\'SmileyFileName\'=>\''.$curSmiley['SmileyFileName'].'\',\'SmileySynonym\'=>\''.$curSmiley['SmileySynonym'].'\',\'SmileyStatus\'=>\''.$curSmiley['SmileyStatus'].'\')';
    19             $toWrite2[] = '\''.$curSmiley['SmileySynonym'].'\'=>\'<img src="'.$curSmiley['SmileyFileName'].'" border="0" alt="'.$curSmiley['SmileySynonym'].'"/>\'';
     18            if($curSmiley['smileyType'] != SMILEY_TYPE_ADMINSMILEY)
     19                $toWrite1[] = 'array(\'smileyID\'=>\''.$curSmiley['smileyID'].'\',\'smileyFileName\'=>\''.$curSmiley['smileyFileName'].'\',\'smileySynonym\'=>\''.$curSmiley['smileySynonym'].'\',\'smileyStatus\'=>\''.$curSmiley['smileyStatus'].'\')';
     20            $toWrite2[] = '\''.$curSmiley['smileySynonym'].'\'=>\'<img src="'.$curSmiley['smileyFileName'].'" border="0" alt="'.$curSmiley['smileySynonym'].'"/>\'';
    2021        }
    2122
     
    2324        $toWrite2 = '<?php $smiliesDataWrite = array('.implode(',',$toWrite2).'); ?>';
    2425
    25         Functions::FileWrite('cache/cache_smilies_read.php',$toWrite1,'w');
    26         Functions::FileWrite('cache/cache_smilies_write.php',$toWrite2,'w');
     26        Functions::FileWrite('cache/SmiliesRead.cache.php',$toWrite1,'w');
     27        Functions::FileWrite('cache/SmiliesWrite.cache.php',$toWrite2,'w');
    2728    }
    2829
     
    3435                include('cache/SmiliesRead.cache.php');
    3536            else {
    36                 $this->modules['DB']->query("SELECT SmileyID,SmileyFileName,SmileySynonym,SmileyStatus FROM ".TBLPFX."smilies WHERE SmileyType='".SMILEY_TYPE_SMILEY."'");
     37                $this->modules['DB']->query("SELECT smileyID,smileyFileName,smileySynonym,smileyStatus FROM ".TBLPFX."smilies WHERE smileyType='".SMILEY_TYPE_SMILEY."'");
    3738                $smiliesDataRead = $this->modules['DB']->raw2Array();
    3839            }
     
    4647                include('cache/SmiliesWrite.cache.php');
    4748            else {
    48                 $this->modules['DB']->query("SELECT SmileyFileName,SmileySynonym FROM ".TBLPFX."smilies WHERE SmileyType='".SMILEY_TYPE_SMILEY."' OR SmileyType='".SMILEY_TYPE_ADMINSMILEY."'");
     49                $this->modules['DB']->query("SELECT smileyFileName,smileySynonym FROM ".TBLPFX."smilies WHERE smileyType='".SMILEY_TYPE_SMILEY."' OR smileyType='".SMILEY_TYPE_ADMINSMILEY."'");
    4950                while($curSmiley = $this->modules['DB']->fetchArray())
    50                     $smiliesDataWrite[$curSmiley['SmileySynonym']] = '<img src="'.$curSmiley['SmileyFileName'].'" border="0" alt="'.$curSmiley['SmileySynonym'].'"/>';
     51                    $smiliesDataWrite[$curSmiley['smileySynonym']] = '<img src="'.$curSmiley['smileyFileName'].'" border="0" alt="'.$curSmiley['smileySynonym'].'"/>';
    5152            }
    5253
     
    6768        $adminSmiliesData = $toWrite = array();
    6869
    69         $this->modules['DB']->query("SELECT SmileyID,SmileyType,SmileyFileName,SmileySynonym,SmileyStatus FROM ".TBLPFX."smilies WHERE SmileyType='".SMILEY_TYPE_ADMINSMILEY."'");
     70        $this->modules['DB']->query("SELECT smileyID,smileyType,smileyFileName,smileySynonym,smileyStatus FROM ".TBLPFX."smilies WHERE smileyType='".SMILEY_TYPE_ADMINSMILEY."'");
    7071        while($curSmiley = $this->modules['DB']->fetchArray()) {
    7172            $adminSmiliesData[] = array(
    72                 'SmileyID'=>$curSmiley['SmileyID'],
    73                 'SmileyFileName'=>$curSmiley['SmileyFileName'],
    74                 'SmileySynonym'=>$curSmiley['SmileySynonym'],
    75                 'SmileyStatus'=>$curSmiley['SmileyStatus']
     73                'smileyID'=>$curSmiley['smileyID'],
     74                'smileyFileName'=>$curSmiley['smileyFileName'],
     75                'smileySynonym'=>$curSmiley['smileySynonym'],
     76                'smileyStatus'=>$curSmiley['smileyStatus']
    7677            );
    77             $toWrite[] = 'array(\'SmileyID\'=>\''.$curSmiley['SmileyID'].'\',\'SmileyFileName\'=>\''.$curSmiley['SmileyFileName'].'\',\'SmileySynonym\'=>\''.$curSmiley['SmileySynonym'].'\',\'SmileyStatus\'=>\''.$curSmiley['SmileyStatus'].'\')';
     78            $toWrite[] = 'array(\'smileyID\'=>\''.$curSmiley['smileyID'].'\',\'smileyFileName\'=>\''.$curSmiley['smileyFileName'].'\',\'smileySynonym\'=>\''.$curSmiley['smileySynonym'].'\',\'smileyStatus\'=>\''.$curSmiley['smileyStatus'].'\')';
    7879        }
    7980
     
    8384    }
    8485
    85     public function setPPicsData() {
    86         $toWrite = $pPicsData = array();
    87 
    88         $this->modules['DB']->query("SELECT SmileyID,SmileyFileName FROM ".TBLPFX."smilies WHERE SmileyType='1'");
     86    public function setTopicPicsData() {
     87        $toWrite = $topicPicsData = array();
     88
     89        $this->modules['DB']->query("SELECT smileyID,smileyFileName FROM ".TBLPFX."smilies WHERE SmileyType='".SMILEY_TYPE_TPIC."'");
    8990        while($curSmiley = $this->modules['DB']->fetchArray()) {
    90             $toWrite[] = 'array(\'SmileyID\'=>\''.$curSmiley['SmileyID'].'\',\'SmileyFileName\'=>\''.$curSmiley['SmileyFileName'].'\')';
    91             $pPicsData[] = $curSmiley;
    92         }
    93 
    94         $toWrite = '<?php $pPicsData = array('.implode(',',$toWrite).'); ?>';
    95 
    96         Functions::FileWrite('cache/PPics.cache.php',$toWrite,'w');
    97 
    98         return $pPicsData;
    99     }
    100 
    101     public function getPPicsData() {
    102         $pPicsData = array();
    103 
    104         if(file_exists('cache/PPics.cache.php') == TRUE)
    105             include('cache/PPics.cache.php');
    106         else return $this->setPPicsData();
    107 
    108         return $pPicsData;
     91            $toWrite[] = 'array(\'smileyID\'=>\''.$curSmiley['smileyID'].'\',\'smileyFileName\'=>\''.$curSmiley['smileyFileName'].'\')';
     92            $topicPicsData[] = $curSmiley;
     93        }
     94
     95        $toWrite = '<?php $topicPicsData = array('.implode(',',$toWrite).'); ?>';
     96
     97        Functions::FileWrite('cache/TopicPics.cache.php',$toWrite,'w');
     98
     99        return $topicPicsData;
     100    }
     101
     102    public function getTopicPicsData() {
     103        $topicPicsData = array();
     104
     105        if(file_exists('cache/TopicPics.cache.php') == TRUE)
     106            include('cache/TopicPics.cache.php');
     107        else return $this->setTopicPicsData();
     108
     109        return $topicPicsData;
    109110    }
    110111
  • trunk/modules/EditProfile.class.php

    r8 r9  
    129129
    130130                $groupsData = array(
    131                     array('GroupName'=>$this->modules['Language']->getString('Required_information'),'groupType'=>1,'groupFields'=>array()),
    132                     array('GroupName'=>$this->modules['Language']->getString('Other_information'),'groupType'=>0,'groupFields'=>array())
     131                    array('groupName'=>$this->modules['Language']->getString('Required_information'),'groupType'=>1,'groupFields'=>array()),
     132                    array('groupName'=>$this->modules['Language']->getString('Other_information'),'groupType'=>0,'groupFields'=>array())
    133133                );
    134134
     
    181181                    ");
    182182
    183                     // TODO richtige meldung
     183                    // TODO correct message
    184184                    die('geupdatet');
    185185                    exit;
     
    259259            case 'UploadAvatar':
    260260                if($this->modules['Config']->getValue('enable_avatar_upload') != 1) {
    261                     include_once('pop_pheader.php');
    262                     show_message($this->modules['Language']->getString('Avatar_upload_disabled'),$this->modules['Language']->getString('message_avatar_upload_disabled'));
    263                     include_once('pop_ptail.php'); exit;
     261                    // TODO: correct message
     262                    die('Upoad disabled');
     263                    //include_once('pop_pheader.php');
     264                    //show_message($this->modules['Language']->getString('Avatar_upload_disabled'),$this->modules['Language']->getString('message_avatar_upload_disabled'));
     265                    //include_once('pop_ptail.php'); exit;
    264266                }
    265267
     
    267269
    268270                if(isset($_GET['doit'])) {
    269                     if(isset($_FILES['p_avatar_file']) == FALSE || $_FILES['p_avatar_file']['name'] == '') $error = $this->modules['Language']->getString('error_invalid_file');
    270                     elseif($_FILES['p_avatar_file']['size'] > $cONFIG['max_avatar_file_size']*1024) $error = $this->modules['Language']->getString('error_file_too_big');
     271                    if(!isset($_FILES['avatarFile']) || $_FILES['avatarFile']['name'] == '') $error = $this->modules['Language']->getString('error_invalid_file');
     272                    elseif($_FILES['avatarFile']['size'] > $this->modules['Config']->getValue('max_avatar_file_size')*1024) $error = $this->modules['Language']->getString('error_file_too_big');
    271273                    else {
    272                         preg_match("/^(.*)\.([^.]*)/i",strtolower($_FILES['p_avatar_file']['name']),$file_extension);
    273                         $file_extension = $file_extension[2];
    274 
    275                         $good_file_extensions = array(
     274                        preg_match("/^(.*)\.([^.]*)/i",strtolower($_FILES['avatarFile']['name']),$fileExtension);
     275                        $fileExtension = $fileExtension[2];
     276
     277                        $validFileExtensions = array(
    276278                            'jpg',
    277279                            'jpeg',
     
    281283                        );
    282284
    283                         if(in_array($file_extension,$good_file_extensions) != TRUE) $error = $this->modules['Language']->getString('error_invalid_file_extension');
     285                        if(!in_array($fileExtension,$validFileExtensions)) $error = $this->modules['Language']->getString('error_invalid_file_extension');
    284286                        else {
    285 
    286                             //
    287                             // Erst muss ueberprueft werden, ob der User nicht schon ein Avatar hochgeladen hat, und falls ja diesen loeschen
    288                             //
    289                             while(list(,$akt_extension) = each($good_file_extensions)) { // Die Dateiendungen durchgehen
    290                                 if(file_exists('upload/avatars/'.$uSER_ID.'.'.$akt_extension) == TRUE) { // Falls eine Datei mit der aktuellen Dateiendung existiert...
    291                                     unlink('upload/avatars/'.$uSER_ID.'.'.$akt_extension); // ...diese loeschen...
    292                                     break; // ...und die Schleife beenden, da der User maximal ein Avatar haben kann
     287                            /**
     288                             * Check if the user already uploaded an avatar
     289                             */
     290                            foreach($validFileExtensions AS $curExtension) {
     291                                if(file_exists('uploads/avatars/'.USERID.'.'.$curExtension)) {
     292                                    unlink('uploads/avatars/'.USERID.'.'.$curExtension);
     293                                    break;
    293294                                }
    294295                            }
    295296
    296                             $remote_avatar_file_name = 'upload/avatars/'.$uSER_ID.'.'.$file_extension;
    297 
    298 
    299                             //
    300                             // Jetzt kann der Avatar verschoben werden...
    301                             //
    302                             move_uploaded_file($_FILES['p_avatar_file']['tmp_name'],$remote_avatar_file_name); // Datei verschieben
    303                             chmod('upload/avatars/'.$uSER_ID.'.'.$file_extension,0777); // Datei aenderbar/loeschbar machen
    304                             $this->modules['DB']->query("UPDATE ".TBLPFX."users SET user_avatar_address='$remote_avatar_file_name' WHERE user_id='$uSER_ID'"); // Neuen Avatar in der Datenbank aktualisieren
    305 
    306                             $tpl = new Template($tEMPLATE_PATH.'/'.$tCONFIG['templates']['editprofile_avatarresult']);
    307 
    308                             $avatar_address = $remote_avatar_file_name;
     297                            /**
     298                             * Move new avatar to correct dir
     299                             */
     300                            $localAvatarFileName = 'upload/avatars/'.USERID.'.'.$fileExtension;
     301                            move_uploaded_file($_FILES['avatarFile']['tmp_name'],$localAvatarFileName);
     302                            chmod($localAvatarFileName,0777);
     303                            $this->modules['DB']->query("UPDATE ".TBLPFX."users SET userAvatarAddress='$localAvatarFileName' WHERE userID='".USERID."'");
     304
    309305                            $avatar_selected_text = sprintf($this->modules['Language']->getString('avatar_selected_text'),'<img src="'.$remote_avatar_file_name.'" width="'.$cONFIG['avatar_image_width'].'" height="'.$cONFIG['avatar_image_height'].'" border="0" alt="" />');
    310306
    311                             include_once('pop_pheader.php');
    312                             $tpl->parseCode(TRUE);
    313                             include_once('pop_ptail.php'); exit;
     307                            // TODO: Correct message
     308
     309                            //include_once('pop_pheader.php');
     310                            //$tpl->parseCode(TRUE);
     311                            //include_once('pop_ptail.php'); exit;
    314312                        }
    315313                    }
    316314                }
    317315
    318                 //$tpl = new Template($tEMPLATE_PATH.'/'.$tCONFIG['templates']['editprofile_uploadavatar']);
     316                $this->modules['Template']->assign(array(
     317                    'error'=>$error
     318                ));
    319319
    320320                $this->modules['PageParts']->printPopupPage('EditProfileUploadAvatar.tpl');
    321                 break;
    322 
    323             case 'selectavatar':
    324                 $avatar_address = isset($_GET['avatar_address']) ? $_GET['avatar_address'] : '';
    325 
    326                 if(isset($_GET['doit'])) {
    327                     $this->modules['DB']->query("UPDATE ".TBLPFX."users SET user_avatar_address='$avatar_address' WHERE user_id='$uSER_ID'");
    328 
    329                     $tpl = new Template($tEMPLATE_PATH.'/'.$tCONFIG['templates']['editprofile_avatarresult']);
    330 
    331                     $avatar_selected_text = sprintf($this->modules['Language']->getString('avatar_selected_text'),'<img src="'.$avatar_address.'" width="'.$cONFIG['avatar_image_width'].'" height="'.$cONFIG['avatar_image_height'].'" border="0" alt="" />');
    332 
    333                     include_once('pop_pheader.php');
    334                     $tpl->parseCode(TRUE);
    335                     include_once('pop_ptail.php'); exit;
    336                 }
    337 
    338                 $tpl = new Template($tEMPLATE_PATH.'/'.$tCONFIG['templates']['editprofile_selectavatar']);
    339 
    340                 $this->modules['DB']->query("SELECT avatar_address FROM ".TBLPFX."avatars");
    341                 $avatars_data = $this->modules['DB']->raw2array();
    342                 $avatars_counter = count($avatars_data);
    343 
    344                 if($avatars_counter > 0) {
    345                     for($i = 0; $i < $avatars_counter; $i++) {
    346                         $akt_avatar = &$avatars_data[$i];
    347                         $akt_encoded_avatar_address = urlencode($akt_avatar['avatar_address']);
    348 
    349                         $tpl->blocks['avatarrow']->blocks['avatarcol']->parseCode(FALSE,TRUE);
    350 
    351                         if(($i+1) % 5 == 0 && $i != $avatars_counter-1) {
    352                             $tpl->blocks['avatarrow']->parseCode(FALSE,TRUE);
    353                             $tpl->blocks['avatarrow']->blocks['avatarcol']->resetTpl();
    354                         }
    355                     }
    356                     $tpl->blocks['avatarrow']->parseCode(FALSE,TRUE);
    357                 }
    358 
    359 
    360                 include_once('pop_pheader.php');
    361                 $tpl->parseCode(TRUE);
    362                 include_once('pop_ptail.php');
    363321                break;
    364322        }
  • trunk/modules/Posting.class.php

    r6 r9  
    77        'Cache',
    88        'Config',
     9        'Constants',
    910        'Language',
    1011        'Navbar',
     
    1415
    1516    public function executeMe() {
    16         /**
    17         * Diese posting.php vereinigt inzwischen die posttopic.php, postreply.php, den edit-Teil der editpost.php
    18         * Damit wirkt das Ganze auf den ersten Blick
    19         * vielleicht etwas durcheinander, aber im Prinzip ist alles doch ziemlich logisch :-)
    20         */
    21 
    22         // Einen falschen Modus ausschliessen
    23         $mode = isset($_GET['Mode']) ? $_GET['Mode'] : '';
     17        $mode = isset($_GET['mode']) ? $_GET['mode'] : '';
    2418        if(in_array($mode,array('Topic','Reply','Edit')) == FALSE) $mode = 'Topic';
    2519
    2620        // Alle angegebenen IDs bestimmen (normalerweise ist immer nur eine ID wichtig
    27         $forumID = isset($_GET['ForumID']) ? intval($_GET['ForumID']) : 0;
    28         $topicID = isset($_GET['TopicID']) ? intval($_GET['TopicID']) : 0;
    29         $postID = isset($_GET['PostID']) ? intval($_GET['PostID']) : 0;
     21        $forumID = isset($_GET['forumID']) ? intval($_GET['forumID']) : 0;
     22        $topicID = isset($_GET['topicID']) ? intval($_GET['topicID']) : 0;
     23        $postID = isset($_GET['postID']) ? intval($_GET['postID']) : 0;
    3024
    3125        switch($mode) {
    3226            case 'Edit':
    3327                if(!$postData = Functions::getPostData($postID)) die('Kann Daten nicht laden: Beitrag');
    34                 $topicID = &$postData['TopicID'];
     28                $topicID = &$postData['topicID'];
    3529            case 'Reply':
    3630                if(!$topicData = Functions::getTopicData($topicID)) die('Kann Daten nicht laden: Thema');
    37                 $forumID = &$topicData['ForumID'];
     31                $forumID = &$topicData['forumID'];
    3832            case 'Topic':
    3933                if(!$forumData = Functions::getForumData($forumID)) die('Kann Daten nicht laden: Forum');
     
    5246        $p = array();
    5347
    54         $p['MessageText'] = isset($_POST['p']['MessageText']) ? $_POST['p']['MessageText'] : (($mode == 'Edit') ? addslashes($postData['PostText']) : '');
    55         $p['MessageTitle'] = isset($_POST['p']['MessageTitle']) ? $_POST['p']['MessageTitle'] : (($mode == 'Edit') ? addslashes($postData['PostTitle']) : (($mode == 'Reply') ? 'Re: '.addslashes($topicData['TopicTitle']) : ''));
    56         $p['GuestNick'] = isset($_POST['p']['GuestNick']) ? $_POST['p']['GuestNick'] : '';
    57         $p['SmileyID'] = isset($_POST['p']['SmileyID']) ? intval($_POST['p']['SmileyID']) : 0;
    58         $p['PollTitle'] = isset($_POST['p']['PollTitle']) ? $_POST['p']['PollTitle'] : '';
    59         $p['PollOptions'] = (isset($_POST['p']['PollOptions']) == TRUE && is_array($_POST['p']['PollOptions']) == TRUE) ? $_POST['p']['PollOptions'] : array();
     48        $p['messageText'] = isset($_POST['p']['messageText']) ? $_POST['p']['messageText'] : (($mode == 'Edit') ? addslashes($postData['postText']) : '');
     49        $p['messageTitle'] = isset($_POST['p']['messageTitle']) ? $_POST['p']['messageTitle'] : (($mode == 'Edit') ? addslashes($postData['postTitle']) : (($mode == 'Reply') ? 'Re: '.addslashes($topicData['topicTitle']) : ''));
     50        $p['guestNick'] = isset($_POST['p']['guestNick']) ? $_POST['p']['guestNick'] : '';
     51        $p['smileyID'] = isset($_POST['p']['smileyID']) ? intval($_POST['p']['smileyID']) : 0;
     52        $p['pollTitle'] = isset($_POST['p']['pollTitle']) ? $_POST['p']['pollTitle'] : '';
     53        $p['pollOptions'] = (isset($_POST['p']['pollOptions']) == TRUE && is_array($_POST['p']['pollOptions']) == TRUE) ? $_POST['p']['pollOptions'] : array();
    6054
    6155        $subscriptionStatus = ($mode == 'Reply' && Functions::getSubscriptionStatus(SUBSCRIPTION_TYPE_TOPIC,USERID,$topicID) == TRUE) ? 1 : 0;
    6256
    63         $c['ShowEditings'] = ($mode == 'Edit') ? $postData['PostShowEditings'] : 1;
    64         $c['EnableURITransformation'] = ($mode == 'Edit') ? $postData['PostEnableURITransformation'] : 1;
    65         $c['EnableSmilies'] = ($mode == 'Edit') ? $postData['PostEnableSmilies'] : 1;
    66         $c['ShowSignature'] = ($mode == 'Edit') ? $postData['PostShowSignature'] : 1;
    67         $c['EnableBBCode'] = ($mode == 'Edit') ? $postData['PostEnableBBCode'] : 1;
    68         $c['EnableHtmlCode'] = ($mode == 'Edit') ? $postData['PostEnableHtmlCode'] : 0;
    69 
    70         $c['PinTopic'] = ($mode == 'Reply') ? $topicData['TopicIsPinned'] : 0;
    71         $c['CloseTopic'] = ($mode == 'Reply') ? $topicData['TopicStatus'] : 0;
    72         $c['SubscribeTopic'] = $subscriptionStatus;
    73 
    74         if(isset($_GET['Doit'])) {
    75             $c['EnableBBCode'] = (isset($_POST['c']['EnableBBCode']) && $forumData['ForumEnableBBCode'] == 1) ? 1 : 0;
    76             $c['EnableSmilies'] = (isset($_POST['c']['EnableSmilies']) && $forumData['ForumEnableSmilies'] == 1) ? 1 : 0;
    77             $c['EnableHtmlCode'] = (isset($_POST['c']['EnableHtmlCode']) && $forumData['ForumEnableHtmlCode'] == 1) ? 1 : 0;
    78             $c['ShowSignature'] = (isset($_POST['c']['ShowSignature']) && $this->modules['Config']->getValue('enable_sig') == 1 && $this->modules['Auth']->isLoggedIn() == 1) ? 1 : 0;
    79             $c['SubscribeTopic'] = isset($_POST['c']['SubscribeTopic']) ? 1 : 0;
    80             $c['EnableURITransformation'] = (isset($_POST['c']['EnableURITransformation']) && $forumData['ForumEnableURITransformation'] == 1) ? 1 : 0;
    81 
    82             if($this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('UserIsAdmin') == 1 || $this->modules['Auth']->getValue('UserIsSupermod') == 1 || $authData['AuthIsMod'] == 1)) {
    83                 $c['ShowEditings'] = isset($_POST['c']['ShowEditings']) ? 1 : 0;
    84                 $c['PinTopic'] = isset($_POST['c']['PinTopic']) ? 1 : 0;
    85                 $c['CloseTopic'] = isset($_POST['c']['CloseTopic']) ? 1 : 0;
     57        $c['showEditings'] = ($mode == 'Edit') ? $postData['postShowEditings'] : 1;
     58        $c['enableURITransformation'] = ($mode == 'Edit') ? $postData['postEnableURITransformation'] : 1;
     59        $c['enableSmilies'] = ($mode == 'Edit') ? $postData['postEnableSmilies'] : 1;
     60        $c['showSignature'] = ($mode == 'Edit') ? $postData['postShowSignature'] : 1;
     61        $c['enableBBCode'] = ($mode == 'Edit') ? $postData['postEnableBBCode'] : 1;
     62        $c['enableHtmlCode'] = ($mode == 'Edit') ? $postData['postEnableHtmlCode'] : 0;
     63
     64        $c['pinTopic'] = ($mode == 'Reply') ? $topicData['topicIsPinned'] : 0;
     65        $c['closeTopic'] = ($mode == 'Reply') ? $topicData['topicStatus'] : 0;
     66        $c['subscribeTopic'] = $subscriptionStatus;
     67
     68        if(isset($_GET['doit'])) {
     69            $c['enableBBCode'] = (isset($_POST['c']['enableBBCode']) && $forumData['forumEnableBBCode'] == 1) ? 1 : 0;
     70            $c['enableSmilies'] = (isset($_POST['c']['enableSmilies']) && $forumData['forumEnableSmilies'] == 1) ? 1 : 0;
     71            $c['enableHtmlCode'] = (isset($_POST['c']['enableHtmlCode']) && $forumData['forumEnableHtmlCode'] == 1) ? 1 : 0;
     72            $c['showSignature'] = (isset($_POST['c']['showSignature']) && $this->modules['Config']->getValue('enable_sig') == 1 && $this->modules['Auth']->isLoggedIn() == 1) ? 1 : 0;
     73            $c['subscribeTopic'] = isset($_POST['c']['subscribeTopic']) ? 1 : 0;
     74            $c['enableURITransformation'] = (isset($_POST['c']['enableURITransformation']) && $forumData['forumEnableURITransformation'] == 1) ? 1 : 0;
     75
     76            if($this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('userIsAdmin') == 1 || $this->modules['Auth']->getValue('userIsSupermod') == 1 || $authData['authIsMod'] == 1)) {
     77                $c['showEditings'] = isset($_POST['c']['showEditings']) ? 1 : 0;
     78                $c['pinTopic'] = isset($_POST['c']['pinTopic']) ? 1 : 0;
     79                $c['closeTopic'] = isset($_POST['c']['closeTopic']) ? 1 : 0;
    8680            }
    8781
    88             if(!isset($_POST['ShowPreview'])) {
    89                 if(trim($p['MessageTitle']) == '') $error = $this->modules['Language']->getString('error_no_title');
    90                 elseif(strlen($p['MessageTitle']) > 100) $error = $this->modules['Language']->getString('error_title_too_long');
    91                 elseif(trim($p['MessageText']) == '') $error = $this->modules['Language']->getString('error_no_post');
    92                 elseif($mode != 'Edit' && $this->modules['Auth']->isLoggedIn() != 1 && Functions::verifyEmail($p['GuestNick']) == FALSE) $error = $this->modules['Language']->getString('error_invalid_name');
    93                 elseif($mode != 'Edit' && $this->modules['Auth']->isLoggedIn() != 1 && Functions::unifyNick($p['GuestNick']) == FALSE) $error = $this->modules['Language']->getString('error_existing_user_name');
     82            if(!isset($_POST['showPreview'])) {
     83                if(trim($p['messageTitle']) == '') $error = $this->modules['Language']->getString('error_no_title');
     84                elseif(strlen($p['messageTitle']) > 255) $error = $this->modules['Language']->getString('error_title_too_long');
     85                elseif(trim($p['messageText']) == '') $error = $this->modules['Language']->getString('error_no_post');
     86                elseif($mode != 'Edit' && $this->modules['Auth']->isLoggedIn() != 1 && Functions::verifyEmail($p['guestNick']) == FALSE) $error = $this->modules['Language']->getString('error_invalid_name');
     87                elseif($mode != 'Edit' && $this->modules['Auth']->isLoggedIn() != 1 && Functions::unifyNick($p['guestNick']) == FALSE) $error = $this->modules['Language']->getString('error_existing_user_name');
    9488                elseif($mode == 'Edit') {
    9589                    $this->modules['DB']->query("
     
    9791                            ".TBLPFX."posts
    9892                        SET
    99                             SmileyID='".$p['SmileyID']."',
    100                             PostEnableBBCode='".$c['EnableBBCode']."',
    101                             PostEnableSmilies='".$c['EnableSmilies']."',
    102                             PostEnableHtmlCode='".$c['EnableHtmlCode']."',
    103                             PostShowSignature='".$c['ShowSignature']."',
    104                             PostEnableURITransformation='".$c['EnableURITransformation']."',
    105                             PostShowEditings='".$c['ShowEditings']."',
    106                             PostEditedCounter=PostEditedCounter+1,
    107                             PostLastEditorNick='".$this->modules['Auth']->getValue('UserNick')."',
    108                             PostTitle='".$p['MessageTitle']."',
    109                             PostText='".$p['MessageText']."'
     93                            smileyID='".$p['smileyID']."',
     94                            postEnableBBCode='".$c['enableBBCode']."',
     95                            postEnableSmilies='".$c['enableSmilies']."',
     96                            postEnableHtmlCode='".$c['enableHtmlCode']."',
     97                            postShowSignature='".$c['showSignature']."',
     98                            postEnableURITransformation='".$c['enableURITransformation']."',
     99                            postShowEditings='".$c['showEditings']."',
     100                            postEditedCounter=postEditedCounter+1,
     101                            postLastEditorNick='".$this->modules['Auth']->getValue('userNick')."',
     102                            postTitle='".$p['messageTitle']."',
     103                            postText='".$p['messageText']."'
    110104                        WHERE
    111                             PostID='$postID'
     105                            postID='$postID'
    112106                    ");
    113                     //Functions::myHeader("index.php?p=$postID&".MYSID."#post$postID"); exit;
    114107                    Functions::myHeader(INDEXFILE."?Action=ViewTopic&PostID=$postID&".MYSID."#Post$postID"); exit;
    115108                }
    116109                else {
    117110                    if(USERID != 0)
    118                         $p['GuestNick'] = '';
     111                        $p['guestNick'] = '';
    119112
    120113                    if($mode == 'Topic') {
    121                         // Das Thema in die Datenbank eintragen
    122114                        $this->modules['DB']->query("
    123115                            INSERT INTO
    124116                                ".TBLPFX."topics
    125117                            SET
    126                                 TopicTitle='".$p['MessageTitle']."',
    127                                 ForumID='$forumID',
    128                                 TopicStatus='".$c['CloseTopic']."',
    129                                 TopicIsPinned='".$c['PinTopic']."',
    130                                 PosterID='".USERID."',
    131                                 SmileyID='$smileyID',
    132                                 TopicTimestamp='".time()."',
    133                                 TopicGuestNick='".$p['GuestNick']."'
     118                                topicTitle='".$p['messageTitle']."',
     119                                forumID='$forumID',
     120                                topicStatus='".$c['closeTopic']."',
     121                                topicIsPinned='".$c['pinTopic']."',
     122                                posterID='".USERID."',
     123                                smileyID='$smileyID',
     124                                topicTimestamp='".time()."',
     125                                topicGuestNick='".$p['guestNick']."'
    134126                        ");
    135127                        $topicID = $this->modules['DB']->getInsertID();
    136128
    137129                        // Eventuell die Umfrage zum Thema hinzufuegen
    138                         if(($this->modules['Auth']->getValue('UserIsAdmin') == 1 || $this->modules['Auth']->getValue('UserIsSupermod') == 1 || $authData['AuthIsMod'] == 1 || $authData['AuthPostPoll'] == 1) && trim($p['PollTitle']) != '') {
    139                             while(list($curKey) = each($p['PollOptions'])) {
    140                                 if(trim($p['PollOptions'][$curKey]) == '')
    141                                     unset($p['PollOptions'][$curKey]);
     130                        if(($this->modules['Auth']->getValue('userIsAdmin') == 1 || $this->modules['Auth']->getValue('userIsSupermod') == 1 || $authData['authIsMod'] == 1 || $authData['authPostPoll'] == 1) && trim($p['pollTitle']) != '') {
     131                            while(list($curKey) = each($p['pollOptions'])) {
     132                                if(trim($p['pollOptions'][$curKey]) == '')
     133                                    unset($p['pollOptions'][$curKey]);
    142134                            }
    143                             reset($p['PollOptions']);
    144 
    145                             if(count($p['PollOptions']) > 1) {
     135                            reset($p['pollOptions']);
     136
     137                            if(count($p['pollOptions']) > 1) {
    146138                                $this->modules['DB']->query("
    147139                                    INSERT INTO
    148140                                        ".TBLPFX."polls
    149141                                    SET
    150                                         TopicID='$topicID',
    151                                         PosterID='".USERID.",
    152                                         PollTitle='".$p['PollTitle']."',
    153                                         PollGuestNick='".$p['GuestNick']."'
     142                                        topicID='$topicID',
     143                                        posterID='".USERID.",
     144                                        pollTitle='".$p['pollTitle']."',
     145                                        pollGuestNick='".$p['guestNick']."'
    154146                                ");
    155147
    156148                                $i = 1;
    157                                 foreach($p['PollOptions'] AS $curOption) {
     149                                foreach($p['pollOptions'] AS $curOption) {
    158150                                    $this->modules['DB']->query("
    159151                                        INSERT INTO
    160152                                            ".TBLPFX."polls_options
    161153                                        SET
    162                                             TopicID='$topicID',
    163                                             OptionID='$i',
    164                                             OptionTitle='$curOption'
     154                                            topicID='$topicID',
     155                                            optionID='$i',
     156                                            optionTitle='$curOption'
    165157                                    ");
    166158                                    $i++;
    167159                                }
    168160
    169                                 $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET TopicHasPoll='1' WHERE TopicID='$topicID'");
     161                                $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET topicHasPoll='1' WHERE topicID='$topicID'");
    170162                            }
    171163                        }
     
    177169                            ".TBLPFX."posts
    178170                        SET
    179                             TopicID='$topicID',
    180                             ForumID='$forumID',
    181                             PosterID='".USERID."',
    182                             SmileyID='".$p['SmileyID']."',
    183                             PostIP='".$_SERVER['REMOTE_ADDR']."',
    184                             PostEnableBBCode='".$c['EnableBBCode']."',
    185                             PostEnableSmilies='".$c['EnableSmilies']."',
    186                             PostEnableHtmlCode='".$c['EnableHtmlCode']."',
    187                             PostShowSignature='".$c['ShowSignature']."',
    188                             PostEnableURITransformation='".$c['EnableURITransformation']."',
    189                             PostShowEditings='".$c['ShowEditings']."',
    190                             PostTimestamp='".time()."',
    191                             PostTitle='".$p['MessageTitle']."',
    192                             PostText='".$p['MessageText']."',
    193                             PostGuestNick='".$p['GuestNick']."'
     171                            topicID='$topicID',
     172                            forumID='$forumID',
     173                            posterID='".USERID."',
     174                            smileyID='".$p['smileyID']."',
     175                            postIP='".$_SERVER['REMOTE_ADDR']."',
     176                            postEnableBBCode='".$c['enableBBCode']."',
     177                            postEnableSmilies='".$c['enableSmilies']."',
     178                            postEnableHtmlCode='".$c['enableHtmlCode']."',
     179                            postShowSignature='".$c['showSignature']."',
     180                            postEnableURITransformation='".$c['enableURITransformation']."',
     181                            postShowEditings='".$c['showEditings']."',
     182                            postTimestamp='".time()."',
     183                            postTitle='".$p['messageTitle']."',
     184                            postText='".$p['messageText']."',
     185                            postGuestNick='".$p['guestNick']."'
    194186                    ");
    195187                    $postID = $this->modules['DB']->getInsertID();
    196188
    197189                    // Verschiedene Dinge updaten (Beitragszahl, erster/letzter Beitrag usw.)
    198                     if($mode == 'Topic') $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET TopicFirstPostID='$postID', TopicLastPostID='$postID' WHERE TopicID='$topicID'");
    199                     else $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET TopicLastPostID='$postID', TopicRepliesCounter=TopicRepliesCounter+1, TopicStatus='".$c['CloseTopic']."', TopicIsPinned='".$c['PinTopic']."' WHERE TopicID='$topicID'");
    200 
    201                     $this->modules['DB']->query("UPDATE ".TBLPFX."forums SET ForumLastPostID='$postID', ForumPostsCounter=ForumPostsCounter+1, ForumTopicsCounter=ForumTopicsCounter+1 WHERE ForumID='$forumID'");
    202                     $this->modules['DB']->query("UPDATE ".TBLPFX."users SET UserPostsCounter=UserPostsCounter+1 WHERE UserID='".USERID."'");
     190                    if($mode == 'Topic') $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET topicFirstPostID='$postID', topicLastPostID='$postID' WHERE topicID='$topicID'");
     191                    else $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET topicLastPostID='$postID', topicRepliesCounter=topicRepliesCounter+1, topicStatus='".$c['closeTopic']."', topicIsPinned='".$c['pinTopic']."' WHERE topicID='$topicID'");
     192
     193                    $this->modules['DB']->query("UPDATE ".TBLPFX."forums SET forumLastPostID='$postID', forumPostsCounter=forumPostsCounter+1, forumTopicsCounter=forumTopicsCounter+1 WHERE forumID='$forumID'");
     194                    $this->modules['DB']->query("UPDATE ".TBLPFX."users SET userPostsCounter=userPostsCounter+1 WHERE userID='".USERID."'");
    203195
    204196                    // Eventuell Themenabo entfernen oder hinzufuegen
    205                     if($mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && $this->modules['Config']->getValue('enable_email_functions') == 1 && $this->modules['Config']->getValue('enable_topic_subscription') == 1 && $c['SubscribeTopic'] != $subscriptionStatus) {
    206                         if($c['SubscribeTopic'] == 0) $this->modules['DB']->query("DELETE FROM ".TBLPFX."topics_subscriptions WHERE TopicID='$topicID' AND UserID='$uSER_ID'");
    207                         else $this->modules['DB']->query("INSERT INTO ".TBLPFX."topics_subscriptions SET TopicID='$topicID', UserID='".USERID."'");
     197                    if($mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && $this->modules['Config']->getValue('enable_email_functions') == 1 && $this->modules['Config']->getValue('enable_topic_subscription') == 1 && $c['subscribeTopic'] != $subscriptionStatus) {
     198                        if($c['subscribeTopic'] == 0) $this->modules['DB']->query("DELETE FROM ".TBLPFX."topics_subscriptions WHERE topicID='$topicID' AND userID='".USERID."'");
     199                        else $this->modules['DB']->query("INSERT INTO ".TBLPFX."topics_subscriptions SET topicID='$topicID', UserID='".USERID."'");
    208200                    }
    209201                    //Functions::myHeader("index.php?t=$topicID&".MYSID); exit;
     
    215207        $show = array();
    216208
    217         $show['EnableSmilies'] = $forumData['ForumEnableSmilies'] == 1;
    218         $show['ShowSignature'] = $this->modules['Config']->getValue('enable_sig') == 1 && $this->modules['Auth']->isLoggedIn() == 1;
    219         $show['EnableBBCode'] = $forumData['ForumEnableBBCode'] == 1;
    220         $show['EnableURITransformation'] = $forumData['ForumEnableURITransformation'];
    221         $show['EnableHtmlCode'] = $forumData['ForumEnableHtmlCode'] == 1;
    222         $show['SubscribeTopic'] = $mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && $this->modules['Config']->getValue('enable_email_functions') == 1 && $this->modules['Config']->getValue('enable_topic_subscription') == 1;
    223         $show['CloseTopic'] = $mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('UserIsAdmin') == 1 || $this->modules['Auth']->getValue('UserIsSupermod') == 1 || $authData['AuthIsMod'] == 1);
    224         $show['PinTopic'] = $mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('UserIsAdmin') == 1 || $this->modules['Auth']->getValue('UserIsSupermod') == 1 || $authData['AuthIsMod'] == 1);
    225         $show['ShowEditings'] = $this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('UserIsAdmin') == 1 || $this->modules['Auth']->getValue('UserIsSupermod') == 1 || $authData['auth_is_mod'] == 1);
    226         $show['PollBox'] = $mode == 'Topic' && ($this->modules['Auth']->getValue('UserIsAdmin') == 1 || $this->modules['Auth']->getValue('UserIsSupermod') == 1 || $authData['AuthIsMod'] == 1 || $authData['AuthPostPoll'] == 1);
    227         $show['PreviewBox'] = isset($_POST['ShowPreview']);
     209        $show['enableSmilies'] = $forumData['forumEnableSmilies'] == 1;
     210        $show['showSignature'] = $this->modules['Config']->getValue('enable_sig') == 1 && $this->modules['Auth']->isLoggedIn() == 1;
     211        $show['enableBBCode'] = $forumData['forumEnableBBCode'] == 1;
     212        $show['enableURITransformation'] = $forumData['forumEnableURITransformation'];
     213        $show['enableHtmlCode'] = $forumData['forumEnableHtmlCode'] == 1;
     214        $show['subscribeTopic'] = $mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && $this->modules['Config']->getValue('enable_email_functions') == 1 && $this->modules['Config']->getValue('enable_topic_subscription') == 1;
     215        $show['closeTopic'] = $mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('userIsAdmin') == 1 || $this->modules['Auth']->getValue('userIsSupermod') == 1 || $authData['authIsMod'] == 1);
     216        $show['pinTopic'] = $mode != 'Edit' && $this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('userIsAdmin') == 1 || $this->modules['Auth']->getValue('userIsSupermod') == 1 || $authData['authIsMod'] == 1);
     217        $show['showEditings'] = $this->modules['Auth']->isLoggedIn() == 1 && ($this->modules['Auth']->getValue('userIsAdmin') == 1 || $this->modules['Auth']->getValue('userIsSupermod') == 1 || $authData['authIsMod'] == 1);
     218        $show['pollBox'] = $mode == 'Topic' && ($this->modules['Auth']->getValue('userIsAdmin') == 1 || $this->modules['Auth']->getValue('userIsSupermod') == 1 || $authData['authIsMod'] == 1 || $authData['authPostPoll'] == 1);
     219        $show['previewBox'] = isset($_POST['showPreview']);
    228220
    229221        // Smilies und Beitragsbilder laden
    230222        $smilies = array(); $smiliesBox = '';
    231         if($show['EnableSmilies'] == TRUE) {
     223        if($show['enableSmilies'] == TRUE) {
    232224            $smilies = $this->modules['Cache']->getSmiliesData('write');
    233225            $smiliesBox = Functions::getSmiliesBox();
    234226        }
    235         $pPicsBox = Functions::getPPicsBox($p['SmileyID']);
     227        $topicPicsBox = Functions::getTopicPicsBox($p['smileyID']);
    236228
    237229        // Die Vorschau
    238230        $previewData = array();
    239         if($show['PreviewBox'] == TRUE) {
    240             if($c['EnableHtmlCode'] != 1 || $show['EnableHtmlCode'] == FALSE) $previewData['MessageText'] = Functions::HTMLSpecialChars($p['MessageText']);
    241             if($c['EnableSmilies'] == 1 && $show['EnableSmilies'] == TRUE) $previewData['MessageText'] = strtr($previewData['MessageText'],$smilies);
    242             $previewData['MessageText'] = nl2br($previewData['MessageText']);
    243             if($c['EnableBBCode'] == 1 && $show['EnableBBCode'] == TRUE) $previewData['MessageText'] = Functions::BBCode($previewData['MessageText']);
    244             $previewData['MessageTitle'] = Functions::HTMLSpecialChars($p['MessageTitle']);
     231        if($show['previewBox'] == TRUE) {
     232            if($c['enableHtmlCode'] != 1 || $show['enableHtmlCode'] == FALSE) $previewData['messageText'] = Functions::HTMLSpecialChars($p['messageText']);
     233            if($c['enableSmilies'] == 1 && $show['enableSmilies'] == TRUE) $previewData['messageText'] = strtr($previewData['messageText'],$smilies);
     234            $previewData['messageText'] = nl2br($previewData['messageText']);
     235            if($c['enableBBCode'] == 1 && $show['enableBBCode'] == TRUE) $previewData['messageText'] = Functions::BBCode($previewData['messageText']);
     236            $previewData['messageTitle'] = Functions::HTMLSpecialChars($p['messageTitle']);
    245237        }
    246238
    247239        // Fuer die richtige Anzeige des Navileiste usw.
    248         $this->modules['Navbar']->addCategories($forumData['CatID']);
    249         $this->modules['Navbar']->addElement(Functions::HTMLSpecialChars($forumData['ForumName']),INDEXFILE.'?Action=ViewForum&amp;ForumID='.$forumID.'&amp;'.MYSID);
     240        $this->modules['Navbar']->addCategories($forumData['catID']);
     241        $this->modules['Navbar']->addElement(Functions::HTMLSpecialChars($forumData['forumName']),INDEXFILE.'?action=ViewForum&amp;forumID='.$forumID.'&amp;'.MYSID);
    250242
    251243        if($mode == 'Topic') {
    252244            $actionText = $this->modules['Language']->getString('Post_topic');
    253             $this->modules['Navbar']->addElement($this->modules['Language']->getString('Post_topic'),INDEXFILE.'?Action=Posting&amp;Mode=Topic&amp;ForumID='.$forumID.'&amp;'.MYSID);
     245            $this->modules['Navbar']->addElement($this->modules['Language']->getString('Post_topic'),INDEXFILE.'?action=Posting&amp;mode=Topic&amp;forumID='.$forumID.'&amp;'.MYSID);
    254246        }
    255247        elseif($mode == 'Reply') {
    256248            $actionText = $this->modules['Language']->getString('Post_reply');
    257249            $this->modules['Navbar']->addElements(
    258                 array(Functions::HTMLSpecialChars($topicData['TopicTitle']),INDEXFILE.'?Action=ViewTopic&amp;TopicID='.$topicID.'&amp;'.MYSID),
    259                 array($this->modules['Language']->getString('Post_reply'),INDEXFILE.'?Action=Posting&amp;Mode=Reply&amp;TopicID='.$topicID.'&amp;'.MYSID)
     250                array(Functions::HTMLSpecialChars($topicData['topicTitle']),INDEXFILE.'?action=ViewTopic&amp;topicID='.$topicID.'&amp;'.MYSID),
     251                array($this->modules['Language']->getString('Post_reply'),INDEXFILE.'?action=Posting&amp;mode=Reply&amp;topicID='.$topicID.'&amp;'.MYSID)
    260252            );
    261253        }
     
    263255            $actionText = $this->modules['Language']->getString('Edit_post');
    264256            $this->modules['Navbar']->addElements(
    265                 array(Functions::HTMLSpecialChars($topicData['TopicTitle']),INDEXFILE.'?Action=ViewTopic&amp;TopicID='.$topicID.'&amp;'.MYSID),
    266                 array($this->modules['Language']->getString('Edit_post'),INDEXFILE.'?Action=Posting&amp;Mode=Edit&amp;PostID='.$postID.'&amp;'.MYSID)
     257                array(Functions::HTMLSpecialChars($topicData['topicTitle']),INDEXFILE.'?action=ViewTopic&amp;topicID='.$topicID.'&amp;'.MYSID),
     258                array($this->modules['Language']->getString('Edit_post'),INDEXFILE.'?action=Posting&amp;mode=Edit&amp;PostID='.$postID.'&amp;'.MYSID)
    267259            );
    268260        }
    269261
    270 
    271262        //
    272263        // Der Rest...
    273264        //
    274265        $title_max_chars = sprintf($this->modules['Language']->getString('Maximum_x_chars'),100);
    275 
    276         $this->modules['PageParts']->printStdHeader();
    277266
    278267        $this->modules['Template']->assign(array(
    279268            'p'=>Functions::HTMLSpecialChars(Functions::StripSlashes($p)),
    280269            'c'=>$c,
    281             'ActionText'=>$actionText,
    282             'Show'=>$show,
    283             'PollOptionsCounter'=>count($p['PollOptions']),
    284             'ForumID'=>$forumID,
    285             'TopicID'=>$topicID,
    286             'PostID'=>$postID,
    287             'Mode'=>$mode,
    288             'Error'=>$error,
    289             'PPicsBox'=>$pPicsBox,
    290             'SmiliesBox'=>$smiliesBox
     270            'actionText'=>$actionText,
     271            'show'=>$show,
     272            'pollOptionsCounter'=>count($p['pollOptions']),
     273            'forumID'=>$forumID,
     274            'topicID'=>$topicID,
     275            'postID'=>$postID,
     276            'mode'=>$mode,
     277            'error'=>$error,
     278            'topicPicsBox'=>$topicPicsBox,
     279            'smiliesBox'=>$smiliesBox
    291280        ));
    292         $this->modules['Template']->display('Posting.tpl');
    293 
    294         $this->modules['PageParts']->printStdTail();
     281        $this->modules['PageParts']->printPage('Posting.tpl');
    295282    }
    296283
    297284    protected function _authenticateUser(&$mode,&$forumData) {
    298         $authData = Functions::getAuthData($forumData,array('AuthPostTopic','AuthPostReply','AuthPostPoll','AuthEditPosts','AuthIsMod'));
    299         if($mode == 'Reply' && $authData['AuthPostReply'] == 0 || $mode == 'Edit' && $authData['AuthEditPosts'] == 0 || $mode == 'Topic' && $authData['AuthPostTopic'] == 0) {
     285        $authData = Functions::getAuthData($forumData,array('authPostTopic','authPostReply','authPostPoll','authEditPosts','authIsMod'));
     286        if($mode == 'Reply' && $authData['authPostReply'] == 0 || $mode == 'Edit' && $authData['authEditPosts'] == 0 || $mode == 'Topic' && $authData['authPostTopic'] == 0) {
    300287            // TODO
    301288            die('Leider kein Zugriff');
  • trunk/modules/Template.class.php

    r8 r9  
    4242
    4343    public function fetch($value) {
    44         $this->smarty->fetch($value);
     44        return $this->smarty->fetch($value);
    4545    }
    4646}
  • trunk/modules/ViewForum.class.php

    r6 r9  
    4343         */
    4444        $topicsCounter = Functions::getTopicsCounter($forumID);
    45         $pageListing = Functions::createPageListing($topicsCounter,$this->modules['Config']->getValue('topics_per_page'),$page,"<a href=\"".INDEXFILE."?action=ViewForum&amp;ForumID=$forumID&amp;Page=%1\$s&amp;".MYSID."\">%2\$s</a>");
     45        $pageListing = Functions::createPageListing($topicsCounter,$this->modules['Config']->getValue('topics_per_page'),$page,"<a href=\"".INDEXFILE."?action=ViewForum&amp;forumID=$forumID&amp;Page=%1\$s&amp;".MYSID."\">%2\$s</a>");
    4646        $start = $page*$this->modules['Config']->getValue('topics_per_page')-$this->modules['Config']->getValue('topics_per_page');
    4747
     
    143143        $this->modules['Navbar']->addCategories($forumData['catID']);
    144144        $this->modules['Navbar']->addElement(Functions::HTMLSpecialChars($forumData['forumName']),INDEXFILE.'?action=ViewForum&amp;forumID='.$forumID.'&amp;'.MYSID);
    145         $this->modules['Navbar']->setRightArea('<a href="'.INDEXFILE.'?action=ViewForum&amp;ForumID='.$forumID.'&amp;markAll=1&amp;'.MYSID.'">'.$this->modules['Language']->getString('Mark_topics_read').'</a>');
     145        $this->modules['Navbar']->setRightArea('<a href="'.INDEXFILE.'?action=ViewForum&amp;forumID='.$forumID.'&amp;markAll=1&amp;'.MYSID.'">'.$this->modules['Language']->getString('Mark_topics_read').'</a>');
    146146
    147147        $this->modules['Template']->assign(array(
  • trunk/modules/ViewTopic.class.php

    r8 r9  
    6060
    6161        if(!isset($_SESSION['topicViews'][$topicID])) { // Falls dieses Thema in dieser Session noch nicht besucht wurde...
    62             $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET TopicViewsCounter=TopicViewsCounter+1 WHERE TopicID='$topicID'"); // ...Anzahl der Views um 1 erhoehen...
     62            $this->modules['DB']->query("UPDATE ".TBLPFX."topics SET topicViewsCounter=topicViewsCounter+1 WHERE topicID='$topicID'"); // ...Anzahl der Views um 1 erhoehen...
    6363            $_SESSION['topicViews'][$topicID] = TRUE; // ...Und Thema in dieser Session vermerken
    6464        }
     
    6969        //
    7070        if(!isset($topicPostsCounter)) $topicPostsCounter = Functions::getPostsCounter($topicID); // Anzahl der Beitraege bestimmen (kann eventuell aus schon vorhandenen Daten geschehen)
    71         $pageListing = Functions::createPageListing($topicPostsCounter,$this->modules['Config']->getValue('posts_per_page'),$page,"<a href=\"".INDEXFILE."?action=ViewTopic&amp;TopicID=$topicID&amp;Page=%1\$s&amp;".MYSID."\">%2\$s</a>"); // Die Seitenansicht erstellen
     71        $pageListing = Functions::createPageListing($topicPostsCounter,$this->modules['Config']->getValue('posts_per_page'),$page,"<a href=\"".INDEXFILE."?action=ViewTopic&amp;topicID=$topicID&amp;Page=%1\$s&amp;".MYSID."\">%2\$s</a>"); // Die Seitenansicht erstellen
    7272        $start = $page*$this->modules['Config']->getValue('posts_per_page')-$this->modules['Config']->getValue('posts_per_page'); // Startbeitrag
    7373
     
    111111                }
    112112
    113                 $this->modules['DB']->query("SELECT OptionID,OptionTitle,OptionVotesCounter FROM ".TBLPFX."polls_options WHERE TopicID='$topicID' ORDER BY OptionID"); // Die Auswahlmoeglichkeiten fuer die Umfrage laden
     113                $this->modules['DB']->query("SELECT OptionID,OptionTitle,OptionVotesCounter FROM ".TBLPFX."polls_options WHERE topicID='$topicID' ORDER BY OptionID"); // Die Auswahlmoeglichkeiten fuer die Umfrage laden
    114114                while($akt_option = $this->modules['DB']->fetchArray()) {
    115115                    $akt_fraction = ($poll_data['poll_votes'] == 0) ? 0 : round($akt_option['option_votes']/$poll_data['poll_votes'],2); // Der Anteil an Stimmen (0,xx)
     
    260260        $subscribeText = '';
    261261        if($this->modules['Auth']->isLoggedIn() == 1 && $this->modules['Config']->getValue('enable_email_functions') == 1 && $this->modules['Config']->getValue('enable_topic_subscription') == 1) {
    262             $this->modules['DB']->query("SELECT UserID FROM ".TBLPFX."topics_subscriptions WHERE TopicID='$topicID' AND UserID='".USERID."'");
     262            $this->modules['DB']->query("SELECT UserID FROM ".TBLPFX."topics_subscriptions WHERE topicID='$topicID' AND UserID='".USERID."'");
    263263            $subscribeText = ($this->modules['DB']->getAffectedRows() == 0) ? $this->modules['Language']->getString('Subscribe_topic') : $this->modules['Language']->getString('Unsubscribe_topic');
    264264        }
     
    291291            $this->modules['DB']->query("
    292292                SELECT
    293                     AuthID
     293                    authID
    294294                FROM
    295295                    ".TBLPFX."forums_auth
    296296                WHERE
    297                     AuthType='".AUTH_TYPE_USER."'
    298                     AND ForumID='$forumID'
    299                     AND AuthIsMod='1'
     297                    authType='".AUTH_TYPE_USER."'
     298                    AND forumID='$forumID'
     299                    AND authIsMod='1'
    300300            ");
    301301            while(list($curUserID) = $this->modules['DB']->fetchArray())
     
    304304            $this->modules['DB']->query("
    305305                SELECT
    306                     t2.MemberID
    307                 FROM
     306                    t2.memberID
     307                FROM (
    308308                    ".TBLPFX."forums_auth AS t1,
    309309                    ".TBLPFX."groups_members AS t2
     310                )
    310311                WHERE
    311                     t1.ForumID='$forumID'
    312                     AND t1.AuthIsMod=1
    313                     AND t1.AuthType='".AUTH_TYPE_GROUP."'
    314                     AND t2.GroupID=t1.AuthID
     312                    t1.forumID='$forumID'
     313                    AND t1.authIsMod=1
     314                    AND t1.authType='".AUTH_TYPE_GROUP."'
     315                    AND t2.groupID=t1.authID
    315316                GROUP BY
    316                     t2.MemberID
     317                    t2.memberID
    317318            ");
    318319            while(list($curUserID) = $this->modules['DB']->fetchArray())
  • trunk/templates/std/templates/AjaxResult.xml

    r6 r9  
    1212    <values>
    1313        {foreach from=$values item=curValue}
    14         <value name="{$curValue.Name}">{$curValue.Value}</value>
     14        <value name="{$curValue.name}">{$curValue.value}</value>
    1515        {/foreach}
    1616    </values>
  • trunk/templates/std/templates/EditProfileExtendedProfile.tpl

    r8 r9  
    77 {if count($curGroup.groupFields) > 0}
    88 <fieldset>
    9  <legend><span class="FontSmall"><b>{$curGroup.GroupName}</b></span></legend>
     9 <legend><span class="FontSmall"><b>{$curGroup.groupName}</b></span></legend>
    1010 <table border="0" cellpadding="2" cellspacing="0" width="100%">
    1111 {foreach from=$curGroup.groupFields item=curField}
  • trunk/templates/std/templates/EditProfileUploadAvatar.tpl

    r6 r9  
    1 <form method="post" action="{$indexFile}?action=EditProfile&amp;mode=UploadAvatar&amp;Doit=1&amp;{$mySID}" enctype="multipart/form-data">
     1<form method="post" action="{$indexFile}?action=EditProfile&amp;mode=UploadAvatar&amp;doit=1&amp;{$mySID}" enctype="multipart/form-data">
    22<table class="TableStd" border="0" cellpadding="3" cellspacing="0" width="100%">
    33<tr><td class="CellTitle" colspan="2"><span class="FontTitle">{$modules.Language->getString('Upload_avatar')}</span></td></tr>
     
    2424<tr>
    2525 <td class="CellStd"><span class="FontNorm">{$modules.Language->getString('File_name')}:</span></td>
    26  <td class="CellAlt"><input class="FormText" size="40" type="file" name="AvatarFile"/></td>
     26 <td class="CellAlt"><input class="FormText" size="40" type="file" name="avatarFile"/></td>
    2727</tr>
    2828<tr><td class="CellButtons" colspan="2" align="center"><input class="FormBButton" type="submit" value="{$modules.Language->getString('Upload_avatar')}"/></td></tr>
  • trunk/templates/std/templates/PopupHeader.tpl

    r6 r9  
    22<html xmlns="http://www.w3.org/1999/xhtml" dir="{$modules.Language->getString('html_direction')}" lang="{$modules.Language->getString('html_language')}" xml:lang="{$modules.Language->getString('html_language')}">
    33<head>
    4  <title>{$hEADER_TITLE}</title>
     4 <title>{$modules.Navbar->parseElements(0)}</title>
    55 <link rel="stylesheet" href="templates/std/templates/styles/ts_tbb2_standard.css" type="text/css"></link>
    6  <script src="templates/std/templates/jscripts.js" type="text/javascript"></script>
    76 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    87 <meta http-equiv="Content-Style-Type" content="text/css"/>
     8 <script src="templates/std/templates/jscripts.js" type="text/javascript"></script>
    99</head>
    1010<body>
  • trunk/templates/std/templates/PopupTail.tpl

    r2 r9  
    11<br/>
    2 <table border="0" cellpadding="0" cellspacing="0" width="100%">
    3 <tr><td align="center"><span class="copyright">Tritanium Bulletin Board 2 Beta (Version {$smarty.const.SCRIPTVERSION})<br/>&copy; 2003-2006 <a class="copyright" target="_blank" href="http://www.tritanium-scripts.com">Tritanium Scripts</a></span></td></tr>
     2<div align="center">
     3<table class="TableCopyright">
     4<tr><td class="CellCopyright" align="center"><span class="FontCopyright">Tritanium Bulletin Board 2 Beta<br/>&copy; <a class="FontCopyright" target="_blank" href="http://www.tritanium-scripts.com">Tritanium Scripts</a></span></td></tr>
    45</table>
     6</div>
    57</body>
    68</html>
  • trunk/templates/std/templates/Posting.tpl

    r6 r9  
    1212
    1313        var newtd = document.createElement('td');
    14         //newtd.className = 'CellMain';
    1514        var newinput = document.createElement('input');
    1615        newinput.type = 'text';
    1716        newinput.className = 'FormText';
    1817        newinput.size = '30';
    19         newinput.name = "p[PollOptions][]";
    20         //newinput.id = "idPollOptions"+LastRowID;
     18        newinput.name = "p[pollOptions][]";
    2119        newtd.appendChild(newinput);
    2220        newtr.appendChild(newtd);
    2321
    24         // Links (loeschen);
    2522        var newtd = document.createElement('td');
    26         //newtd.className = 'cellmain';
    2723        newtd.align = 'left';
    2824        var newspan = document.createElement('span');
     
    5248    {/literal}
    5349</script>
    54 {if $show.PreviewBox}
     50{if $show.previewBox}
    5551 <table class="TableStd" border="0" cellspacing="0" cellpadding="3" width="100%">
    5652 <tr><td class="CellTitle"><span class="FontTitle">{$modules.Language->getString('Preview')}</span></td></tr>
     
    5955 <br/>
    6056{/if}
    61 <form method="post" action="{$indexFile}?action=Posting&amp;mode={$mode}&amp;ForumID={$forumID}&amp;TopicID={$topicID}&amp;PostID={$postID}&amp;Doit=1&amp;{$mySID}" name="MyForm">
     57<form method="post" action="{$indexFile}?action=Posting&amp;mode={$mode}&amp;forumID={$forumID}&amp;topicID={$topicID}&amp;postID={$postID}&amp;doit=1&amp;{$mySID}" name="MyForm">
    6258<table class="TableStd" border="0" cellspacing="0" cellpadding="3" width="100%">
    6359<colgroup>
     
    7167 <tr>
    7268  <td class="CellStd"><span class="FontNorm">{$modules.Language->getString('Your_name')}:</span><br/><span class="FontSmall">{$modules.Language->getString('nick_conventions')}</span></td>
    73   <td class="CellAlt" valign="top"><input size="20" class="FormText" type="text" name="p[GuestNick]" value="{$p.GuestNick}" maxlength="15"/></td>
     69  <td class="CellAlt" valign="top"><input size="20" class="FormText" type="text" name="p[guestNick]" value="{$p.guestNick}" maxlength="15"/></td>
    7470 </tr>
    7571{/if}
    7672<tr>
    7773 <td class="CellStd" valign="top"><span class="FontNorm">{$modules.Language->getString('Post_pic')}:</span></td>
    78  <td class="CellAlt" valign="top">{$pPicsBox}</td>
     74 <td class="CellAlt" valign="top">{$topicPicsBox}</td>
    7975</tr>
    8076<tr>
    8177 <td class="CellStd"><span class="FontNorm">{$modules.Language->getString('Title')}:</span></td>
    82  <td class="CellAlt"><input class="FormText" type="text" size="65" name="p[MessageTitle]" value="{$p.MessageTitle}" maxlength="100"/>&nbsp;<span class="FontSmall">({$title_max_chars})</span></td>
     78 <td class="CellAlt"><input class="FormText" type="text" size="65" name="p[messageTitle]" value="{$p.messageTitle}" maxlength="100"/>&nbsp;<span class="FontSmall"></span></td>
    8379</tr>
    8480 <tr>
    8581  <td class="CellStd" valign="top"></td>
    86   <td class="CellAlt">{$bbcode_box}</td>
     82  <td class="CellAlt"></td>
    8783 </tr>
    8884<tr>
    8985 <td class="CellStd" valign="top"><span class="FontNorm">{$modules.Language->getString('Post')}:</span><br/><br/>{$smiliesBox}</td>
    90  <td class="CellAlt"><textarea class="FormTextArea" name="p[MessageText]" rows="14" cols="80" onselect="storecaret();" onclick="storecaret();" onkeyup="storecaret();">{$p.MessageText}</textarea></td>
     86 <td class="CellAlt"><textarea class="FormTextArea" name="p[messageText]" rows="14" cols="80" onselect="storecaret();" onclick="storecaret();" onkeyup="storecaret();">{$p.messageText}</textarea></td>
    9187</tr>
    9288<tr>
    9389 <td class="CellStd" valign="top"><span class="FontNorm">{$modules.Language->getString('Options')}:</span></td>
    9490 <td class="CellAlt"><span class="FontNorm">
    95   {if $show.EnableSmilies}<input type="checkbox" name="c[EnableSmilies]" value="1"{if $c.EnableSmilies == 1} checked="checked"{/if} id="idEnableSmilies"/><label for="idEnableSmilies"> {$modules.Language->getString('Enable_smilies')}</label><br/>{/if}
    96   {if $show.ShowSignature}<input type="checkbox" name="c[ShowSignature]" value="1"{if $c.ShowSignature == 1} checked="checked"{/if} id="idShowSignature"/><label for="idShowSignature"> {$modules.Language->getString('Show_signature')}</label><br/>{/if}
    97   {if $show.EnableBBCode}<input type="checkbox" name="c[EnableBBCode]" value="1"{if $c.EnableBBCode} == 1} checked="checked"{/if} id="idEnableBBCode"/><label for="idEnableBBCode"> {$modules.Language->getString('Enable_bbcode')}</label><br/>{/if}
    98   {if $show.EnableHtmlCode}<input type="checkbox" name="c[EnableHtmlCode]" value="1"{if $c.EnableHtmlCode == 1} checked="checked"{/if} id="idEnableHtmlCode"/><label for="idEnableHtmlCode"> {$modules.Language->getString('Enable_html_code')}</label><br/>{/if}
    99   {if $show.EnableURITransformation}<input type="checkbox" name="c[EnableURITransformation]" value="1"{if $c.EnableURITransformation == 1} checked="checked"{/if} id="idEnableURITransformation"/><label for="idEnableURITransformation">&nbsp;{$modules.Language->getString('Enable_url_transformation')}</label><br/>{/if}
    100   {if $show.ShowEditings}<input type="checkbox" name="c[ShowEditings]" value="1"{if $c.ShowEditings == 1} checked="checked"{/if} id="idShowEditings"/><label for="idShowEditings"> {$modules.Language->getString('Show_post_editings')}</label><br/>{/if}
    101   {if $show.SubscribeTopic}<input type="checkbox" name="c[SubscribeTopic]" value="1"{if $c.SubscribeTopic == 1} checked="checked"{/if} id="idSubscribeTopic"/><label for="idSubscribeTopic"> {$modules.Language->getString('Subscribe_topic')}</label><br/>{/if}
    102   {if $show.PicTopic}<input type="checkbox" name="c[PinTopic]" value="1"{if $c.PinTopic == 1} checked="checked"{/if} id="idPinTopic"/><label for="idPinTopic"> {$modules.Language->getString('Mark_topic_important')}</label><br/>{/if}
    103   {if $show.CloseTopic}<input type="checkbox" name="c[CloseTopic]" value="1"{if $c.CloseTopic == 1} checked="checked"{/if} id="idCloseTopic"/><label for="idCloseTopic"> {$modules.Language->getString('Close_topic')}</label>{/if}
     91  {if $show.enableSmilies}<label><input type="checkbox" name="c[enableSmilies]" value="1"{if $c.enableSmilies == 1} checked="checked"{/if}/> {$modules.Language->getString('Enable_smilies')}</label><br/>{/if}
     92  {if $show.showSignature}<label><input type="checkbox" name="c[showSignature]" value="1"{if $c.showSignature == 1} checked="checked"{/if}/> {$modules.Language->getString('Show_signature')}</label><br/>{/if}
     93  {if $show.enableBBCode}<label><input type="checkbox" name="c[enableBBCode]" value="1"{if $c.enableBBCode} == 1} checked="checked"{/if}/> {$modules.Language->getString('Enable_bbcode')}</label><br/>{/if}
     94  {if $show.enableHtmlCode}<label><input type="checkbox" name="c[enableHtmlCode]" value="1"{if $c.enableHtmlCode == 1} checked="checked"{/if}/> {$modules.Language->getString('Enable_html_code')}</label><br/>{/if}
     95  {if $show.enableURITransformation}<label><input type="checkbox" name="c[enableURITransformation]" value="1"{if $c.enableURITransformation == 1} checked="checked"{/if}/> {$modules.Language->getString('Enable_url_transformation')}</label><br/>{/if}
     96  {if $show.showEditings}<label><input type="checkbox" name="c[showEditings]" value="1"{if $c.showEditings == 1} checked="checked"{/if}/> {$modules.Language->getString('Show_post_editings')}</label><br/>{/if}
     97  {if $show.subscribeTopic}<label><input type="checkbox" name="c[subscribeTopic]" value="1"{if $c.subscribeTopic == 1} checked="checked"{/if}/> {$modules.Language->getString('Subscribe_topic')}</label><br/>{/if}
     98  {if $show.pinTopic}<label><input type="checkbox" name="c[pinTopic]" value="1"{if $c.pinTopic == 1} checked="checked"{/if}/> {$modules.Language->getString('Mark_topic_important')}</label><br/>{/if}
     99  {if $show.closeTopic}<label><input type="checkbox" name="c[closeTopic]" value="1"{if $c.closeTopic == 1} checked="checked"{/if}/> {$modules.Language->getString('Close_topic')}</label>{/if}
    104100 </span></td>
    105101</tr>
    106 {if $show.PollBox}
     102{if $show.pollBox}
    107103 <tr><td class="CellCat" colspan="2"><a name="pollrow"></a><span class="FontCat">{$modules.Language->getString('Poll')}</span></td></tr>
    108104 <tr>
    109105  <td class="CellStd" valign="top"><span class="FontNorm">{$modules.Language->getString('Poll_title')}:</span><br/><span class="FontSmall">{$modules.Language->getString('add_poll_info')}</span></td>
    110   <td class="CellAlt" valign="top"><input class="FormText" type="text" name="p_poll_title" maxlength="255" size="60" value="{$p_poll_title}"/></td>
     106  <td class="CellAlt" valign="top"><input class="FormText" type="text" name="p[pollTitle]" maxlength="255" size="60" value="{$p.pollTitle}"/></td>
    111107 </tr>
    112108 <tr>
     
    114110  <td class="CellAlt" valign="top">
    115111   <table id="idPollOptionsTable" border="0" cellpadding="1" cellspacing="0">
    116    {foreach from=$p.PollOptions item=curOption}
    117     <tr id="idOption{$poll_options_counter}">
    118      <td><input type="text" class="FormText" size="30" value="{$curOption}" name="p[PollOptions][]""/></td>
    119      <td><span class="FontSmall"><a href="javascript:deletePollOption('idOption{$poll_options_counter}');">l&ouml;schen</a></span></td>
     112   {foreach from=$p.pollOptions item=curOption name=pollOptionsLoop}
     113    <tr id="idOption{$smarty.foreach.pollOptionsLoop.iteration}">
     114     <td><input type="text" class="FormText" size="30" value="{$curOption}" name="p[pollOptions][]""/></td>
     115     <td><span class="FontSmall"><a href="javascript:deletePollOption('idOption{$smarty.foreach.pollOptionsLoop.iteration}');">l&ouml;schen</a></span></td>
    120116    </tr>
    121117   {/foreach}
  • trunk/templates/std/templates/SmiliesBox.tpl

    r6 r9  
    11<table border="0" cellpadding="0" cellspacing="0" width="100%">
    22 <tr><td align="center">
    3   <table border="0" cellpadding="3" cellspacing="0">
     3  <table border="0" cellpadding="0" cellspacing="4">
    44   <tr>
    5    {foreach from=$smiliesData item=curSmiley name=SmiliesLoop}
    6     <td valign="bottom"><a href="javascript:insertatcaret(' {$curSmiley.SmileySynonym} ')"><img src="{$curSmiley.SmileyFileName}" alt="{$curSmiley.SmileySynonym}" border="0"/></a></td>
    7     {if $smarty.foreach.SmiliesLoop.iteration % 7 == 0 && $smarty.foreach.SmiliesLoop.iteration != $smarty.foreach.SmiliesLoop.total}</tr><tr>{/if}
     5   {foreach from=$smiliesData item=curSmiley name=smiliesLoop}
     6    <td><a href="javascript:insertatcaret(' {$curSmiley.smileySynonym} ')"><img src="{$curSmiley.smileyFileName}" alt="{$curSmiley.smileySynonym}" border="0"/></a></td>
     7    {if $smarty.foreach.smiliesLoop.iteration % 7 == 0 && $smarty.foreach.smiliesLoop.iteration != $smarty.foreach.smiliesLoop.total}</tr><tr>{/if}
    88   {/foreach}
    99   </tr>
  • trunk/templates/std/templates/TopicPicsBox.tpl

    r6 r9  
    1 <table border="0" cellpadding="2" cellspacing="0">
     1<table border="0" cellpadding="0" cellspacing="4">
    22 <tr>
    3 {foreach from=$pPicsData item=curPPic name=PPicsLoop}
    4   <td><input type="radio" name="p[SmileyID]" value="{$curPPic.SmileyID}"/><img border="0" src="{$curPPic.SmileyFileName}" alt=""/></td>
    5  {if $smarty.foreach.PPicsLoop.iteration % 7 == 0 && $smarty.foreach.PPicsLoop.iteration != $smarty.foreach.PPicsLoop.total}</tr><tr>{/if}
     3{foreach from=$topicPicsData item=curTopicPic name=topicPicsLoop}
     4  <td><input type="radio" name="p[smileyID]" value="{$curTopicPic.smileyID}"/><img border="0" src="{$curTopicPic.smileyFileName}" alt=""/></td>
     5 {if $smarty.foreach.topicPicsLoop.iteration % 7 == 0 && $smarty.foreach.topicPicsLoop.iteration != $smarty.foreach.topicPicsLoop.total}</tr><tr>{/if}
    66{/foreach}
    77 </tr>
  • trunk/templates/std/templates/ViewTopic.tpl

    r6 r9  
    11<script>
    2     IndexFile = "{$indexFile}";
    3     MySID = "{$mySID}";
     2    indexFile = "{$indexFile}";
     3    mySID = "{$mySID}";
    44{literal}
    5     function toggleFastEdit(PostID) {
    6         if(document.getElementById("Post"+PostID+"Text").style.display == "none") {
    7             document.getElementById("Post"+PostID+"Text").style.display = "";
    8             document.getElementById("Post"+PostID+"EditBox").style.display = "none"
     5    function toggleFastEdit(postID) {
     6        if(document.getElementById("post"+postID+"Text").style.display == "none") {
     7            document.getElementById("post"+postID+"Text").style.display = "";
     8            document.getElementById("post"+postID+"EditBox").style.display = "none"
    99        } else {
    10             document.getElementById("Post"+PostID+"Text").style.display = "none";
    11             document.getElementById("Post"+PostID+"EditBox").style.display = ""
     10            document.getElementById("post"+postID+"Text").style.display = "none";
     11            document.getElementById("post"+postID+"EditBox").style.display = ""
    1212        }
    1313    }
    1414
    15     function ajaxUpdatePost(PostID) {
    16         var AjaxConnection = ajaxGetInstance("ajaxUpdatePostHandle");
    17         AjaxConnection.open("GET", IndexFile+"?action=Ajax&mode=EditPost&PostID="+PostID+"&PostText="+encodeURIComponent(document.getElementsByName('PostData'+PostID)[0].value)+"&"+MySID, true);
    18         AjaxConnection.send(null);
     15    function ajaxUpdatePost(postID) {
     16        var ajaxConnection = ajaxGetInstance("ajaxUpdatePostHandle");
     17        ajaxConnection.open("GET", indexFile+"?action=Ajax&mode=EditPost&postID="+postID+"&postText="+encodeURIComponent(document.getElementsByName('postData'+postID)[0].value)+"&"+mySID, true);
     18        ajaxConnection.send(null);
    1919    }
    2020
    21     function ajaxUpdatePostHandle(AjaxConnection) {
    22         if(AjaxConnection.readyState == 4) {
    23             if(ajaxGetStatus(AjaxConnection.responseXML) != 'SUCC') {
    24                 alert(ajaxGetValue(AjaxConnection.responseXML,'Error'));
     21    function ajaxUpdatePostHandle(ajaxConnection) {
     22        if(ajaxConnection.readyState == 4) {
     23            if(ajaxGetStatus(ajaxConnection.responseXML) != 'SUCC') {
     24                alert(ajaxGetValue(ajaxConnection.responseXML,'error'));
    2525            } else {
    26                 document.getElementById("Post"+ajaxGetValue(AjaxConnection.responseXML,'PostID')+"Text").innerHTML = ajaxGetValue(AjaxConnection.responseXML,'PostTextHTMLReady');
    27                 document.getElementById("Post"+ajaxGetValue(AjaxConnection.responseXML,'PostID')+"Text").style.display = "";
    28                 document.getElementById("Post"+ajaxGetValue(AjaxConnection.responseXML,'PostID')+"EditBox").style.display = "none";
     26                document.getElementById("post"+ajaxGetValue(ajaxConnection.responseXML,'postID')+"Text").innerHTML = ajaxGetValue(ajaxConnection.responseXML,'postTextHTMLReady');
     27                document.getElementById("post"+ajaxGetValue(ajaxConnection.responseXML,'postID')+"Text").style.display = "";
     28                document.getElementById("post"+ajaxGetValue(ajaxConnection.responseXML,'postID')+"EditBox").style.display = "none";
    2929            }
    30             delete AjaxConnection;
     30            delete ajaxConnection;
    3131        }
    3232    }
     
    3838 <tr>
    3939  <td><span class="FontNavbar">{$pageListing}</span></td>
    40   <td align="right"><span class="FontNavbar"><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;TopicID={$topicID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddReply.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_reply')}"/></a><a href="{$indexFile}?action=Posting&amp;mode=Topic&amp;ForumID={$forumID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddTopic.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_topic')}"/></a></span></td>
     40  <td align="right"><span class="FontNavbar"><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;topicID={$topicID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddReply.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_reply')}"/></a><a href="{$indexFile}?action=Posting&amp;mode=Topic&amp;forumID={$forumID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddTopic.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_topic')}"/></a></span></td>
    4141 </tr>
    4242 </table>
     
    5757   <table border="0" cellspacing="0" cellpadding="0" width="100%">
    5858   <tr>
    59     <td>{if $curPost.postSmileyFileName != ''}<span style="margin-right:4px;"><img src="{$curPost.postSmileyFileName}" border="0" alt=""/></span>{/if}<span class="FontSmall"><a id="Post{$curPost.postID}" name="Post{$curPost.postID}"></a><b>{$curPost.postTitle}</b></span></td>
     59    <td>{if $curPost.postSmileyFileName != ''}<span style="margin-right:4px;"><img src="{$curPost.postSmileyFileName}" border="0" alt=""/></span>{/if}<span class="FontSmall"><a id="post{$curPost.postID}" name="post{$curPost.postID}"></a><b>{$curPost.postTitle}</b></span></td>
    6060    <td align="right">
    6161     <table border="0" cellpadding="0" cellspacing="0">
    6262      <tr>
    63        {if $curPost.show.deleteButton}<td><a href="{$indexFile}?action=DeletePost&amp;PostID={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/delete.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
     63       {if $curPost.show.deleteButton}<td><a href="{$indexFile}?action=DeletePost&amp;postID={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/delete.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
    6464       {if $curPost.show.editButton}<td><a href="javascript:toggleFastEdit('{$curPost.postID}');"><img src="templates/std/templates/images/buttons/de/test.png" alt="" class="ImageButton" border="0"/></a></td>{/if}
    65        {if $curPost.show.editButton}<td><a href="{$indexFile}?action=Posting&amp;mode=Edit&amp;PostID={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/test.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
     65       {if $curPost.show.editButton}<td><a href="{$indexFile}?action=Posting&amp;mode=Edit&amp;postID={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/test.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
    6666       {if $curPost.postPosterHideEmail != 1 && $curPost.postPosterEmail != ''}<td><a href="mailto:{$curPost.postPosterEmail}"><img src="templates/std/templates/images/buttons/de/email.png" class="ImageButton" alt="{$curPost.postPosterEmail}" border="0"/></a>{else}<td>{if $curPost.postPosterReceiveEmails == 1}<a href="{$indexFile}?action=ViewProfile&amp;profileID={$curPost.UserID}&amp;mode=SendMail&amp;{$mySID}"><img src="{$modules.Template->getTemplateDir()}/images/button_user_email.gif" alt="{$modules.Language->getString('Send_email')}" border="0"/></a></td>{/if}{/if}
    67        <td><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;TopicID={$topicID}&amp;Quote={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/quote.png" class="ImageButton" alt="" border="0"/></a></td>
     67       <td><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;topicID={$topicID}&amp;Quote={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/quote.png" class="ImageButton" alt="" border="0"/></a></td>
    6868      </tr>
    6969     </table>
     
    7575 <tr>
    7676  <td class="CellStd">
    77    <div id="Post{$curPost.postID}Text" class="FontNorm"{if $curPost.show.editButton} ondblclick="toggleFastEdit('{$curPost.postID}');"{/if}>{$curPost._postText}</div>
    78    <div id="Post{$curPost.postID}EditBox" style="display:none;">
     77   <div id="post{$curPost.postID}Text" class="FontNorm"{if $curPost.show.editButton} ondblclick="toggleFastEdit('{$curPost.postID}');"{/if}>{$curPost._postText}</div>
     78   <div id="post{$curPost.postID}EditBox" style="display:none;">
    7979    <table class="TableStd" cellpadding="0"width="100%">
    8080    <tr><td class="CellCat"><span class="FontCat">Fast Edit</span></td></tr>
    81     <tr><td class="CellNone" align="center"><textarea class="FormTextArea" rows="14" style="width:99%;" name="PostData{$curPost.postID}">{$curPost._postEditBoxText}</textarea></td></tr>
     81    <tr><td class="CellNone" align="center"><textarea class="FormTextArea" rows="14" style="width:99%;" name="postData{$curPost.postID}">{$curPost._postEditBoxText}</textarea></td></tr>
    8282    <tr><td class="CellButtons" align="center"><input class="FormBButton" type="button" value="{$modules.Language->getString('Edit_post')}" onclick="ajaxUpdatePost({$curPost.postID});"/></td></tr>
    8383    </table>
     
    9696 <tr>
    9797  <td><span class="FontNavbar">{$pageListing}</span></td>
    98   <td align="right"><span class="FontNavbar"><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;TopicID={$topicID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddReply.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_reply')}"/></a><a href="{$indexFile}?action=Posting&amp;mode=Topic&amp;ForumID={$forumID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddTopic.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_topic')}"/></a></span></td>
     98  <td align="right"><span class="FontNavbar"><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;topicID={$topicID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddReply.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_reply')}"/></a><a href="{$indexFile}?action=Posting&amp;mode=Topic&amp;forumID={$forumID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/{$modules.Language->getLC()}/AddTopic.png" class="ImageButton" border="0" alt="{$modules.Language->getString('Post_new_topic')}"/></a></span></td>
    9999 </tr>
    100100 </table>
  • trunk/templates/std/templates/ajax.js

    r2 r9  
    1 function ajaxGetInstance(FunctionName) {
    2     var AjaxConnection = false;
     1function ajaxGetInstance(functionName) {
     2    var ajaxConnection = false;
    33
    44    if (window.XMLHttpRequest) {
    5         AjaxConnection = new XMLHttpRequest();
     5        ajaxConnection = new XMLHttpRequest();
    66    } else if (window.ActiveXObject) {
    7         AjaxConnection = new ActiveXObject("Microsoft.XMLHTTP");
     7        ajaxConnection = new ActiveXObject("Microsoft.XMLHTTP");
    88    }
    99
    10     if(AjaxConnection) {
    11         AjaxConnection.onreadystatechange = function() {
    12             eval(FunctionName+'(AjaxConnection)');
     10    if(ajaxConnection) {
     11        ajaxConnection.onreadystatechange = function() {
     12            eval(functionName+'(ajaxConnection)');
    1313        }
    14         return AjaxConnection;
     14        return ajaxConnection;
    1515    } else {
    1616        alert("Fehler!");
     
    1818}
    1919
    20 function ajaxGetValue(XMLObject,ValueName) {
    21     var Result = null;
     20function ajaxGetValue(xmlObject,valueName) {
     21    var result = null;
    2222
    23     for(var i = 0; i < XMLObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('values')[0].getElementsByTagName('value').length; i++) {
    24         if(XMLObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('values')[0].getElementsByTagName('value')[i].getAttribute('name') == ValueName) {
    25             Result = XMLUnescapeString(XMLObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('values')[0].getElementsByTagName('value')[i].firstChild.data);
     23    for(var i = 0; i < xmlObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('values')[0].getElementsByTagName('value').length; i++) {
     24        if(xmlObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('values')[0].getElementsByTagName('value')[i].getAttribute('name') == valueName) {
     25            result = xmlUnescapeString(xmlObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('values')[0].getElementsByTagName('value')[i].firstChild.data);
    2626            break;
    2727        }
    2828    }
    2929
    30     return Result;
     30    return result;
    3131}
    3232
    33 function ajaxGetStatus(XMLObject) {
    34     return XMLObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('status')[0].firstChild.data;
     33function ajaxGetStatus(xmlObject) {
     34    return xmlObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('status')[0].firstChild.data;
    3535}
    3636
    37 function ajaxGetMode(XMLObject) {
    38     return XMLObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('mode')[0].firstChild.data;
     37function ajaxGetMode(xmlObject) {
     38    return xmlObject.getElementsByTagName('ajaxresult')[0].getElementsByTagName('mode')[0].firstChild.data;
    3939}
    4040
    41 function XMLUnescapeString(Value) {
    42     Value = Value.replace(/&lt;/g,"<");
    43     Value = Value.replace(/&gt;/g,">");
    44     Value = Value.replace(/&amp;/g,"&");
    45     Value = Value.replace(/&quot;/g,"\"");
    46     Value = Value.replace(/&apos;/g,"'");
     41function xmlUnescapeString(value) {
     42    value = value.replace(/&lt;/g,"<");
     43    value = value.replace(/&gt;/g,">");
     44    value = value.replace(/&amp;/g,"&");
     45    value = value.replace(/&quot;/g,"\"");
     46    value = value.replace(/&apos;/g,"'");
    4747
    48     return Value;
     48    return value;
    4949}
Note: See TracChangeset for help on using the changeset viewer.