News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 18, 2019, 08:50:33 PM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189090
  • Total Topics: 20764
  • Online Today: 73
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 51
Total: 51

Author Topic: A suggestion for TinyPortal - Front page settings  (Read 3053 times)

0 Members and 1 Guest are viewing this topic.

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
A suggestion for TinyPortal - Front page settings
« on: December 28, 2006, 05:24:52 AM »
I have rearranged the order, I have not changed the code, to select what to show first and then the refining options. I have also changed some of the the text strings in TPortalAdmin.english to hopefully make it easier to understand for a Noob.

This is the revised code for TPortalAdmin.template, the section for the Front Page Settings - lines 698 to 842.

Code: [Select]
// frontpage settings
elseif($subaction=='frontpage'){
echo '
     <form name="TPadmin" action="' . $scripturl . '?action=tpadmin" method="post" style="margin: 0px;">
<input name="TPadmin_settings" type="hidden" value="set">
<input type="hidden" name="sc" value="', $context['session_id'], '" />
<table width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr>
<td colspan="2" class="titlebg">TinyPortal - '.$txt['tp-frontpage_settings'].'</td>
</tr>
<tr class="windowbg2">
<td align="right" width="45%">'.$txt['tp-allowguests'].'</td>
<td>
<input name="tp_allow_guestnews" type="radio" value="0" ' , $context['TPortal']['allow_guestnews']==0 ? 'checked' : '' , '> '.$txt['tp-no'].'
<input name="tp_allow_guestnews" type="radio" value="1" ' , $context['TPortal']['allow_guestnews']==1 ? 'checked' : '' , '> '.$txt['tp-yes'].'
</td>
</tr>
<tr class="windowbg2">
<td align="right">'.$txt['tp-whattoshow'].'</td>
<td>
<input name="tp_front_type" type="radio" value="forum_only" ' , $context['TPortal']['front_type']=='forum_only' ? 'checked' : '' , '> '.$txt['tp-onlyforum'].'<br />
<input name="tp_front_type" type="radio" value="forum_articles" ' , $context['TPortal']['front_type']=='forum_articles' ? 'checked' : '' , '> '.$txt['tp-bothforum'].'<br />
<input name="tp_front_type" type="radio" value="articles_only" ' , $context['TPortal']['front_type']=='articles_only' ? 'checked' : '' , '> '.$txt['tp-onlyarticles'].'<br />
<input name="tp_front_type" type="radio" value="single_page"  ' , $context['TPortal']['front_type']=='single_page' ? 'checked' : '' , '> '.$txt['tp-singlepage'].'<br />
<input name="tp_front_type" type="radio" value="frontblock"  ' , $context['TPortal']['front_type']=='frontblock' ? 'checked' : '' , '> '.$txt['tp-frontblocks'].'<br />
<input name="tp_front_type" type="radio" value="boardindex"  ' , $context['TPortal']['front_type']=='boardindex' ? 'checked' : '' , '> '.$txt['tp-boardindex'].'<br />
</td>
</tr>
<tr class="windowbg2">
<td align="right">'.$txt['tp-frontblockoption'].'</td>
<td>
<input name="tp_frontblock_type" type="radio" value="single"  ' , $context['TPortal']['frontblock_type']=='single' ? 'checked' : '' , '> '.$txt['tp-frontblocksingle'].'<br />
<input name="tp_frontblock_type" type="radio" value="first"  ' , $context['TPortal']['frontblock_type']=='first' ? 'checked' : '' , '> '.$txt['tp-frontblockfirst'].'<br />
<input name="tp_frontblock_type" type="radio" value="last"  ' , $context['TPortal']['frontblock_type']=='last' ? 'checked' : '' , '> '.$txt['tp-frontblocklast'].'<br />
</td>
</tr> <tr class="windowbg2">
<td align="right" width="45%">'.$txt['tp-frontpage_layout'].'</td>
<td>
<input name="tp_frontpage_layout" type="radio" value="0" ' , $context['TPortal']['frontpage_layout']==0 ? 'checked' : '' , '> A
<input name="tp_frontpage_layout" type="radio" value="1" ' , $context['TPortal']['frontpage_layout']==1 ? 'checked' : '' , '> B
<input name="tp_frontpage_layout" type="radio" value="2" ' , $context['TPortal']['frontpage_layout']==2 ? 'checked' : '' , '> C
<input name="tp_frontpage_layout" type="radio" value="3" ' , $context['TPortal']['frontpage_layout']==3 ? 'checked' : '' , '> D
</td>
</tr>
<tr class="windowbg2">
<td colspan="2" align="center">
<div>
<div style="float: left; margin: 4px;"> ' , $context['TPortal']['frontpage_layout']==0 ? '[<b>A</b>]' : 'A' , '
<table class="tborder" cellspacing="2" cellpadding="2" width="100" style="margin-top: 5px;">
  <tr><td height="20" style="background: red;">&nbsp;</td></tr>
<tr><td height="30" style="background: grey;">&nbsp;</td></tr>
</table>
</div>
<div style="float: left; margin: 4px;"> ' , $context['TPortal']['frontpage_layout']==1 ? '[<b>B</b>]' : 'B' , '
<table class="tborder" cellspacing="2" cellpadding="2" width="100" style="margin-top: 5px;">
<tr><td colspan="2" height="20" style="background: red;">&nbsp;</td></tr>
  <tr><td height="30"  style="background: grey;">&nbsp;</td><td height="30" style="background: grey;">&nbsp;</td></tr>
</table>
</div>
<div style="float: left; margin: 4px;"> ' , $context['TPortal']['frontpage_layout']==2 ? '[<b>C</b>]' : 'C' , '
<table class="tborder" cellspacing="2" cellpadding="2" width="100" style="margin-top: 5px;">
  <tr><td height="30" rowspan="2" style="background: red;">&nbsp;</td><td height="20" style="background: grey;">&nbsp;</td></tr>
<tr><td height="30" style="background: grey;">&nbsp;</td></tr>
</table>
</div>
<div style="float: left; margin: 4px;"> ' , $context['TPortal']['frontpage_layout']==3 ? '[<b>D</b>]' : 'D' , '
<table class="tborder" cellspacing="2" cellpadding="2" width="100" style="margin-top: 5px;">
  <tr><td height="20" style="background: red;">&nbsp;</td><td height="20" style="background: grey;">&nbsp;</td></tr>
  <tr><td height="30" style="background: grey;">&nbsp;</td><td height="30" style="background: grey;">&nbsp;</td></tr>
</table>
</div>
</div>
</td>
</tr>
<tr class="windowbg2">
<td align="right">'.$txt['tp-showforumposts'].'</td>
<td>';

echo '
<select size="1" name="tp_ssiboard1">';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board1'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
</select> ';
// board 2
echo '
<select size="1" name="tp_ssiboard2"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board2'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
</select> ';
// board 3
echo '
<select size="1" name="tp_ssiboard3"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board3'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
</select> ';
// board 4
echo '
<select size="1" name="tp_ssiboard4"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board4'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}
echo '
</select> ';
// board 5
echo '
<select size="1" name="tp_ssiboard5"><option value="0">',$txt['tp-none-'],'</option>';
$tn=sizeof($context['TPortal']['boards']);
for($n=0 ; $n<$tn; $n++){
echo '
<option value="'.$context['TPortal']['boards'][$n]['id'].'" ' ,$context['TPortal']['boards'][$n]['id']==$context['TPortal']['SSI_board5'] ? 'selected' : '' , '>'.$context['TPortal']['boards'][$n]['name'].'</option>';
}

echo '
</select>
</td>
      </tr>
      <tr class="windowbg2">
<td align="right">'.$txt['tp-numberofposts'].'</td>
<td><input style="margin-left: 10px;" name="tp_ssiboard_number" size="5" maxsize="5" type="text" value="' ,$context['TPortal']['frontpage_limit'], '">
</td>
</tr>
<tr class="windowbg2">
<td align="right">'.$txt['tp-lengthofposts'].'</td>
<td><input style="margin-left: 10px;" name="tp_ssiboard_len" size="5" maxsize="5" type="text" value="' ,$context['TPortal']['frontpage_limit_len'], '">
</td>
</tr>

<tr class="windowbg"><td colspan="2" align="center"><input type="submit" value="'.$txt['tp-send'].'" name="send"></td></tr>
</table>
      </form>';
}


These are the changes to TPortalAdmin.english

In the section // Version: 0.9; TPortalAdmin
Code: [Select]
$txt['tp-numberofposts']='Number of forum-posts to show on front page:';
$txt['tp-lengthofposts']='Number of characters to show per forum-post:';
$txt['tp-onlyforum']='Only forum-posts';
$txt['tp-bothforum']='Forum-posts and articles - sorted on date';
$txt['tp-singlepage']='Featured article and front page blocks';

In the section // beta 7 (these are minor tweaks I also did to keep the letter case consistant)
Code: [Select]
$txt['tp-centersideblocks']='Center blocks';
$txt['tp-frontsideblocks']='Front page blocks';
$txt['tp-addcenterblock']='Add center block';
$txt['tp-addfrontblock']='Add front page block';
$txt['tp-frontblocks'] = 'Only front page blocks';

In the section // v0.9

Code: [Select]
$txt['tp-frontpage_layout'] = 'Articles layout for the front page:';

Offline Skhilled

  • Beta Tester
  • *
  • Posts: 1166
  • Once you stop learning, you stop living!
    • Doc Skillz
Re: A suggestion for TinyPortal - Front page settings
« Reply #1 on: December 28, 2006, 07:28:12 AM »
I think C should go before D (just my way of thinking, LOL) but looks better and more sensible.

Reading can seriously damage your ignorance!

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: A suggestion for TinyPortal - Front page settings
« Reply #2 on: January 07, 2007, 09:53:14 AM »
I like it. Seems very logical, I will work this in.

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: A suggestion for TinyPortal - Front page settings
« Reply #3 on: January 07, 2007, 10:59:38 AM »

Offline bloc

  • Founder
  • *
  • Posts: 5217
    • Bloc
Re: A suggestion for TinyPortal - Front page settings
« Reply #4 on: January 08, 2007, 05:24:16 PM »
Added to TP 0.9.8.

denis

  • Guest
Re: A suggestion for TinyPortal - Front page settings
« Reply #5 on: January 24, 2007, 05:35:50 PM »
I like it as well :up: