Learn about Security for code and servers. Learn how to secure your site and your code. Learn about hacking prevention, finding and identifying exploits, and recognising vulnerabilities. Plus, Weekly Security tips and Tutorials.
Forum rules
Post questions related to security, analyse and learn about vulnerabilities and exploits within code to protect yourself against hackers.
/** * @var string * return the article block title */ private $cms_title;
/** * Let get the topics needed for the CMS articles. * @return * @param object $a_forum_id Sets the forum id to get the topics from * @param object $limit Sets the limit of articles for pagnition * @param object $display_nav Display article navigation true/false * @param object $comments Display a link to the topic for comments true/false, * REMEMBER the forum must be public for comments. * @param object $order Order the articles by 'ASC'/'DESC' * @param object $cms_title Give your page atitle 'Home Page' * * cms_class::get_cms($a_forum_id, $limit, $display_nav, $comments, $order, $cms_title); * EXAMPLE cms_class::get_cms('2', '6', true, true, 'ASC', 'Home Page'); */ public static function get_cms($a_forum_id, $limit, $display_nav, $comments, $order, $cms_title) { /** * Set the needed globals */ global $phpbb_root_path, $phpEx, $db, $template, $user, $auth;
/** No big permission deal here because they would need permissions to the forum first * only admins should see these links */ 'U_EDIT' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$a_forum_id&p={$post_data['post_id']}"), 'U_DELETE' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$a_forum_id&p={$post_data['post_id']}"), )); }
// free the result $db->sql_freeresult($result);
/** * Run the query again with a count to set the pagnition */ $sql_ary['SELECT'] = 'COUNT(p.post_subject) as total_articles'; $sql = $db->sql_build_query('SELECT', $sql_ary); $result = $db->sql_query($sql);
// get the total articles, this is a single row, single field. $total_articles = $db->sql_fetchfield('total_articles'); // free the result $db->sql_freeresult($result);
// Assign index specific vars $template->assign_vars(array( 'CMS_TITLE' => $cms_title, // S_CMS_PAGES is a simple controler for the pages, can be used for CMS specific blocks 'S_CMS_PAGES' => true, 'S_NAVIGATION' => $display_nav, 'S_COMMENTS' => $comments,
include_once($phpbb_root_path . './../includes/classes/cms_class.' . $phpEx); /** * Let get the topics needed for the CMS articles. * @return * @param object $a_forum_id Sets the forum id to get the topics from * @param object $limit Sets the limit of articles for pagnition * @param object $display_nav Display article navigation true/false * @param object $comments Display a link to the topic for comments true/false, * REMEMBER the forum must be public for comments. * @param object $order Order the articles by 'ASC'/'DESC' * @param object $cms_title Give your page a title 'Home Page' * * cmsClass::get_cms($a_forum_id, $limit, $display_nav, $comments, $order, $cms_title); * NO 'quotes' around $display_nav true/false * EXAMPLE cms_class::get_cms('2', '6', true, true, 'ASC', 'Home Page'); * * You can also use <!-- IF S_CMS_PAGES --> in the templates * like the overall_header for page specific code */ cms_class::get_cms('2', '4', true, true, 'ASC', 'Home Page Articles');
Do not PM me for Support unless I give permission in a post......PM's only help one, posts help everyone !
/** * @var string * return the article block title */ private $cms_title;
Those lines limit you to PHP5+, and aren't really needed since you're using the scope resolution operator (cms::get_cms()), and not using it via instantiated object (like $cms->get_cms()).
うるさいうるさいうるさい!
StopForumSpam Spam Reporting Database Giving xrumer and friends a great big "screw you" since 2007.