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,947
  • Latest: sgm09
Stats
  • Total Posts: 195,765
  • Total Topics: 21,279
  • Online today: 436
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 392
  • Total: 392

Fronpage news from few boards

Started by Nolt, June 19, 2011, 06:36:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nolt

Link to my site: http://www.wizzi.pl
SMF version: SMF 2.0
TP version: TP 1.0 RC2
Default Forum Language: Polish
Theme name and version: Recall
Browser Name and Version: FF4
Mods installed: TP, Aeva lite, Stop Spammer
Related Error messages:

News on front page are fetch only from first board that I typed. I have 3 of them from three different forum boards.

IchBin

What option do you have selected to display on front page?

Only forum-posts
Selected topics only
Forum-posts and articles - sorted on date


IchBin

Find in TPortal.php this code:
// Find the post ids.
if($context['TPortal']['front_type'] == 'forum_only')
$request =  $smcFunc['db_query']('', '
SELECT t.id_first_msg as ID_FIRST_MSG
FROM ({db_prefix}topics as t, {db_prefix}boards as b)
WHERE t.id_board = b.id_board
AND t.id_board IN({string:board})
' . ($context['TPortal']['allow_guestnews'] == 0 ? 'AND {string:guestnews}' : '') . '
ORDER BY t.id_first_msg DESC
LIMIT {int:max}',
array(
'board' => $context['TPortal']['SSI_board'],
'guestnews' => $user_info['query_see_board'],
'max' => $totalmax)
);


Replace with this code:
// Find the post ids.
if($context['TPortal']['front_type'] == 'forum_only')
$request =  $smcFunc['db_query']('', '
SELECT t.id_first_msg as ID_FIRST_MSG
FROM ({db_prefix}topics as t, {db_prefix}boards as b)
WHERE t.id_board = b.id_board
AND t.id_board IN({raw:board})
' . ($context['TPortal']['allow_guestnews'] == 0 ? 'AND {query_see_board}' : '') . '
ORDER BY t.id_first_msg DESC
LIMIT {int:max}',
array(
'board' => $context['TPortal']['SSI_board'],
'max' => $totalmax)
);


candidosa2

thank you
But i need all board...when post new message she can automatic to frontpage
how can do that thank you
TinyPortal 100% Translate Portugues and Brazilian

ZarPrime

Quote from: candidosa2 on July 15, 2011, 10:09:00 PM
thank you
But i need all board...when post new message she can automatic to frontpage
how can do that thank you

candidosa2,

I have marked this topic solved.  Please start a new topic if you have an issue.

ZarPrime

ZER0X304

// Find the post ids.
if($context['TPortal']['front_type'] == 'forum_only')
$request =  $smcFunc['db_query']('', '
SELECT t.id_first_msg as ID_FIRST_MSG
FROM ({db_prefix}topics as t, {db_prefix}boards as b)
WHERE t.id_board = b.id_board
AND t.id_board IN({string:board})
' . ($context['TPortal']['allow_guestnews'] == 0 ? 'AND {string:guestnews}' : '') . '
ORDER BY t.id_first_msg DESC
LIMIT {int:max}',
array(
'board' => $context['TPortal']['SSI_board'],
'guestnews' => $user_info['query_see_board'],
'max' => $totalmax)
);


All we do is change this line:

AND t.id_board IN({string:board})

To this:

AND t.id_board IN({raw:board})

Can we get this added to the next TP release please? Thanks :)

Lesmond

Thanks ZER0X304 and welcome to Tinyportal O0

I will point this out to Ichbin when he gets back, hes out of town for a few days so may not see this...

So you like a bit of php? stick around we are always on the lookout for coders   O0

IchBin

Yep I've already made the change. Thanks ZEROX304.

This website is proudly hosted on Crocweb Cloud Website Hosting.