TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,946
  • Latest: Sparo
Stats
  • Total Posts: 195,713
  • Total Topics: 21,274
  • Online today: 90
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 55
  • Total: 55

Where are settings saved?

Started by xadio, February 11, 2006, 10:59:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xadio

I am working on a hack and I am working on adding options in the admin menu to turn it on and off.
I have the following in TPortalAdmin.template.php:

                      
<tr class="windowbg2">
                        <
td align="right" width="45%">'.$txt['tp-showchildrenboards'].'</td>
                        <
td>
                          <
input name="tp_show_children_boards" type="radio" value="0" ' , $context['TPortal']['show_children_boards']==0 ? 'checked' : '' , ''.$txt['tp-no'].'
                          
<input name="tp_show_children_boards" type="radio" value="1" ' , $context['TPortal']['show_children_boards']==1 ? 'checked' : '' , ''.$txt['tp-yes'].'
                        
</td>
                      </
tr>
                      <
tr class="windowbg2">
                        <
td align="right" width="45%">'.$txt['tp-showboardname'].'</td>
                        <
td>
                          <
input name="tp_show_board_name" type="radio" value="0" ' , $context['TPortal']['show_board_name']==0 ? 'checked' : '' , ''.$txt['tp-no'].'
                          
<input name="tp_show_board_name" type="radio" value="1" ' , $context['TPortal']['show_board_name']==1 ? 'checked' : '' , ''.$txt['tp-yes'].'
                        
</td>
                      </
tr>


And the following in TPortalAdmin.php:

//-- START: Show Childern Boards Hack --//
                   
elseif($what=='tp_show_children_boards'){
                       
db_query("UPDATE {$tp_prefix}settings SET value='$value' WHERE name='show_children_boards'"__FILE____LINE__);
                       
$go=6;
                   }
                   
//-- END: Show Childern Boards Hack --//
                   //-- START: Show Board Names Hack --//
                   
elseif($what=='tp_show_board_name'){
                       
db_query("UPDATE {$tp_prefix}settings SET value='$value' WHERE name='show_board_name'"__FILE____LINE__);
                       
$go=6;
                   }
                   
//-- END: Show Board Names Hack --//


But I am unsure of where the following would be set:

$context
['TPortal']['show_children_boards']
$txt['tp-showchildrenboards']


Thanks in advance!

bloc

Well, any $context values needs to be filled within TPortalAdmin.php, while the $txt entries needs to go into TPortalAdmin.language.php.

xadio


xadio

Hey here is another question... when tp is going to output "Both forum and articles - sorted on date" in

if ($output_method != 'echo')
                return $return;

        foreach ($return as $news)
        {
                echo '
                        <table border="0" width="100%" align="center" class="ssi_table">
                                <tr>
                                        <td>', $news['icon'], ' <b>'$news['subject'], '</b><span class="smaller"><br />', $news['time'], ' ', $txt[525], ' ', $news['poster']['link'], '<br /><br /></span></td>
                                </tr>
                                <tr>
                                        <td>', $news['body'], '<br /><br /></td>
                                </tr>
                                <tr>
                                        <td>', $news['link'], ' | ', $news['new_comment'], '</td>
                                </tr>
                        </table>
                        <br />';

                if (!$news['is_last'])
                        echo '
                        <hr width="100%" />
                        <br />';
        }


does it use the above echo or is it returned in $output_method != 'echo';?

Thanks a bunch!

Oh and when I finish my hack where is a good place to post it?

xadio

#4
I finished it!  Thanks for all your help bloc!  If anyone is curious what my hack does it can be viewed at http://www.teamgouranga.com

When I get time I will create a guide on how to do it.



[attachment deleted by admin]

This website is proudly hosted on Crocweb Cloud Website Hosting.