| Mod Beschreibung | Zeigt oder verbirgt Kategorien |
| Mod Kompatibilität | Invision Power Board 1.3 |
| Mod Kategorie | Minor Mod |
| Mod Autor | Peter |
| Mod Emailadresse des Autors | Peter@ibforen.de |
| Dokumentationspfad | sources/mods/collapse/mod_collapse_howto.htm |
| Mod Version | 1.2.0 |
| Hinweis | Weitergabe ohne Zustimmung ist untersagt. Download von ibforen.de Alle Änderungen sind am mod_token zu erkennen Dieses html-howto wurde erstellt mit The ModInstaller 1.3.2 von Peter@ibforen.de, released on 29th January, 2007 Erstellungsdatum: 2009-03-20 Es darf ohne ausdrückliche Genehmigung nicht weiterverwendet werden. Hinweis
|
| Mod Token | mod_collapse |
| Changed file | Changed function |
| sources/Boards.php | Boards(..) |
| sources/Boards.php | process_all_cats(..) |
| sources/Forums.php | show_subforums(..) |
| sources/functions.php | load_skin(..) |
A. Suche in function Boards(..)
|
$stats_html = ""; |
|
$stats_html = ""; //-- mod_collapse begin if ($std->my_getcookie("fstats_block") == "none" && !isset($ibforums->input['collapse_stats_s'])) { $stats_html = 1; } else { //-- mod_collapse end |
B. Suche in function Boards(..)
|
if ($stats_html != "") { |
|
//-- mod_collapse begin } //-- mod_collapse end if ($stats_html != "") { |
C. Suche in function Boards(..)
|
if ($stats_html != "") { |
|
if ($stats_html != "") { //-- mod_collapse begin global $HTTP_COOKIE_VARS; if (!$this->use_skin && file_exists(ROOT_PATH."Skin/{$ibforums->skin_id}/mod_collapse_skin.php")) { $this->collapse_html = $std->load_template('mod_collapse_skin'); $this->use_skin = true; } if (isset($ibforums->input['collapse_stats_s'])) { $std->my_setcookie("fstats_block", "", 1); $_COOKIE[$ibforums->vars['cookie_id'].'fstats_block'] = "block"; $HTTP_COOKIE_VARS[$ibforums->vars['cookie_id'].'fstats_block'] = "block"; } if (isset($ibforums->input['collapse_stats_h'])) { $std->my_setcookie("fstats_block", "none", 1); $_COOKIE[$ibforums->vars['cookie_id'].'fstats_block'] = "none"; $HTTP_COOKIE_VARS[$ibforums->vars['cookie_id'].'fstats_block'] = "none"; } $url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext']."?".$_SERVER['QUERY_STRING']; $url = preg_replace("`\&collapse_stats_.=\d*`", "", $url); if (($std->my_getcookie("fstats_block") == "none" || isset($ibforums->input['collapse_stats_h'])) && !isset($ibforums->input['collapse_stats_s'])) { $url .= "&collapse_stats_s=1"; if ($this->use_skin) { $this->output .= $this->collapse_html->stats_header_hide($url); $this->output .= $this->collapse_html->stats_footer(); } else { $html = $this->html->stats_header(); $col = "\n<table width='100%'>"; $col .= "\n<tr>"; $col .= "\n<td align='left'>{$ibforums->lang['board_stats']}</td>"; $col .= "\n<td align='right'><a href='$url' onclick=\"show('fstats');return true;\"><img src='{$ibforums->vars['img_url']}/plus.gif' border='0' /></a></td>"; $col .= "\n</tr>"; $col .= "\n</table>\n"; $html = str_replace($ibforums->lang['board_stats'], $col, $html); $html = preg_replace("`(^.*)(<table.*$)`is", "\\1<div id='fstats_block' style='display:block;'>\\2", $html); $this->output .= $html; $this->output .= preg_replace("`(^.*?</table>)`is", "\\1\n</div>", $this->html->stats_footer()); } } else if (TRUE) { $url .= "&collapse_stats_h=1"; if ($this->use_skin) { $this->output .= $this->collapse_html->stats_header_show($url); $this->output .= $stats_html; $this->output .= $this->collapse_html->stats_footer(); } else { $html = $this->html->stats_header(); $col = "\n<table width='100%'>"; $col .= "\n<tr>"; $col .= "\n<td align='left'>{$ibforums->lang['board_stats']}</td>"; $col .= "\n<td align='right'><a href='javascript:show('fstats');' ><img src='{$ibforums->vars['img_url']}/minus.gif' style='vertical-align:middle;border:0px;' id='fstats_collapse' /></a></td>"; $col .= "\n</tr>"; $col .= "\n</table>\n"; $html = str_replace($ibforums->lang['board_stats'], $col, $html); $html = preg_replace("`(^.*)(<table.*$)`is", "\\1<div id='fstats_block' style='display:block;'>\\2", $html); $this->output .= $html; $this->output .= $stats_html; $this->output .= preg_replace("`(^.*?</table>)`is", "\\1</div>", $this->html->stats_footer()); } } else { //-- mod_collapse end |
D. Suche in function Boards(..)
|
$this->output .= $this->html->stats_footer(); |
|
$this->output .= $this->html->stats_footer(); //-- mod_collapse begin } //-- mod_collapse end |
E. Suche in function process_all_cats(..)
|
function process_all_cats() { global $std, $DB, $ibforums; |
|
function process_all_cats() { global $std, $DB, $ibforums; //-- mod_collapse begin global $HTTP_COOKIE_VARS; if (file_exists(ROOT_PATH."Skin/{$ibforums->skin_id}/mod_collapse_skin.php")) { $this->collapse_html = $std->load_template('mod_collapse_skin'); $this->use_skin = true; } if (isset($ibforums->input['collapse_s'])) { $std->my_setcookie("fc".$ibforums->input['collapse_s']."_block", "", 1); $_COOKIE[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_s']."_block"] = "block"; $HTTP_COOKIE_VARS[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_s']."_block"] = "block"; } if (isset($ibforums->input['collapse_h'])) { $std->my_setcookie("fc".$ibforums->input['collapse_h']."_block", "none", 1); $_COOKIE[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_h']."_block"] = "none"; $HTTP_COOKIE_VARS[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_h']."_block"] = "none"; } $url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext']."?".$_SERVER['QUERY_STRING']; $url = preg_replace("`\&collapse_.=\d*`", "", $url); $url = preg_replace("`\#col\d*$`", "", $url); //-- mod_collapse end |
F. Suche in function process_all_cats(..)
|
if ( $cat_data['state'] != 1 ) { continue; } |
|
if ( $cat_data['state'] != 1 ) { continue; } //-- mod_collapse begin $hide_this_cat = $std->my_getcookie("fc{$cat_id}_block") == "none" && $ibforums->input['collapse_s'] != $cat_id; $this->output .= "<a href='' name='col".$cat_id."'></a>"; $cat_data['collapse_url'] = $url."&collapse_s=".$cat_id."#col".$cat_id; if ($hide_this_cat) { if ($this->use_skin) { $this->output .= $this->collapse_html->CatHeader_Expanded_Hide($cat_data); } else { $html = $this->html->CatHeader_Expanded($cat_data); $html = preg_replace("`(.*<table)`is", "\\1 id=\"fc{$cat_id}_block\" style=\"display:none;\"", $html); $pic = "<a href=\"{$cat_data['collapse_url']}\" onclick=\"show('fc{$cat_id}');return true;\"><img style='border:0px;vertical-align:middle;text-align:right;cursor:pointer; cursor:hand;' src='{$ibforums->vars['img_url']}/plus.gif' /></a>"; $col_1 = "\n<table width='100%'>"; $col_1 .= "\n<tr>"; $col_1 .= "\n<td align='left'>"; $col_2 = "</td>\n<td align='right'>$pic</td>"; $col_2 .= "\n</tr>"; $col_2 .= "\n</table>\n"; $match = "`(<\{CAT_IMG\}>.*?{$cat_data['name']}.*?<\/a>)`is"; if (!preg_match($match, $html)) $match = "`({$cat_data['name']}.*?<\/a>)`is"; $html = preg_replace($match, "$col_1\\1$col_2", $html); $this->output .= $html; } $this->output .= $this->html->end_this_cat(); } else { //-- mod_collapse end |
G. Suche in function process_all_cats(..)
|
if ($temp_html != "") { |
|
if ($temp_html != "") { //-- mod_collapse begin $cat_data['collapse_url'] = $url."&collapse_h=".$cat_id."#col".$cat_id; if ($this->use_skin) { $this->output .= $this->collapse_html->CatHeader_Expanded_Show($cat_data); } else if (TRUE) { $html = $this->html->CatHeader_Expanded($cat_data); $html = preg_replace("`(.*<table)`is", "\\1 id=\"fc{$cat_id}_block\" style=\"display:block;\"", $html); $pic = "<a href=\"javascript:show('fc{$cat_id}')\" ><img style='border:0px;vertical-align:middle;text-align:right;cursor:pointer; cursor:hand;' src='{$ibforums->vars['img_url']}/minus.gif' id='fc{$cat_id}_collapse' /></a>"; $col_1 = "\n<table width='100%'>"; $col_1 .= "\n<tr>"; $col_1 .= "\n<td align='left'>"; $col_2 = "</td>\n<td align='right'>$pic</td>"; $col_2 .= "\n</tr>"; $col_2 .= "\n</table>\n"; $match = "`(<\{CAT_IMG\}>.*?{$cat_data['name']}.*?<\/a>)`is"; if (!preg_match($match, $html)) $match = "`({$cat_data['name']}.*?<\/a>)`is"; $html = preg_replace($match, "$col_1\\1$col_2", $html); $this->output .= $html; } else //-- mod_collapse end |
H. Suche in function process_all_cats(..)
|
unset($temp_html); } $this->output .= $this->html->end_all_cats(); |
|
//-- mod_collapse begin } //-- mod_collapse end unset($temp_html); } $this->output .= $this->html->end_all_cats(); |
A. Suche in function show_subforums(..)
|
$fid = $ibforums->input['f']; |
|
$fid = $ibforums->input['f']; //-- mod_collapse begin global $HTTP_COOKIE_VARS; if (file_exists(ROOT_PATH."Skin/{$ibforums->skin_id}/mod_collapse_skin.php")) { $this->collapse_html = $std->load_template('mod_collapse_skin'); $this->use_skin = true; } if (isset($ibforums->input['collapse_s'])) { $std->my_setcookie("fc".$ibforums->input['collapse_s']."_block", "", 1); $_COOKIE[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_s']."_block"] = "block"; $HTTP_COOKIE_VARS[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_s']."_block"] = "block"; } if (isset($ibforums->input['collapse_h'])) { $std->my_setcookie("fc".$ibforums->input['collapse_h']."_block", "none", 1); $_COOKIE[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_h']."_block"] = "none"; $HTTP_COOKIE_VARS[$ibforums->vars['cookie_id']."fc".$ibforums->input['collapse_h']."_block"] = "none"; } $url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext']."?".$_SERVER['QUERY_STRING']; $url = preg_replace("`\&collapse_.=f\d*`", "", $url); $hide_this_cat = $std->my_getcookie("fcf{$fid}_block") == "none" && $ibforums->input['collapse_s'] != "f".$fid; $this->sub_output .= "<a href='' name='col".$fid."'></a>"; $cat_data['collapse_url'] = $url."&collapse_s=f".$fid."#col".$fid; $cat_data['id'] = "f".$fid; if ($hide_this_cat) { if ($this->use_skin) { $cat_data['collapse_name'] = $ibforums->lang['forums']; $this->sub_output .= $this->collapse_html->CatHeader_Expanded_Hide($cat_data); } else { $html = $this->board_html->CatHeader_Expanded($cat_data); $html = preg_replace("`(.*<table)`is", "\\1 id=\"fc{$cat_id}_block\" style=\"display:none;\"", $html); $pic = "<a href=\"javascript:show('fcf{$fid}')\" ><img style='border:0px;vertical-align:middle;text-align:right;cursor:pointer; cursor:hand;' src='{$ibforums->vars['img_url']}/plus.gif' /></a>"; $col_1 = "\n<table width='100%'>"; $col_1 .= "\n<tr>"; $col_1 .= "\n<td align='left'>"; $col_2 = "</td>\n<td align='right'>$pic</td>"; $col_2 .= "\n</tr>"; $col_2 .= "\n</table>\n"; $match = "`(<\{CAT_IMG\}>.*?{$cat_data['name']}.*?<\/a>)`is"; if (!preg_match($match, $html)) $match = "`({$cat_data['name']}.*?<\/a>)`is"; $html = preg_replace($match, "$col_1\\1{$ibforums->lang['forums']}$col_2", $html); if (preg_match("`(.*?<table.*)<table.*?>\s*<tr.*/tr>\s*</table>`is", $html)) { $html = preg_replace("`(.*?<table.*)<table.*?>\s*<tr.*/tr>\s*</table>`is", "\\1", $html); } else { $html = preg_replace("`(.*)<tr.*?/tr>`is", "\\1", $html); } $this->sub_output .= $html; } $this->sub_output .= $this->board_html->end_this_cat(); } else { //-- mod_collapse end |
B. Suche in function show_subforums(..)
|
if ($temp_html != "") { |
|
if ($temp_html != "") { /*-- mod_collapse exclude begin |
C. Suche in function show_subforums(..)
|
$this->sub_output .= $this->board_html->subheader(); |
|
$this->sub_output .= $this->board_html->subheader(); -- mod_collapse exclude end */ //-- mod_collapse begin $this->sub_output .= "<a href='' name='col".$fid."'></a>"; $cat_data['collapse_url'] = $url."&collapse_h=f".$fid."#col".$fid; if ($this->use_skin) { $cat_data['collapse_name'] = $ibforums->lang['forums']; $this->sub_output .= $this->collapse_html->CatHeader_Expanded_Show($cat_data); } else { $html = $this->board_html->CatHeader_Expanded($cat_data); $html = preg_replace("`(.*<table)`is", "\\1 id=\"fcf{$fid}_block\" style=\"display:block;\"", $html); $pic = "<a href=\"javascript:show('fcf{$fid}')\" ><img style='border:0px;vertical-align:middle;text-align:right;cursor:pointer; cursor:hand;' src='{$ibforums->vars['img_url']}/minus.gif' id='fcf{$fid}_collapse' /></a>"; $col_1 = "\n<table width='100%'>"; $col_1 .= "\n<tr>"; $col_1 .= "\n<td align='left'>"; $col_2 = "{$ibforums->lang['forums']}</td>\n<td align='right'>$pic</td>"; $col_2 .= "\n</tr>"; $col_2 .= "\n</table>\n"; $match = "`(<\{CAT_IMG\}>.*?{$cat_data['name']}.*?<\/a>)`is"; if (!preg_match($match, $html)) $match = "`({$cat_data['name']}.*?<\/a>)`is"; $html = preg_replace($match, "$col_1\\1$col_2", $html); $this->sub_output .= $html; } //-- mod_collapse end |
D. Suche in function show_subforums(..)
|
unset($temp_html); $this->sub_output .= $this->board_html->end_all_cats(); |
|
//-- mod_collapse begin } //-- mod_collapse end unset($temp_html); $this->sub_output .= $this->board_html->end_all_cats(); |
Suche in function load_skin(..)
|
$ibforums->member['skin'] = $row['sid']; } |
|
$ibforums->member['skin'] = $row['sid']; } //-- mod_collapse begin $col_js = "\n<script type='text/javascript' language='javascript'>\n"; $col_js .= "var __COOKIE_DOMAIN__ = '{$ibforums->vars['cookie_domain']}';\n"; $col_js .= "var __COOKIE_PATH__ = '{$ibforums->vars['cookie_path']}';\n"; $col_js .= "var __COOKIE_PREFIX__ = '{$ibforums->vars['cookie_id']}';\n"; $col_js .= "\n</script>\n"; $col_js .= "\n<script type='text/javascript' language='javascript' src='html/mod_collapse.js'></script>\n"; $row['template'] = str_replace( "<% JAVASCRIPT %>", "<% JAVASCRIPT %>".$col_js, $row['template']); //-- mod_collapse end |