How to limit # of forums displayed under mainpage categories, pagination, collapse ?
akm Offline
Member
***
Posts: 115
Joined: Nov 2011
Post: #11
RE: How to limit # of forums displayed under mainpage categories, pagination, collapse ?
(02-05-2012 03:09 PM)Sama34 Wrote:  Tabs only seems reasonable for rol games forums and alike, as many users who go there ofter, already know where their place is or whatnot.

Thank you for the input.
Hoping to at least try it (collapse/expand), and then decide if it works (or not) for this case.
Found some code at functions_forumlist.php...

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Check if this category is either expanded or collapsed and hide it as necessary.
[code]		$expdisplay = '';
			$collapsed_name = "cat_{$forum['fid']}_c";
			
			if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: show;")

			{
				$expcolimage = "collapse_collapsed.gif";
				$expdisplay = "display: none;";
				$expaltext = "[+]";
			}
			else
			{
				$expcolimage = "collapse.gif";
				$expaltext = "[-]";
			}

Does that look like where might be able to set for collapsed display as default for when initially open homepage ?
Have changed image to make it more clear where to click, now hope to try changing code so homepage opens with category collapsed.

Ps: The only other code found is at /admin/modules/style/templates.php...

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
foreach($template_groups as $prefix => $group)
	{	
		$tmp_expand = "";
		if(in_array($group['gid'], $expand_array))
		{
			$expand = $lang->collapse;
			$expanded = true;
			
			$tmp_expand = $expand_array;
			$unsetgid = array_search($group['gid'], $tmp_expand);
			unset($tmp_expand[$unsetgid]);
			$group['expand_str'] = implode("|", $tmp_expand);
		}
		else
		{
			$expand = $lang->expand;
			$expanded = false;
			
			$group['expand_str'] = implode("|", $expand_array);
			if($group['expand_str'])
			{
				$group['expand_str'] .= "|";
			}
			$group['expand_str'] .= $group['gid'];
		}
		
		if($group['expand_str'])
		{
			$group['expand_str'] = "&expand={$group['expand_str']}";
		}
		
		if($expanded == true && isset($group['templates']) && count($group['templates']) > 0)
		{
			$table->construct_cell("<strong><a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>");
			$table->construct_cell("<a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
			$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
		
			$templates = $group['templates'];
			ksort($templates);
			
			foreach($templates as $template)
			{
				$template['pretty_title'] = $template['title'];
				
				$popup = new PopupMenu("template_{$template['tid']}", $lang->options);
				$popup->add_item($lang->full_edit, "index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}{$expand_str}");
				
				if(isset($template['modified']) && $template['modified'] == true)
				{					
					if($sid > 0)
					{
						$popup->add_item($lang->diff_report, "index.php?module=style-templates&amp;action=diff_report&amp;title=".urlencode($template['title'])."&amp;sid2={$sid}");
					
						$popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&amp;action=revert&amp;title=".urlencode($template['title'])."&amp;sid={$sid}&amp;my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')");
					}
					
					$template['pretty_title'] = "<span style=\"color: green;\">{$template['title']}</span>";
				}				
				// This template does not exist in the master list
				else if(isset($template['original']) && $template['original'] == false)
				{
					$popup->add_item($lang->delete_template, "index.php?module=style-templates&amp;action=delete_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}&amp;my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_deletion}')");
					
					$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>";
				}
				
				$table->construct_cell("<span style=\"padding: 20px;\"><a href=\"index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");
				$table->construct_cell($popup->fetch(), array("class" => "align_center"));
				
				$table->construct_row();
			}
		}
		else if(isset($group['templates']) && count($group['templates']) > 0)
		{			
			$table->construct_cell("<strong><a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>");
 			$table->construct_cell("<a href=\"index.php?module=style-templates&amp;sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center"));
 			$table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
		}
	}
	
	$table->output($template_sets[$sid]);
	
	$page->output_footer();
}


Thanks again for your help !
(This post was last modified: 02-06-2012 03:00 PM by akm.)
02-06-2012 02:24 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread

 Standard Tools
Forum Jump: