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,965
  • Latest: boruko
Stats
  • Total Posts: 195,980
  • Total Topics: 21,320
  • Online today: 281
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 142
  • Total: 142

Changing default option in creating articles

Started by fangweile, April 01, 2009, 12:15:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fangweile

Hello there,

What file and code that should i edit to change the default option in tp when creating new articles. I want to set default option to this:

Use intro = yes
Display on front page = no
Display author avatar/info = no
Show Social Bookmarks buttons = yes

Thanks for your help in advance

fangweile

JPDeni

This is the sort of thing you do at your own risk, of course, but the options list is in /Sources/TPAdmin.php, starting probably around line 979. (You didn't say which version of TP you're using, so I can't be certain.)

For use intro, look for

$artu=isset($_POST['tp_article_useintro']) ? $_POST['tp_article_useintro'] : 0;


Change the 0 to 1.

Most of the rest of the options are in the line


$artoptions = 'date,title,author,linktree,top,cblock,rblock,lblock,tblock,lbblock,views,rating,ratingallow,avatar,inherit,social,nofrontsetting';


If the option is in the list, it is set to be "on". Take out the things you don't want. Be careful, though. Save a copy of the list so you can get back the original in case you take out something you didn't mean to and need to get it back.

For the display on the front page, you'll need to go to /Themes/default/TPortalAdmin.template.php (You probably don't have a template for that in any custom theme, but if you do, you'll have to change it there, too.)

Around line 1950 find


echo '
<tr class="windowbg2">
<td valign="top" align="right">'.$txt['tp-showonfrontpage'].'</td>
<td valign="top">
<input name="tp_article_frontpage" type="radio" value="0"> '.$txt['tp-no'].'
<input name="tp_article_frontpage" type="radio" value="1" checked> '.$txt['tp-yes'].'
</td>
</tr>';


Move the word checked to the previous line.

fangweile

thanks a lot JPDeni, works fine now in my site.  ;)

This website is proudly hosted on Crocweb Cloud Website Hosting.