0 Members and 1 Guest are viewing this topic.
Feline: Thanks for PortaMX..works great with my SMF 2.0 rc2 site.I feel sort of embarassed to ask, but Im not much on php and continue to get parse errors attempting to get a block to read blog posts, so I know Im messing it up even with your examples. Could you please post a working snipplet to get me on the right track? Thx
include_once('PmxBlogSSI.php');PmxBlogSSI_Recent();
include_once('PmxBlogSSI.php');global $smcFunc, $user_info, $txt;$maxarticles = 5; // max articles to showif(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, ''); PmxBlogArticles_SSI_Out($article, $result, $artid);}
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);}