SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: Sabrinova on November 08, 2013, 09:37:24 PM
-
I have tried the code I found here:
<?php
error_reporting(0);
global $smcFunc, $context, $scripturl, $modSettings, $txt, $settings;
$limit = 10;
$sql = $smcFunc['db_query']('','
SELECT co.id_initial, co.subject, co.body, co.time, co.id_cat, co.icon, co.id_member, ca.id_cat, ca.title,
mem.avatar, mem.real_name, mem.id_member,
IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type
FROM {db_prefix}blog_comments AS co, {db_prefix}blog_categories AS ca, {db_prefix}members AS mem
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
WHERE co.is_started = {int:s} AND co.id_cat = ca.id_cat AND mem.id_member = co.id_member
ORDER BY co.id_initial DESC
LIMIT {int:limit}',
array(
'limit' => $limit,
's' => 1,
)
);
$context['info'] = array();
$width = 50;
while($row = $smcFunc['db_fetch_assoc']($sql))
{
$image = '<img src="'.$settings['images_url'].'/post/'.$row['icon'].'.gif" alt="" /> ';
$context['info'][] = array(
'id' => $row['id_initial'],
'id_member' => $row['id_member'],
'member' => '<a href="'.$scripturl.'?action=profile;u='.$row['id_member'].'">'.$row['real_name'].'</a>',
'avatar' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img width="'.$width.'" src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img width="'.$width.'" src="' . $row['avatar'] . '" alt="" class="avatar" border="0" />' : '<img width="'.$width.'" src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar']) . '" alt="" class="avatar" border="0" />'),
'subject' => $row['subject'],
'time' => timeformat($row['time']),
'id_cat' => $row['id_cat'],
'title' => $row['title'],
'icon' => !empty($row['icon']) ? $image : '',
'cat' => '<a href="'.$scripturl.'?blog='.$context['blog']['id_user'].';sa=cat;id='.$row['id_cat'].'">'.$row['title'].'</a>',
);
}
echo'
<table style="width: 100%;">';
foreach($context['info'] AS $post)
{
echo'
<tr>
<td style="width: 60px;">
'.$post['avatar'].'
</td>
<td>
<div class="smalltext">
'.$post['icon'].'<a href="'.$scripturl.'?blog='.$post['id_member'].';sa=topic;id='.$post['id'].'" style="font-weight: bold;">'.$post['subject'].'</a> '.$txt['by'].' '.$post['member'].' '.$txt['on'].' '.$post['time'].'
</div>
</td>
</tr>';
}
echo'
</table>';
?>
and it works, but it only displays the title, author and date of the blog posts. I really need to display the full blog posts or at least a long teaser. Please can somebody help me with the code? :)
-
I can feel your pains, i recently had to give up on ADK portal because of their lack of support. i am moving over to simple portal. i wish i could help.
-
1) This is a topic more than 1-year old...
2) It *shouldn't* be related to ADK portal since it's SimplePortal forum... It *should* be related to some integration of the ADK blog into SimplePortal
3) Merry Christmas :)