Advertisement:

Author Topic: Adding an updateable postpage underneath Boards  (Read 927 times)

Offline thomp4pal

  • Semi-Newbie
  • *
  • Posts: 13
Adding an updateable postpage underneath Boards
« on: December 08, 2017, 12:28:11 PM »
I have been working on adding a post-page which will seat just immediately underneath Boards, before forum statistics.
the page will be updated daily with recent hot topics in the boards of the forum, bearing hyperlinks to the thread's topic...
So far i've tried using both T.P and S.P even AdkPortal, but this page gets created underneath Forum statistics >:( and other mishaps am not comfortable with.
A little guidance here will be greatly appreciated..

Forum link : 
Code: [Select]
www.unbox9ja.com


Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Adding an updateable postpage underneath Boards
« Reply #1 on: December 08, 2017, 12:48:10 PM »
AFAIK, portals don't edit board index code, they add blocks above, below, and on either side.  Don't have time to look at it now, but you could probably adapt the code from the relevant portal block and place it in a <div> at the location you want it in BoardIndex.template.php.

Offline thomp4pal

  • Semi-Newbie
  • *
  • Posts: 13
Re: Adding an updateable postpage underneath Boards
« Reply #2 on: December 08, 2017, 01:05:50 PM »

Hi Sir Osis of Liver,

Thanks for the reply, I understand this approach clearly, now i have to figure out how to get the code from the relevant portal block...

Offline thomp4pal

  • Semi-Newbie
  • *
  • Posts: 13
Re: Adding an updateable postpage underneath Boards
« Reply #3 on: December 08, 2017, 03:38:51 PM »
Still Not popping out under board.

Done Editing of BoardIndex.template.php and inserting  TinyPortal article block code

BoardIndex.template.php code:

Code: [Select]
// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
template_button_strip($mark_read_button, 'top');

echo '
</div>
</div>';
}

template_info_center();
}

function template_info_center()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Here's where the "Info Center" starts...
echo '
<div class="tborder clearfix" id="infocenterframe">
<h3 class="catbg">

TinyPortal article block code:


Code: [Select]
div class="tparticle">
<div class="cat_bar">
<h3 class="catbg"><span class="left"></span>{article_shortdate} {article_title} {article_category}</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
{article_avatar}
<div class="article_info">
{article_author}
{article_date}
{article_views}
{article_rating}
{article_options}
</div>
<div class="article_padding">{article_text}</div>
<div class="article_padding">{article_moreauthor}</div>
<div class="article_padding">{article_bookmark}</div>
<div class="article_padding">{article_morelinks}</div>
<div class="article_padding">{article_comments}</div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>

BoardIndex.template.php code after editing:

Code: [Select]
// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
template_button_strip($mark_read_button, 'top');

echo '
</div>
</div>';

div class="tparticle">
<div class="cat_bar">
<h3 class="catbg"><span class="left"></span>{article_shortdate} {article_title} {article_category}</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
{article_avatar}
<div class="article_info">
{article_author}
{article_date}
{article_views}
{article_rating}
{article_options}
</div>
<div class="article_padding">{article_text}</div>
<div class="article_padding">{article_moreauthor}</div>
<div class="article_padding">{article_bookmark}</div>
<div class="article_padding">{article_morelinks}</div>
<div class="article_padding">{article_comments}</div>
</div>
<span class="botslice"><span></span></span>
</div>
</div>

}

template_info_center();
}

function template_info_center()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Here's where the "Info Center" starts...
echo '
<div class="tborder clearfix" id="infocenterframe">
<h3 class="catbg">

After editing, saving and uploading BoardIndex.template.php, still no post or article underneath board...

Offline thomp4pal

  • Semi-Newbie
  • *
  • Posts: 13
Re: Adding an updateable postpage underneath Boards
« Reply #4 on: December 08, 2017, 03:57:17 PM »
should look something like this underneath board  8)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Adding an updateable postpage underneath Boards
« Reply #5 on: December 08, 2017, 09:02:33 PM »
I believe you have to have TP installed and running, with that portal block active, that should show it in both locations, then it's a matter of removing the lower block.  I'll tinker with it soon as I get a chance.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Adding an updateable postpage underneath Boards
« Reply #6 on: December 08, 2017, 10:09:59 PM »
Ok, got this far -

Code: [Select]

// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
echo '<div class="mark_read">', template_button_strip($mark_read_button, 'right'), '</div>';
}
else
{
echo '
<div id="posting_icons" class="flow_hidden">
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';
}

/// TP recent posts

echo '

<div id="tptopbarHeader" style="' , in_array('tptopbarHeader',$context['tp_panels']) && $context['TPortal']['showcollapse']==1 ? 'display: none;' : '' , 'clear: both;">
' , TPortal_panel('top') , '
</div>

<div id="tplowerbarHeader" style="' , in_array('tplowerbarHeader',$context['tp_panels']) && $context['TPortal']['showcollapse']==1 ? 'display: none;' : '' , '">
' , TPortal_panel('lower') , '</div>';


template_info_center();
}


Displays recent topics block above info center, but only if lower block is activated, so it's displayed twice.  Now have to figure out how to remove lower block.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Adding an updateable postpage underneath Boards
« Reply #7 on: December 08, 2017, 10:23:29 PM »
Ok, block has to be active.  In TPBlockLayout.template.php -

Code: [Select]

function template_tp_below()
{
global $context;

if($context['TPortal']['lowerpanel']!=1)
echo '
<div id="tplowerbarHeader" style="' , in_array('tplowerbarHeader',$context['tp_panels']) && $context['TPortal']['showcollapse']==1 ? 'display: none;' : '' , '">
' , TPortal_panel('lower') , '</div>';


It removes the block below board index, leaves the new one above info center.

Offline thomp4pal

  • Semi-Newbie
  • *
  • Posts: 13
Re: Adding an updateable postpage underneath Boards
« Reply #8 on: December 09, 2017, 07:24:49 AM »
This seems to do the magic, but am not done yet Sir Osis of Liver ;D

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,735
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Adding an updateable postpage underneath Boards
« Reply #9 on: December 21, 2017, 11:34:18 AM »
So, is everything figured out now, or do you still need assistance with something? :)
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline thomp4pal

  • Semi-Newbie
  • *
  • Posts: 13
Re: Adding an updateable postpage underneath Boards
« Reply #10 on: December 30, 2017, 12:56:16 PM »
Due to Heavy workload and planning on designs i've been off this thread until now, my apologies pls...

And now Situation Report  ;D

Yes the code provided by Sir Osis of Liver did worked like charm however something weird came up after editing TPBlockLayout.template.php

'Forum' starts to appear twice in current position in forum link... (check attached picture) am sure it has to do with Tinyportal, also i noticed that i am redirected to 'Forum' by default each time a user logs in, I sorted that from TP settings (How to redirect after login: >Redirect  to frontpage).  But still 'Forum' still appears double in Current position in forum link...



« Last Edit: December 30, 2017, 01:19:34 PM by thomp4pal »

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,458
Re: Adding an updateable postpage underneath Boards
« Reply #11 on: December 30, 2017, 03:32:11 PM »
Hmm, the edits shouldn't have affected the menu, I believe it's pulled in with a hook.  Go to the TP support topic, Mick will help you with that.  Give him a link to my code above.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,735
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Adding an updateable postpage underneath Boards
« Reply #12 on: January 11, 2018, 05:40:35 AM »
Go to the TP support topic, Mick will help you with that.  Give him a link to my code above.
Judging from the discussion in the mod's topic, this would appear to be solved.
I'll mark the topic solved, but if the OP still need assistance they are free to mark the topic not solved again. :)
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas