Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 04, 2020, 04:31:11 PM

Login with username, password and session length
Members
  • Total Members: 3786
  • Latest: Deaks
Stats
  • Total Posts: 190582
  • Total Topics: 20864
  • Online Today: 100
  • Online Ever: 917
  • (January 21, 2020, 09:02:26 AM)
Users Online
Users: 1
Guests: 61
Total: 62

Author Topic: Fronpage news from few boards  (Read 14125 times)

0 Members and 1 Guest are viewing this topic.

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Fronpage news from few boards
« on: June 19, 2011, 11:36:31 AM »
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.
« Last Edit: July 16, 2011, 08:09:38 AM by ZarPrime »

Offline IchBin

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Fronpage news from few boards
« Reply #1 on: June 19, 2011, 11:41:19 AM »
What option do you have selected to display on front page?
 
Only forum-posts
Selected topics only
Forum-posts and articles - sorted on date

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Fronpage news from few boards
« Reply #2 on: June 19, 2011, 03:13:14 PM »
Only forum posts.

Offline IchBin

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Fronpage news from few boards
« Reply #3 on: June 19, 2011, 07:15:12 PM »
Find in TPortal.php this code:
Code: [Select]
// 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:
Code: [Select]
// 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)
);

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Fronpage news from few boards
« Reply #4 on: June 20, 2011, 01:53:35 AM »
Thanks, it working.

Offline candidosa2

  • SMFPT BY APLIC
  • Jr. Member
  • **
  • Posts: 25
  • FreeLancer CMS
    • SMFPT
Re: Fronpage news from few boards
« Reply #5 on: July 15, 2011, 03: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
TinyPortal 100% Translate Portugues and Brazilian

Offline ZarPrime

  • Friends
  • *
  • Posts: 4653
Re: Fronpage news from few boards
« Reply #6 on: July 16, 2011, 08:11:11 AM »
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

Offline ZER0X304

  • Newbie
  • *
  • Posts: 2
Re: Fronpage news from few boards
« Reply #7 on: July 24, 2011, 07:29:26 AM »
Code: [Select]
// 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:

Code: [Select]
AND t.id_board IN({string:board})
To this:

Code: [Select]
AND t.id_board IN({raw:board})
Can we get this added to the next TP release please? Thanks :)

Offline Lesmond

  • Do what you have to!
  • Administrator
  • *
  • Posts: 3146
    • Tiny Pix... Free Image Hosting and Sharing.
Re: Fronpage news from few boards
« Reply #8 on: July 24, 2011, 07:49:01 AM »
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
Please don't PM me for support without an invitation.


Offline IchBin

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Fronpage news from few boards
« Reply #9 on: July 24, 2011, 08:30:41 AM »
Yep I've already made the change. Thanks ZEROX304.

Offline ZarPrime

  • Friends
  • *
  • Posts: 4653
Re: Fronpage news from few boards
« Reply #10 on: July 24, 2011, 08:36:47 AM »
Yes ZER0X304, but there are a few other edits in that part of the code from lines 1445 to 1458.  The full edit for those lines is specified in Ichbin's post above --> http://www.tinyportal.net/index.php?topic=34125.msg272832#msg272832

and yes, as Ichbin said, these edits have already been done for the next Release Candidate of TinyPortal [1.0 RC3] which is currently undergoing testing.

ZarPrime

Offline ZER0X304

  • Newbie
  • *
  • Posts: 2
Re: Fronpage news from few boards
« Reply #11 on: July 24, 2011, 09:41:03 AM »
welcome to Tinyportal O0

Thanks :)

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

I do quite a bit of work, but it's my first time looking through TP today - usually I have no need. I expect I'll be around a bit more often now :)

Yep I've already made the change.

Good to know, thanks.

Yes ZER0X304, but there are a few other edits in that part of the code from lines 1445 to 1458.

So they were, but I didn't find those edits a requirement :)

Offline BD

  • Newbie
  • *
  • Posts: 1
Re: Fronpage news from few boards
« Reply #12 on: November 12, 2011, 07:33:35 PM »
Find in TPortal.php this code:
Code: [Select]
// 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:
Code: [Select]
// 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)
);
Thank you for this!

Is there a way to do the same if you have selected "Forum-posts and articles - sorted on date" to display, rather than "Only forum-posts."

I really appreciate your help!
BD

Offline IchBin

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Fronpage news from few boards
« Reply #13 on: November 13, 2011, 12:02:03 AM »
I'm not sure what you are asking BD. Do the same what?