Add Search XS BBcode


Subject: Add Search XS BBcode
Find:

Code: [Download] [Hide] [Select]
'img' => array(
'nested' => false,
'inurl' => true,
),


After Add:
Code: [Download] [Hide]
  1. 'search' => array(  
  2. 'nested' => true,  
  3. 'inurl' => false,  
  4. 'allow_empty' => false,  
  5. ), 


Find:
Code: [Download] [Hide] [Select]
// IMG
if($tag === 'img')
{
global $config_mg;
if($this->is_sig)
{
return $error;
}
// main parameters
$params = array(
'src' => false,
'alt' => false,
'slide' => false,
);

// additional allowed parameters
$extras = $this->allow_styling ? array('width', 'height', 'border', 'style', 'class', 'title', 'align') : array('width', 'height', 'border', 'title', 'align');


// [img=blah]blah2[/img]
if(isset($item['params']['param']))
{

$params['src'] = ($config_mg['thumbnail_posts'] == 1 ) ? "image_thumbnail.php?pic_id=" . $item['params']['param'] : $item['params']['param'];
$params['alt'] = $content;
$params['slide'] = isset($item['params']['slide']) ? $item['params']['slide'] : '';
$slideshow = ($params['slide']) ? 'lightbox[' . $item['params']['slide'] . ']': 'lightbox';
}
// [img src=blah alt=blah width=123][/img]
elseif(isset($item['params']['src']))
{
$params['src'] = ($config_mg['thumbnail_posts'] == 1 ) ? "image_thumbnail.php?pic_id=" . $item['params']['src'] : $item['params']['src'];
$params['alt'] = isset($item['params']['alt']) ? $item['params']['alt'] : $content;
$params['slide'] = isset($item['params']['slide']) ? $item['params']['slide'] : '';
$slideshow = ($params['slide']) ? 'lightbox[' . $item['params']['slide'] . ']': 'lightbox';
for($i=0; $i<count($extras); $i++)
{
if(!empty($item['params'][$extras[$i]]))
{
if($extras[$i] === 'style')
{
$style = $this->valid_style($item['params']['style']);
if($style !== false)
{
$params['style'] = $style;
}
}
else
{
$params[$extras[$i]] = $item['params'][$extras[$i]];
}
}
}
}
// [img]blah[/img], [img width=blah]blah[/img]
elseif(!empty($content))
{
//Added in 033 -LIW -BEGIN
if ( $config_mg['thumbnail_posts'] != 1 && $max_image_width != 0 && $board_config['liw_enabled'] == 1 && !$this->is_sig && (!$item['params']['width'] || $item['params']['width'] >= $max_image_width))
{
$image_size = @getimagesize($content);
$item['params']['width'] = ($image_size[0] > $max_image_width) ? $max_image_width : $item['params']['width'];
}
//Added in 033 -LIW -END
$link_url = $content;
$params['src'] = ($config_mg['thumbnail_posts'] == 1 ) ? "image_thumbnail.php?pic_id=" . $content: $content;
$params['alt'] = isset($item['params']['alt']) ? $item['params']['alt'] : (isset($params['title']) ? $params['title'] : '');
$params['slide'] = isset($item['params']['slide']) ? $item['params']['slide'] : '';
$slideshow = ($params['slide']) ? 'lightbox[' . $item['params']['slide'] . ']': 'lightbox';
for($i=0; $i<count($extras); $i++)
{
if(!empty($item['params'][$extras[$i]]))
{
if($extras[$i] === 'style')
{
$style = $this->valid_style($item['params']['style']);
if($style !== false)
{
$params['style'] = $style;
}
}
else
{
$params[$extras[$i]] = $item['params'][$extras[$i]];
}
}
}
}

// generate html
$html = '<img';
foreach($params as $var => $value)
{
$html .= ' ' . $var . '="' . $this->process_text($value) . '"';
}
if(!isset($params['title']))
{
$html .= ' title="' . $this->process_text($params['alt']) . '"';
}
$html .= ' />';
// add url
if(empty($item['inurl']))
{
$html = ($config_mg['thumbnail_posts'] == 1 ) ? '<a href="' . $link_url . '" rel="'.$slideshow.'" title="' . $params['alt'] . '">' . $html . '</a>' : '<a href="' . $params['src'] . '" target="_blank" title="' . $lang['OpenNewWindow'] . '">' . $html . '</a>';;
}
return array(
'valid' => true,
'html' => $html,
'allow_nested' => false,
);
}


After Add

Code: [Download] [Hide] [Select]
//Search
if($tag === 'search')
{
// if($this->is_sig)
// {
// return $error;
// }
if($item['iteration'] > 1)
{
return $error;
}
$str = '<a href="search.php?search_keywords=' . $content . '" target="_blank">';
return array(
'valid' => true,
'start' => $str,
'end' => '</a>'
);
}



No icon now!! Sorry

Subject: Respuesta: Add Search XS BBcode
BBCode ? :?

Subject: Re: Add Search XS BBcode
This is really useful for supports site.

Moved to XS Mods.

Many Thanks.

Subject: Re: Respuesta: Add Search XS BBcode
ThE KuKa wrote: [View Post]
BBCode ? :?



Yes!! It is quick search to post

phpBBXS

Code: [Download] [Hide] [Select]
[search]phpBBXS[/search]


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.1032s (PHP: 17% SQL: 83%)
SQL queries: 10 - Debug Off - GZIP Enabled