Main Menu
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 log in.

Who's Online

  • Dot Guests: 827
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

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]


Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Board News problem

Started by Eloryn, December 18, 2009, 12:28:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eloryn

SMF 1.1.11, SP 2.3.1

I have serveral boards, all private but one. Within the Board News block I'd like to show from three different boards.

If I use the default settings, it works as expected. You can only see posts from those boards that you have access too. If unregistered or logged out, you see posts from the one public board. When you login you see posts from those boards you have access too.

However, I'd prefer to be able to pick the boards shown. When I choose which boards to show, they show to everyone, with or without the correct permissions. So if I pick my three boards, two of them being private, even those logged out or unregistered can see posts from the private boards in the block.

Nathaniel

Code ("Find (Sources/PortalBlocks.php)") Select
$request = db_query("
SELECT t.ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
INNER JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
WHERE " . (empty($board) ? $user_info['query_see_board'] . "
AND t.ID_FIRST_MSG >= " . ($modSettings['maxMsgID'] - 45 * min($limit, 5)) : "b.ID_BOARD IN (" . implode(', ', $board) . ")") . "
AND (t.locked != 1 OR m.icon != 'moved')
ORDER BY t.ID_FIRST_MSG DESC
LIMIT $limit", __FILE__, __LINE__);


Code ("Replace") Select
$request = db_query("
SELECT t.ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
INNER JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
WHERE " . $user_info['query_see_board'] . (empty($board) ? "
AND t.ID_FIRST_MSG >= " . ($modSettings['maxMsgID'] - 45 * min($limit, 5)) : "b.ID_BOARD IN (" . implode(', ', $board) . ")") . "
AND (t.locked != 1 OR m.icon != 'moved')
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.

Eloryn

I really appreciate the help. However it now wants to download \index.php like its a file (when opening home).

Nathaniel

Huh. I don't think that that is a related issue. The edit in my post above was not substantial, so its highly unlikely that it is the cause of that issue.

Does it only occur when that edit has been made? Can you remove the edit and see if its still happening?
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.

Eloryn

Yeah, I checked it like five times. Permissions are all the same. Seems a bit odd to me also. But I've gone back and forth with the original and the fix. Using firefox.

Edit: All the other buttons work fine. Clicking Home button and it tries to download the index.php. Undo the fix and the problem goes away.

Eloryn

Okay, a little more progress on this. I swapped fix back in again, as some kind of sadistic last test to prove I wasn't crazy. And this time it worked..... Which only proved to me I was crazy because I knew what I saw before. lol.

I then went in and changed the boards it uses for the news (selected three of them [one public, two private]). And the problem is back. Home button wants to download index.php.

When turning off all selected boards (default setting), the problem goes away.

Eloryn

And I just verified the original again. It hasn't got this problem, no matter what boards are selected. But it still has the original problem, of course.

Nathaniel

Hmm, I still can't work out why that edit would be causing any issues.

Does the problem occur (without the edit made) if you set the block so that all boards are shown? (Deselect all boards 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.

Eloryn

It only happens with this edit, and only when certain boards are chosen. It does not happen without this. And it does not happen if I have the default settings (no boards selected).

If I use the fix, and choose a board, it does not work.

Eloryn

Now that Christmas is over, is anyone able to help me with this?

Nathaniel

Could you please attach your Sources/PortalBlocks.php file?
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.

Eloryn

There ya go. Thanks, for the help too.

Nathaniel

Sorry for the wait on this issue, the replace code should be:
$request = db_query("
SELECT t.ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
INNER JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
WHERE " . $user_info['query_see_board'] . (empty($board) ? "
AND t.ID_FIRST_MSG >= " . ($modSettings['maxMsgID'] - 45 * min($limit, 5)) : "AND b.ID_BOARD IN (" . implode(', ', $board) . ")") . "
AND (t.locked != 1 OR m.icon != 'moved')
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.

Eloryn

I think that's the same as the first? I can't see anything different. But I did copy/paste it as is, and I still have the same problem.

[SiNaN]

Try this one instead:

Code ("Find (Sources/PortalBlocks.php)") Select
$request = db_query("
SELECT t.ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
INNER JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
WHERE " . (empty($board) ? $user_info['query_see_board'] . "
AND t.ID_FIRST_MSG >= " . ($modSettings['maxMsgID'] - 45 * min($limit, 5)) : "b.ID_BOARD IN (" . implode(', ', $board) . ")") . "
AND (t.locked != 1 OR m.icon != 'moved')
ORDER BY t.ID_FIRST_MSG DESC
LIMIT $limit", __FILE__, __LINE__);


Code ("Replace") Select
$request = db_query("
SELECT t.ID_FIRST_MSG
FROM {$db_prefix}topics AS t
INNER JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
INNER JOIN {$db_prefix}messages AS m ON (m.ID_MSG = t.ID_FIRST_MSG)
WHERE " . $user_info['query_see_board'] . (empty($board) ? "
AND t.ID_FIRST_MSG >= " . ($modSettings['maxMsgID'] - 45 * min($limit, 5)) : " AND b.ID_BOARD IN (" . implode(', ', $board) . ")") . "
AND (t.locked != 1 OR m.icon != 'moved')
ORDER BY t.ID_FIRST_MSG DESC
LIMIT $limit", __FILE__, __LINE__);
And slowly, you come to realize... It's all as it should be...

Eloryn

Awesome, that fixed it. Thanks for all the help.

[SiNaN]

And slowly, you come to realize... It's all as it should be...