Код: Выделить всё
##############################################################
## MOD Title: [pic] bbCode
## MOD Author: chyduskam < chuduskam@debilarius.ru > (Egor Naklonyaeff) N/A
## MOD Description: [pic] bbCode for Smartor Photo Album support
## MOD Version: 0.1.2
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 1
## includes/bbcode.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbbguru.net/mods/
##############################################################
## Author Notes: Usage [pic]pic number[/pic]
## Sapienty Sat
##############################################################
## MOD History:
## 2005-03-27 - Version 0.1.2
## - insert code for View full pic as a popup album settings
## 2005-03-26 - Version 0.1.1
## - initial release
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]-------------------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]----------------------------------------
#
// Patterns and replacements for URL and email tags.
#
#-----[ BEFORE, ADD ]----------------------------------
#
// [pic] bbCode
$text = preg_replace("#\[pic:$uid\](.*?)\[/pic:$uid\]#sie", "pic_bbCode('\\1')", $text);
#
#-----[ FIND ]----------------------------------------
#
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)
#
#-----[ BEFORE, ADD ]----------------------------------
#
// [pic] bbCode
$text = preg_replace("#\[pic\](\d+)\[/pic\]#si", "[pic:$uid]\\1[/pic:$uid]", $text);
#
#-----[ FIND ]----------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]----------------------------------
#
function pic_bbCode($text)
{
//
// Returns picBBcode
//
global $board_config,$phpEx;
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
$index_url = $server_protocol . $server_name . $server_port . (( $script_name != '' )? $script_name . '/':'');
$pic_id=intval($text);
// Uncomment next code if you use view full pic as a popup album settings
// return '<a href="'.append_sid($index_url."album_pic.$phpEx?pic_id=$pic_id").'" target=_blank><img border="0" src="'.append_sid($index_url."album_thumbnail.$phpEx?pic_id=$pic_id").'" alt=""></a>';
return '<a href="'.append_sid($index_url."album_page.$phpEx?pic_id=$pic_id").'" target=_blank><img border="0" src="'.append_sid($index_url."album_thumbnail.$phpEx?pic_id=$pic_id").'" alt=""></a>';
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Пример работы: http://naklon.info/talk/viewtopic.php?p=2519#2519
Добавлено спустя 2 часа 42 минуты 21 секунду:
А вот и первые исправления. В первоначальном варианте оказалось несовместно с RSS. т.к. пути должны быть полными, а не относительными.