Vergleich admin/inc/functions_themes.php - 1.8.25 - 1.8.29

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
{
global $mybb, $db;


{
global $mybb, $db;


	require_once MYBB_ROOT."inc/class_xml.php";

$parser = new XMLParser($xml);

	$parser = create_xml_parser($xml);



	$tree = $parser->get_tree();

if(!is_array($tree) || !is_array($tree['theme']))

	$tree = $parser->get_tree();

if(!is_array($tree) || !is_array($tree['theme']))

Zeile 59Zeile 57
				}
}
$css_120 .= "}\n";

				}
}
$css_120 .= "}\n";

		}
}


		}
}


	if(isset($theme['themebits']) && is_array($theme['themebits']))
{
$themebits = kill_tags($theme['themebits']);

	if(isset($theme['themebits']) && is_array($theme['themebits']))
{
$themebits = kill_tags($theme['themebits']);

Zeile 102Zeile 100
			}

if($property == 'colors' || $property == 'disporder')

			}

if($property == 'colors' || $property == 'disporder')

			{

			{

				$data = my_unserialize($value['value']);

if(!is_array($data))

				$data = my_unserialize($value['value']);

if(!is_array($data))

Zeile 130Zeile 128

$query = $db->simple_select("themes", "tid", "name='".$db->escape_string($name)."'", array("limit" => 1));
$existingtheme = $db->fetch_array($query);


$query = $db->simple_select("themes", "tid", "name='".$db->escape_string($name)."'", array("limit" => 1));
$existingtheme = $db->fetch_array($query);

	if(!empty($options['force_name_check']) && $existingtheme['tid'])

	if(!empty($options['force_name_check']) && !empty($existingtheme['tid']))

	{
return -3;
}

	{
return -3;
}

	else if($existingtheme['tid'])

	else if(!empty($existingtheme['tid']))

	{
$options['tid'] = $existingtheme['tid'];
}

	{
$options['tid'] = $existingtheme['tid'];
}

Zeile 146Zeile 144

// Do we have any templates to insert?
if(!empty($theme['templates']['template']) && empty($options['no_templates']))


// Do we have any templates to insert?
if(!empty($theme['templates']['template']) && empty($options['no_templates']))

	{
if($options['templateset'])
{
$sid = $options['templateset'];
}
else
{
$sid = $db->insert_query("templatesets", array('title' => $db->escape_string($name)." Templates"));
}


	{	










		$templates = $theme['templates']['template'];
if(is_array($templates))
{

		$templates = $theme['templates']['template'];
if(is_array($templates))
{

Zeile 166Zeile 155
			}
}


			}
}


 
		// Security check

		$security_check = false;

		$security_check = false;

		$templatecache = array();

 
		foreach($templates as $template)
{
if(check_template($template['value']))

		foreach($templates as $template)
{
if(check_template($template['value']))

Zeile 175Zeile 164
				$security_check = true;
break;
}

				$security_check = true;
break;
}

 
		}

if($security_check == true)
{
return -4;
}

if(!empty($options['templateset']))
{
$sid = (int)$options['templateset'];
}
else
{
$sid = $db->insert_query("templatesets", array('title' => $db->escape_string($name)." Templates"));
}





 
		$templatecache = array();
foreach($templates as $template)
{

			$templatecache[] = array(
"title" => $db->escape_string($template['attributes']['name']),
"template" => $db->escape_string($template['value']),

			$templatecache[] = array(
"title" => $db->escape_string($template['attributes']['name']),
"template" => $db->escape_string($template['value']),

Zeile 183Zeile 190
				"version" => $db->escape_string($template['attributes']['version']),
"dateline" => TIME_NOW
);

				"version" => $db->escape_string($template['attributes']['version']),
"dateline" => TIME_NOW
);

		}

if($security_check == true)
{
return -4;

 
		}

foreach($templatecache as $template)

		}

foreach($templatecache as $template)

Zeile 240Zeile 242
		{
$inherited_stylesheets = my_unserialize($db->fetch_field($query, "stylesheets"));


		{
$inherited_stylesheets = my_unserialize($db->fetch_field($query, "stylesheets"));


			if(is_array($inherited_stylesheets['inherited']))

			if(isset($inherited_stylesheets['inherited']) && is_array($inherited_stylesheets['inherited']))

			{
$loop = 1;
foreach($inherited_stylesheets['inherited'] as $action => $stylesheets)

			{
$loop = 1;
foreach($inherited_stylesheets['inherited'] as $action => $stylesheets)

Zeile 402Zeile 404
			$fp = @fopen(MYBB_ROOT . $theme_directory."/index.html", "w");
@fwrite($fp, "");
@fclose($fp);

			$fp = @fopen(MYBB_ROOT . $theme_directory."/index.html", "w");
@fwrite($fp, "");
@fclose($fp);


}
}



}
}


	$theme_vars = array(
"theme" => $theme_directory
);

	$theme_vars = array(
"theme" => $theme_directory
);

Zeile 498Zeile 500
	}

return false;

	}

return false;

}

/**

}

/**

 * @deprecated
* @param string $url

 * @deprecated
* @param string $url

 *

 *

 * @return string
*/
function fix_css_urls($url)
{
if(!preg_match("#^([a-z0-9]+\:|/)#i", $url) && strpos($url, "../../../") === false)

 * @return string
*/
function fix_css_urls($url)
{
if(!preg_match("#^([a-z0-9]+\:|/)#i", $url) && strpos($url, "../../../") === false)

	{

	{

		return "url(../../../{$url})";
}
else

		return "url(../../../{$url})";
}
else

Zeile 524Zeile 526
 * @return string
*/
function fix_css_urls_callback($matches)

 * @return string
*/
function fix_css_urls_callback($matches)

{

{

	return fix_css_urls($matches[2]);
}


	return fix_css_urls($matches[2]);
}


Zeile 595Zeile 597

$parent_stylesheets = my_unserialize($parent_theme['stylesheets']);
if(!empty($parent_stylesheets))


$parent_stylesheets = my_unserialize($parent_theme['stylesheets']);
if(!empty($parent_stylesheets))

		{

		{

			foreach($parent_stylesheets as $location => $value)
{
if($location == "inherited")
{
continue;

			foreach($parent_stylesheets as $location => $value)
{
if($location == "inherited")
{
continue;

				}

				}


foreach($value as $action => $sheets)
{


foreach($value as $action => $sheets)
{

Zeile 610Zeile 612
						$stylesheets[$location][$action][] = $stylesheet;
$inherited_check = "{$location}_{$action}";
if(!empty($parent_stylesheets['inherited'][$inherited_check][$stylesheet]))

						$stylesheets[$location][$action][] = $stylesheet;
$inherited_check = "{$location}_{$action}";
if(!empty($parent_stylesheets['inherited'][$inherited_check][$stylesheet]))

						{

						{

							$stylesheets['inherited'][$inherited_check][$stylesheet] = $parent_stylesheets['inherited'][$inherited_check][$stylesheet];
}
else

							$stylesheets['inherited'][$inherited_check][$stylesheet] = $parent_stylesheets['inherited'][$inherited_check][$stylesheet];
}
else

Zeile 619Zeile 621
						}
}
}

						}
}
}

			}

			}

		}

		}

	}


	}


	if(!$inherited_properties)
{
$theme_vars = array(

	if(!$inherited_properties)
{
$theme_vars = array(

Zeile 630Zeile 632
		);
$properties['logo'] = parse_theme_variables($properties['logo'], $theme_vars);
}

		);
$properties['logo'] = parse_theme_variables($properties['logo'], $theme_vars);
}

	



	$updated_theme = array();
if(!empty($stylesheets))
{
$updated_theme['stylesheets'] = $db->escape_string(my_serialize($stylesheets));

	$updated_theme = array();
if(!empty($stylesheets))
{
$updated_theme['stylesheets'] = $db->escape_string(my_serialize($stylesheets));

	}

	}

	$updated_theme['properties'] = $db->escape_string(my_serialize($properties));

if(count($updated_theme) > 0)

	$updated_theme['properties'] = $db->escape_string(my_serialize($properties));

if(count($updated_theme) > 0)

Zeile 644Zeile 646
	}

return $tid;

	}

return $tid;

}

}


/**
* Generates an array from an incoming CSS file.


/**
* Generates an array from an incoming CSS file.

Zeile 714Zeile 716
function get_selectors_as_options($css, $selected_item=null)
{
$select = "";

function get_selectors_as_options($css, $selected_item=null)
{
$select = "";


if(!is_array($css))


if(!is_array($css))

	{
$css = css_to_array($css);
}

	{
$css = css_to_array($css);
}

Zeile 785Zeile 787
		return false;
}
return parse_css_properties($css[$id]['values']);

		return false;
}
return parse_css_properties($css[$id]['values']);

}

}


/**
* Parses CSS supported properties and returns them as an array.


/**
* Parses CSS supported properties and returns them as an array.

Zeile 795Zeile 797
 */
function parse_css_properties($values)
{

 */
function parse_css_properties($values)
{

	$css_bits = array();



	$css_bits = array(
'extra' => null,
);


if(!$values)


if(!$values)

	{

	{

		return null;
}


		return null;
}


Zeile 810Zeile 814
		list($property, $css_value) = explode(":", $value, 2);
$property = trim($property);
switch(strtolower($property))

		list($property, $css_value) = explode(":", $value, 2);
$property = trim($property);
switch(strtolower($property))

		{

		{

			case "background":
case "color":
case "width":

			case "background":
case "color":
case "width":

Zeile 858Zeile 862
	if($css)
{
$parsed_css = css_to_array($css);

	if($css)
{
$parsed_css = css_to_array($css);

	}

	}


if(!$class_id)
{


if(!$class_id)
{

Zeile 928Zeile 932
	global $db;

$stylesheet['tid'] = $tid;

	global $db;

$stylesheet['tid'] = $tid;

	unset($stylesheet['sid']);


	unset($stylesheet['sid']);


	$new_stylesheet = array();
foreach($stylesheet as $key => $value)
{

	$new_stylesheet = array();
foreach($stylesheet as $key => $value)
{

Zeile 976Zeile 980
			if($stylesheet['tid'] != $tid)
{
$stylesheet['inherited'] = $stylesheet['tid'];

			if($stylesheet['tid'] != $tid)
{
$stylesheet['inherited'] = $stylesheet['tid'];

			}

			}


$stylesheets[$stylesheet['name']] = $stylesheet;
}
}

$theme_stylesheets = array();


$stylesheets[$stylesheet['name']] = $stylesheet;
}
}

$theme_stylesheets = array();





	foreach($stylesheets as $name => $stylesheet)
{
$sid = $stylesheet['sid'];

	foreach($stylesheets as $name => $stylesheet)
{
$sid = $stylesheet['sid'];

Zeile 991Zeile 995

foreach($parent_list as $theme_id)
{


foreach($parent_list as $theme_id)
{

			if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath']))

			if(!empty($mybb->settings['usecdn']) && !empty($mybb->settings['cdnpath']))

			{
$cdnpath = rtrim($mybb->settings['cdnpath'], '/\\').'/';
if(file_exists($cdnpath."cache/themes/theme{$theme_id}/{$stylesheet['name']}") && filemtime(
$cdnpath."cache/themes/theme{$theme_id}/{$stylesheet['name']}"

			{
$cdnpath = rtrim($mybb->settings['cdnpath'], '/\\').'/';
if(file_exists($cdnpath."cache/themes/theme{$theme_id}/{$stylesheet['name']}") && filemtime(
$cdnpath."cache/themes/theme{$theme_id}/{$stylesheet['name']}"

					) >= $stylesheet['lastmodified']
)
{
$css_url = "cache/themes/theme{$theme_id}/{$stylesheet['name']}";
break;
}

					) >= $stylesheet['lastmodified']
)
{
$css_url = "cache/themes/theme{$theme_id}/{$stylesheet['name']}";
break;
}

			}
else
{

			}
else
{

Zeile 1015Zeile 1019
				}
}
}

				}
}
}

		



		if(is_object($plugins))
{
$plugins->run_hooks('update_theme_stylesheet_list_set_css_url', $css_url);

		if(is_object($plugins))
{
$plugins->run_hooks('update_theme_stylesheet_list_set_css_url', $css_url);

Zeile 1073Zeile 1077
		$properties = $theme['properties'];

if(!is_array($properties))

		$properties = $theme['properties'];

if(!is_array($properties))

		{

		{

			$properties = my_unserialize($theme['properties']);
}

			$properties = my_unserialize($theme['properties']);
}

		



		$max_disporder = 0;

foreach($stylesheets as $stylesheet)

		$max_disporder = 0;

foreach($stylesheets as $stylesheet)

Zeile 1086Zeile 1090
				$orphaned_stylesheets[] = $stylesheet['name'];
continue;
}

				$orphaned_stylesheets[] = $stylesheet['name'];
continue;
}

			



			if($properties['disporder'][$stylesheet['name']] > $max_disporder)
{
$max_disporder = $properties['disporder'][$stylesheet['name']];

			if($properties['disporder'][$stylesheet['name']] > $max_disporder)
{
$max_disporder = $properties['disporder'][$stylesheet['name']];

Zeile 1119Zeile 1123
		foreach($child_list as $id)
{
update_theme_stylesheet_list($id, false, $update_disporders);

		foreach($child_list as $id)
{
update_theme_stylesheet_list($id, false, $update_disporders);

		}
}

$cache->update_default_theme();


		}
}

$cache->update_default_theme();


	return true;
}


	return true;
}


Zeile 1169Zeile 1173
		if(is_array($parents))
{
$themes = array_merge($themes, $parents);

		if(is_array($parents))
{
$themes = array_merge($themes, $parents);

		}
}


		}
}


	return $themes;
}


	return $themes;
}


Zeile 1183Zeile 1187
function make_child_theme_list($tid)
{
static $themes_by_child;

function make_child_theme_list($tid)
{
static $themes_by_child;





	$themes = array();
if(!is_array($themes_by_child))
{
$theme_cache = cache_themes();
foreach($theme_cache as $key => $theme)

	$themes = array();
if(!is_array($themes_by_child))
{
$theme_cache = cache_themes();
foreach($theme_cache as $key => $theme)

		{
if($key == "default")
{
continue;
}


		{
if($key == "default")
{
continue;
}


			$themes_by_child[$theme['pid']][$theme['tid']] = $theme;

			$themes_by_child[$theme['pid']][$theme['tid']] = $theme;

		}
}

		}
}


if(!isset($themes_by_child[$tid]) || !is_array($themes_by_child[$tid]))


if(!isset($themes_by_child[$tid]) || !is_array($themes_by_child[$tid]))

	{

	{

		return null;

		return null;

	}


	}


	$themes = array();

foreach($themes_by_child[$tid] as $theme)

	$themes = array();

foreach($themes_by_child[$tid] as $theme)

Zeile 1218Zeile 1222
	}

return $themes;

	}

return $themes;

}

}


/**
* @return array


/**
* @return array

Zeile 1232Zeile 1236
		$query = $db->simple_select("themes", "*", "", array('order_by' => "pid, name"));
while($theme = $db->fetch_array($query))
{

		$query = $db->simple_select("themes", "*", "", array('order_by' => "pid, name"));
while($theme = $db->fetch_array($query))
{

 
			$theme['users'] = 0;

			$theme['properties'] = my_unserialize($theme['properties']);
$theme['stylesheets'] = my_unserialize($theme['stylesheets']);
$theme_cache[$theme['tid']] = $theme;

			$theme['properties'] = my_unserialize($theme['properties']);
$theme['stylesheets'] = my_unserialize($theme['stylesheets']);
$theme_cache[$theme['tid']] = $theme;

Zeile 1239Zeile 1244
			if($theme['def'] == 1)
{
$theme_cache['default'] = $theme['tid'];

			if($theme['def'] == 1)
{
$theme_cache['default'] = $theme['tid'];

			}
}
}


			}
}
}


	// Do we have no themes assigned as default?
if(empty($theme_cache['default']))
{
$theme_cache['default'] = 1;
}

	// Do we have no themes assigned as default?
if(empty($theme_cache['default']))
{
$theme_cache['default'] = 1;
}





	return $theme_cache;
}

	return $theme_cache;
}





/**
* @param int $parent
* @param int $depth

/**
* @param int $parent
* @param int $depth

Zeile 1259Zeile 1264
function build_theme_list($parent=0, $depth=0)
{
global $mybb, $db, $table, $lang, $page; // Global $table is bad, but it will have to do for now

function build_theme_list($parent=0, $depth=0)
{
global $mybb, $db, $table, $lang, $page; // Global $table is bad, but it will have to do for now

	static $theme_cache;

$padding = $depth*20; // Padding

if(!is_array($theme_cache))
{
$themes = cache_themes();

	static $theme_cache;

$padding = $depth*20; // Padding

if(!is_array($theme_cache))
{
$themes = cache_themes();

		$query = $db->simple_select("users", "style, COUNT(uid) AS users", "", array('group_by' => 'style'));
while($user_themes = $db->fetch_array($query))
{
if($user_themes['style'] == 0)
{
$user_themes['style'] = $themes['default'];

		$query = $db->simple_select("users", "style, COUNT(uid) AS users", "", array('group_by' => 'style'));
while($user_themes = $db->fetch_array($query))
{
if($user_themes['style'] == 0)
{
$user_themes['style'] = $themes['default'];

			}

if($themes[$user_themes['style']]['users'] > 0)
{

			}

if(isset($themes[$user_themes['style']]['users']) && $themes[$user_themes['style']]['users'] > 0)
{

				$themes[$user_themes['style']]['users'] += (int)$user_themes['users'];
}
else
{
$themes[$user_themes['style']]['users'] = (int)$user_themes['users'];

				$themes[$user_themes['style']]['users'] += (int)$user_themes['users'];
}
else
{
$themes[$user_themes['style']]['users'] = (int)$user_themes['users'];

			}
}

// Restrucure the theme array to something we can "loop-de-loop" with
foreach($themes as $key => $theme)
{
if($key == "default")
{
continue;
}

			}
}

// Restrucure the theme array to something we can "loop-de-loop" with
foreach($themes as $key => $theme)
{
if($key == "default")
{
continue;
}


$theme_cache[$theme['pid']][$theme['tid']] = $theme;
}
$theme_cache['num_themes'] = count($themes);
unset($themes);


$theme_cache[$theme['pid']][$theme['tid']] = $theme;
}
$theme_cache['num_themes'] = count($themes);
unset($themes);

	}

	}





	if(!is_array($theme_cache[$parent]))

	if(!isset($theme_cache[$parent]) || !is_array($theme_cache[$parent]))

	{
return;
}

	{
return;
}

Zeile 1306Zeile 1311
	foreach($theme_cache[$parent] as $theme)
{
$popup = new PopupMenu("theme_{$theme['tid']}", $lang->options);

	foreach($theme_cache[$parent] as $theme)
{
$popup = new PopupMenu("theme_{$theme['tid']}", $lang->options);

 
		$set_default = '';

		if($theme['tid'] > 1)
{
$popup->add_item($lang->edit_theme, "index.php?module=style-themes&action=edit&tid={$theme['tid']}");

		if($theme['tid'] > 1)
{
$popup->add_item($lang->edit_theme, "index.php?module=style-themes&action=edit&tid={$theme['tid']}");

Zeile 1315Zeile 1321
			if($theme_cache['num_themes'] > 2)
{
$popup->add_item($lang->delete_theme, "index.php?module=style-themes&action=delete&tid={$theme['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_deletion}')");

			if($theme_cache['num_themes'] > 2)
{
$popup->add_item($lang->delete_theme, "index.php?module=style-themes&action=delete&tid={$theme['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_deletion}')");

			}

			}


if($theme['def'] != 1)
{


if($theme['def'] != 1)
{

Zeile 1327Zeile 1333
				$set_default = "<img src=\"styles/{$page->style}/images/icons/default.png\" alt=\"{$lang->default_theme}\" style=\"vertical-align: middle;\" title=\"{$lang->default_theme}\" />";
}
$popup->add_item($lang->force_on_users, "index.php?module=style-themes&amp;action=force&amp;tid={$theme['tid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_forced}')");

				$set_default = "<img src=\"styles/{$page->style}/images/icons/default.png\" alt=\"{$lang->default_theme}\" style=\"vertical-align: middle;\" title=\"{$lang->default_theme}\" />";
}
$popup->add_item($lang->force_on_users, "index.php?module=style-themes&amp;action=force&amp;tid={$theme['tid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_theme_forced}')");

 
			$set_default = "<div class=\"float_right\">{$set_default}</div>";

		}
$popup->add_item($lang->export_theme, "index.php?module=style-themes&amp;action=export&amp;tid={$theme['tid']}");
$popup->add_item($lang->duplicate_theme, "index.php?module=style-themes&amp;action=duplicate&amp;tid={$theme['tid']}");

		}
$popup->add_item($lang->export_theme, "index.php?module=style-themes&amp;action=export&amp;tid={$theme['tid']}");
$popup->add_item($lang->duplicate_theme, "index.php?module=style-themes&amp;action=duplicate&amp;tid={$theme['tid']}");

		$table->construct_cell("<div class=\"float_right\">{$set_default}</div><div style=\"margin-left: {$padding}px;\"><strong>{$theme['name']}</strong></div>");

		$table->construct_cell("{$set_default}<div style=\"margin-left: {$padding}px;\"><strong>{$theme['name']}</strong></div>");

		$table->construct_cell(my_number_format($theme['users']), array("class" => "align_center"));
$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();

		$table->construct_cell(my_number_format($theme['users']), array("class" => "align_center"));
$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();

Zeile 1363Zeile 1370
			if($key == "default")
{
continue;

			if($key == "default")
{
continue;

			}

			}


$theme_cache[$theme['pid']][$theme['tid']] = $theme;


$theme_cache[$theme['pid']][$theme['tid']] = $theme;

		}

		}

		unset($theme);

		unset($theme);

	}

if(!is_array($theme_cache[$parent]) || $ignoretid === $parent)

	}

if(!isset($theme_cache[$parent]) || !is_array($theme_cache[$parent]) || $ignoretid === $parent)

	{
return null;

	{
return null;

	}

	}


foreach($theme_cache[$parent] as $theme)
{


foreach($theme_cache[$parent] as $theme)
{

Zeile 1388Zeile 1395
	}

if(!$parent)

	}

if(!$parent)

	{

	{

		return $list;
}
}

		return $list;
}
}

Zeile 1424Zeile 1431
			foreach($style as $stylesheet2)
{
$stylesheets[$stylesheet2]['applied_to'][$file][] = $action;

			foreach($style as $stylesheet2)
{
$stylesheets[$stylesheet2]['applied_to'][$file][] = $action;

				if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))

				if(isset($file_stylesheets['inherited'][$file."_".$action]) && is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet2, array_keys($file_stylesheets['inherited'][$file."_".$action])))

				{
$stylesheets[$stylesheet2]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];
foreach($file_stylesheets['inherited'][$file."_".$action] as $value)

				{
$stylesheets[$stylesheet2]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];
foreach($file_stylesheets['inherited'][$file."_".$action] as $value)

Zeile 1438Zeile 1445

foreach($stylesheets as $file => $stylesheet2)
{


foreach($stylesheets as $file => $stylesheet2)
{

		if(is_array($stylesheet2['inherited']))

		if(isset($stylesheet2['inherited']) && is_array($stylesheet2['inherited']))

		{
foreach($stylesheet2['inherited'] as $inherited_file => $tid)
{

		{
foreach($stylesheet2['inherited'] as $inherited_file => $tid)
{

Zeile 1556Zeile 1563

foreach($to_add as $class_id => $array)
{


foreach($to_add as $class_id => $array)
{

		if($already_parsed[$class_id])

		if(isset($already_parsed[$class_id]))

		{
$already_parsed[$class_id]++;
$class_id .= "_".$already_parsed[$class_id];

		{
$already_parsed[$class_id]++;
$class_id .= "_".$already_parsed[$class_id];