SSI Multiple Board News (ssi_multiBoardNews)

Started by vbgamer45, December 25, 2009, 01:57:08 AM

Previous topic - Next topic

Suki

That function already includes a parameter to add a custom delimeter, by default is 3 dots
Many ssi functions does include a way to cut off text, all this function do is to add more options.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Deadfire

Been trying to figure this out for a little while now, and it seems the posts that I need to see are no longer in this thread for some reason.

Anyways the issue I have is making attachments display. and I think I must be doing it wrong,

Here is my code:


$parameters = array(
'limit' => 5,
'board' => array(1,2,3,4,5),
'output_type' => 'array',
'attachments'=> 'inline',
);
$return = ssi_multiBoardNews($parameters);
foreach ($return['topics'] as $news)
{
echo'
<article>
<h2>', $news['subject'], '</h2>
<p class="pubdate">written by ', $news['poster']['link'], ', <time datetime="2013-03-01T12:00:00-05:00">', $news['time'], '</time></p>
<p class="pubdate">posted in ', $news['board']['link'], '</p>
<hr />
<p>', $news['body'], '</p>';
if (isset($news['attachments']))               
                     echo '
            <p><img src="', $news['attachments']['href'], '" width="500px" height="500" /></p>';         
echo' <hr />
<p class="read">', $news['link'], ' | ', $news['new_comment'], '</p>
</article>
<hr class="article-divider" />';

if (!$news['is_last'])
echo '
<hr width="100%" />
<br />';
}


Now am I'm figuring $news['attachments']['href'] what would be correct?

Yağız...

Replace $return['topic'] with only $return in foreach. And replace every $news with $news['topic'] except attachments.

Deadfire

Quote from: Yağız... on March 13, 2013, 06:15:24 AM
Replace $return['topic'] with only $return in foreach. And replace every $news with $news['topic'] except attachments.

That just gives me blank echos, as in there is no data that appears.


$parameters = array(
'limit' => 5,
'board' => array(1,2,3,4,5),
'output_type' => 'array',
'attachments'=> 'inline',
);
$return = ssi_multiBoardNews($parameters);
foreach ($return as $news)
{
echo'
<article>
<h2>', $news['topic']['subject'], '</h2>
<p class="pubdate">written by ', $news['topic']['poster']['link'], ', <time datetime="2013-03-01T12:00:00-05:00">', $news['topic']['time'], '</time></p>
<p class="pubdate">posted in ', $news['topic']['board']['link'], '</p>
<hr />
<p>', $news['topic']['body'], '</p>';
if (isset($news['attachments']))               
                     echo '
            <p><img src="', $news['attachments']['href'], '" width="150px" height="" /></p>';         
echo' <hr />
<p class="read">', $news['topic']['link'], ' | ', $news['topic']['new_comment'], '</p>
</article>
<hr class="article-divider" />';

if (!$news['topic']['is_last'])
echo '
<hr width="100%" />
<br />';
}

Yağız...

Sorry, what you did was correct. But there is a problem with count(array_intersect($parameters['board'], boardsAllowedTo('view_attachments'))) > 0 statement. Maybe you should wait for the author or Arantor to fix this problem.

Arantor

Why is there a problem with that, exactly? It's a perfectly legitimate construct.

Yağız...

Quote from: Arantor on March 13, 2013, 12:40:11 PM
Why is there a problem with that, exactly? It's a perfectly legitimate construct.
When I remove this part from the line attachments are in the output. I tried it on a new install, didn't touch any permissions.

Arantor

That would imply the user who views the page does not have permission to view attachments in the board(s) in question...

Yağız...

Quote from: Arantor on March 13, 2013, 02:24:29 PM
That would imply the user who views the page does not have permission to view attachments in the board(s) in question...
So why it doesn't show the attachments to an admin? :)

Arantor

Oh, because boardsAllowedTo() has strange properties for admins.

Deadfire

Quote from: Arantor on March 13, 2013, 04:21:57 PM
Oh, because boardsAllowedTo() has strange properties for admins.

Wouldn't your fix here fix that issue though?

Quote from: Arantor on March 06, 2011, 07:01:21 PM
OK, I looked at the code again, and with what I know now that I didn't know over a year ago, I can see a bug for administrators.

Code (find) Select
if ($parameters['attachments'] != 'none' && !empty($modSettings['attachmentEnable']) && count(array_intersect($parameters['board'], boardsAllowedTo('view_attachments'))) > 0)

Code (replace) Select
if ($parameters['attachments'] != 'none' && !empty($modSettings['attachmentEnable']) && ($context['user']['is_admin'] || count(array_intersect($parameters['board'], boardsAllowedTo('view_attachments'))) > 0))

boardsAllowedTo is a strange function; it returns the list of boards as it should, except for administrators, though why it showed them to me is a mystery. Before anyone else asks, I don't have the power to update this modification and if for any reason it were returned to me, I would remove it from this site.

Just as well I can't view the attachment even as a guest, and I've checked to make sure that the permissions were set.

Arantor

That fix would fix that issue, yes.

What permissions, exactly, were set?

Deadfire

well I guess 'permission' would be better, Guests can view attachments.

Arantor

No, it's not one permission. It's the confluence of permissions/groups/profiles/boards. Thus, what *permissions* total have been set?

Deadfire

Well the board profiles are all that allow for guests (and everyone) to view attachments, Permissions for all the membergroups also allow to view attachments

Arantor

Links to the SSI page would be useful at this point in time.

Deadfire

Quote from: Arantor on March 13, 2013, 07:57:15 PM
Links to the SSI page would be useful at this point in time.

roger :) I'll just limit to the ssi_multiBoardNews function unless you want it full


function ssi_multiBoardNews($parameters)
{
global $scripturl, $db_prefix, $txt, $settings, $modSettings, $context, $smcFunc, $user_profile;

loadLanguage('Stats');

// 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';

$feed_types = array('rss', 'rdf', 'atom', 'none');
$attach_types = array('none', 'linkonly', 'thumbnail', 'inline');
$avatar_types = array('none', 'left', 'right');

// Checking off the parameters first
$parameters['limit'] = isset($parameters['limit']) ? max(1, (int) $parameters['limit']) : 5;
$parameters['start'] = isset($parameters['start']) ? max(0, (int) $parameters['start']) : 0;
$parameters['length'] = isset($parameters['length']) ? (int) $parameters['length'] : 0;
$parameters['perms_override'] = isset($parameters['perms_override']) ? (bool) $parameters['perms_override'] : false;
$parameters['attachments'] = isset($parameters['attachments']) ? (in_array($parameters['attachments'], $attach_types) ? $parameters['attachments'] : 'none') : 'none';
$parameters['avatar'] = isset($parameters['avatar']) ? (in_array($parameters['avatar'], $avatar_types) ? $parameters['avatar'] : 'none') : 'none';

$parameters['feed'] = isset($parameters['feed']) ? (array) $parameters['feed'] : array('none');
$parameters['feed'] = array_intersect($parameters['feed'], $feed_types);
if (count($parameters['feed']) == 0)
$parameters['feed'] = array('none');

$parameters['board'] = isset($parameters['board']) ? (array) $parameters['board'] : array(0);
$parameters['category'] = isset($parameters['category']) ? (array) $parameters['category'] : array(0);
$parameters['board_disp'] = isset($parameters['board_disp']) ? (bool) $parameters['board_disp'] : true;
$parameters['category_disp'] = isset($parameters['category_disp']) ? (bool) $parameters['category_disp'] : false;

$parameters['icon'] = isset($parameters['icon']) ? (array) $parameters['icon'] : array();
$parameters['icon'] = array_intersect(array_unique($parameters['icon']), $stable_icons);

$parameters['output_type'] = isset($parameters['output_type']) ? ($parameters['output_type'] == 'echo' ? 'echo' : 'array') : 'echo';

foreach ($parameters['board'] as $key => $value)
{
$value = (int) $value;
if ($value < 1)
unset ($parameters['board'][$key]);
else
$parameters['board'][$key] = (int) $value;
}

if (!empty($parameters['category']))
{
$parameters['category'] = array_unique((array) $parameters['category']);
foreach ($parameters['category'] as $key => $value)
{
$value = (int) $value;
if ($value < 1)
unset ($parameters['category'][$key]);
else
$parameters['category'][$key] = (int) $value;
}

if (count($parameters['category']) > 0)
{
$query = $smcFunc['db_query']('', '
SELECT id_board FROM {db_prefix}boards WHERE id_cat IN ({array_int:cat_list})',
array(
'cat_list' => $parameters['category'],
)
);
while($row = $smcFunc['db_fetch_row']($query))
$parameters['board'][] = $row[0];

$smcFunc['db_free_result']($query);
}
}

$parameters['board'] = array_unique($parameters['board']);

if (count($parameters['board']) == 0)
$parameters['board'] = array(0);

if (!$parameters['perms_override'])
{
// So we're checking the guest perms here. Note this can only be done from a PHP call.
// You can't do this from an external SSI type include (via $_GET) for obvious reasons!

$board_count = count($parameters['board']);

$board_limit = 1;
$where = 'FIND_IN_SET(-1, member_groups)';
if ($board_count > 1)
{
$where = 'id_board IN ({array_int:board_list}) AND ' . $where;
$board_limit = $board_count;
}

// So, either get all boards we asked for and check their membergroups,
// or we asked for nothing, so get the first board you find that is guest safe

$request = $smcFunc['db_query']('', '
SELECT id_board
FROM {db_prefix}boards
WHERE ' . $where . '
LIMIT {int:limit}',
array(
'board_list' => $parameters['board'],
'limit' => $board_limit,
)
);
if ($smcFunc['db_num_rows']($request) == 0)
{
if ($output_method == 'echo')
die($txt['ssi_no_guests']);
else
return array();
}

$allowed_boards = array();
while($row = $smcFunc['db_fetch_row']($request))
$allowed_boards[] = $row[0];
$smcFunc['db_free_result']($request);

if ($board_count > 0)
$parameters['board'] = array_intersect($parameters['board'], $allowed_boards);
else
$parameters['board'] = $allowed_boards;

if (count($parameters['board']) == 0)
$parameters['board'] = array(0);
}

// Find the post ids.
$request = $smcFunc['db_query']('', '
SELECT id_first_msg, icon
FROM {db_prefix}topics AS t INNER JOIN {db_prefix}messages AS m ON (t.id_first_msg = m.id_msg)
WHERE t.id_board IN ({array_int:board_list})' . (count($parameters['icon']) > 0 ? '
AND m.icon IN ({array_string:icon})' : '') . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '') . '
ORDER BY id_first_msg DESC
LIMIT ' . $parameters['start'] . ', ' . $parameters['limit'],
array(
'board_list' => $parameters['board'],
'is_approved' => 1,
'icon' => $parameters['icon'],
)
);

$posts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$posts[] = $row['id_first_msg'];
$smcFunc['db_free_result']($request);

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

// 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.id_topic, m.id_member, m.smileys_enabled, m.id_msg, t.locked, t.id_board, b.name AS board_name, c.id_cat, c.name AS cat_name
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)
INNER JOIN {db_prefix}boards AS b ON (t.id_board = b.id_board)
INNER JOIN {db_prefix}categories AS c ON (b.id_cat = c.id_cat)
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();
$posters = array();
$messages = array();
$last = 0;
while ($row = $smcFunc['db_fetch_assoc']($request))
{
// If we want to limit the length of the post.
if ($parameters['length'] > 0 && $smcFunc['strlen']($row['body']) > $parameters['length'])
{
$row['body'] = $smcFunc['substr']($row['body'], 0, $parameters['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']);

$return['topics'][$row['id_topic']] = array(
'id' => $row['id_topic'],
'board' => array(
'id' => $row['id_board'],
'name' => $row['board_name'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>',
),
'category' => array(
'id' => $row['id_cat'],
'name' => $row['cat_name'],
'href' => $scripturl . '#c' . $row['id_cat'],
'link' => '<a href="' . $scripturl . '#c' . $row['id_cat'] . '">' . $row['cat_name'] . '</a>',
),
'message_id' => $row['id_msg'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
'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'] . ';num_replies=' . $row['num_replies'],
'comment_link' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['id_topic'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'] . '">' . $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,
);
$posters[$row['id_member']][] = $row['id_topic'];
$messages[] = $row['id_msg'];
$last = $row['id_topic'];
}

$smcFunc['db_free_result']($request);

// Get all the attachments, but only if we actually want them
if ($parameters['attachments'] != 'none' && !empty($modSettings['attachmentEnable']) && ($context['user']['is_admin'] || count(array_intersect($parameters['board'], boardsAllowedTo('view_attachments'))) > 0))
{
$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, IFNULL(thumb.id_attach, 0) AS id_thumb, thumb.width AS thumb_width, thumb.height AS thumb_height, m.id_topic
FROM {db_prefix}attachments AS a
LEFT JOIN {db_prefix}attachments AS thumb ON (thumb.id_attach = a.id_thumb)
INNER JOIN {db_prefix}messages AS m ON (a.id_msg = m.id_msg)
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' => $messages,
'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);

// This is better than sorting it with the query...
ksort($temp);

foreach ($temp as $attach_single)
{
$attachment = array(
'href' => $scripturl . '?action=dlattach;topic=' . $attach_single['id_topic'] . '.0;attach=' . $attach_single['id_attach'],
'filename' => htmlspecialchars($attach_single['filename']),
'filesize' => round($attach_single['filesize'] / 1024, 2) . ' ' . $txt['kilobyte'],
'width' => $attach_single['width'],
'height' => $attach_single['height'],
'imgsize' => $attach_single['width'] > 0 ? $attach_single['width'] . 'x' . $attach_single['height'] : '',
'downloads' => $txt['attach_viewed'] . ' ' . $attach_single['downloads'] . ' ' . $txt['attach_times'],
);
$attachment['thumbnail'] = $attach_single['id_thumb'] == 0 ? false : array(
'href' => $scripturl . '?action=dlattach;topic=' . $attach_single['id_topic'] . '.0;attach=' . $attach_single['id_thumb'] . ';image',
'width' => $attach_single['thumb_width'],
'height' => $attach_single['thumb_height'],
);
$return['topics'][$attach_single['id_topic']]['attachments'][] = $attachment;
}
}

// Get all the avatars, but only if we actually want them, then attach to the posts!
if ($parameters['avatar'] != 'none')
{
if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
{
$avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
$avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
}
else
{
$avatar_width = '';
$avatar_height = '';
}

$poster_ids = loadMemberData(array_keys($posters));
foreach ($poster_ids as $member)
{
$topic = $posters[$member]; // to get back to $return
$profile = $user_profile[$member];
$avatar = array(
'image' => $profile['avatar'] == '' ? ($profile['id_attach'] > 0 ? '<img src="' . (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($profile['avatar'], 'http://') ? '<img src="' . $profile['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($profile['avatar']) . '" alt="" class="avatar" border="0" />'),
'href' => $profile['avatar'] == '' ? ($profile['id_attach'] > 0 ? (empty($profile['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $profile['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $profile['filename']) : '') : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']),
);

if ($avatar['href'] > '')
foreach ($topic as $tid)
$return['topics'][$tid]['poster']['avatar'] = $avatar;

}
}

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

$return['topics'][$last]['is_last'] = true;

$return['feed'] = array();

if (in_array('rss', $parameters['feed']))
$return['feed']['RSS'] = array(
'href' => $scripturl . '?action=.xml;sa=news;type=rss;boards=' . implode(',', $parameters['board']),
'link' => '<a href="' . $scripturl . '?action=.xml;sa=news;type=rss;boards=' . implode(',', $parameters['board']) . '">RSS</a>',
);

if (in_array('rdf', $parameters['feed']))
$return['feed']['RDF'] = array(
'href' => $scripturl . '?action=.xml;sa=news;type=rdf;boards=' . implode(',', $parameters['board']),
'link' => '<a href="' . $scripturl . '?action=.xml;sa=news;type=rdf;boards=' . implode(',', $parameters['board']) . '">RDF</a>',
);

if (in_array('rdf', $parameters['feed']))
$return['feed']['Atom'] = array(
'href' => $scripturl . '?action=.xml;sa=news;type=atom;boards=' . implode(',', $parameters['board']),
'link' => '<a href="' . $scripturl . '?action=.xml;sa=news;type=atom;boards=' . implode(',', $parameters['board']) . '">Atom</a>',
);

if ($parameters['output_type'] != 'echo')
return $return;

foreach ($return['topics'] as $news)
{
if ($parameters['avatar'] != 'none' && isset($news['poster']['avatar']))
$news['body'] = '<img class="ssi_avatar" src="' . $news['poster']['avatar']['href'] . '" style="margin:0 1em 1em 1em; float: ' . $parameters['avatar'] . '" />' . $news['body'];

echo '
<div>
', ($parameters['category_disp'] ? '[' . $news['category']['link'] . ']' : ''), ($parameters['board_disp'] ? ' [' . $news['board']['link'] . ']' : ''), ' <a href="', $news['href'], '">', $news['icon'], '</a> <strong>', $news['subject'], '</strong>
<div class="smaller">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '</div>

<div class="post" style="padding: 2ex 0;">', $news['body'], '</div>

', ($parameters['perms_override'] ? '' : $news['link'] . ($news['locked'] ? '' : ' | ' . $news['comment_link'])), '
</div>';

if (!empty($news['attachments']))
{
$count = count($news['attachments']);
if ($count > 0) {
switch($parameters['attachments'])
{
case 'linkonly':
echo ' <ul>';
foreach ($news['attachments'] as $attach)
echo '
<li><a target="_blank" href="', $attach['href'], '">', $attach['filename'], '</a> (', ($attach['imgsize'] != '' ? $attach['imgsize'] . ', ' : ''), $attach['filesize'], ')</li>';
echo '
</ul>';
break;
case 'thumbnail':
foreach ($news['attachments'] as $attach)
{
echo '
<div class="ssi_attach" style="margin-top:0.3em;">';
if ($attach['thumbnail'])
echo '
<img src="', $attach['thumbnail']['href'], '" width="', $attach['thumbnail']['width'], '" height="', $attach['thumbnail']['height'], '" />';
echo '
<div class="ssi_attach_filename"><a target="_blank" href="', $attach['href'], '">', $attach['filename'], '</a></div>
<div class="ssi_attach_filesize">', $attach['filesize'], ($attach['imgsize'] != '' ? ', ' . $attach['imgsize'] : ''), '</div>';
echo '
</div>';
}
break;
case 'inline':
foreach ($news['attachments'] as $attach)
{
echo '
<div class="ssi_attach" style="margin-top:0.3em;">';
if ($attach['width'] > 0)
echo '
<img src="', $attach['href'], '" width="', $attach['width'], '" height="', $attach['height'], '" />';
echo '
<div class="ssi_attach_filename"><a target="_blank" href="', $attach['href'], '">', $attach['filename'], '</a></div>
<div class="ssi_attach_filesize">', ($attach['imgsize'] != '' ? $attach['imgsize'] . ', ' : ''), $attach['filesize'], '</div>
</div>';
}
break;
}
}
}

if (!$news['is_last'])
echo '
<hr style="margin: 2ex 0; clear:left;" width="100%" />';
}

// Now, what about feeds

if (count($return['feed']) > 0)
{
$feeds = array();
foreach ($return['feed'] as $feed)
$feeds[] = $feed['link'];
echo '
<hr style="margin: 2ex 0;" width="100%" />
<div class="smalltext">', implode(' | ', $feeds), '</div>';
}
}

Arantor

-sigh- I want to see this stuff in action, ideally with a link to the threads in question that they're being pulled from.

Deadfire

Quote from: Arantor on March 13, 2013, 08:14:33 PM
-sigh- I want to see this stuff in action, ideally with a link to the threads in question that they're being pulled from.

Heh, it's a private in-dev forum at the moment, contact me via PM if you wish to see it, otherwise it's just a normally vanilla install other then the permissions changed up like I described.

Arantor

That's the reason I want to see for myself - but I'm not going to do the PM tag dance (nothing personal, I just don't like doing anything in private) - because in about 85% of the cases where "it's set up like I described..." it isn't.


Advertisement: