News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

Motorhed

Can someone shed any light on why attachments show on every page of Simple Portal EXCEPT the main "Home" portal page when you're a Guest?

In other words, Guests can see attachments on Blocks when they're anywhere BUT the "Home" portal page. Then it's like they don't have permission.

Yes, Guests have permission to view attachments on my forum.

Motorhed

I hate to "bump", but I wanted to note I still haven't found a solution for this... and maybe to explain a bit more.

Anywhere the portal block shows, the attachment shows... Except the front page of the portal. There, it is as if the attachment doesn't exist... but only for Guests.

Guests can see the attachments everywhere else the block appears, meaning it's not a permissions problem.

player.samp

The only explanation I can give you is that you have a problem with the SimplePortal script but there might be other options which I am not aware of.

Which version of SimplePortal are you using?

Chas Large

I've been using SP for years and have never seen this phenomenon. I use the main portal page as the front page for my site and the blocks thoughout the forum, never have I seen any attachments show in a block. It sounds like another mod is conflicting. I would be tempted to create a local (WAMPP) version of the site, do a full SMF install or update and then install SP followed by other mods to identify which one is causing the problem. When found you can then uninstall it from the live site.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Chen Zhen

Motorhed,

  Something you have in a custom block or perhaps another edit or modification is likely causing the issue.
May I have a link to an example on your forum so that I can analyze the occurrence? 

Regards.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

lonewolfe2015

I recently switched over my forum domain and it looks like there's a bit of a problem with logging in from the index page now.

Whenever members login from http://{forum}/index.php they're redirected to http://{forum}/action=forum, which 404's since it doesn't exist (needs to be http://{forum}/index.php?action=forum).

I figured I could probably just uninstall SimplePortal and re-install it, but now it's telling me there would be an error in ./Sources/Who.php if I did so.

Would anyone happen to have any suggestions for how I can troubleshoot this login bug and/or bypass the error I'm getting? Do I need to post the find/replace segments?

lonewolfe2015

Any chance someone could offer some suggestions here? Have more members noticing this 404 now. Would it be best for me to just try forcing the uninstall even with the error since I'm going to re-install it anyways?

Chen Zhen

lonewolfe2015,

  This sounds to me like it may be a directory path issue.
Ensure the paths are correct for SMF, your themes and the standalone url (<-- if you use it).
This tool will allow you to easily adjust paths if necessary: http://download.simplemachines.org/index.php?thanks;filename=repair_settings.php
Here is the instruction for it: http://wiki.simplemachines.org/smf/Repair_settings.php
Standalone url setting is within Simple Portal general settings (<-- if you use this feature)


Let me know if that resolves the issue.

Regards.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

lonewolfe2015

The things I could do from the admin panel I checked, including accidentally breaking the forum link and having to reset it from ftp. I had the server owner run the repair settings utility too (he said he did it when he moved the domain over as well) and it was trying to get him point some items at his internal IP. But otherwise we believe we set all the directories to point where they should.

I ended up noticing that the disable portal redirection was on in the general settings when I checked there and re-enabled it. For now at least when my users log in they're being directed to the index page and logged in successfully, but I'd prefer they had the freedom to log in right to the forum.

I'm not sure what else it could be though than some sort of directory issue, so if the SMF tool checks all those is it possible SimplePortal isn't redirecting properly and there's a file somewhere I should check that might be off from the domain move?

Motorhed

Fortunately, the problem fixed itself. I have no idea how.

I kept trying over and over and over again, logging out and logging in, and images just would NOT show to guests on the "main" portal page. Now, days later, it's working perfectly as if nothing was wrong.

I can only assume it was some sort of cache issue that wasn't cleared up when I emptied logs, cleared my browser, etc. No idea what caused this.

Motorhed

I spoke too soon. Attachments are back to not showing for guests. :(

http://stinko.com

The sidebar post, "10 Unexpected Characters We Need to See in the Next Mortal Kombat", should have an image next to it.

See it displayed correctly here: http://stinko.com/articles/10-unexpected-characters-we-need-to-see-in-the-next-mortal-kombat/

It doesn't show the attachment next to the post title in the sidebar anywhere but the post view. This is so weird, because it seemed to have fixed itself...

Chen Zhen

Motorhed,

  The css for that block is different between your home page & the actual post's page. Also the home page does not display the html for that image at all.
Is this the included Articles block being used? What exact block is being used and if it is an included block, has it been modified?
If this is a blog block then which blog mod do you have installed?

Regards.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

MESWEB

Where is info about responsive portal. Google need responsive theme if You install it then portal is are not readable in smartphone with resolution like 360 x 480

DSystem

RESPOSIVE adaptations:


portal.css (...themes/default/css/portal.css)


before
body
{
min-width: 750px;
}


After
body
{
min-width: device-width;
}



Add at the end
@media only screen and (max-width: 799px)
{
#sp_left, #sp_right
{
display: none;
visibility: hidden;
}
}

MESWEB

Thanks man  :) . So how do You think how the website should look like if I want display sp right and left.

Motorhed

Quote from: Chen Zhen on May 01, 2015, 11:49:37 PM
Motorhed,

  The css for that block is different between your home page & the actual post's page. Also the home page does not display the html for that image at all.
Is this the included Articles block being used? What exact block is being used and if it is an included block, has it been modified?
If this is a blog block then which blog mod do you have installed?

Regards.

It's a direct SSI edit, with the SSI called in that block.

It's essentially pulling the threads from a specific board and displaying the first attachment to the left.

In the SSI file, if there's NO attachment, then it displays nothing. If there IS an attachment, it displays.

I'm starting to feel like this isn't a SimplePortal thing... but the problem is the attachment will display ANYWHERE else but the portal blocks outside the post.

Like, if I use it on an external web page completely separate from the forum in total, the attachments display.

Chen Zhen

Motorhed,

  Would you be able to post exactly what code you are using?
Within BBcode code tags show the code within your php block and then show the actual edited SSI function.
This way I can adjust it to how you want it.

Regards.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Bixby

#5057
Hello.

I just uninstalled Simple Portal 2.3.4 in preparation for installing 2.3.6 and now the website generates this error:
"Fatal error: Call to undefined function sportal_init() in /home/content/r/e/a/readersgreg/html/forumsmwr/index.php on line 213"

Any help would be appreciated.
(1) I did a full backup prior to install.
(2) I am very non-technical (Using package manager for all installs and uninstalls).
(3) I am running SMF 2.0.10
(4) GoDaddy is my host.

EDIT: Resolved. Thankfully I have a friend that knows PHP
Life is Short; Play Games!

Motorhed

Here's the block code:

<?php ssi_coolNews2(array(2,99), 6null0); ?>

Here's the specific SSI code being called:

// Show the latest news, with a template... by board.
function ssi_coolNews2($board = null, $limit = null, $start = null, $length = null, $output_method = 'echo')
{
global $scripturl, $db_prefix, $txt, $settings, $modSettings, $context;
global $smcFunc;

loadLanguage('Stats');

// Must be integers....
if ($limit === null)
$limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 5;
else
$limit = (int) $limit;

if ($start === null)
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
else
$start = (int) $start;

/*
if ($board !== null)
$board = (int) $board;
elseif (isset($_GET['board']))
$board = (int) $_GET['board'];
*/

if (empty($board))
return;
elseif (!is_array($board))
$board = array($board);

if ($length === null)
$length = isset($_GET['length']) ? (int) $_GET['length'] : 0;
else
$length = (int) $length;

$limit = max(0, $limit);
$start = max(0, $start);

/*
// Make sure guests can see this board.
$request = $smcFunc['db_query']('', '
SELECT id_board
FROM {db_prefix}boards
WHERE ' . ($board === null ? '' : 'id_board = {int:current_board}
AND ') . 'FIND_IN_SET(-1, member_groups)
LIMIT 1',
array(
'current_board' => $board,
)
);
if ($smcFunc['db_num_rows']($request) == 0)
{
if ($output_method == 'echo')
die($txt['ssi_no_guests']);
else
return array();
}
list ($board) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
*/

// Load the message icons - the usual suspects.
$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find the post ids.
$request = $smcFunc['db_query']('', '
SELECT id_first_msg
FROM {db_prefix}topics
WHERE id_board IN ({array_int:current_board})' . ($modSettings['postmod_active'] ? '
AND approved = {int:is_approved}' : '') . '
ORDER BY id_first_msg DESC
LIMIT ' . $start . ', ' . $limit,
array(
'current_board' => $board,
'is_approved' => 1,
)
);
$posts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$posts[] = $row['id_first_msg'];
$smcFunc['db_free_result']($request);

if (empty($posts))
return array();

global $sourcedir, $attachments, $topic;
require_once($sourcedir . '/Display.php');

$attachments = array();
$request = $smcFunc['db_query']('', '
SELECT
a.id_attach, a.id_folder, a.id_msg, a.filename, IFNULL(a.size, 0) AS filesize, a.downloads, a.approved,
a.width, a.height' . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? '' : ',
IFNULL(thumb.id_attach, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height') . '
FROM {db_prefix}attachments AS a' . (empty($modSettings['attachmentShowImages']) || empty($modSettings['attachmentThumbnails']) ? '' : '
LEFT JOIN {db_prefix}attachments AS thumb ON (thumb.id_attach = a.id_thumb)') . '
WHERE a.id_msg IN ({array_int:message_list})
AND a.attachment_type = {int:attachment_type}' . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : '
AND a.approved = {int:is_approved}'),
array(
'message_list' => $posts,
'attachment_type' => 0,
'is_approved' => 1,
)
);
$temp = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$temp[$row['id_attach']] = $row;

if (!isset($attachments[$row['id_msg']]))
$attachments[$row['id_msg']] = array();
}
$smcFunc['db_free_result']($request);

ksort($temp);

foreach ($temp as $row)
$attachments[$row['id_msg']][] = $row;

// Find the posts.
$request = $smcFunc['db_query']('', '
SELECT
m.icon, m.subject, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
t.num_replies, t.num_views, t.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, t.id_last_msg
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
WHERE t.id_first_msg IN ({array_int:post_list})
ORDER BY t.id_first_msg DESC
LIMIT ' . count($posts),
array(
'post_list' => $posts,
)
);
$return = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
// If we want to limit the length of the post.
if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
{
$row['body'] = $smcFunc['substr']($row['body'], 0, $length);

// The first space or line break. (<br />, etc.)
$cutoff = max(strrpos($row['body'], ' '), strrpos($row['body'], '<'));

if ($cutoff !== false)
$row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
$row['body'] .= '...';
}

$row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']);

// Check that this message icon is there...
if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

censorText($row['subject']);
censorText($row['body']);

$topic = $row['id_topic'];
$return[] = array(
'attachments' => loadAttachmentContext($row['id_msg']),
'id' => $row['id_topic'],
'views' => $row['num_views'],
'message_id' => $row['id_msg'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" alt="' . $row['icon'] . '" />',
'subject' => $row['subject'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'body' => $row['body'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['num_replies'] . ' ' . ($row['num_replies'] == 1 ? $txt['ssi_comment'] : $txt['ssi_comments']) . '</a>',
'replies' => $row['num_replies'],
'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'],
'comment_link' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';last_msg=' . $row['id_last_msg'] . '">' . $txt['ssi_write_comment'] . '</a>',
'new_comment' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . '">' . $txt['ssi_write_comment'] . '</a>',
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
),
'locked' => !empty($row['locked']),
'is_last' => false
);
}
$smcFunc['db_free_result']($request);

if (empty($return))
return $return;

$return[count($return) - 1]['is_last'] = true;

if ($output_method != 'echo')
return $return;

foreach ($return as $news)
{
$attachment = array();
if (!empty($news['attachments'][0]))
{
$attachment = $news['attachments'][0];

if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<div style="display: block; overflow: auto;"><div class="floatsquare"><a href="', $news['href'], '"><img src="', $attachment['thumbnail']['href'], '" alt="' . $news['subject'] . '" border="0" /></a><br /></div><div class="newsblock">';
else
echo '
<div style="display: block; overflow: auto;"><div class="floatsquare"><a href="', $news['href'], '"><img src="' . $attachment['href'] . ';image" alt="' . $news['subject'] . '" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /></a><br /></div><div class="newsblock">';
}
}
else
echo '
<div style="display: block; overflow: auto;"><div class="newsblock2">';

echo '
<div class="headline"><a href="', $news['href'], '">', $news['subject'], '</a></div>
<div class="details">', $news['link'], $news['locked'] ? '' : ' | ' . $news['views'], ' views</div>

</div></div><div style="clear: both;"></div>';

if (!$news['is_last'])
echo '
<hr />';
}
}

CrashTester

#5059
Hi. I'm looking for support on Simple Portal, I registered to the forum a few days ago and did not get an activation email, have tried again and again to have it resent but nothing. Its not in my junk folder. I'm using my Hotmail account, my username is Crash100 please can you enable my account on hxxp:simpleportal.net [nonactive]. Thanks.

My problem is that I get a the following error page when copy and pasting some HTML content into a new page I want to create, any suggestions on how to resolve this?

This page can't be displayed

•Make sure the web address http://condadodealhamaforum.com is correct.
•Look for the page with your search engine.
•Refresh the page in a few minutes.

Advertisement: