Changeset 74


Ignore:
Timestamp:
02/28/2010 02:31:16 AM (3 years ago)
Author:
someotherguy
Message:

Begin re-coding user-side.

Location:
trunk/Upload
Files:
26 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Upload/admin/manage/ad_articles.php

    r73 r74  
    232232                #============================= 
    233233 
    234                 if ( ! $a = $this->trellis->func->articles->get_single_by_id( array( 'id', 'cid', 'title', 'description', 'content', 'rating', 'votes', 'views', 'comments', 'html', 'date', 'modified', 'allow_comments', 'allow_rating' ), $this->trellis->input['id'] ) ) $this->trellis->skin->error('no_article'); 
     234                if ( ! $a = $this->trellis->func->articles->get_single_by_id( array( 'id', 'cid', 'title', 'description', 'content', 'rating_average', 'votes', 'views', 'comments', 'html', 'date', 'modified', 'allow_comments', 'allow_rating' ), $this->trellis->input['id'] ) ) $this->trellis->skin->error('no_article'); 
    235235 
    236236                #============================= 
     
    275275                ( $a['modified'] ) ? $a['modified_human'] = $this->trellis->td_timestamp( array( 'time' => $a['modified'], 'format' => 'long' ) ) : $a['modified_human'] = '--'; 
    276276 
    277                 $a['rating_visual'] = $this->trellis->skin->rating_visual( $a['rating'] ); 
     277                $a['rating_visual'] = $this->trellis->skin->rating_visual( $a['rating_average'] ); 
    278278 
    279279                if ( ! $a['description'] ) $a['description'] = '<i>{lang.no_description}</i>'; 
     
    282282                ( $a['allow_rating'] ) ? $a['rating_status'] = '({lang.enabled})' : $a['rating_status'] = '({lang.disabled})'; 
    283283 
    284                 $aoutput_params = array( 'urls' => 1 ); 
    285  
    286                 ( $a['html'] ) ? $aoutput_params['html'] = 1 : $aoutput_params['nl2br'] = 1; 
     284        $aoutput_params = array( 'linkify' => 1 ); 
     285 
     286            if ( $a['html'] ) 
     287                { 
     288                        $aoutput_params['html'] = 1; 
     289                } 
     290                else 
     291                { 
     292                        $aoutput_params['paragraphs'] = 1; 
     293                        $aoutput_params['nl2br'] = 1; 
     294                } 
    287295 
    288296                $a['content'] = $this->trellis->prepare_output( $a['content'], $aoutput_params ); 
     
    372380                                $c['date'] = $this->trellis->td_timestamp( array( 'time' => $c['date'], 'format' => 'long' ) ); 
    373381 
    374                                 $coutput_params = array( 'urls' => 1 ); 
    375  
    376                                 ( $c['html'] ) ? $coutput_params['html'] = 1 : $coutput_params['nl2br'] = 1; 
     382                        $coutput_params = array( 'linkify' => 1 ); 
     383 
     384                            if ( $c['html'] ) 
     385                                { 
     386                                        $coutput_params['html'] = 1; 
     387                                } 
     388                                else 
     389                                { 
     390                                        $coutput_params['paragraphs'] = 1; 
     391                                        $coutput_params['nl2br'] = 1; 
     392                                } 
    377393 
    378394                                $c['message'] = $this->trellis->prepare_output( $c['message'], $coutput_params ); 
    379395 
    380                                 /*if ( $c['signature'] ) $c['message'] .= '<br /><br />'. $this->trellis->prepare_output( $c['usignature'], array( 'html' => $c['sig_html'] ) );*/ 
     396                                if ( $c['signature'] ) $c['message'] .= '<br /><br />'. $this->trellis->prepare_output( $c['usignature'], array( 'html' => $c['sig_html'] ) ); # TODO: sigs on comments? 
    381397 
    382398                                $this->output .= "<div id='cc{$c['id']}'> 
     
    457473                                                                plugins : 'inlinepopups,safari,spellchecker', 
    458474                                                                dialog_type : 'modal', 
    459                                                                 forced_root_block : false, 
    460                                                                 force_br_newlines : true, 
    461                                                                 force_p_newlines : false, 
    462475                                                                theme_advanced_toolbar_location : 'top', 
    463476                                                                theme_advanced_toolbar_align : 'left', 
     
    747760 
    748761                if ( ! $this->trellis->input['title'] ) $this->add_article('no_title'); 
    749                 if ( ! $this->trellis->remove_extra_lbs( $this->trellis->input['content'] ) ) $this->add_article('no_content'); 
     762                if ( ! $this->trellis->input['content'] ) $this->add_article('no_content'); 
    750763 
    751764                #============================= 
     
    757770                                                  'title'                       => $this->trellis->input['title'], 
    758771                                                  'description'         => $this->trellis->input['description'], 
    759                                                   'content'                     => $this->trellis->remove_extra_lbs( $this->trellis->input['content'] ), 
     772                                                  'content'                     => $this->trellis->input['content'], 
    760773                                                  'allow_comments'      => $this->trellis->input['allow_comments'], 
    761774                                                  'allow_rating'        => $this->trellis->input['allow_rating'], 
     
    790803 
    791804                if ( ! $this->trellis->input['title'] ) $this->edit_article('no_title'); 
    792                 if ( ! $this->trellis->remove_extra_lbs( $this->trellis->input['content'] ) ) $this->edit_article('no_content'); 
     805                if ( ! $this->trellis->input['content'] ) $this->edit_article('no_content'); 
    793806 
    794807                #============================= 
     
    800813                                                  'title'                       => $this->trellis->input['title'], 
    801814                                                  'description'         => $this->trellis->input['description'], 
    802                                                   'content'                     => $this->trellis->remove_extra_lbs( $this->trellis->input['content'] ), 
     815                                                  'content'                     => $this->trellis->input['content'], 
    803816                                                  'allow_comments'      => $this->trellis->input['allow_comments'], 
    804817                                                  'allow_rating'        => $this->trellis->input['allow_rating'], 
     
    918931                # Security Checks 
    919932                #============================= 
    920  
    921                 if ( $this->trellis->input['html'] ) 
    922                 { 
    923                         $this->trellis->input['message'] = $this->trellis->remove_extra_lbs( $this->trellis->input['message'] ); 
    924                 } 
    925933 
    926934                if ( ! $this->trellis->input['message'] ) $this->view_article( array( 'comment_error' => 'no_message' ) ); 
     
    966974                # Security Checks 
    967975                #============================= 
    968  
    969                 if ( $this->trellis->input['html'] ) 
    970                 { 
    971                         $this->trellis->input['message'] = $this->trellis->remove_extra_lbs( $this->trellis->input['message'] ); 
    972                 } 
    973976 
    974977                if ( ! $this->trellis->input['message'] ) $this->trellis->skin->ajax_output( '0' ); 
  • trunk/Upload/admin/manage/ad_news.php

    r73 r74  
    124124                        foreach( $news as $nid => $n ) 
    125125                        { 
    126                                 if ( $n['excerpt'] ) 
    127                                 { 
    128                                         $n['content'] = $this->trellis->prepare_output( $n['excerpt'] ); 
    129                                 } 
    130                                 else 
    131                                 { 
    132                                         if ( $this->trellis->cache->data['settings']['news']['rte'] ) 
    133                                         { 
    134                                                 $n['content'] = $this->trellis->shorten_str( $this->trellis->remove_html( $this->trellis->convert_html( $n['content'] ) ), 80, 1 ); 
    135                                         } 
    136                                         else 
    137                                         { 
    138                                                 $n['content'] = $this->trellis->shorten_str( $n['excerpt'], 80, 1 ); 
    139                                         } 
    140                                 } 
     126                                if ( ! $n['excerpt'] ) $n['excerpt'] = '<i>{lang.no_excerpt}</i>'; 
    141127 
    142128                                $news_rows .= "<tr> 
    143129                                                                        <td class='bluecellthin-light'><strong>{$n['id']}</strong></td> 
    144130                                                                        <td class='bluecellthin-dark'><a href='<! HD_URL !>/admin.php?section=manage&amp;page=news&amp;act=view&amp;id={$n['id']}'>{$n['title']}</a></td> 
    145                                                                         <td class='bluecellthin-light' style='font-weight: normal'><a href='<! HD_URL !>/admin.php?section=manage&amp;page=news&amp;act=view&amp;id={$n['id']}'>{$n['content']}</a></td> 
     131                                                                        <td class='bluecellthin-light' style='font-weight: normal'><a href='<! HD_URL !>/admin.php?section=manage&amp;page=news&amp;act=view&amp;id={$n['id']}'>{$n['excerpt']}</a></td> 
    146132                                                                        <td class='bluecellthin-light' align='center'><a href='<! HD_URL !>/admin.php?section=manage&amp;page=news&amp;act=edit&amp;id={$n['id']}'><img src='<! IMG_DIR !>/button_edit.gif' alt='{lang.edit}' /></a></td> 
    147133                                                                        <td class='bluecellthin-light' align='center'><a href='<! HD_URL !>/admin.php?section=manage&amp;page=news&amp;act=dodel&amp;id={$n['id']}' onclick='return confirmDelete({$n['id']})'><img src='<! IMG_DIR !>/button_delete.gif' alt='{lang.delete}' /></a></td> 
     
    425411                                                                plugins : 'inlinepopups,safari,spellchecker', 
    426412                                                                dialog_type : 'modal', 
    427                                                                 forced_root_block : false, 
    428                                                                 force_br_newlines : true, 
    429                                                                 force_p_newlines : false, 
    430413                                                                theme_advanced_toolbar_location : 'top', 
    431414                                                                theme_advanced_toolbar_align : 'left', 
     
    700683 
    701684                if ( ! $this->trellis->input['title'] ) $this->add_news('no_title'); 
    702                 if ( ! $this->trellis->remove_extra_lbs( $this->trellis->input['content'] ) ) $this->add_news('no_content'); 
     685                if ( ! $this->trellis->input['content'] ) $this->add_news('no_content'); 
    703686 
    704687                #============================= 
    705688                # Add News 
    706689                #============================= 
     690 
     691                ( $this->trellis->input['html'] && $this->trellis->cache->data['settings']['news']['rte'] ) ? $html = 1 : $html = 0; 
    707692 
    708693                $db_array = array( 
     
    713698                                                  'email'                       => $this->trellis->input['email_users'], 
    714699                                                  'allow_comments'      => $this->trellis->input['allow_comments'], 
    715                                                   'html'                => $this->trellis->input['html'], 
     700                                                  'html'                => $html, 
    716701                                                  'date'                        => time(), 
    717702                                                  'ipadd'                       => $this->trellis->input['ip_address'], 
     
    726711                #============================= 
    727712 
    728                 // TO BE COMPLETED 
     713                # TODO: to be completed 
    729714 
    730715                #============================= 
     
    758743 
    759744                if ( ! $this->trellis->input['title'] ) $this->edit_news('no_title'); 
    760                 if ( ! $this->trellis->remove_extra_lbs( $this->trellis->input['content'] ) ) $this->edit_news('no_content'); 
     745                if ( ! $this->trellis->input['content'] ) $this->edit_news('no_content'); 
    761746 
    762747                #============================= 
    763748                # Update News 
    764749                #============================= 
     750 
     751                ( $this->trellis->input['html'] && $this->trellis->cache->data['settings']['news']['rte'] ) ? $html = 1 : $html = 0; 
    765752 
    766753                $db_array = array( 
     
    770757                                                  'content'                     => $this->trellis->input['content'], 
    771758                                                  'allow_comments'      => $this->trellis->input['allow_comments'], 
    772                                                   'html'                => $this->trellis->input['html'], 
     759                                                  'html'                => $html, 
    773760                                                 ); 
    774761 
  • trunk/Upload/admin/manage/ad_tickets.php

    r73 r74  
    11431143                $toutput_params = array( 'linkify' => 1 ); 
    11441144 
    1145                 ( $t['html'] ) ? $toutput_params['html'] = 1 : $toutput_params['nl2br'] = 1; 
     1145        if ( $t['html'] ) 
     1146        { 
     1147                $toutput_params['html'] = 1; 
     1148        } 
     1149        else 
     1150        { 
     1151                $toutput_params['paragraphs'] = 1; 
     1152                $toutput_params['nl2br'] = 1; 
     1153        } 
    11461154 
    11471155                $t['message'] = $this->trellis->prepare_output( $t['message'], $toutput_params ); 
     
    13631371                                $routput_params = array( 'linkify' => 1 ); 
    13641372 
    1365                                 if ( $r['html'] ) 
    1366                                 { 
    1367                                         $routput_params['html'] = 1; 
    1368                                 } 
    1369                                 else 
    1370                                 { 
    1371                                         $routput_params['nl2br'] = 1; 
    1372                                 } 
     1373                        if ( $r['html'] ) 
     1374                        { 
     1375                                $routput_params['html'] = 1; 
     1376                        } 
     1377                        else 
     1378                        { 
     1379                                $routput_params['paragraphs'] = 1; 
     1380                                $routput_params['nl2br'] = 1; 
     1381                        } 
    13731382 
    13741383                                $r['message'] = $this->trellis->prepare_output( $r['message'], $routput_params ); 
  • trunk/Upload/admin/manage/ad_users.php

    r73 r74  
    10801080                } 
    10811081 
    1082                 #* if staff member has updated sub-groups, merge with any hidden groups that may have already been selected 
     1082                # TODO: if staff member has updated sub-groups, merge with any hidden groups that may have already been selected 
    10831083 
    10841084                #============================= 
  • trunk/Upload/includes/classes/class_askin.php

    r72 r74  
    15421542        <script src="includes/scripts/jqueryextras.js" type="text/javascript"></script> 
    15431543        <script src="includes/tinymce/tiny_mce.js" type="text/javascript"></script> 
    1544         <script src="includes/scripts/global.js" type="text/javascript"></script> 
     1544        <script src="includes/scripts/common.js" type="text/javascript"></script> 
    15451545        <% JAVASCRIPT %> 
    15461546</head> 
  • trunk/Upload/includes/classes/class_session.php

    r52 r74  
    2222class td_class_session { 
    2323 
    24         var $user       = array(); 
     24        var $user = array(); 
    2525 
    2626        #======================================= 
    2727        # @ Load Session 
    28         # Loads the session.  What else? :D 
    29         #======================================= 
    30  
    31         function load_session() 
     28        #======================================= 
     29 
     30        public function load_session() 
    3231        { 
    33                 $authorized = 0; // Initialize for Security 
    34  
    35                 #============================= 
    36                 # Kill Any Bad Sessions 
    37                 #============================= 
    38  
    39                 $this->kill_old_tokens(); 
     32                $authorized = 0; 
    4033 
    4134                #============================= 
     
    8477                                        #============================= 
    8578 
     79                                        $location = array(); 
     80 
     81                                        if ( $this->trellis->input['page'] ) $location['page'] = $this->trellis->input['page']; 
     82                                        if ( $this->trellis->input['act'] ) $location['act'] = $this->trellis->input['act']; 
     83                                        if ( $this->trellis->input['id'] ) $location['id'] = $this->trellis->input['id']; 
     84 
    8685                                        $this->trellis->db->construct( array( 
    8786                                                                                                                         'update'       => 'sessions', 
    88                                                                                                                          'set'          => array( 's_location' => $this->trellis->input['act'], 's_time'        => time() ), 
     87                                                                                                                         'set'          => array( 's_location' => serialize( $location ), 's_time' => time() ), 
    8988                                                                                                                         'where'        => array( 's_id', '=', $this->user['s_id'] ), 
    9089                                                                                                                         'limit'        => array( 1 ), 
     
    249248        #======================================= 
    250249        # @ Do Login 
    251         # Attempt to login. 
    252         #======================================= 
    253  
    254         function do_login() 
     250        #======================================= 
     251 
     252        public function do_login() 
    255253        { 
    256254                #============================= 
     
    258256                #============================= 
    259257 
    260                 $this->trellis->check_token('login'); 
    261  
    262                 if ( ! $this->trellis->input['username'] || ! $this->trellis->input['password'] ) 
    263                 { 
    264                         $this->error('fill_form_completely', 1); 
    265                 } 
     258                if ( ! $this->trellis->input['username'] || ! $this->trellis->input['password'] ) $this->error( 'fill_form_completely', 1 ); 
    266259 
    267260                #============================= 
     
    285278                { 
    286279                        $this->error('login_no_user', 1); 
     280 
     281                        # TD LOG: name not found 
    287282                } 
    288283 
     
    299294                        #============================= 
    300295 
    301                         if ( ! $mem['val_email'] ) $this->error('login_must_val'); 
    302  
    303                         if ( ! $mem['val_admin'] ) $this->error('login_must_val_admin'); 
     296                        if ( ! $mem['val_email'] ) $this->error('login_must_val'); # TD LOG: no email val 
     297 
     298                        if ( ! $mem['val_admin'] ) $this->error('login_must_val_admin'); # TD LOG: no admin val 
    304299 
    305300                        #============================= 
     
    393388                else 
    394389                { 
    395                         $this->error('login_no_pass', 1); 
     390                        $this->error('login_no_pass', 1); # TD Log: incorrect pass 
    396391                } 
    397392        } 
     
    399394        #======================================= 
    400395        # @ Do Guest Login 
    401         # Attempt to login a guest. 
    402         #======================================= 
    403  
    404         function do_guest_login() 
     396        #======================================= 
     397 
     398        public function do_guest_login() 
    405399        { 
    406400                #============================= 
     
    408402                #============================= 
    409403 
    410                 if ( $onthefly ) 
     404                if ( $onthefly ) # TODO: guest tickets 
    411405                { 
    412406                        $this->trellis->input['email_address'] = $this->trellis->input['email']; 
    413407                        $this->trellis->input['ticket_key'] = $this->trellis->input['key']; 
    414408                } 
    415                 else 
    416                 { 
    417                         $this->trellis->check_token('glogin'); 
    418                 } 
    419409 
    420410                if ( ! $this->trellis->validate_email( $this->trellis->input['email_address'] ) ) 
    421411                { 
    422412                        $this->error('no_valid_email'); 
    423                 } 
    424  
    425                 if ( strlen( $this->trellis->input['ticket_key'] ) != 11 ) 
    426                 { 
    427                         $this->error('no_valid_tkey'); 
    428413                } 
    429414 
     
    442427                if ( $this->trellis->db->get_num_rows() != 1 ) 
    443428                { 
    444                         $this->error('no_ticket_guest'); 
     429                        $this->error('no_ticket_guest'); # TD LOG: guest ticket not found 
    445430                } 
    446431 
     
    473458        #======================================= 
    474459        # @ Do Logout 
    475         # Attempt to logout. 
    476         #======================================= 
    477  
    478         function do_logout() 
     460        #======================================= 
     461 
     462        public function do_logout() 
    479463        { 
    480464                if ( ! $this->trellis->user['id'] ) $this->error('logout_already_guest'); 
     
    556540        #======================================= 
    557541        # @ Kill Old Sessions 
    558         # Kills sessions older than the session 
    559         # timeout (defined in ACP). 
    560         #======================================= 
    561  
    562         function kill_old_sessions() 
     542        #======================================= 
     543 
     544        private function kill_old_sessions() 
    563545        { 
    564546                $timeout = time() - ( $this->trellis->cache->data['settings']['security']['session_timeout'] * 60 ); 
     
    578560 
    579561        #======================================= 
    580         # @ Kill Old Tokens 
    581         # Kills tokens older than 1 hour. 
    582         #======================================= 
    583  
    584         function kill_old_tokens() 
    585         { 
    586                 if ( $this->trellis->cache->data['settings']['security']['form_tokens'] ) 
    587                 { 
    588                         $timeout = time() - ( 60 * 60 ); 
    589  
    590                         $this->trellis->db->construct( array( 
    591                                                                                                          'delete'       => 'tokens', 
    592                                                                                                          'where'        => array( 'date', '<=', $timeout ), 
    593                                                                                           )     ); 
    594  
    595                         $this->trellis->db->next_shutdown(); 
    596                         $this->trellis->db->execute(); 
    597  
    598                         $num_killed = $this->trellis->db->get_num_rows(); 
    599  
    600                         return $num_killed; 
    601                 } 
    602         } 
    603  
    604         #======================================= 
    605562        # @ Error 
    606563        #======================================= 
    607564 
    608         function error($msg, $login=0) 
     565        private function error($msg, $login=0) 
    609566        { 
    610567                $this->trellis->load_skin(); 
  • trunk/Upload/includes/classes/class_skin.php

    r73 r74  
    2222class td_class_skin { 
    2323 
    24         private $data; 
     24        public $data; 
    2525        private $smarty; 
    2626 
     
    240240 
    241241                $this->set_var( 'user', &$this->trellis->user ); 
    242                 $this->set_var( 'cache', &$this->trellis->cache->data ); # TODO: let's try to all cache references in templates for speed 
     242                $this->set_var( 'cache', array( 'settings' => &$this->trellis->cache->data['settings'] ) ); # TODO: let's try to all cache references in templates for speed 
    243243                $this->set_var( 'input', &$this->trellis->input ); 
    244244 
  • trunk/Upload/includes/css/tiburon.css

    r73 r74  
    509509        padding: 0; 
    510510        margin: 0 0 12px 0; 
     511} 
     512 
     513.rollstart a, 
     514.rollcustomer a { 
     515    color: #36567f; 
     516    border-bottom: 1px dotted #92acc8; 
     517    text-decoration: none; 
     518} 
     519 
     520.rollstaff a { 
     521    color: #3c5311; 
     522    border-bottom: 1px dotted #99b070; 
     523    text-decoration: none; 
     524} 
     525 
     526.rollstaffonly a { 
     527    color: #7f291e; 
     528    border-bottom: 1px dotted #ca827c; 
     529    text-decoration: none; 
    511530} 
    512531 
  • trunk/Upload/includes/functions/func_articles.php

    r73 r74  
    2020*/ 
    2121 
    22 class td_func_articles { 
    23  
    24         public $error = ''; 
     22class td_func_articles extends td_func_template { 
    2523 
    2624        #======================================= 
     
    216214                $id = $this->trellis->db->get_insert_id(); 
    217215 
    218                 $this->trellis->db->construct( array( 
    219                                                                                                    'update'     => 'articles', 
    220                                                                                                    'set'        => array( 'comments' => array( '+', 1 ) ), 
    221                                                                                                    'where'      => array( 'id', '=', $aid ), 
    222                                                                                                    'limit'      => array( 1 ), 
    223                                                                                         )          ); 
     216                $this->increase_count( $aid, 1, 'comments' ); 
     217 
     218                return $id; 
     219        } 
     220 
     221        #======================================= 
     222        # @ Add Rating 
     223        #======================================= 
     224 
     225        public function add_rating($amount, $aid, $params=array()) 
     226        { 
     227                if ( ! $amount = intval( $amount ) ) return false; 
     228                if ( ! $aid = intval( $aid ) ) return false; 
     229 
     230                $sql_select = array(); 
     231 
     232                if ( ! isset( $params['rating_total'] ) ) $sql_select[] = 'rating_total'; 
     233                if ( ! isset( $params['votes'] ) ) $sql_select[] = 'votes'; 
     234 
     235                if ( ! empty( $sql_select ) ) 
     236                { 
     237                        if ( ! $a = $this->get_single_by_id( array( 'select' => $sql_select ), $id ) ) return false; 
     238                } 
     239 
     240                if ( ! isset( $params['rating_total'] ) ) $params['rating_total'] = $a['rating_total']; 
     241                if ( ! isset( $params['votes'] ) ) $params['votes'] = $a['votes']; 
     242 
     243                $db_array = array( 
     244                                                  'aid'                 => $aid, 
     245                                                  'uid'                 => $this->trellis->user['id'], 
     246                                                  'rating'              => $amount, 
     247                                                  'date'                => time(), 
     248                                                  'ipadd'               => $this->trellis->input['ip_address'], 
     249                                                 ); 
     250 
     251                $this->trellis->db->construct( array( 
     252                                                                                         'insert'       => 'article_rate', 
     253                                                                                         'set'          => $db_array, 
     254                                                                          )              ); 
     255 
     256                $this->trellis->db->execute(); 
     257 
     258                $id = $this->trellis->db->get_insert_id(); 
     259 
     260                $new_total = $params['rating_total'] + $amount; 
     261                $new_average = round( ( $new_total ) / ( $params['votes'] + 1 ), 2 ); 
     262 
     263                $this->trellis->db->construct( array( 
     264                                                                                         'update'       => 'articles', 
     265                                                                                         'set'          => array( 'rating_average' => $new_average, 'rating_total' => $new_total, 'votes' => ( $params['votes'] + 1 ) ), 
     266                                                                                         'where'        => array( 'id', '=', $aid ), 
     267                                                                                         'limit'        => array( 1 ), 
     268                                                                          )              ); 
    224269 
    225270                $this->trellis->db->execute(); 
     
    346391                $dc = $this->trellis->db->get_affected_rows(); 
    347392 
    348                 $this->trellis->db->construct( array( 
    349                                                                                                    'update'     => 'articles', 
    350                                                                                                    'set'        => array( 'comments' => array( '-', 1 ) ), 
    351                                                                                                    'where'      => array( 'id', '=', $params['aid'] ), 
    352                                                                                                    'limit'      => array( 1 ), 
    353                                                                                         )          ); 
    354  
    355                 $this->trellis->db->next_shutdown(); 
    356                 $this->trellis->db->execute(); 
     393                $this->decrease_count( $params['aid'], 1, 'comments' ); 
    357394 
    358395                return $dc; 
    359396        } 
    360397 
     398        #======================================= 
     399        # @ Increase Count 
     400        #======================================= 
     401 
     402        public function increase_count($id, $amount, $field, $now=0) 
     403        { 
     404                $this->update_stats( $id, $amount, 'articles', $field, 'increase', $now ); 
     405        } 
     406 
     407        #======================================= 
     408        # @ Decrease Count 
     409        #======================================= 
     410 
     411        public function decrease_count($id, $amount, $field, $now=0) 
     412        { 
     413                $this->update_stats( $id, $amount, 'articles', $field, 'decrease', $now ); 
     414        } 
     415 
    361416} 
    362417 
  • trunk/Upload/includes/functions/func_rebuild.php

    r73 r74  
    123123        $to_cache = array(); 
    124124 
    125         if ( ! $limit ) $limit = $this->trellis->cache->data['settings']['news']['portal_amount']; 
    126  
    127         $this->trellis->db->construct( array( 
    128                                                                                          'select'       => array( 'id', 'title', 'excerpt', 'content', 'date' ), 
     125        if ( ! $limit ) $limit = $this->trellis->cache->data['settings']['news']['dashboard_amount']; 
     126 
     127        $this->trellis->db->construct( array( 
     128                                                                                         'select'       => array( 'id', 'title', 'excerpt', 'date' ), 
    129129                                                                                         'from'     => 'news', 
    130130                                                                                         'order'        => array( 'date' => 'desc' ), 
     
    136136                while ( $a = $this->trellis->db->fetch_row() ) 
    137137                { 
    138                         if ( ! $a['excerpt'] ) 
    139                         { 
    140                                 if ( $this->trellis->cache->data['settings']['news']['rte'] ) 
    141                                 { 
    142                                         if ( $this->trellis->cache->data['settings']['news']['excerpt_trim'] ) 
    143                                         { 
    144                                                 $a['excerpt'] = $this->trellis->shorten_str( $this->trellis->remove_html( $this->trellis->remove_dbl_spaces( $this->trellis->convert_html( $a['content'] ) ) ), $this->trellis->cache->data['settings']['news']['excerpt_trim'], 1 ); 
    145                                         } 
    146                                         else 
    147                                         { 
    148                                                 $a['excerpt'] = $this->trellis->remove_html( $this->trellis->remove_dbl_spaces( $this->trellis->convert_html( $a['content'] ) ) ); 
    149                                         } 
    150                                 } 
    151                                 else 
    152                                 { 
    153                                         if ( $this->trellis->cache->data['settings']['news']['excerpt_trim'] ) 
    154                                         { 
    155                                                 $a['excerpt'] = $this->trellis->shorten_str( $a['content'], $this->trellis->cache->data['settings']['news']['excerpt_trim'], 1 ); 
    156                                         } 
    157                                         else 
    158                                         { 
    159                                                 $a['excerpt'] = $a['content']; 
    160                                         } 
    161                                 } 
    162                         } 
    163  
    164                         unset( $a['content'] ); 
    165  
    166138                        $to_cache[ $a['id'] ] = $a; 
    167139                } 
  • trunk/Upload/includes/trellis.php

    r73 r74  
    8080 
    8181            $this->db = new td_class_db_mysql( array( 'host' => $this->config['db_host'], 'user' => $this->config['db_user'], 'pass' => $this->config['db_pass'], 'name' => $this->config['db_name'], 'prefix' => $this->config['db_prefix'], 'shutdown_queries' => $this->config['db_shutdown_queries'] ) ); 
     82 
     83                #============================= 
     84                # Load Templates 
     85                #============================= 
     86 
     87            require_once HD_FUNC .'template.php'; 
    8288        } 
    8389 
     
    210216                        if( ! $this->func->$name ) 
    211217                { 
    212                     if ( file_exists( HD_INC .'functions/func_'. $name .'.php' ) ) 
     218                    if ( file_exists( HD_FUNC . $name .'.php' ) ) 
    213219                        { 
    214                                 require_once HD_INC .'functions/func_'. $name .'.php'; 
     220                                require_once HD_FUNC . $name .'.php'; 
    215221 
    216222                                $class_name = 'td_func_'. $name; 
     
    566572                if ( ! $this->htmlpurifier ) require_once HD_INC .'htmlpurifier/HTMLPurifier.standalone.php'; 
    567573 
    568                 $key = base64_encode( serialize( array( 'html' => $params['html'], 'linkify' => $params['linkify'] ) ) ); 
     574                $key = base64_encode( serialize( array( 'html' => $params['html'], 'paragraphs' => $params['paragraphs'], 'linkify' => $params['linkify'] ) ) ); 
    569575 
    570576                if ( ! $this->htmlp_configs[ $key ] ) 
     
    577583                        if ( ! $params['html'] ) 
    578584                        { 
    579                                 $config->set( 'AutoFormat.AutoParagraph', true ); 
     585                                if ( $params['paragraphs'] ) $config->set( 'AutoFormat.AutoParagraph', true ); 
     586 
    580587                                $config->set( 'HTML.Allowed', 'p,br,a[href]' ); 
    581588 
     
    12841291 
    12851292        #======================================= 
    1286         # @ Check Token 
    1287         # Check form token with database. 
    1288         #======================================= 
    1289  
    1290         function check_token($type) 
    1291         { 
    1292                 if ( $this->cache->data['settings']['security']['form_tokens'] ) 
    1293                 { 
    1294                         if ( $this->cache->data['settings']['security']['token_ip_check'] ) 
    1295                         { 
    1296                                 $sql_where = array( array( 'token', '=', $this->input['token'] ), array( 'type', '=', $type, 'and' ), array( 'ipadd', '=', $this->input['ip_address'], 'and' ) ); 
    1297                         } 
    1298                         else 
    1299                         { 
    1300                                 $sql_where = array( array( 'token', '=', $this->input['token'] ), array( 'type', '=', $type, 'and' ) ); 
    1301                         } 
    1302  
    1303                         $this->db->construct( array( 
    1304                                                                                           'select'      => array( 'id' ), 
    1305                                                                                           'from'        => 'tokens', 
    1306                                                                                           'where'       => $sql_where, 
    1307                                                                                           'limit'       => array( 0, 1 ), 
    1308                                                                            )    ); 
    1309  
    1310                         $this->db->execute(); 
    1311  
    1312                         if ( $this->db->get_num_rows() ) 
    1313                         { 
    1314                                 $this->db->construct( array( 
    1315                                                                                                   'delete'      => 'tokens', 
    1316                                                                                                   'where'       => array( 'token', '=', $this->input['token'] ), 
    1317                                                                                                   'limit'       => array( 1 ), 
    1318                                                                                    )    ); 
    1319  
    1320                                 $this->db->next_shutdown(); 
    1321                                 $this->db->execute(); 
    1322  
    1323                                 return TRUE; 
    1324                         } 
    1325                         else 
    1326                         { 
    1327                                 $this->skin->error('token_mismatch'); 
    1328                         } 
    1329                 } 
    1330                 else 
    1331                 { 
    1332                         return TRUE; 
    1333                 } 
    1334         } 
    1335  
    1336         #======================================= 
    13371293        # @ Check Ticket Auto Close 
    13381294        # Check tickets for ones that need to 
  • trunk/Upload/install/index.php

    r37 r74  
    17961796                @import "../includes/local.css"; 
    17971797        </style> 
    1798         <script src='../includes/scripts/global.js' type='text/javascript'></script> 
     1798        <script src='../includes/scripts/common.js' type='text/javascript'></script> 
    17991799        <script src='../includes/scripts/prototype.js' type='text/javascript'></script> 
    18001800        <script src='../includes/scripts/scriptaculous.js' type='text/javascript'></script> 
  • trunk/Upload/language/en/lang_global.php

    r64 r74  
    1414'account_info' => 'Account Information', 
    1515'admin' => 'Admin', 
    16 'announcements' => 'Announcements', 
    1716'bytes' => 'Bytes', 
    1817'closed' => 'Closed', 
     
    8988'submitted' => 'Submitted', 
    9089'ticket_history' => 'Ticket History', 
    91 'ticket_overview' => 'Ticket Overview', 
     90'tickets_overview' => 'Tickets Overview', 
    9291'tickets' => 'Tickets', 
    9392'today' => 'Today', 
     
    106105'guest_tag' => '&#40;Guest&#41;', 
    107106'antispam_captcha' => 'Captcha', 
     107'read_on' => 'Click to read...', 
     108'no_excerpt' => 'No excerpt', 
    108109 
    109110); 
  • trunk/Upload/language/en/lang_knowledgebase.php

    r21 r74  
    3434'sub_categories' => 'Sub-Categories', 
    3535'no_description' => 'No description', 
     36'alert_rating_added' => 'Your rating has been successfully added.', 
    3637 
    3738); 
  • trunk/Upload/skin/s1/acc_change_email.tpl

    r20 r74  
    1818        <div class="formtail"><input type="submit" name="submit" id="change" value="{$lang['change_email_button']}" class="button" /></div> 
    1919        </form> 
    20         <script type="text/javascript"> 
    21         {lv_field name="new_email"} 
    22         {lv_rule name="new_email" type="presence"} 
    23         {lv_rule name="new_email" type="email"} 
    24         {lv_field name="new_email_b"} 
    25         {lv_rule name="new_email_b" type="presence"} 
    26         {lv_rule name="new_email_b" type="email"} 
    27         {lv_rule name="new_email_b" type="match" against="new_email"} 
    28         {focus name="new_email"} 
    29         </script> 
    3020</div> 
     21<script type="text/javascript"> 
     22//<![CDATA[ 
     23{lv_field name="new_email"} 
     24{lv_rule name="new_email" type="presence"} 
     25{lv_rule name="new_email" type="email"} 
     26{lv_field name="new_email_b"} 
     27{lv_rule name="new_email_b" type="presence"} 
     28{lv_rule name="new_email_b" type="email"} 
     29{lv_rule name="new_email_b" type="match" against="new_email"} 
     30{focus name="new_email"} 
     31//]]> 
     32</script> 
  • trunk/Upload/skin/s1/acc_change_pass.tpl

    r20 r74  
    2222        <div class="formtail"><input type="submit" name="submit" id="change" value="{$lang['change_pass_button']}" class="button" /></div> 
    2323        </form> 
    24         <script type="text/javascript"> 
    25         {lv_field name="current_pass"} 
    26         {lv_rule name="current_pass" type="presence"} 
    27         {lv_field name="new_pass"} 
    28         {lv_rule name="new_pass" type="presence"} 
    29         {lv_field name="new_pass_b"} 
    30         {lv_rule name="new_pass_b" type="presence"} 
    31         {lv_rule name="new_pass_b" type="match" against="new_pass"} 
    32         {focus name="current_pass"} 
    33         </script> 
    3424</div> 
     25<script type="text/javascript"> 
     26//<![CDATA[ 
     27{lv_field name="current_pass"} 
     28{lv_rule name="current_pass" type="presence"} 
     29{lv_field name="new_pass"} 
     30{lv_rule name="new_pass" type="presence"} 
     31{lv_field name="new_pass_b"} 
     32{lv_rule name="new_pass_b" type="presence"} 
     33{lv_rule name="new_pass_b" type="match" against="new_pass"} 
     34{focus name="current_pass"} 
     35//]]> 
     36</script> 
  • trunk/Upload/skin/s1/acc_modify.tpl

    r73 r74  
    9898        {if $validate} 
    9999        <script type="text/javascript"> 
     100        //<![CDATA[ 
    100101        {foreach $validate as $f} 
    101102        {lv_field name=$f} 
    102103        {lv_rule name=$f type="presence"} 
    103104        {/foreach} 
     105        //]]> 
    104106        </script> 
    105107        {/if} 
  • trunk/Upload/skin/s1/dashboard.tpl

    r44 r74  
    33        <tr> 
    44                <td width="1%" style="padding:0 8px 7px 8px"> 
    5                         <a href="{$td_url}/index.php?page=tickets&act=open"><img src="{$img_url}/ticket_icon.gif" alt="{$lang['open_ticket']}" /></a> 
     5                        <a href="{$td_url}/index.php?page=tickets&amp;act=open"><img src="{$img_url}/ticket_icon.gif" alt="{$lang['open_ticket']}" /></a> 
    66                </td> 
    77                <td width="46%"> 
    8                         <span class="blbig"><a href="{$td_url}/index.php?page=tickets&act=open">{$lang['open_ticket']}</a></span> 
     8                        <span class="blbig"><a href="{$td_url}/index.php?page=tickets&amp;act=open">{$lang['open_ticket']}</a></span> 
    99                </td> 
    1010                {if $cache['settings']['kb']['enable'] && $user['g_kb_access']} 
     
    1717                {else} 
    1818                <td width="1%" style="padding:0 8px 7px 8px"> 
    19                         <a href="{$td_url}/index.php?page=tickets&act=history"><img src="{$img_url}/kb_icon.gif" alt="{$lang['ticket_history']}" /></a> 
     19                        <a href="{$td_url}/index.php?page=tickets&amp;act=history"><img src="{$img_url}/kb_icon.gif" alt="{$lang['ticket_history']}" /></a> 
    2020                </td> 
    2121                <td width="52%"> 
    22                         <span class="blbig"><a href="{$td_url}/index.php?page=tickets&act=history">{$lang['ticket_history']}</a></span> 
     22                        <span class="blbig"><a href="{$td_url}/index.php?page=tickets&amp;act=history">{$lang['ticket_history']}</a></span> 
    2323                </td> 
    2424                {/if} 
     
    2727        <tr> 
    2828                <td colspan="4"> 
    29                         <div class="groupbox">{if $cache['settings']['news']['page']}<a href="{$td_url}/index.php?page=news">{/if}{$lang['announcements']}{if $cache['settings']['news']['page']}</a>{/if}</div> 
     29                        <div class="groupbox">{if $cache['settings']['news']['page']}<a href="{$td_url}/index.php?page=news">{/if}{$lang['news']}{if $cache['settings']['news']['page']}</a>{/if}</div> 
    3030                        {foreach $news as $n} 
    31                         <div class="subbox">{if $cache['settings']['news']['page']}<a href="{$td_url}/index.php?page=news&act=view&id={$n['id']}">{/if}{$n['title']}{if $cache['settings']['news']['page']}</a>{/if}<span class="date"> -- {$n['date']}</span></div> 
     31                        <div class="subbox">{if $cache['settings']['news']['page']}<a href="{$td_url}/index.php?page=news&amp;act=view&amp;id={$n['id']}">{/if}{$n['title']}{if $cache['settings']['news']['page']}</a>{/if}<span class="date"> -- {$n['date_human']}</span></div> 
    3232                        <div class="row1"> 
     33                                {if $n['excerpt']} 
    3334                                {$n['excerpt']} 
     35                                {else} 
     36                                {if $cache['settings']['news']['page']}<a href="{$td_url}/index.php?page=news&amp;act=view&amp;id={$n['id']}">{$lang['read_on']}</a>{else}<i>{$lang['no_excerpt']}</i>{/if} 
     37                                {/if} 
    3438                        </div> 
    3539                        {/foreach} 
     
    4044        <tr> 
    4145                <td colspan="4"> 
    42                         <div class="groupbox">{$lang['ticket_overview']}</div> 
     46                        <div class="groupbox">{$lang['tickets_overview']}</div> 
    4347                        <table width="100%" cellpadding="3" cellspacing="0" class="smtable"> 
    4448                        <tr> 
     
    5256                        {if $user['id'] or $user['s_tkey']} 
    5357                        {if $tickets} 
     58                        {$ticket_rows = 0} 
    5459                        {foreach $tickets as $t} 
     60                        {$ticket_rows = $ticket_rows+1} 
     61                        {if $ticket_rows & 1}{$ticket_class = 1}{else}{$ticket_class = 2}{/if} 
    5562                        <tr> 
    56                                 <td class="option{$t['class']}-mini"><a href="{$td_url}/index.php?page=tickets&act=view&id={$t['mask']}">{$t['mask']}</a></td> 
    57                                 <td class="option{$t['class']}-mini"><a href="{$td_url}/index.php?page=tickets&act=view&id={$t['mask']}">{if $t['escalated']}<img src='{$img_url}/icon_escalate.png' alt='E' style='vertical-align:middle;margin-bottom:2px' />&nbsp;{/if}{$t['subject']}</a></td> 
    58                                 <td class="option{$t['class']}-mini"><img src="{$td_url}/images/priorities/{$t['icon_regular']}" alt="{$t['pname']}" class="prioritybox" />&nbsp;&nbsp;{$t['pname']}</td> 
    59                                 <td class="row{$t['class']}-mini">{$t['dname']}</td> 
    60                                 <td class="row{$t['class']}-mini">{$t['last_reply']}</td> 
    61                                 <td class="option{$t['class']}-mini">{$t['status_abbr']}</td> 
     63                                <td class="option{$ticket_class}-mini"><a href="{$td_url}/index.php?page=tickets&amp;act=view&amp;id={$t['mask']}">{$t['mask']}</a></td> 
     64                                <td class="option{$ticket_class}-mini"><a href="{$td_url}/index.php?page=tickets&amp;act=view&amp;id={$t['mask']}">{if $t['escalated']}<img src='{$img_url}/icon_escalate.png' alt='E' style='vertical-align:middle;margin-bottom:2px' />&nbsp;{/if}{$t['subject']}</a></td> 
     65                                <td class="option{$ticket_class}-mini"><img src="{$td_url}/images/priorities/{$t['icon_regular']}" alt="{$t['pname']}" class="prioritybox" />&nbsp;&nbsp;{$t['pname']}</td> 
     66                                <td class="row{$ticket_class}-mini">{$t['dname']}</td> 
     67                                <td class="row{$ticket_class}-mini">{$t['last_reply_human']}</td> 
     68                                <td class="option{$ticket_class}-mini">{$t['status_abbr']}</td> 
    6269                        </tr> 
    6370                        {/foreach} 
     
    8491                        <div class="row1"> 
    8592                                {foreach $recent_articles as $a} 
    86                                 <a href="{$td_url}/index.php?page=kb&act=view&id={$a['id']}" title="{$a['description']}">{$a['title']}</a><br /> 
     93                                <a href="{$td_url}/index.php?page=kb&amp;act=view&amp;id={$a['id']}" title="{$a['description']}">{$a['title']}</a><br /> 
    8794                                {/foreach} 
    8895                        </div> 
     
    94101                        <div class="row1"> 
    95102                                {foreach $popular_articles as $a} 
    96                                 <a href="{$td_url}/index.php?page=kb&act=view&id={$a['id']}" title="{$a['description']}">{$a['title']}</a><br /> 
     103                                <a href="{$td_url}/index.php?page=kb&amp;act=view&amp;id={$a['id']}" title="{$a['description']}">{$a['title']}</a><br /> 
    97104                                {/foreach} 
    98105                        </div> 
  • trunk/Upload/skin/s1/kb_article.tpl

    r25 r74  
    1 <script type="text/javascript"> 
    2         function amirate(rate) 
    3         { 
    4                 rating = Math.round(rate); 
    5  
    6             for ( x = 1; x < rate + 1; x++ ) 
    7             { 
    8                 document.images["rate"+x].src = "{$img_url}/rate_hover.gif"; 
    9             } 
    10         } 
    11         function unamirate(rating) 
    12         { 
    13                 rating = Math.round(rating); 
    14  
    15             for ( x = 1; x <= rating; x++ ) 
    16             { 
    17                 document.images["rate"+x].src = "{$img_url}/rate_on.gif"; 
    18             } 
    19  
    20             for ( x = x; x <= 5; x++ ) 
    21             { 
    22                 document.images["rate"+x].src = "{$img_url}/rate_off.gif"; 
    23             } 
    24         } 
    25         function validate_form(form) 
    26         { 
    27                 if ( ! form.comment.value ) 
    28                 { 
    29                         alert("{$lang['err_no_comment']}"); 
    30                         form.comment.focus(); 
    31                         return false; 
    32                 } 
    33         } 
    34         function sure_delete() 
    35         { 
    36                 if ( confirm("{$lang['confirm_delete']}") ) 
    37                 { 
    38                         return true; 
    39                 } 
    40                 else 
    41                 { 
    42                         return false; 
    43                 } 
    44         } 
    45 </script> 
    461<div class="content_block"> 
    472        <h1>{$lang['viewing_article']}</h1> 
     3        {if $alert}<div class="alert">{$alert}</div>{/if} 
    484        <div class="groupbox"><div style="float:right">{$rate} | {$a['date_human']} | <a href="{$td_url}/index.php?page=kb&amp;act=print&amp;id={$a['id']}">{$lang['print']}</a></div>{$a['title']}</div> 
    49         <div class="row1"> 
     5        <div class="row1 post"> 
    506                {$a['content']} 
    517        </div> 
    528 
    539        {if $comments} 
     10        {$comments_count = 0} 
    5411        {foreach $comments as $c} 
     12        {$comments_count = $comments_count+1} 
     13        {if $comments_count & 1}{$comments_class = 2}{else}{$comments_class = 1}{/if} 
    5514        <a name="com{$c['id']}"></a> 
    56         <div class="subbox{$c['class_staff']}"><div class="links" style="float:right">{$c['time_ago']}{if $user['g_kb_com_edit'] && $c['uid'] == $user['id']}&nbsp;&nbsp;<a href="{$td_url}/index.php?page=kb&amp;act=editcomment&amp;id={$c['id']}"><img src="{$img_url}/edit_icon.gif" alt="{$lang['edit']}" id="edit_{$c['id']}" style="vertical-align: middle" /></a>{/if}{if $user['g_kb_com_delete'] && $c['uid'] == $user['id']}&nbsp;&nbsp;<a href="{$td_url}/index.php?page=kb&amp;act=dodeletecomment&amp;id={$c['id']}" onclick="return sure_delete()"><img src="{$img_url}/delete_icon.gif" alt="{$lang['delete']}" id="delete_{$c['id']}" style="vertical-align: middle" /></a>{/if}</div>{$c['uname']} -- {$c['date']}</div> 
    57         <div class="row{$c['class']}"> 
     15        <div class="subbox{if $c['staff']}staff{/if}"> 
     16                <div class="links" style="float:right">{$c['time_ago']}{if $c['can_edit']}&nbsp;&nbsp;<a href="{$td_url}/index.php?page=kb&amp;act=editcomment&amp;id={$c['id']}"><img src="{$img_url}/edit_icon.gif" alt="{$lang['edit']}" id="edit_{$c['id']}" style="vertical-align: middle" /></a>{/if}{if $c['can_delete']}&nbsp;&nbsp;<a href="{$td_url}/index.php?page=kb&amp;act=dodeletecomment&amp;id={$c['id']}" onclick="return sure_delete()"><img src="{$img_url}/delete_icon.gif" alt="{$lang['delete']}" id="delete_{$c['id']}" style="vertical-align: middle" /></a>{/if} 
     17                </div>{$c['uname']} -- {$c['date_human']} 
     18        </div> 
     19        <div class="row{$comments_class} post"> 
    5820                {$c['message']} 
    5921        </div> 
    6022        {/foreach}<br /> 
    61         {elseif $cache['settings']['kb']['allow_comments'] && ! $a['dis_comments']} 
     23        {elseif $a['can_comment']} 
    6224        <div class="option2-mini">{$lang['no_comments']}</div> 
    6325        {/if} 
    6426 
    65         {if $show_comment_form} 
     27        {if $a['can_comment']} 
    6628        <br /> 
    67         {if $error} 
    68         <div class="critical">{$error}</div> 
    69         {/if} 
     29        {if $error}<div class="critical">{$error}</div>{/if} 
    7030        <div class="groupbox">{$lang['add_a_comment']}</div> 
    71         <form action="{$td_url}/index.php?page=kb&amp;act=doaddcomment&amp;id={$a['id']}" method="post" onsubmit="return validate_form(this)"> 
     31        <form action="{$td_url}/index.php?page=kb&amp;act=doaddcomment&amp;id={$a['id']}" method="post"> 
    7232        <div class="option1"><textarea name="message" id="message" rows="6" cols="100" style="width: 98%; height: 100px;">{$input['message']}</textarea></div> 
    7333        <div class="formtail"><input type="submit" name="submit" id="send" value="{$lang['add_comment_button']}" class="button" /></div> 
     
    7535        {/if} 
    7636</div> 
     37<script type="text/javascript"> 
     38//<![CDATA[ 
     39function amirate(rate) { 
     40        rating = Math.round(rate); 
     41 
     42    for ( x = 1; x < rate + 1; x++ ) { 
     43        document.images["rate"+x].src = "{$img_url}/rate_hover.gif"; 
     44    } 
     45} 
     46function unamirate(rating) { 
     47        rating = Math.round(rating); 
     48 
     49    for ( x = 1; x <= rating; x++ ) { 
     50        document.images["rate"+x].src = "{$img_url}/rate_on.gif"; 
     51    } 
     52 
     53    for ( x = x; x <= 5; x++ ) { 
     54        document.images["rate"+x].src = "{$img_url}/rate_off.gif"; 
     55    } 
     56} 
     57function sure_delete() { 
     58        if ( confirm("{$lang['confirm_delete']}") ) { 
     59                return true; 
     60        } 
     61        else { 
     62                return false; 
     63        } 
     64} 
     65//]]> 
     66</script> 
  • trunk/Upload/skin/s1/wrapper.tpl

    r71 r74  
    66        <link href="{$tpl_url}/style.css" rel="stylesheet" type="text/css" media="all" /> 
    77        <script src="{$td_url}/includes/jquery/js/jquery.js" type="text/javascript"></script> 
    8         <script src="{$td_url}/includes/scripts/global.js" type="text/javascript"></script> 
     8        <script src="{$td_url}/includes/scripts/common.js" type="text/javascript"></script> 
    99        <script src="{$td_url}/includes/scripts/livevalidation.js" type="text/javascript"></script> 
    1010</head> 
  • trunk/Upload/skin/s2/wrapper.tpl

    r11 r74  
    55        <title>{$title}</title> 
    66        <link href='{$tpl_url}/style.css' rel='stylesheet' type='text/css' media='all' /> 
    7         <script src='{$td_url}/includes/scripts/global.js' type='text/javascript'></script> 
     7        <script src='{$td_url}/includes/scripts/common.js' type='text/javascript'></script> 
    88</head> 
    99<body> 
  • trunk/Upload/sources/account.php

    r73 r74  
    122122                #============================= 
    123123 
    124                 if ( $alert ) 
    125                 { 
    126                         $this->trellis->skin->set_var( 'alert', $this->trellis->lang[ 'alert_'. $alert ] ); 
    127                 } 
     124                if ( $alert ) $this->trellis->skin->set_var( 'alert', $this->trellis->lang[ 'alert_'. $alert ] ); 
    128125 
    129126                $this->trellis->skin->set_var( 'sub_tpl', 'account.tpl' ); 
     
    271268                #============================= 
    272269 
    273                 if ( $error ) 
    274                 { 
    275                         $this->trellis->skin->set_var( 'error', $this->trellis->lang[ 'err_'. $error ] ); 
    276                 } 
     270                if ( $error ) $this->trellis->skin->set_var( 'error', $this->trellis->lang[ 'err_'. $error ] ); 
    277271 
    278272                $this->nav = array( 
     
    332326                #============================= 
    333327 
    334                 if ( $error ) 
    335                 { 
    336                         $this->trellis->skin->set_var( 'error', $this->trellis->lang[ 'err_'. $error ] ); 
    337                 } 
     328                if ( $error ) $this->trellis->skin->set_var( 'error', $this->trellis->lang[ 'err_'. $error ] ); 
    338329 
    339330                $this->nav = array( 
  • trunk/Upload/sources/dashboard.php

    r64 r74  
    3232                #============================= 
    3333 
    34                 if ( $this->trellis->cache->data['settings']['news']['enable'] && $this->trellis->cache->data['settings']['news']['portal'] ) 
     34                if ( $this->trellis->cache->data['settings']['news']['enable'] && $this->trellis->cache->data['settings']['news']['dashboard'] ) 
    3535                { 
    36                         $final_a = array(); 
    37                         $row_count = 0; 
    38                         $news = 0; 
    39  
    4036                        if ( ! empty( $this->trellis->cache->data['news'] ) ) 
    4137                        { 
    42                                 while ( list( $id, $a ) = each( $this->trellis->cache->data['news'] ) ) 
     38                                $news = array(); 
     39 
     40                                foreach( $this->trellis->cache->data['news'] as $n ) 
    4341                                { 
     42                                        $news[ $n['id'] ] = $n; 
     43 
    4444                                        #============================= 
    4545                                        # Fix Up Information 
    4646                                        #============================= 
    4747 
    48                                         $row_count ++; 
    49  
    50                                         ( $row_count & 1 ) ? $a['class'] = 1 : $a['class'] = 2; 
    51  
    52                                         $a['date'] = $this->trellis->td_timestamp( array( 'time' => $a['date'], 'format' => 'short' ) ); 
    53  
    54                                         $final_a[] = $a; 
     48                                        $news[ $n['id'] ]['date_human'] = $this->trellis->td_timestamp( array( 'time' => $a['date'], 'format' => 'short' ) ); 
    5549                                } 
    5650 
    57                                 $this->trellis->skin->set_var( 'news', $final_a ); 
     51                                $this->trellis->skin->set_var( 'news', $news ); 
    5852                        } 
    5953                } 
     
    10195 
    10296                                $ticket_rows = array(); 
    103                                 $row_count = 0; 
    10497 
    10598                                if ( $tickets ) 
     
    111104                                                #============================= 
    112105 
    113                                                 $row_count ++; 
    114  
    115                                                 ( $row_count & 1 ) ? $t['class'] = 1 : $t['class'] = 2; 
    116  
    117                                                 if ( $t['date'] ) $t['date'] = $this->trellis->td_timestamp( array( 'time' => $t['date'], 'format' => 'short' ) ); 
    118                                                 if ( $t['last_reply'] ) $t['last_reply'] = $this->trellis->td_timestamp( array( 'time' => $t['last_reply'], 'format' => 'short' ) ); 
     106                                                if ( $t['date'] ) $t['date_human'] = $this->trellis->td_timestamp( array( 'time' => $t['date'], 'format' => 'short' ) ); 
     107                                                if ( $t['last_reply'] ) $t['last_reply_human'] = $this->trellis->td_timestamp( array( 'time' => $t['last_reply'], 'format' => 'short' ) ); 
    119108 
    120109                                        if ( ! $t['status_abbr'] ) $t['status_abbr'] = $t['status_name']; 
  • trunk/Upload/sources/knowledgebase.php

    r48 r74  
    1616|    @ Build: <#TAG_VER_BUILD_TAG#> 
    1717#====================================================== 
    18 |    | Knowledge Base :: Sources 
     18|    | Sources :: Knowledge Base 
    1919#====================================================== 
    2020*/ 
    2121 
    22 class knowledgebase { 
     22class td_source_knowledgebase { 
    2323 
    2424        #======================================= 
    2525        # @ Auto Run 
    26         # Function that is run automatically 
    27         # when the file is required. 
    2826        #======================================= 
    2927 
     
    3129        { 
    3230                #============================= 
     31                # Security Checks 
     32                #============================= 
     33 
     34                if ( ! $this->trellis->cache->data['settings']['kb']['enable'] ) $this->trellis->skin->error('kb_disabled'); 
     35 
     36                if ( ! $this->trellis->user['g_kb_access'] || $this->trellis->user['ban_kb'] ) 
     37                { 
     38                        $this->trellis->log( 'security', "Blocked Access Knowledge Base" ); 
     39 
     40                        $this->trellis->skin->error('banned_kb'); 
     41                } 
     42 
     43                #============================= 
    3344                # Initialize 
    3445                #============================= 
    35  
    36                 if ( ! $this->trellis->cache->data['settings']['kb']['enable'] ) 
    37                 { 
    38                         $this->trellis->skin->error('kb_disabled'); 
    39                 } 
    40  
    41                 if ( ! $this->trellis->user['g_kb_access'] || $this->trellis->user['ban_kb'] ) 
    42                 { 
    43                         $this->trellis->log( 'security', "Blocked Access Knowledge Base" ); 
    44  
    45                         $this->trellis->skin->error('banned_kb'); 
    46                 } 
    4746 
    4847                $this->trellis->load_lang('knowledgebase'); 
     
    5958                                $this->do_search(); 
    6059                break; 
    61                 case 'rate': 
    62                                 $this->do_rate(); 
    63                 break; 
    6460 
    6561                case 'editcomment': 
     
    7571                case 'dodeletecomment': 
    7672                                $this->do_delete_comment(); 
     73                break; 
     74                case 'dorate': 
     75                                $this->do_rate(); 
    7776                break; 
    7877 
     
    124123                $this->trellis->load_functions('categories'); 
    125124 
    126                 if ( ! $c = $this->trellis->func->categories->get_single_by_id( array( 'id', 'name', 'description', 'articles' ), $this->trellis->input['id'] ) ) 
    127                 { 
    128                         $this->trellis->skin->error('no_category'); 
    129                 } 
     125                if ( ! $c = $this->trellis->func->categories->get_single_by_id( array( 'id', 'name', 'description', 'articles' ), $this->trellis->input['id'] ) ) $this->trellis->skin->error('no_category'); 
    130126 
    131127                $this->trellis->skin->set_var( 'c', $c ); 
     
    167163        #======================================= 
    168164 
    169         private function view_article($error="", $type="") 
     165        private function view_article($alert="", $error="") 
    170166        { 
    171167                #============================= 
     
    175171                $this->trellis->load_functions('articles'); 
    176172 
    177                 if ( ! $a = $this->trellis->func->articles->get_single_by_id( array( 'id', 'cid', 'title', 'description', 'content', 'rating', 'votes', 'views', 'comments', 'html', 'date', 'modified', 'allow_comments', 'allow_rating' ), $this->trellis->input['id'] ) ) 
     173                if ( ! $a = $this->trellis->func->articles->get_single_by_id( array( 'id', 'cid', 'title', 'description', 'content', 'rating_average', 'votes', 'views', 'comments', 'html', 'date', 'modified', 'allow_comments', 'allow_rating' ), $this->trellis->input['id'] ) ) 
    178174                { 
    179175                        $this->trellis->log( 'error', "Article Not Found ID: ". $this->trellis->input['id'] ); 
     
    188184                $a['date_human'] = $this->trellis->td_timestamp( array( 'time' => $a['date'], 'format' => 'short' ) ); 
    189185 
    190                 $aoutput_params = array( 'urls' => 1 ); 
    191  
    192                 ( $a['html'] ) ? $aoutput_params['html'] = 1 : $aoutput_params['nl2br'] = 1; 
     186                $aoutput_params = array( 'linkify' => 1 ); 
     187 
     188                if ( $a['html'] ) 
     189                { 
     190                        $aoutput_params['html'] = 1; 
     191                } 
     192                else 
     193                { 
     194                        $aoutput_params['paragraphs'] = 1; 
     195                        $aoutput_params['nl2br'] = 1; 
     196                } 
    193197 
    194198                $a['content'] = $this->trellis->prepare_output( $a['content'], $aoutput_params ); 
    195199 
    196                 $this->trellis->skin->set_var( 'a', $a ); 
    197  
    198200                #============================= 
    199201                # Can We Rate? 
    200202                #============================= 
    201203 
    202                 if ( $this->trellis->user['id'] ) 
    203                 { 
    204                         if ( $this->trellis->func->articles->get_single_rating( array( 'id' ), array( 'uid', '=', $this->trellis->user['id'], 'and' ) ) || ! $this->trellis->cache->data['settings']['kb']['rating'] || ! $this->trellis->user['g_kb_rate'] || ! $this->trellis->cache->data['categories'][ $a['cid'] ]['allow_rating'] || ! $a['allow_rating'] ) 
     204                if ( $this->trellis->cache->data['settings']['kb']['rating'] && $this->trellis->cache->data['categories'][ $a['cid'] ]['allow_rating'] && $a['allow_rating'] ) 
     205                { 
     206                        if ( $this->trellis->user['id'] && $this->trellis->user['g_kb_rate'] ) # TODO: allow guests to rate 
    205207                        { 
    206                                 $rate = $this->rate_stars( $a['rating'], 0, $a['id'] ); 
     208                                if ( $this->trellis->func->articles->get_single_rating( array( 'id' ), array( array( 'aid', '=', $a['id'] ), array( 'uid', '=', $this->trellis->user['id'], 'and' ) ) ) ) 
     209                                { 
     210                                        $rate = $this->rate_stars( $a['rating_average'], 0, $a['id'] ); 
     211                                } 
     212                                else 
     213                                { 
     214                                        $rate = $this->rate_stars( $a['rating_average'], 1, $a['id'] ); 
     215                                } 
    207216                        } 
    208217                        else 
    209218                        { 
    210                                 $rate = $this->rate_stars( $a['rating'], 1, $a['id'] ); 
     219                                $rate = $this->rate_stars( $a['rating_average'], 0, $a['id'] ); 
    211220                        } 
    212                 } 
    213                 else 
    214                 { 
    215                         $rate = $this->rate_stars( $a['rating'], 0, $a['id'] ); 
    216                 } 
    217  
    218                 $this->trellis->skin->set_var( 'rate', $rate ); 
     221 
     222                        $this->trellis->skin->set_var( 'rate', $rate ); 
     223                } 
    219224 
    220225                #============================= 
     
    235240                if ( $comments ) 
    236241                { 
    237                         $row_count = 0; // Initialize for Security 
    238  
    239242                    foreach ( $comments as $c ) 
    240243                    { 
     
    243246                                #============================= 
    244247 
    245                                 $row_count ++; 
    246  
    247                                 ( $row_count & 1 ) ? $comments[ $c['id'] ]['class'] = 1 : $comments[ $c['id'] ]['class'] = 2; 
    248  
    249                                 if ( $c['staff'] ) $comments[ $c['id'] ]['class_staff'] = 'staff'; 
    250  
    251248                                $comments[ $c['id'] ]['time_ago'] = $this->trellis->td_timestamp( array( 'time' => $comments[ $c['id'] ]['date'], 'format' => 'relative' ) ); 
    252249 
    253                                 $comments[ $c['id'] ]['date'] = $this->trellis->td_timestamp( array( 'time' => $comments[ $c['id'] ]['date'], 'format' => 'short' ) ); 
    254  
    255                         $coutput_params = array( 'urls' => 1 ); 
    256  
    257                         ( $c['html'] ) ? $coutput_params['html'] = 1 : $coutput_params['nl2br'] = 1; 
     250                                $comments[ $c['id'] ]['date_human'] = $this->trellis->td_timestamp( array( 'time' => $comments[ $c['id'] ]['date'], 'format' => 'short' ) ); 
     251 
     252                        $coutput_params = array( 'linkify' => 1 ); 
     253 
     254                            if ( $c['html'] ) 
     255                                { 
     256                                        $coutput_params['html'] = 1; 
     257                                } 
     258                                else 
     259                                { 
     260                                        $coutput_params['paragraphs'] = 1; 
     261                                        $coutput_params['nl2br'] = 1; 
     262                                } 
     263 
     264                                // Permissions for Templates 
     265                                if ( $c['uid'] == $this->trellis->user['id'] ) 
     266                                { 
     267                                        if ( $this->trellis->user['g_kb_com_edit'] ) $comments[ $c['id'] ]['can_edit'] = 1; 
     268                                        if ( $this->trellis->user['g_kb_com_delete'] ) $comments[ $c['id'] ]['can_delete'] = 1; 
     269                                } 
    258270 
    259271                        $comments[ $c['id'] ]['message'] = $this->trellis->prepare_output( $c['message'], $coutput_params ); 
     
    264276 
    265277                #============================= 
     278                # Stats 
     279                #============================= 
     280 
     281                $this->trellis->func->articles->increase_count( $a['id'], 1, 'views' ); 
     282 
     283                #============================= 
    266284                # Do Output 
    267285                #============================= 
    268286 
    269                 if ( $this->trellis->cache->data['settings']['kb']['comments'] && $this->trellis->user['g_kb_comment'] && $this->trellis->cache->data['categories'][ $a['cid'] ]['allow_comments'] && $a['allow_comments'] ) 
    270                 { 
    271                         $this->trellis->skin->set_var( 'show_comment_form', 1 ); 
    272  
    273                         if ( $error ) 
    274                         { 
    275                                 $this->trellis->skin->set_var( 'error', $this->trellis->lang[ 'err_'. $error ] ); 
    276                         } 
    277                 } 
    278  
    279                 #============================= 
    280                 # Update Article 
    281                 #============================= 
    282  
    283                 $this->trellis->db->construct( array( 
    284                                                                                                  'update'       => 'articles', 
    285                                                                                                  'set'          => array( 'views' => $a['views'] + 1 ), 
    286                                                                                                  'where'        => array( 'id', '=', $a['id'] ), 
    287                                                                                                  'limit'        => array( 1 ), 
    288                                                                                   )     ); 
    289  
    290                 $this->trellis->db->next_shutdown(); 
    291                 $this->trellis->db->execute(); 
    292  
    293                 #============================= 
    294                 # Do Output 
    295                 #============================= 
     287                if ( $error ) $this->trellis->skin->set_var( 'error', $this->trellis->lang[ 'err_'. $error ] ); 
     288                if ( $alert ) $this->trellis->skin->set_var( 'alert', $this->trellis->lang[ 'alert_'. $alert ] ); 
     289 
     290                // Permissions for Templates 
     291                if ( $this->trellis->cache->data['settings']['kb']['comments'] && $this->trellis->user['g_kb_comment'] && $this->trellis->cache->data['categories'][ $a['cid'] ]['allow_comments'] && $a['allow_comments'] ) $a['can_comment'] = 1; 
     292 
     293                $this->trellis->skin->set_var( 'a', $a ); 
    296294 
    297295                $this->nav = array( 
     
    317315        #======================================= 
    318316        # @ Submit Comment 
    319         # Adds a new comment to an article. 
    320         #======================================= 
    321  
    322         function do_add_comment() 
     317        #======================================= 
     318 
     319        private function do_add_comment() 
    323320        { 
    324321                #============================= 
     
    328325                $this->trellis->load_functions('articles'); 
    329326 
    330                 if ( ! $this->trellis->input['message'] ) $this->view_article( array( 'comment_error' => 'no_message' ) ); 
     327                if ( ! $this->trellis->input['message'] ) $this->view_article( null, 'no_message' ); 
    331328 
    332329                if ( ! $a = $this->trellis->func->articles->get_single_by_id( array( 'id', 'cid', 'title', 'allow_comments' ), $this->trellis->input['id'] ) ) $this->trellis->skin->error('no_article'); 
     
    357354        #======================================= 
    358355        # @ Do Search 
    359         # Performs a search and returns results. 
    360356        #======================================= 
    361357 
     
    365361                # Search! 
    366362                #============================= 
     363 
     364                # TODO: improve / finish search! 
    367365 
    368366                $this->trellis->check_token('search'); 
     
    433431        #======================================= 
    434432        # @ Do Rate 
    435         # Adding rating to article. 
    436         #======================================= 
    437  
    438         function do_rate() 
     433        #======================================= 
     434 
     435        private function do_rate() 
    439436        { 
    440437                #============================= 
     
    442439                #============================= 
    443440 
    444                 $this->trellis->input['id'] = intval( $this->trellis->input['id'] ); 
    445                 $this->trellis->input['amount'] = intval( $this->trellis->input['amount'] ); 
    446  
    447                 if ( ! $this->trellis->cache->data['settings']['kb']['rating'] ) 
    448                 { 
    449                         $this->trellis->skin->error('kb_rating_disabled'); 
    450                 } 
    451  
    452                 $this->trellis->db->construct( array( 
    453                                                                                                  'select'       => array( 'id', 'cid', 'title', 'votes', 'rating', 'allow_rating' ), 
    454                                                                                                  'from'         => 'articles', 
    455                                                                                                  'where'        => array( 'id', '=', $this->trellis->input['id'] ), 
    456                                                                                                  'limit'        => array( 0, 1 ), 
    457                                                                                   )     ); 
    458  
    459                 $this->trellis->db->execute(); 
    460  
    461                 if ( ! $this->trellis->db->get_num_rows() ) 
    462                 { 
    463                         $this->trellis->log( 'error', "Article Not Found ID: ". $this->trellis->input['id'] ); 
    464  
    465                         $this->trellis->skin->error('no_article'); 
    466                 } 
    467  
    468                 $a = $this->trellis->db->fetch_row(); 
    469  
    470                 if ( ! $this->trellis->user['g_kb_rate'] || ! $this->trellis->cache->data['categories'][ $a['cid'] ]['allow_rating'] || ! $a['allow_rating'] ) 
    471                 { 
    472                         $this->trellis->log( 'security', "Blocked Article Rating" ); 
    473  
    474                         $this->trellis->skin->error('banned_kb_rate'); 
    475                 } 
     441                $this->trellis->load_functions('articles'); 
     442 
     443                if ( ! $a = $this->trellis->func->articles->get_single_by_id( array( 'id', 'cid', 'title', 'rating_total', 'votes', 'allow_rating' ), $this->trellis->input['id'] ) ) $this->trellis->skin->error('no_article'); 
    476444 
    477445                if ( ! $this->trellis->user['id'] ) 
     
    491459                } 
    492460 
    493                 $this->trellis->db->construct( array( 
    494                                                                                                  'select'       => 'all', 
    495                                                                                                  'from'         => 'article_rate', 
    496                                                                                                  'where'        => array( array( 'aid', '=', $a['id'] ), array( 'uid', '=', $this->trellis->user['id'], 'and' ) ), 
    497                                                                                                  'limit'        => array( 0, 1 ), 
    498                                                                                   )     ); 
    499  
    500                 $this->trellis->db->execute(); 
    501  
    502                 if ( $this->trellis->db->get_num_rows() ) 
     461                if ( ! $this->trellis->cache->data['settings']['kb']['rating'] || ! $this->trellis->user['g_kb_rate'] || ! $this->trellis->cache->data['categories'][ $a['cid'] ]['allow_rating'] || ! $a['allow_rating'] ) $this->trellis->skin->error('no_perm');  # TD LOG no perm 
     462 
     463                if ( $this->trellis->func->articles->get_single_rating( array( 'id' ), array( array( 'aid', '=', $a['id'] ), array( 'uid', '=', $this->trellis->user['id'], 'and' ) ) ) ) 
    503464                { 
    504465                        $this->trellis->log( 'security', "Already Rated Article By User &#039;". $a['name'] ."&#039;", 1, $a['id'] ); 
    505466 
    506                         $this->trellis->skin->error('already_rated'); 
     467                        #$this->trellis->skin->error('already_rated'); 
    507468                } 
    508469 
     
    511472                #============================= 
    512473 
    513                 $db_array = array( 
    514                                                   'aid'                 => $a['id'], 
    515                                                   'uid'                 => $this->trellis->user['id'], 
    516                                                   'rating'              => $this->trellis->input['amount'], 
    517                                                   'date'                => time(), 
    518                                                   'ipadd'               => $this->trellis->input['ip_address'], 
    519                                                  ); 
    520  
    521                 $this->trellis->db->construct( array( 
    522                                                                                                  'insert'       => 'article_rate', 
    523                                                                                                  'set'          => $db_array, 
    524                                                                                   )     ); 
    525  
    526                 $this->trellis->db->execute(); 
     474                $this->trellis->func->articles->add_rating( $this->trellis->input['amount'], $a['id'], array( 'rating_total' => $a['rating_total'], 'votes' => $a['votes'] ) ); 
    527475 
    528476                $this->trellis->log( 'user', "Article Rating Value ". $this->trellis->input['amount'] ." Added &#039;". $a['name'] ."&#039;", 1, $a['id'] ); 
    529  
    530                 #============================= 
    531                 # Update Article 
    532                 #============================= 
    533  
    534                 $new_rating = round( ( $a['rating'] + $this->trellis->input['amount'] ) / ( $a['votes'] + 1 ), 2 ); 
    535  
    536                 $this->trellis->db->construct( array( 
    537                                                                                                  'update'       => 'articles', 
    538                                                                                                  'set'          => array( 'votes' => $a['votes'] + 1, 'rating' => $new_rating ), 
    539                                                                                                  'where'        => array( 'id', '=', $a['id'] ), 
    540                                                                                                  'limit'        => array( 1 ), 
    541                                                                                   )     ); 
    542  
    543                 $this->trellis->db->next_shutdown(); 
    544                 $this->trellis->db->execute(); 
    545477 
    546478            #============================= 
     
    548480                #============================= 
    549481 
    550                 $this->trellis->skin->redirect( '?page=kb&act=view&id='. $a['id'], 'add_rating_success' ); 
     482                $this->view_article( 'rating_added' ); 
    551483        } 
    552484 
     
    726658        function rate_stars($rating, $rate=0, $fid=0) 
    727659        { 
     660                # TODO: move to templates 
     661 
    728662                $half = 0; // Initialize for Security 
    729663 
     
    734668 
    735669                $real_rating = $rating; 
    736  
    737                 $rating = round( $rating ); 
    738670 
    739671                for ( $x = 1; $x < $rating + 1; $x++ ) 
     
    743675                        if ( $rate ) 
    744676                        { 
    745                                 $a5_html .= "<a href='". $this->trellis->config['hd_url'] ."/index.php?page=kb&amp;act=rate&amp;amount=". $x ."&amp;id={$fid}' title='". $x ." ". $this->trellis->lang['stars'] ."'><img src='images/". $this->trellis->skin->data['img_dir'] ."/rate_half.gif' alt='". $this->trellis->lang['half_star'] ."' name='rate". $x ."' style='vertical-align:top' onmouseover='amirate(". $x .")' onmouseout='unamirate(". $real_rating .")' /></a>"; 
     677                                $a5_html .= "<a href='". $this->trellis->config['hd_url'] ."/index.php?page=kb&amp;act=dorate&amp;amount=". $x ."&amp;id={$fid}' title='". $x ." ". $this->trellis->lang['stars'] ."'><img src='images/". $this->trellis->skin->data['img_dir'] ."/rate_half.gif' alt='". $this->trellis->lang['half_star'] ."' name='rate". $x ."' style='vertical-align:top' onmouseover='amirate(". $x .")' onmouseout='unamirate(". $real_rating .")' /></a>"; 
    746678                        } 
    747679                        else 
     
    754686                        if ( $rate ) 
    755687                        { 
    756                                 $a5_html .= "<a href='". $this->trellis->config['hd_url'] ."/index.php?page=kb&amp;act=rate&amp;amount=". $x ."&amp;id={$fid}' title='". $x ." ". $this->trellis->lang['stars'] ."'><img src='images/". $this->trellis->skin->data['img_dir'] ."/rate_on.gif' alt='". $this->trellis->lang['lang.full_star'] ."' name='rate". $x ."' style='vertical-align:top' onmouseover='amirate(". $x .")' onmouseout='unamirate(". $real_rating .")' /></a>"; 
     688                                $a5_html .= "<a href='". $this->trellis->config['hd_url'] ."/index.php?page=kb&amp;act=dorate&amp;amount=". $x ."&amp;id={$fid}' title='". $x ." ". $this->trellis->lang['stars'] ."'><img src='images/". $this->trellis->skin->data['img_dir'] ."/rate_on.gif' alt='". $this->trellis->lang['lang.full_star'] ."' name='rate". $x ."' style='vertical-align:top' onmouseover='amirate(". $x .")' onmouseout='unamirate(". $real_rating .")' /></a>"; 
    757689                        } 
    758690                        else 
     
    767699                if ( $rate ) 
    768700                { 
    769                         $a5_html .= "<a href='". $this->trellis->config['hd_url'] ."/index.php?page=kb&amp;act=rate&amp;amount=". $x ."&amp;id={$fid}' title='". $x ." ". $this->trellis->lang['stars'] ."'><img src='images/". $this->trellis->skin->data['img_dir'] ."/rate_off.gif' alt='". $this->trellis->lang['no_star'] ."' name='rate". $x ."' style='vertical-align:top' onmouseover='amirate(". $x .")' onmouseout='unamirate(". $real_rating .")' /></a>"; 
     701                        $a5_html .= "<a href='". $this->trellis->config['hd_url'] ."/index.php?page=kb&amp;act=dorate&amp;amount=". $x ."&amp;id={$fid}' title='". $x ." ". $this->trellis->lang['stars'] ."'><img src='images/". $this->trellis->skin->data['img_dir'] ."/rate_off.gif' alt='". $this->trellis->lang['no_star'] ."' name='rate". $x ."' style='vertical-align:top' onmouseover='amirate(". $x .")' onmouseout='unamirate(". $real_rating .")' /></a>"; 
    770702                } 
    771703                else 
  • trunk/Upload/sources/tickets.php

    r73 r74  
    282282                $toutput_params = array( 'linkify' => 1 ); 
    283283 
    284                 ( $t['html'] ) ? $toutput_params['html'] = 1 : $toutput_params['nl2br'] = 1; 
     284        if ( $t['html'] ) 
     285        { 
     286                $toutput_params['html'] = 1; 
     287        } 
     288        else 
     289        { 
     290                $toutput_params['paragraphs'] = 1; 
     291                $toutput_params['nl2br'] = 1; 
     292        } 
    285293 
    286294                $t['message'] = $this->trellis->prepare_output( $t['message'], $toutput_params ); 
     
    341349                        $routput_params = array( 'urls' => 1 ); 
    342350 
    343                         ( $r['html'] ) ? $routput_params['html'] = 1 : $routput_params['nl2br'] = 1; 
     351                        if ( $r['html'] ) 
     352                        { 
     353                                $routput_params['html'] = 1; 
     354                        } 
     355                        else 
     356                        { 
     357                                $routput_params['paragraphs'] = 1; 
     358                                $routput_params['nl2br'] = 1; 
     359                        } 
    344360 
    345361                        $replies[ $r['id'] ]['message'] = $this->trellis->prepare_output( $r['message'], $routput_params ); 
  • trunk/Upload/upgrade/index.php

    r37 r74  
    400400                @import "../includes/local.css"; 
    401401        </style> 
    402         <script src='../includes/scripts/global.js' type='text/javascript'></script> 
     402        <script src='../includes/scripts/common.js' type='text/javascript'></script> 
    403403        <script src='../includes/scripts/prototype.js' type='text/javascript'></script> 
    404404        <script src='../includes/scripts/scriptaculous.js' type='text/javascript'></script> 
Note: See TracChangeset for help on using the changeset viewer.