News:

Wondering if this will always be free?  See why free is better.

Main Menu

Adding an updateable postpage underneath Boards

Started by thomp4pal, December 08, 2017, 12:28:11 PM

Previous topic - Next topic

thomp4pal

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 :  www.unbox9ja.com



Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

thomp4pal


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...

thomp4pal

Still Not popping out under board.

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

BoardIndex.template.php code:


// 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:


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:

// 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...

thomp4pal

should look something like this underneath board  8)

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Ok, got this far -



// 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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Ok, block has to be active.  In TPBlockLayout.template.php -



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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

thomp4pal

This seems to do the magic, but am not done yet Sir Osis of Liver ;D

Aleksi "Lex" Kilpinen

So, is everything figured out now, or do you still need assistance with something? :)
Slava
Ukraini!
"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

How you can help SMF

thomp4pal

#10
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...




Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Aleksi "Lex" Kilpinen

Quote from: Sir Osis of Liver on December 30, 2017, 03:32:11 PM
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. :)
Slava
Ukraini!
"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

How you can help SMF

Advertisement: