collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 404
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Board News: Add topic of different sections ?  (Read 10121 times)

0 Members and 1 Guest are viewing this topic.

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Board News: Add topic of different sections ?
« on: April 07, 2009, 02:56:40 PM »
I saw in options that in Board NEws i can add topic of one section only is possible add topics of 2 or 3 different sections?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #1 on: April 07, 2009, 09:42:44 PM »
That block doesn't support showing posts from multiple boards. Although if you post your SMF version then I can post some edits that you can make so that it will allow you to do that.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Re: Board News: Add topic of different sections ?
« Reply #2 on: April 08, 2009, 03:09:27 AM »
That block doesn't support showing posts from multiple boards. Although if you post your SMF version then I can post some edits that you can make so that it will allow you to do that.

2.0 RC1 thx for help, i wanted show in board news ONLY topics of certains board not topcs of all boards

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #3 on: April 08, 2009, 03:24:13 AM »
Edits for the 'SPortal2.php' file.

These edits will mean that you can enter a list of board IDs separated by commas into the 'Board ID' field. Eg '1,45,3,2'.

Find this code:
Code: [Select]
$block_parameters = array(
'board' => 'int',
'limit' => 'int',
'start' => 'int',
'length' => 'int',
'avatar' => 'check',
'per_page' => 'int',
);

if ($return_parameters)
return $block_parameters;

$board = !empty($parameters['board']) ? (int) $parameters['board'] : null;

Replace with this code:
Code: [Select]
$block_parameters = array(
'board' => 'text',
'limit' => 'int',
'start' => 'int',
'length' => 'int',
'avatar' => 'check',
'per_page' => 'int',
);

if ($return_parameters)
return $block_parameters;

$boards = !empty($parameters['board']) ? explode(',', $parameters['board']) : array();
foreach ($boards as $id_board => $board)
{
$board = (int) $board;
if (empty($board))
unset($boards[$id_board]);
else
$boards[$id_board] = $board;
}

Find this code:
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT id_first_msg
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
WHERE ' . (empty($board) ? '{query_see_board}' : 'b.id_board = {int:current_board}') . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '') . '
ORDER BY t.id_first_msg DESC
LIMIT {int:limit}',
array(
'current_board' => $board,
'is_approved' => 1,
'limit' => $limit,
)
);

Replace with this code:
Code: [Select]
$request = $smcFunc['db_query']('', '
SELECT id_first_msg
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
WHERE ' . (empty($boards) ? '{query_see_board}' : 'b.id_board IN ({array_int:current_boards})') . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '') . '
ORDER BY t.id_first_msg DESC
LIMIT {int:limit}',
array(
'current_boards' => $boards,
'is_approved' => 1,
'limit' => $limit,
)
);
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Re: Board News: Add topic of different sections ?
« Reply #4 on: April 08, 2009, 05:47:08 AM »
Edits for the 'SPortal2.php' file.

These edits will mean that you can enter a list of board IDs separated by commas into the 'Board ID' field. Eg '1,45,3,2'.


please sticky me in bold the part of code where i must add board id , i cannot understand :(

thx
« Last Edit: April 08, 2009, 05:51:54 AM by edi67 »

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #5 on: April 08, 2009, 06:26:08 AM »
You put them into the 'Board ID' field that is shown when you edit/add a Board News block. ;)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Re: Board News: Add topic of different sections ?
« Reply #6 on: April 08, 2009, 07:15:46 AM »
You put them into the 'Board ID' field that is shown when you edit/add a Board News block. ;)
work like a chamr thx ;) but there is one problem big for me, now every user groups can view topics in portal but can view too topic of sections where are NOT enabled to view, i means, there are some sections in my forum that some user groups cannot view, and now topics of these sections are visible for disable user groups too
is possible fix this?

tha anyway
« Last Edit: April 08, 2009, 07:21:42 AM by edi67 »

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Re: Board News: Add topic of different sections ?
« Reply #7 on: April 09, 2009, 05:28:07 PM »
please you can reply me to my last question thx.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #8 on: April 09, 2009, 08:40:00 PM »
The Board News block assumes that you are only showing topics/boards that you want all users to see.

Replace this code:
Code: [Select]
   $request = $smcFunc['db_query']('', '
      SELECT id_first_msg
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
      WHERE ' . (empty($boards) ? '{query_see_board}' : 'b.id_board IN ({array_int:current_boards})') . ($modSettings['postmod_active'] ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY t.id_first_msg DESC
      LIMIT {int:limit}',
      array(
         'current_boards' => $boards,
         'is_approved' => 1,
         'limit' => $limit,
      )
   );

With this code:
Code: [Select]
   $request = $smcFunc['db_query']('', '
      SELECT id_first_msg
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
      WHERE {query_see_board}
AND b.id_board IN ({array_int:current_boards})' . ($modSettings['postmod_active'] ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY t.id_first_msg DESC
      LIMIT {int:limit}',
      array(
         'current_boards' => $boards,
         'is_approved' => 1,
         'limit' => $limit,
      )
   );
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Re: Board News: Add topic of different sections ?
« Reply #9 on: April 10, 2009, 11:54:52 AM »
work good now with permission, but one little question not inerent this.

Why the TAG (CODE, QUOTE etc) are not showed in correct way ?
look screenshot,  portal not show CODE with code style but with the TAG look screen for understand.

but not problem for it , thx for help everything is ok ;)
« Last Edit: April 10, 2009, 12:01:33 PM by edi67 »

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #10 on: April 11, 2009, 04:44:54 AM »
Looks like the post is being cut off in the middle of the Code tags, although it should be able to cope with that.

This is either an SMF or SP bug.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Nigel

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 1.1.8
  • SP Version: 2.2
Re: Board News: Add topic of different sections ?
« Reply #11 on: May 02, 2009, 04:23:59 PM »
That block doesn't support showing posts from multiple boards. Although if you post your SMF version then I can post some edits that you can make so that it will allow you to do that.

How about SMF version 1.1.8? Anyway I can also fix this code in order to display multiple boards on the Frontpage block?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #12 on: May 02, 2009, 07:36:43 PM »
For SMF 1.1.8:
Replace this code:
Code: [Select]
SELECT ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE " . (empty($board) ? $user_info['query_see_board'] : "b.ID_BOARD = $board") . "
ORDER BY t.ID_FIRST_MSG DESC
LIMIT $limit", __FILE__, __LINE__);

With this code:
Code: [Select]
SELECT ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE $user_info[query_see_board]" . (empty($board) ? '' : "
b.ID_BOARD = $board") . "
ORDER BY t.ID_FIRST_MSG DESC
LIMIT $limit", __FILE__, __LINE__);)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Nigel

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 1.1.8
  • SP Version: 2.2
Re: Board News: Add topic of different sections ?
« Reply #13 on: May 02, 2009, 08:24:07 PM »
Thank you for the reply.

I applied the code changes you suggested for 1.1.8 and also do the code changes mentioned above for the "$block_parameters".

However, when previewing the Board News block I receive the following:
Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b.ID_BOARD = 2
ORDER BY t.ID_FIRST_MSG DESC
LIMIT 5' at line 5
File: /home8/xxxx/public_html/Sources/SPortal1-1.php
Line: 1344

Any ideas where this is coming from and how I can fix this?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #14 on: May 02, 2009, 10:04:11 PM »
Whoops, try this:
Code: [Select]
      SELECT ID_FIRST_MSG
      FROM {$db_prefix}topics AS t
         INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
      WHERE $user_info[query_see_board]' . (empty($board) ? '' : '
         AND b.id_board IN (' . implode(',', $boards) . ')') . ($modSettings['postmod_active'] ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY t.ID_FIRST_MSG DESC
      LIMIT $limit", __FILE__, __LINE__);
« Last Edit: May 02, 2009, 10:09:09 PM by LHVWB »
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Nigel

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 1.1.8
  • SP Version: 2.2
Re: Board News: Add topic of different sections ?
« Reply #15 on: May 03, 2009, 07:57:31 AM »
Hi LHVWB,

Thank you for your help so far.
Unfortunately I now receive the following error message:
Code: [Select]
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home8/xxxx/public_html/Sources/SPortal1-1.php on line 1342
I've been trying for some hours now trying to fix this on my own, but it's pretty obvious my skills are not that good as I might have hoped  :-X

Any suggestions?

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #16 on: May 03, 2009, 08:01:59 AM »
Sigh, not having any luck today. Shows what happens when I am not concentraiting.

The code below should work:
Code: [Select]
SELECT ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
WHERE $user_info[query_see_board]" . (empty($board) ? '' : "
AND b.id_board IN (" . implode(',', $boards) . ')') . ($modSettings['postmod_active'] ? "
AND t.approved = {int:is_approved}" : '') . "
ORDER BY t.ID_FIRST_MSG DESC
LIMIT $limit", __FILE__, __LINE__);;
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Nigel

  • Semi Newbie
  • *
  • Posts: 9
  • SMF Version: 1.1.8
  • SP Version: 2.2
Re: Board News: Add topic of different sections ?
« Reply #17 on: May 03, 2009, 09:32:38 AM »
Ahh that did the trick for me  :D

Thanks for your help.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Board News: Add topic of different sections ?
« Reply #18 on: May 23, 2009, 12:30:55 PM »
./Sources

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #19 on: May 25, 2009, 04:53:36 AM »
You are running SMF 1.1.8, so the file is at '{smf directory}/sources/Subs-SPortal1-1.php'. ;)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #20 on: May 25, 2009, 05:32:21 PM »
SMF 1.1.9 is essentially the same as SMF 1.1.8, the file that you need to edit is still at '{smf directory}/sources/Subs-SPortal1-1.php'.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Board News: Add topic of different sections ?
« Reply #21 on: May 25, 2009, 08:15:50 PM »
You are running SMF 1.1.8, so the file is at '{smf directory}/sources/Subs-SPortal1-1.php'. ;)

Make sure the "S" in "sources" is capitalized.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Board News: Add topic of different sections ?
« Reply #22 on: June 04, 2009, 05:27:17 PM »
No, sorry, the edits are for the '{smf directory}/Sources/SPortal1-1.php' file. :/

If you attach that file then I can do the edits for you. :)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline edi67

  • Semi Newbie
  • *
  • Posts: 22
  • SMF Version: 2 RC1
  • SP Version: 2.3
Re: Board News: Add topic of different sections ?
« Reply #23 on: October 18, 2009, 02:39:11 AM »
The Board News block assumes that you are only showing topics/boards that you want all users to see.

Replace this code:
Code: [Select]
   $request = $smcFunc['db_query']('', '
      SELECT id_first_msg
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
      WHERE ' . (empty($boards) ? '{query_see_board}' : 'b.id_board IN ({array_int:current_boards})') . ($modSettings['postmod_active'] ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY t.id_first_msg DESC
      LIMIT {int:limit}',
      array(
         'current_boards' => $boards,
         'is_approved' => 1,
         'limit' => $limit,
      )
   );

With this code:
Code: [Select]
   $request = $smcFunc['db_query']('', '
      SELECT id_first_msg
      FROM {db_prefix}topics AS t
         INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
      WHERE {query_see_board}
AND b.id_board IN ({array_int:current_boards})' . ($modSettings['postmod_active'] ? '
         AND t.approved = {int:is_approved}' : '') . '
      ORDER BY t.id_first_msg DESC
      LIMIT {int:limit}',
      array(
         'current_boards' => $boards,
         'is_approved' => 1,
         'limit' => $limit,
      )
   );

i need help please in simpleportal 2.3 where i can find that code to edit ?