StuButler wrote:a lightbox system
So you're already using JS. I did this once for
Highslide.
However, to have the post ID and/or user ID available in a custom BBCode there is a rather q+d approach. Open
/includes/bbcode.php and find:
Before, add:
Code: Select all
/*** 2012-01-31 BEGIN AmigoJack
Provide post ID and user ID to custom BBCodes ***/
if( count( $str['search'] )&& count( $str['replace']== 1 ) ) $pType= 'str'; else
if( count( $preg['search'] )&& count( $preg['replace']== 1 ) ) $pType= 'preg'; else
$pType= '';
if( $pType ) { // Custom BBCodes only have one replacement
global $row; // Obviously this only works for viewtopic.php
${$pType}['replace'][0]= str_replace
( array
( '{POST}' // Hardcoded tokens to be used in the BBCode replacement
, '{USER}' // You could add more, of course...
)
, array
( isset( $row['post_id'] )? $row['post_id']: 0 // ...replaced with the current value
, isset( $row['user_id'] )? $row['user_id']: 0
)
, ${$pType}['replace'][0]
);
}
/*** 2012-01-31 END ***/
That's it. Now you can create your custom BBCodes with the
BBCode usage of anything, i.e.:
[thispost][/thispost]
and a
HTML replacement which contains i.e. the text
{POST}
.
You can use the token
{USER}
in the same manner. Or use both in one replacement.
Tested.