Kamis, 13 Desember 2007

Invision Power Board: Hide Links

Product:
Invision Power Board

IPB version:
v2.3.x

Description:
Hide thread posted links from selected guest, eg. Guests, Banned users etc.

Let's start here!

1. Open file: sources/lib/func_topic_linear.php
Find:
[sourcecode language="php"]

//-----------------------------------------

// Print post row

//-----------------------------------------

[/sourcecode]
and add:
[sourcecode language="php"]
if($this->ipsclass->vars['bl_hide_links_on']){
if (in_array($this->ipsclass->member['mgroup'],
explode(',', $this->ipsclass->vars['bl_hide_links_group']))){
$gelen=$row['post'];
$post_array = preg_split('/()/', $gelen, 65535, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
for ($i=0; $i<=count($post_array); $i++){
if(strstr($post_array[$i], ' $gelen = str_replace($post_array[$i],
$this->ipsclass->vars['bl_hide_links_replace'], $gelen);
}

// replace code [CODE]
$post_array = preg_split('/(.*?)/', $gelen, 65535, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
for ($i=0; $i<=count($post_array); $i++){
if(strstr($post_array[$i],''))
$gelen=str_replace($post_array[$i],
$this->ipsclass->vars['bl_hide_links_replace_code'], $gelen);
}
$row['post'] = $gelen;
}
}[/sourcecode]
2. Open file: sources/lib/func_topic_threaded.php
Find:
[sourcecode language="php"]

//-----------------------------------------

// Print post row

//-----------------------------------------

[/sourcecode]
and add:
[sourcecode language="php"]
if($this->ipsclass->vars['bl_hide_links_on']){
if (in_array($this->ipsclass->member['mgroup'],
explode(',', $this->ipsclass->vars['bl_hide_links_group']))){
$gelen=$row['post'];
$post_array = preg_split('/()/', $gelen, 65535, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
for ($i=0; $i<=count($post_array); $i++){
if(strstr($post_array[$i], ' $gelen = str_replace($post_array[$i],
$this->ipsclass->vars['bl_hide_links_replace'], $gelen);
}

// replace code [CODE]

$post_array = preg_split('/(.*?)/',
$gelen, 65535, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
for ($i=0; $i<=count($post_array); $i++){
if(strstr($post_array[$i],''))
$gelen=str_replace($post_array[$i],
$this->ipsclass->vars['bl_hide_links_replace_code'], $gelen);
}
$row['post'] = $gelen;
}
}[/sourcecode]
Now, go to IPB Control Panel -> Tools & Settings -> XML settings file tools
and, upload this XML file: ipb_settings_partial.zip

Everything is done.