Changeset 29


Ignore:
Timestamp:
Apr 16, 2007, 5:53:43 PM (11 years ago)
Author:
julian
Message:
  • Fixed bugs #11 #13 #14 #15
  • First trials to integrate administration
  • Some small fixes
Location:
trunk
Files:
6 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/config/Core.config.class.php

    r21 r29  
    77        'enableOutputCompression'=>TRUE,
    88        'allowedActions'=>array(
     9            'AdminMain',
    910            'Ajax',
    1011            'EditProfile',
  • trunk/docs/dbstructure.sql

    r27 r29  
    7070  `forumIsModerated` tinyint(1) unsigned NOT NULL default '0',
    7171  `forumShowLatestPosts` tinyint(1) unsigned NOT NULL default '0',
    72   `membersAuthViewForum` tinyint(1) unsigned NOT NULL default '0',
     72  `authViewForumMembers` tinyint(1) unsigned NOT NULL default '0',
    7373  `authPostTopicMembers` tinyint(1) unsigned NOT NULL default '0',
    7474  `authPostReplyMembers` tinyint(1) unsigned NOT NULL default '0',
  • trunk/docs/testdata.sql

    r28 r29  
    109109/*!40000 ALTER TABLE `tbb2_forums` DISABLE KEYS*/;
    110110LOCK TABLES `tbb2_forums` WRITE;
    111 REPLACE INTO `tbb2_forums` (`forumID`, `catID`, `orderID`, `forumName`, `forumDescription`, `forumTopicsCounter`, `forumPostsCounter`, `forumLastPostID`, `forumEnableBBCode`, `forumEnableHtmlCode`, `forumEnableSmilies`, `forumEnableURITransformation`, `forumIsModerated`, `forumShowLatestPosts`, `membersAuthViewForum`, `authPostTopicMembers`, `authPostReplyMembers`, `authPostPollMembers`, `authEditPostsMembers`, `authViewForumGuests`, `authPostTopicGuests`, `authPostReplyGuests`, `authPostPollGuests`) VALUES
     111REPLACE INTO `tbb2_forums` (`forumID`, `catID`, `orderID`, `forumName`, `forumDescription`, `forumTopicsCounter`, `forumPostsCounter`, `forumLastPostID`, `forumEnableBBCode`, `forumEnableHtmlCode`, `forumEnableSmilies`, `forumEnableURITransformation`, `forumIsModerated`, `forumShowLatestPosts`, `authViewForumMembers`, `authPostTopicMembers`, `authPostReplyMembers`, `authPostPollMembers`, `authEditPostsMembers`, `authViewForumGuests`, `authPostTopicGuests`, `authPostReplyGuests`, `authPostPollGuests`) VALUES
    112112    (1,2,1,'Testforum','Zum Testen',0,0,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,0);
    113113UNLOCK TABLES;
  • trunk/languages/de/Main.language

    r23 r29  
    109109Message = Nachricht
    110110Subject = Betreff
    111 
     111Administration = Administration
    112112
    113113Display_options = Darstellungsoptionen
  • trunk/languages/de/PageParts.language

    r23 r29  
    88welcome_not_logged_in = <b>Willkommen bei %1$s!</b> Falls dies Ihr erster Besuch hier ist, lesen Sie sich bitte die <a href=%2$s?Action=Help&amp;%3$s>Hilfe mit den h&auml;ufigsten Fragen</a> und ausf&uuml;hrlichen Erkl&auml;rungen durch! Falls Sie an den Diskussionen teilnehmen wollen, sollten Sie <a href=%2$s?Action=Register&amp;%3$s>sich registrieren</a> oder, falls Sie das schon getan haben, <a href=%2$s?Action=Login&amp;%3$s>sich einloggen</a>. Wir w&uuml;nschen Ihnen viel Spa&szlig;!
    99welcome_logged_in = Hallo %1$s! Wir haben %2$s <a href=%3$s?Action=Logout&amp;%4$s>[ Ausloggen ]</a>
    10 Administration = Administration
    1110technical_stats_text = Datenbankzugriffe: %1$s; GZIP-Komprimierung: %2$s;<br />Seitenaufbauzeit: %3$s (PHP: %4$s, DB: %5$s)
  • trunk/modules/ForumIndex.class.php

    r28 r29  
    1515
    1616    public function executeMe() {
    17         //echo $this->modules['BBCode']->parse('[quote]test[/quote][quote=xxx]test[/quote][b]bold[/b][i]italic[/i][u]underline[/u][s]strike[/s][center]center[/center][email]juulian@tritanium-scripts.com[/email][img]tralala.gif[/img][url=http://www.julianbackes.de]jb[/url][url]http://www.julianbackes.de[/url][color=#FFFFFF]weisser text[/color][code]hehehe[/code]');
    1817        $baseCatID = isset($_GET['baseCatID']) ? intval($_GET['baseCatID']) : 1;
    1918        $catID = isset($_GET['catID']) ? intval($_GET['catID']) : $baseCatID;
     
    4342
    4443        $closedCatIDs = array();
    45         if(!isset($_COOKIE['ClosedCatIDs'])) {
     44        if(!isset($_COOKIE['closedCatIDs'])) {
    4645            for($i = 0; $i < $catsCounter; $i++) {
    4746                if($catsData[$i]['catStandardStatus'] != 1) $closedCatIDs[] = $catsData[$i]['catID'];
    4847            }
    49             setcookie('ClosedCatIDs',implode('.',$closedCatIDs),time()+31536000);
     48            setcookie('closedCatIDs',implode('.',$closedCatIDs),time()+31536000);
    5049        }
    5150        else
    52             $closedCatIDs = explode('.',$_COOKIE['ClosedCatIDs']);
     51            $closedCatIDs = explode('.',$_COOKIE['closedCatIDs']);
    5352
    5453        for($i = 0; $i < $catsCounter; $i++) {
    5554            $curCat = &$catsData[$i];
    5655
    57             if(in_array($curCat['catID'],$closedCatIDs) == TRUE) $curCat['catIsOpen'] = 0;
     56            if(in_array($curCat['catID'],$closedCatIDs)) $curCat['catIsOpen'] = 0;
    5857            else $curCat['catIsOpen'] = 1;
    5958
     
    7271            }
    7372            elseif($this->modules['Auth']->getValue('userIsAdmin')!= 1 && $this->modules['Auth']->getValue('userIsSupermod') != 1) {
    74                 if($forumsData[$i]['membersAuthViewForum'] == 1) {
     73                if($forumsData[$i]['authViewForumMembers'] == 1) {
    7574                    while(list($curKey,$curData) = each($forumsAuthData)) {
    7675                        if($curData['forumID'] != $forumsData[$i]['forumID']) continue;
     
    8685                else {
    8786                    $curAuthViewForum = 0;
    88                     while(list($akt_key,$akt_data) = each($forumsAuthData)) {
     87                    while(list($curKey,$curData) = each($forumsAuthData)) {
    8988                        if($curData['forumID'] != $forumsData[$i]['forumID']) continue;
    9089
    91                         unset($forumsAuthData[$akt_key]);
     90                        unset($forumsAuthData[$curKey]);
    9291
    9392                        if($curData['authViewForum'] == 1) {
     
    314313                //$news_comments_link = "<a href=\"index.php?action=viewtopic&amp;post_id=".$news_data['post_id']."&amp;$mYSID\">".sprintf($lNG['x_comments'],$news_data['news_comments_counter']).'</a>';
    315314
    316                 $newsData['NewsTitle'] = Functions::HTMLSpecialChars($newsData['NewsTitle']);
    317 
    318                 if($newsData['PostEnableHtmlCode'] != 1) $newsData['NewsText'] = Functions::HTMLSpecialChars($newsData['NewsText']);
    319                 if($newsData['PostEnableSmilies'] == 1 && $forumData['ForumEnableSmilies'] == 1) $newsData['NewsText'] = strtr($newsData['NewsText']);
    320                 $newsData['NewsText'] = nl2br($newsData['NewsText']);
    321                 //if($newsData['PostEnableBBCode'] == 1) $newsData['NewsText'] = bbcode($news_data['news_text']);
     315                $newsData['newsTitle'] = Functions::HTMLSpecialChars($newsData['newsTitle']);
     316
     317                if($newsData['postEnableHtmlCode'] != 1) $newsData['newsText'] = Functions::HTMLSpecialChars($newsData['newsText']);
     318                if($newsData['postEnableSmilies'] == 1 && $forumData['forumEnableSmilies'] == 1) $newsData['newsText'] = strtr($newsData['newsText']);
     319                $newsData['newsText'] = nl2br($newsData['newsText']);
     320                if($newsData['postEnableBBCode'] == 1) $newsData['newsText'] = $this->modules['BBCode']->parse($newsData['newsText']);
    322321            }
    323322        }
  • trunk/modules/Globals.class.php

    r20 r29  
    1010    public function initializeMe() {
    1111        $this->modules['Navbar']->addElement($this->modules['Config']->getValue('board_name'),INDEXFILE.'?'.MYSID);
     12
     13        if(isset($_GET['t'])) {
     14            $_GET['action'] = 'ViewTopic';
     15            $_GET['topicID'] = $_GET['t'];
     16        }
     17        if(isset($_GET['p'])) {
     18            $_GET['action'] = 'ViewTopic';
     19            $_GET['postID'] = $_GET['p'];
     20        }
    1221    }
    1322}
  • trunk/modules/PageParts.class.php

    r21 r29  
    1414        'inEditProfile'=>FALSE,
    1515        'inAdministration'=>FALSE,
    16         'inPrivateMessages'=>FALSE
     16        'inPrivateMessages'=>FALSE,
     17        'inAdministration'=>FALSE
    1718    );
    1819
     
    6768            $this->modules['Template']->display('PrivateMessagesHeader.tpl');
    6869        }
     70        elseif($this->flags['inAdministration']) {
     71            $this->modules['Template']->display('AdminPageHeader.tpl');
     72        }
    6973    }
    7074
     
    97101        elseif($this->flags['inPrivateMessages'] == TRUE)
    98102            $this->modules['Template']->display('PrivateMessagesTail.tpl');
     103        elseif($this->flags['inAdministration']) {
     104            $this->modules['Template']->display('AdminPageTail.tpl');
     105        }
    99106
    100107        $this->modules['Template']->display('PageTail.tpl');
  • trunk/modules/Posting.class.php

    r28 r29  
    122122                    }
    123123
    124                     Functions::myHeader(INDEXFILE."?action=ViewTopic&postID=$postID&".MYSID."#post$postID"); exit;
     124                    Functions::myHeader(INDEXFILE."?p=$postID&".MYSID."#post$postID");
    125125                }
    126126                else {
     
    138138                                topicIsPinned='".$c['pinTopic']."',
    139139                                posterID='".USERID."',
    140                                 smileyID='$smileyID',
     140                                smileyID='".$p['smileyID']."',
    141141                                topicPostTimestamp='".time()."',
    142142                                topicGuestNick='".$p['guestNick']."'
     
    158158                                    SET
    159159                                        topicID='$topicID',
    160                                         posterID='".USERID.",
     160                                        posterID='".USERID."',
    161161                                        pollTitle='".$p['pollTitle']."',
    162162                                        pollGuestNick='".$p['guestNick']."'
     
    216216                        else $this->modules['DB']->query("INSERT INTO ".TBLPFX."topics_subscriptions SET topicID='$topicID', UserID='".USERID."'");
    217217                    }
    218                     //Functions::myHeader("index.php?t=$topicID&".MYSID); exit;
    219                     exit;
     218                    Functions::myHeader(INDEXFILE."?t=$topicID&".MYSID);
    220219                }
    221220            }
  • trunk/modules/Register.class.php

    r28 r29  
    180180                        $this->modules['Navbar']->addElement($this->modules['Language']->getString('Registration_successful'),INDEXFILE."?Action=Register&amp;".MYSID);
    181181
    182                         // TODO: Richtige Meldung bei Accoutn verification
     182                        // TODO: Richtige Meldung bei Account verification
    183183                        $this->modules['PageParts']->printMessage('registration_successful',array(sprintf($this->modules['Language']->getString('link_click_here_login'),'<a href="'.INDEXFILE.'?action=Login&amp;'.MYSID.'">','</a>')));
    184184                        exit;
     
    189189                // Die Spezial-Profilfelder
    190190                //
     191                $groupsData = array();
    191192                if($fieldsCounter > 0) {
    192193                    $groupsData = array(
  • trunk/templates/std/files/ForumIndex.tpl

    r17 r29  
    88    var i;
    99
    10     if(document.getElementById("CatForums"+CatID).style.display == "none") {
    11         document.getElementById("CatForums"+CatID).style.display = "";
    12         document.getElementById("CatPic"+CatID).src = templateDir+"/images/minus.gif";
     10    if(document.getElementById("CatForums"+catID).style.display == "none") {
     11        document.getElementById("CatForums"+catID).style.display = "";
     12        document.getElementById("CatPic"+catID).src = templateDir+"/images/minus.gif";
    1313
    1414        for(i = 0; i < closedCatIDs.length; i++) {
    15             if(closedCatIDs[i] == CatID) {
     15            if(closedCatIDs[i] == catID) {
    1616                closedCatIDs.splice(i,1);
    17                 setCookieValue("ClosedCatIDs",ClosedCatIDs.join("."));
     17                setCookieValue("ClosedCatIDs",closedCatIDs.join("."));
    1818                break;
    1919            }
    2020        }
    2121    } else {
    22         document.getElementById("CatForums"+CatID).style.display= "none";
    23         document.getElementById("CatPic"+CatID).src = templateDir+"/images/plus.gif";
     22        document.getElementById("CatForums"+catID).style.display= "none";
     23        document.getElementById("CatPic"+catID).src = templateDir+"/images/plus.gif";
    2424
    2525        closedCatIDs.push(catID);
    26         setCookieValue("ClosedCatIDs",ClosedCatIDs.join("."));
     26        setCookieValue("closedCatIDs",closedCatIDs.join("."));
    2727    }
    2828}
     
    3131    var cookieValue;
    3232
    33     if(cookieValue = getCookieValue("ClosedCatIDs"))
     33    if(cookieValue = getCookieValue("closedCatIDs"))
    3434        closedCatIDs = cookieValue.split(".");
    3535}
  • trunk/templates/std/files/PageTail.tpl

    r28 r29  
    1 <!--<table border="0" cellpadding="0" cellspacing="0" width="100%">
    2 <tr><td align="center"><span class="FontNorm">{$admin_link}</span></td></tr>
    3 </table>-->
     1{if $modules.Auth->getValue('userIsAdmin') == 1}
     2<br/>
     3<div align="center">
     4 <span class="FontNorm"><a href="{$indexFile}?action=AdminMain&amp;{$mySID}">{$modules.Language->getString('Administration')}</a></span></td></tr>
     5</div>
     6{/if}
    47<br/>
    58<div align="center">
  • trunk/templates/std/files/styles/ts_tbb2_standard.css

    r15 r29  
    270270    padding:0px;
    271271    padding-left:3px;
     272    padding-right:3px;
    272273    height:30px;
    273274    background-image:url(../images/celltitle.gif);
     
    309310    padding:0px;
    310311    padding-left:3px;
     312    padding-right:3px;
    311313    height:25px;
    312314    background-image:url(../images/cellcat.gif);
Note: See TracChangeset for help on using the changeset viewer.