TinyPortal

Development => Feedback => Topic started by: Vuurvreter on August 14, 2013, 10:39:30 PM

Title: General feature request
Post by: Vuurvreter on August 14, 2013, 10:39:30 PM
Hello,

I just started using TinyPortal on a forum, but I came across some (I think) limitations of TinyPortal, and I wondered if I didn't search at the right place, or that the functions maybe could be added in a new version of TinyPortal.
Is it possible to (for example) disable comments for all articles at the same time? Now I need to uncheck the box for every article I create, everytime again. This is also true for the viewing options.
And also, is it possible to switch the social media buttons on and off per site?
Title: Re: General feature request
Post by: IchBin on August 15, 2013, 12:33:19 AM
To remove the option to have comments for the article you can in Sources/TPortalAdmin.php find this section:

// are we starting a new one?
if(isset($_GET['sa']) && substr($_GET['sa'], 0, 11) == 'addarticle_')
{
TPadd_linktree($scripturl.'?action=tpadmin;sa='.$_GET['sa'], $txt['tp-addarticle']);
$context['TPortal']['editarticle'] = array(
            'id' => '',
            'date' => time(),
            'body' => '',
            'intro' => '',
            'useintro' => 0,
            'category' => !empty($_GET['cu']) ? $_GET['cu'] : 0,
            'frontpage' => 1,
            'author_id' => $context['user']['id'],
            'subject' => '',
            'author' => $context['user']['name'],
            'frame' => 'theme',
            'approved' => 0,
            'off' => 1,
            'options' => 'date,title,author,linktree,top,cblock,rblock,lblock,bblock,tblock,lbblock,category,catlist,comments,commentallow,commentupshrink,views,rating,ratingallow,avatar,inherit,social,globaltags,nofrontsetting',
   


Remove in the options line at the bottom of that the commentallow part so the line looks like this:

            'options' => 'date,title,author,linktree,top,cblock,rblock,lblock,bblock,tblock,lbblock,category,catlist,comments,commentupshrink,views,rating,ratingallow,avatar,inherit,social,globaltags,nofrontsetting',
   


You can remove any of those other options from that line if you need. This will make it so that the options are not automatically checked.

It's not possible to turn off individual social icons off per site. You can remove any that you don't want by editing the TPsubs.template.php file in the default theme folder. Look for the article_bookmark() function where each image is put in the code there.