Changeset 37


Ignore:
Timestamp:
Apr 19, 2007, 12:43:51 PM (11 years ago)
Author:
julian
Message:
  • finished rework on polls (#21)
  • began to move some functions out of Functions.class.php to functions/Xyz.class.php
  • new hover effect on forumindex
  • other small fixes
Location:
trunk
Files:
5 added
15 edited

Legend:

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

    r29 r37  
    2222            'Register',
    2323            'SubscribeTopic',
     24            'Vote',
    2425            'WhoIsOnline'
    2526        )
  • trunk/core/Core.class.php

    r20 r37  
    6363}
    6464
     65function __autoload($className) {
     66    require_once('functions/'.$className.'.class.php');
     67}
     68
    6569?>
  • trunk/core/Functions.class.php

    r27 r37  
    118118        else
    119119            $DB->query("SELECT * FROM ".TBLPFX."users WHERE UserID='$UserID'");
    120         return ($DB->getAffectedRows() == 1) ? $DB->fetchArray() : FALSE;
    121     }
    122 
    123     public static function getForumData($ForumID) {
    124         $DB = Factory::singleton('DB');
    125         $DB->query("SELECT * FROM ".TBLPFX."forums WHERE ForumID='$ForumID'");
    126         return ($DB->getAffectedRows() == 1) ? $DB->fetchArray() : FALSE;
    127     }
    128 
    129     public static function getTopicData($TopicID) {
    130         $DB = Factory::singleton('DB');
    131         $DB->query("SELECT * FROM ".TBLPFX."topics WHERE TopicID='$TopicID'");
    132120        return ($DB->getAffectedRows() == 1) ? $DB->fetchArray() : FALSE;
    133121    }
  • trunk/docs/testdata.sql

    r29 r37  
    6464    ('maximum_sig_length','1000'),
    6565    ('mod_rank_pic','images/rankpics/mod.gif'),
    66     ('newest_user_id','2541'),
    67     ('newest_user_nick','test456'),
     66    ('newest_user_id','0'),
     67    ('newest_user_nick',''),
    6868    ('news_forum','0'),
    6969    ('online_users_record','10,1118500662'),
  • trunk/languages/de/ViewTopic.language

    r33 r37  
    2424rank_administrator = Administrator
    2525rank_supermoderator = Supermoderator
    26 Must_be_logged_in_vote = Sie müssen eingeloggt sein um abstimmen zu können
    27 Must_be_logged_in_view_results = Sie müssen eingeloggt sein um die Ergebnisse zu sehen
    28 Results_after_end_of_poll = Die Ergebnisse werden erst nach Ende der Umfrage angezeigt
     26Must_be_logged_in_vote = Sie müssen eingeloggt sein um abstimmen zu können.
     27Must_be_logged_in_view_results = Sie müssen eingeloggt sein um die Ergebnisse zu sehen.
     28Results_after_end_of_poll = Sie haben schon abgestimmt. Die Ergebnisse werden erst nach Ende der Umfrage angezeigt.
  • trunk/modules/Ajax.class.php

    r9 r37  
    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 = FuncForums::getForumData($postData['forumID'])) $error = 'Kann Daten nicht laden: Forum';
    2929                else {
    3030                    $authData = Functions::getAuthData($forumData,array('authIsMod','authEditPosts'));
  • trunk/modules/EditTopic.class.php

    r35 r37  
    1818        elseif(!$topicData = Functions::getTopicData($topicID)) die('Cannot load data: topic');
    1919        elseif($topicData['topicMovedID'] != 0) die('Cannot edit topic: moved topic');
    20         elseif(!$forumData = Functions::getForumData($topicData['forumID'])) die('Cannot load data: forum');
     20        elseif(!$forumData = FuncForums::getForumData($topicData['forumID'])) die('Cannot load data: forum');
    2121
    2222        $forumID = &$topicData['forumID'];
  • trunk/modules/Posting.class.php

    r35 r37  
    3131                $forumID = &$topicData['forumID'];
    3232            case 'Topic':
    33                 if(!$forumData = Functions::getForumData($forumID)) die('Kann Daten nicht laden: Forum');
     33                if(!$forumData = FuncForums::getForumData($forumID)) die('Kann Daten nicht laden: Forum');
    3434                break;
    3535        }
  • trunk/modules/SubscribeTopic.class.php

    r21 r37  
    1717        $returnPage = isset($_GET['returnPage']) ? intval($_GET['returnPage']) : 1;
    1818
    19         if(!$topicData = Functions::getTopicData($topicID)) die('Cannot load data: topic');
     19        if(!$topicData = Functions::FuncTopics($topicID)) die('Cannot load data: topic');
    2020        if($topicData['topicMovedID'] != 0) die('Cannot subscribe topic: topic was moved');
    21         elseif(!$forumData = Functions::getForumData($topicData['forumID'])) die('Cannot load data: forum');
     21        elseif(!$forumData = FuncForums::getForumData($topicData['forumID'])) die('Cannot load data: forum');
    2222
    2323        $forumID = $forumData['forumID'];
  • trunk/modules/ViewForum.class.php

    r23 r37  
    1616        $page = isset($_GET['page']) ? $_GET['page'] : 1;
    1717
    18         if(!$forumData = Functions::getForumData($forumID)) die('Cannot load data: Forum');
     18        if(!$forumData = FuncForums::getForumData($forumID)) die('Cannot load data: Forum');
    1919
    2020        $this->modules['Language']->addFile('ViewForum');
  • trunk/modules/ViewTopic.class.php

    r36 r37  
    4242
    4343        // Thema- und Forumdaten laden
    44         if(!$topicData = Functions::getTopicData($topicID)) die('Kann Daten nicht laden: Thema'); // Themendaten laden
    45         if($topicData['topicMovedID'] != 0 && ($topicData = Functions::getTopicData($topicData['topicMovedID'])) == FALSE) die('Thema wurde verschoben/kann neues Thema nicht laden!'); // Falls das Thema verschoben wurde und die neuen Daten nicht gefunden werden koennen
    46         elseif($topicData['forumID'] != 0 && ($forumData = Functions::getForumData($topicData['forumID'])) == FALSE) die('Kann Daten nicht laden: Forum');
     44        if(!$topicData = FuncTopics::getTopicData($topicID)) die('Kann Daten nicht laden: Thema'); // Themendaten laden
     45        if($topicData['topicMovedID'] != 0 && ($topicData = FuncTopics::getTopicData($topicData['topicMovedID'])) == FALSE) die('Thema wurde verschoben/kann neues Thema nicht laden!'); // Falls das Thema verschoben wurde und die neuen Daten nicht gefunden werden koennen
     46        elseif($topicData['forumID'] != 0 && ($forumData = FuncForums::getForumData($topicData['forumID'])) == FALSE) die('Kann Daten nicht laden: Forum');
    4747
    4848        $topicID = &$topicData['topicID']; // ID des Themas, ist wichtig, falls es ein verschobenes Thema ist
  • trunk/templates/std/files/ForumIndex.tpl

    r29 r37  
    6767 {foreach from=$forumsData item=curForum}
    6868  {if $curForum.catID == $curCat.catID}
    69   <tr>
     69  <tr class="RowToHighlight" onmouseover="setRowCellsClass(this,'CellHighlight');" onmouseout="restoreRowCellsClass(this);">
    7070   <td class="CellAlt" align="center"></td>
    7171   <td class="CellStd" width="50%">
  • trunk/templates/std/files/ViewTopic.tpl

    r33 r37  
    4545<br/>
    4646{if $topicData.topicHasPoll == 1}
    47  <table class="TableStd" width="100%">
     47<form method="post" action="{$indexFile}?action=Vote&amp;pollID={$pollData.pollID}&amp;{$mySID}">
     48<table class="TableStd" width="100%">
    4849 <tr><td class="CellTitle"><span class="FontTitle">{$modules.Language->getString('Poll')}: {$pollData.pollTitle}</td></tr>
    49  <tr><td class="CellStd"><span class="FontNorm">
    5050  {if $userAlreadyVoted || $modules.Auth->isloggedIn() != 1 && $pollData.pollGuestsVote != 1 || $pollHasEnded}
    51    {if $modules.Auth->isloggedIn() != 1 && $pollData.pollGuestsViewResults == 0}
    52     {$modules.Language->getString('Must_be_logged_in_view_results')}
     51   {if $modules.Auth->isloggedIn() != 1 && $pollData.pollGuestsVote != 1 && !$userAlreadyVoted && !$pollHasEnded}
     52    <tr><td class="CellMessageBox"><span class="FontNorm">{$modules.Language->getString('Must_be_logged_in_vote')}</span></td></tr>
     53   {elseif $modules.Auth->isloggedIn() != 1 && $pollData.pollGuestsViewResults == 0}
     54    <tr><td class="CellMessageBox"><span class="FontNorm">{$modules.Language->getString('Must_be_logged_in_view_results')}</span></td></tr>
    5355   {elseif $pollData.pollShowResultsAfterEnd && !$pollHasEnded}
    54     {$modules.Language->getString('Results_after_end_of_poll')}
     56    <tr><td class="CellMessageBox"><span class="FontNorm">{$modules.Language->getString('Results_after_end_of_poll')}</span></td></tr>
    5557   {else}
     58    <tr><td class="CellStd">
    5659    <table border="0" cellpadding="2" cellspacing="0">
    5760    {foreach from=$pollOptionsData item=curOption}
     
    6366    {/foreach}
    6467    </table>
     68    </tr></td>
    6569   {/if}
    6670  {else}
     71   <tr><td class="CellStd">
    6772   <table border="0" cellpadding="2" cellspacing="0">
    6873   {foreach from=$pollOptionsData item=curOption}
    69     <tr>
    70      <td style="padding:3px;"><span class="FontNorm"><input type="radio" name="p_option_id" value="{$curOption.optionID}"/></span></td>
    71      <td style="padding:3px;"><span class="FontNorm">{$curOption.optionTitle}</span></td>
    72     </tr>
     74    <tr><td style="padding:3px;"><span class="FontNorm"><label><input type="radio" name="p[optionID]" value="{$curOption.optionID}"/>&nbsp;{$curOption.optionTitle}</label></span></td></tr>
    7375   {/foreach}
    7476   </table>
     77   </td></tr>
     78   <tr><td class="CellButtons"><input type="submit" class="FormBButton" value="{$modules.Language->getString('Vote')}"/></td></tr>
    7579  {/if}
    76  </span></td></tr>
    7780 </table>
     81 </form>
    7882 <br/>
    7983{/if}
  • trunk/templates/std/files/jscripts.js

    r17 r37  
    7777}
    7878
     79function removeRowCellsClass(row) {
     80    for(var i = 0; i < row.cells.length; i++) {
     81        row.cells[i].setAttribute("tbbOldClassName",row.cells[i].className);
     82        row.cells[i].className = '';
     83    }
     84}
     85
    7986function restoreRowCellsClass(row,newClass) {
    8087    for(var i = 0; i < row.cells.length; i++) {
  • trunk/templates/std/files/styles/ts_tbb2_standard.css

    r29 r37  
    210210    border-spacing:1px;
    211211    empty-cells:show;
     212    border-collapse:separate;
    212213}
    213214
     
    225226
    226227td.CellHighlight {
    227     padding:4px;
    228     border:#000000 0px solid;
    229     background-color:#B0C4DE;
    230 }
    231 
     228    padding:3px;
     229    /*border:#000000 1px dashed;*/
     230    border:#8c8c8c 1px dashed;
     231    background-color:#d5dce5;
     232}
     233td.CellMessageBox {
     234    padding:15px;
     235    border:#ACACAC 1px solid;
     236    background-color:#EEF0F2;
     237    text-align:center;
     238}
     239/*tr.RowToHighlight {
     240    padding:5px;
     241    border:3px black solid;
     242    margin:10px;
     243}
     244tr.RowToHighlight:hover {
     245    padding:30px;
     246    border:2px black solid;
     247}*/
    232248
    233249/**
     
    366382    border:1px #000000 solid;
    367383    padding:1px;
     384}
     385.FontButtonsStd {
     386    font-family:verdana,arial;
     387    font-size:13px;
     388    color:#FFFFFF;
     389}
     390
     391.FontButtonsSmall {
     392    font-family:verdana,arial;
     393    font-size:10px;
     394    color:#FFFFFF;
    368395}
    369396
Note: See TracChangeset for help on using the changeset viewer.