0 Members and 1 Guest are viewing this topic.
set the access rights for the block ...Fel
Yes, try this ..Code: [Select]include_once('PmxBlogSSI.php');global $context, $smcFunc, $user_info, $txt;$maxarticles = 5; // max articles to show$context['PmxBlog']['content_len'] = 40; // Teaser lengthif(AllowedToBlog('view')){ $result = array(); $req = $smcFunc['db_query']('', ' SELECT c.ID, c.subject FROM {db_prefix}pmxblog_content AS c LEFT JOIN {db_prefix}members AS m ON (c.owner = m.id_member) LEFT JOIN {db_prefix}pmxblog_manager AS a ON (c.owner = a.owner) WHERE a.blogenabled > 0 AND a.bloglocked = 0 AND c.published = 1 AND (c.allow_view = 0 OR (c.allow_view = 1 AND {int:idmem} > 0) OR (c.allow_view = 2 AND {string:s_idmem} IN (m.buddy_list)) OR (c.allow_view = 3 AND c.owner = {int:idmem}) OR (c.owner = {int:idmem})) GROUP BY c.ID ORDER BY c.date_created DESC LIMIT {int:lim}', array( 's_idmem' => (string) $user_info['id'], 'idmem' => $user_info['id'], 'lim' => $maxarticles, ) ); if($smcFunc['db_num_rows']($req) > 0) { $i = 0; while($row = $smcFunc['db_fetch_assoc']($req)) { $result[$i] = array('id' => $row['ID'], 'subject' => $row['subject']); $i++; } $smcFunc['db_free_result']($req); } // link requested? if(isset($_REQUEST['blogcont'])) $artid = (int) $_REQUEST['blogcont']; elseif(!empty($result)) $artid = $result[0]['id']; else { echo ' '. $txt['PmxBlog_nothing_read']; return; } // get the selected article data $article = PmxBlogSSI_GetArticle($artid, ''); $article['body'] = Post_Teaser($article['body']); // call the teaser PmxBlogArticles_SSI_Out($article, $result, $artid);}Fel
include_once('PmxBlogSSI.php');global $context, $smcFunc, $user_info, $txt;$maxarticles = 5; // max articles to show$context['PmxBlog']['content_len'] = 40; // Teaser lengthif(AllowedToBlog('view')){ $result = array(); $req = $smcFunc['db_query']('', ' SELECT c.ID, c.subject FROM {db_prefix}pmxblog_content AS c LEFT JOIN {db_prefix}members AS m ON (c.owner = m.id_member) LEFT JOIN {db_prefix}pmxblog_manager AS a ON (c.owner = a.owner) WHERE a.blogenabled > 0 AND a.bloglocked = 0 AND c.published = 1 AND (c.allow_view = 0 OR (c.allow_view = 1 AND {int:idmem} > 0) OR (c.allow_view = 2 AND {string:s_idmem} IN (m.buddy_list)) OR (c.allow_view = 3 AND c.owner = {int:idmem}) OR (c.owner = {int:idmem})) GROUP BY c.ID ORDER BY c.date_created DESC LIMIT {int:lim}', array( 's_idmem' => (string) $user_info['id'], 'idmem' => $user_info['id'], 'lim' => $maxarticles, ) ); if($smcFunc['db_num_rows']($req) > 0) { $i = 0; while($row = $smcFunc['db_fetch_assoc']($req)) { $result[$i] = array('id' => $row['ID'], 'subject' => $row['subject']); $i++; } $smcFunc['db_free_result']($req); } // link requested? if(isset($_REQUEST['blogcont'])) $artid = (int) $_REQUEST['blogcont']; elseif(!empty($result)) $artid = $result[0]['id']; else { echo ' '. $txt['PmxBlog_nothing_read']; return; } // get the selected article data $article = PmxBlogSSI_GetArticle($artid, ''); $article['body'] = Post_Teaser($article['body']); // call the teaser PmxBlogArticles_SSI_Out($article, $result, $artid);}
include_once('PmxBlogSSI.php');global $context, $smcFunc, $user_info, $txt, $scripturl;$maxarticles = 5; // max articles to show$context['PmxBlog']['content_len'] = 40; // Teaser lengthif(AllowedToBlog('view')){ $result = array(); $req = $smcFunc['db_query']('', ' SELECT c.ID, c.subject FROM {db_prefix}pmxblog_content AS c LEFT JOIN {db_prefix}members AS m ON (c.owner = m.id_member) LEFT JOIN {db_prefix}pmxblog_manager AS a ON (c.owner = a.owner) WHERE a.blogenabled > 0 AND a.bloglocked = 0 AND c.published = 1 AND (c.allow_view = 0 OR (c.allow_view = 1 AND {int:idmem} > 0) OR (c.allow_view = 2 AND {string:s_idmem} IN (m.buddy_list)) OR (c.allow_view = 3 AND c.owner = {int:idmem}) OR (c.owner = {int:idmem})) GROUP BY c.ID ORDER BY c.date_created DESC LIMIT {int:lim}', array( 's_idmem' => (string) $user_info['id'], 'idmem' => $user_info['id'], 'lim' => $maxarticles, ) ); if($smcFunc['db_num_rows']($req) > 0) { $i = 0; while($row = $smcFunc['db_fetch_assoc']($req)) { $result[$i] = array('id' => $row['ID'], 'subject' => $row['subject']); $i++; } $smcFunc['db_free_result']($req); } // link requested? if(isset($_REQUEST['blogcont'])) $artid = (int) $_REQUEST['blogcont']; elseif(!empty($result)) $artid = $result[0]['id']; else { echo ' '. $txt['PmxBlog_nothing_read']; return; } // get the selected article data $article = PmxBlogSSI_GetArticle($artid, ''); $article['body'] = Post_Teaser($article['body']); // call the teaser // add a "Read more" link... $article['body'] .= '<div style="padding-top:10px;"><a href="'. $scripturl .'?action=pmxblog;sa=view;cont='. $artid .';uid='. $article['ownerid'] .'">'. $txt['PmxBlog_readmore'] .'</a></div>'; PmxBlogArticles_SSI_Out($article, $result, $artid);}
Great!! Thanks Fel...that works better,Code: [Select]include_once('PmxBlogSSI.php');PmxBlogSSI_ShowArticles(2); but displays too much for a side block.(see attached pmx_blog_sideblock2.jpg) I was hoping that by using cools' example as a starting point (because it only displays title, author, date/time as in attached pmx_blog_sideblock1.jpg) that it would work similarly to the way his original code does (less info, trunicated or no content, without calendar or categories) , sorry I did look into the samples again, but Im just not sure what code to use in order to make it work.
include_once('PmxBlogSSI.php');PmxBlogSSI_ShowArticles(2);
with the RSS Reader block you can read feeds from any page the have a rss feed.Fel