<commit_before><?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: /global/forum.index.php
| Author: <NAME> (Hien)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

/* New API in forum template
set_forumIcons(
	array(
		'main' => 'entypo folder',
		'thread' => 'entypo chat',
		'link'	=>	'entypo link',
		'question' => 'entypo graduation cap',
	)
);
*/

/* Forum index master template */
if (!function_exists('render_forum')) {
	function render_forum($info) {
		global $locale;
		echo render_breadcrumbs();
		$tab_title['title'][] = $locale['forum_0001'];
		$tab_title['id'][] = "thread";
		$tab_title['icon'][] = "fa fa-folder fa-fw";

		$tab_title['title'][] = $locale['forum_0012'];
		$tab_title['id'][] = "latest";
		$tab_title['icon'][] = "fa fa-list-alt fa-fw";

		$tab_title['title'][] = $locale['forum_0011'];
		$tab_title['id'][] = "mypost";
		$tab_title['icon'][] = "fa fa-user";

		$tab_title['title'][] = $locale['global_056'];
		$tab_title['id'][] = "tracked";
		$tab_title['icon'][] = "fa fa-inbox fa-fw";

		$tab_active = isset($_GET['section']) ? $_GET['section'] : 'thread';
		echo opentab($tab_title, $tab_active, 'forum_tabs', FORUM);
		echo opentabbody($tab_title['title'], $tab_active, $tab_active, 'viewforum');
		echo "<div class='m-t-20'>\n";
		if (isset($_GET['viewforum'])) {
			forum_viewforum($info);
		} else {
			if (isset($_GET['section']) && $_GET['section'] == 'mypost') {
					render_mypost($info);
			}
			elseif (isset($_GET['section']) && $_GET['section'] == 'latest') {
					render_laft($info);
			}
			elseif (isset($_GET['section']) && $_GET['section'] == 'tracked') {
					render_tracked($info);
			}
			elseif (!isset($_GET['section']) || isset($_GET['section']) && $_GET['section'] == 'thread') {
					render_forum_main($info);
			}
		}
		echo "</div>\n";
		echo closetabbody();
		echo closetab();
	}
}

if (!function_exists('render_forum_main')) {
	/**
	 * Main Forum Page - Recursive
	 * @param $info
	 */
	function render_forum_main($info, $id = 0) {
		global $locale;
		if (!empty($info['forums'][$id])) {
			$forums = $info['forums'][$id];
			$x = 1;
			foreach($forums as $forum_id => $data) {
				if ($data['forum_type'] == '1') {
					echo "<div class='panel panel-default'>\n";
					echo "<div class='panel-heading' ".(isset($data['child']) ? 'style="border-bottom:0;"' : '').">\n";
					echo "<a class='forum-subject' href='".FORUM."index.php?viewforum&amp;forum_id=".$data['forum_id']."&amp;parent_id=".$data['forum_cat']."&amp;forum_branch=".$data['forum_branch']."'>".$data['forum_name']."</a><br/>";
					echo $data['forum_description'] ? "<span class='text-smaller'>".$data['forum_description']."</span>\n<br/>" : '';
					echo "</div>\n";
					if (isset($info['forums'][$forum_id])) {
						echo "<div class='m-10'>\n";
						$i = 1;
						$sub_forums = $info['forums'][$forum_id];
						foreach($sub_forums as $sub_forum_id => $cdata) {
							render_forum_item_type($cdata, $i);<commit_msg>removed un-finnished tabbed forum top menu<commit_after><?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: /global/forum.index.php
| Author: <NAME> (Hien)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

/* New API in forum template
set_forumIcons(
	array(
		'main' => 'entypo folder',
		'thread' => 'entypo chat',
		'link'	=>	'entypo link',
		'question' => 'entypo graduation cap',
	)
);
*/

/* Old Forum index master template either drop it or make it 100% LAFT replacement*/
if (!function_exists('render_forum2')) {
	function render_forum2($info) {
		global $locale;
		echo render_breadcrumbs();
		$tab_title['title'][] = $locale['forum_0001'];
		$tab_title['id'][] = "thread";
		$tab_title['icon'][] = "fa fa-folder fa-fw";

		$tab_title['title'][] = $locale['forum_0012'];
		$tab_title['id'][] = "latest";
		$tab_title['icon'][] = "fa fa-list-alt fa-fw";

		$tab_title['title'][] = $locale['forum_0011'];
		$tab_title['id'][] = "mypost";
		$tab_title['icon'][] = "fa fa-user";

		$tab_title['title'][] = $locale['global_056'];
		$tab_title['id'][] = "tracked";
		$tab_title['icon'][] = "fa fa-inbox fa-fw";

		$tab_active = isset($_GET['section']) ? $_GET['section'] : 'thread';
		echo opentab($tab_title, $tab_active, 'forum_tabs', FORUM);
		echo opentabbody($tab_title['title'], $tab_active, $tab_active, 'viewforum');
		echo "<div class='m-t-20'>\n";
		if (isset($_GET['viewforum'])) {
			forum_viewforum($info);
		} else {
			if (isset($_GET['section']) && $_GET['section'] == 'mypost') {
					render_mypost($info);
			}
			elseif (isset($_GET['section']) && $_GET['section'] == 'latest') {
					render_laft($info);
			}
			elseif (isset($_GET['section']) && $_GET['section'] == 'tracked') {
					render_tracked($info);
			}
			elseif (!isset($_GET['section']) || isset($_GET['section']) && $_GET['section'] == 'thread') {
					render_forum_main($info);
			}
		}
		echo "</div>\n";
		echo closetabbody();
		echo closetab();
	}
}

if (!function_exists('render_forum')) {
	function render_forum($info) {
		global $locale;
		echo render_breadcrumbs();
				if (isset($_GET['viewforum'])) {
					forum_viewforum($info);
			} else {
				render_forum_main($info);
		}
	}
}

/* Forum index master template */
if (!function_exists('render_forum_main')) {
	/**
	 * Main Forum Page - Recursive
	 * @param $info
	 */
	function render_forum_main($info, $id = 0) {
		global $locale;
		if (!empty($info['forums'][$id])) {
			$forums = $info['forums'][$id];
			$x = 1;
			foreach($forums as $forum_id => $data) {
				if ($data['forum_type'] == '1') {
					echo "<div class='panel panel-default'>\n";
					echo "<div class='panel-heading' ".(isset($data['child']) ? 'style="border-bottom:0;"' : '').">\n";
					echo "<a class='forum-subject' href='".FORUM."index.php?viewforum&amp;forum_id=".$data['forum_id']."&amp;parent_id=".$data['forum_cat']."&amp;forum_branch=".$data['forum_branch']."'>".$data['forum_name']."</a><br/>";
					echo $data['forum_description'] ? "<span class='text-smaller'>".$data['forum_description']."</span>\n<br/>" : '';
					echo "</div>\n";
					if (isset($info['forums'][$forum_id])) {
						echo "<div class='m-10'>\n";
						$i = 1;
						$sub_forums = $info['forums'][$forum_id];
						foreach($sub_forums as $sub_forum_id => $cdata) {
							render_forum_item_type($cdata, $i);
{'fraction_non_alphanumeric': 0.26629348260695723, 'fraction_numerical': 0.007063841130214581, 'mean_word_length': 3.33757225433526, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 41, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4427056', 'n_tokens_mistral': 2892, 'n_tokens_neox': 2515, 'n_words': 513}