1 answer this is for PHPBB :
PHP Code:
#-----[ COPY ]-------------------------------------------------------
#
copy bbcode_box/images/*.* to styles/prosilver/imageset/bbcode_box/images/*.*
#
#-----[ OPEN ]-------------------------------------------------------
#
includes/abbcode.php
#
#-----[ FIND ]-------------------------------------------------------
#
'ABBC3_WEB' => true, // Display icon for [web]Web Iframe URL[/web] code.. ?
#
#-----[ BEFORE, ADD ]-------------------------------------------------
# NOTE: Add these lines on a new blank line before the preceding line(s) to find.
#
'ABBC3_RAPIDSHARE' => true, // Display icon for [rapidshare]http://rapidshare.com/files/...[/rapidshare] code.. ?
#
#-----[ FIND ]-------------------------------------------------------
#
if ( preg_match_all ( "/\[table=(.*?)\](.*?)\[\/table\]/i", $post_text, $table_ary ) )
#
#-----[ BEFORE, ADD ]-------------------------------------------------
# NOTE: Add these lines on a new blank line before the preceding line(s) to find.
#
// MOD : add-on rapidshare checker - START
if ( preg_match_all ( "/\[rapidshare\](.*?)\[\/rapidshare\]/i", $post_text, $rapidshare_ary ) )
{
$post_text = rapidshare_pass ( $post_text, $rapidshare_ary );
}
// MOD : add-on rapidshare checker - END
#
#-----[ FIND ]-------------------------------------------------------
#
/**
* ******************************************************************
* IMAGES BBCODE
* You can do it yourself in ACP -> Posting -> Messages -> BBCodes [Add a new BBcode]
* ******************************************************************
#
#-----[ BEFORE, ADD ]------------------------------------------------
# NOTE: Add these lines on a new blank line before the preceding line(s) to find.
#
// MOD : add-on rapidshare checker - START
function rapidshare_pass ( $post_text, $rapidshare_ary )
{
foreach ( $rapidshare_ary[0] as $i => $rapidshare )
{
$rapidshare_url = $rapidshare_ary[1][$i];
$rapidshare_seek = array( '{RAPIDSHARE_URL}', '{RAPIDSHARE_RETURN}' );
$rapidshare_with = array( $rapidshare_url, rapidshare_second_pass ( $rapidshare_url ) );
$rapidshare_replace = str_replace( $rapidshare_seek, $rapidshare_with, '<a href="{RAPIDSHARE_URL}" title="{RAPIDSHARE_URL}" alt="{RAPIDSHARE_URL}" target="_blanc">{RAPIDSHARE_URL}</a> {RAPIDSHARE_RETURN}' );
$post_text = str_replace( $rapidshare, $rapidshare_replace, $post_text );
}
return $post_text;
}
function rapidshare_second_pass ( $rapidshare_url )
{
global $user, $phpbb_root_path;
$rs_checkfiles = fopen ( "http://rapidshare.com/cgi-bin/checkfiles.cgi?urls=" . $rapidshare_url, "r" );
$t_imageset_path = "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset/bbcode_box/images/';
while ( !feof ( $rs_checkfiles ) )
{
$buffer = fgets ( $rs_checkfiles, 4096 );
if ( eregi ( '<font color="red">File', $buffer ) )
{
# $rapidshare_msg = '<font color="red" size="4" >' . $user->lang['RAPIDSHARE_WRONG'] . '</font>';
$rapidshare_pic = '<img src="' . $t_imageset_path . 'error.gif" class="postimage" type="image" name="abbc_rapidshare" alt="' . $user->lang['RAPIDSHARE_WRONG'] . '" title="' . $user->lang['RAPIDSHARE_GOOD'] . '" />';
}
if ( eregi ( '<font color="green">File', $buffer ) )
{
# $rapidshare_msg = '<font color="green" size="4" >' . $user->lang['RAPIDSHARE_GOOD'] . '</font>';
$rapidshare_pic = '<img src="' . $t_imageset_path . 'ok.gif" class="postimage" type="image" name="abbc_rapidshare" alt="' . $user->lang['RAPIDSHARE_GOOD'] . '" title="' . $user->lang['RAPIDSHARE_GOOD'] .'" />';
}
}
fclose ( $rs_checkfiles );
return $rapidshare_pic; // or you can use : return $rapidshare_msg;
}
// MOD : add-on rapidshare checker - END
#
#-----[ OPEN ]-------------------------------------------------------
#
language/en/mods/abbcode.php
#
#-----[ FIND ]-------------------------------------------------------
#
));
?>
#
#-----[ BEFORE, ADD ]------------------------------------------------
# NOTE: Add these lines on a new blank line before the preceding line(s) to find.
#
// MOD : add-on rapidshare checker - START
'ABBCODE_RAPIDSHARE_MOVER' => 'Insert a file from rapidshare',
'ABBCODE_RAPIDSHARE_HELP' => ' [rapidshare]http://rapidshare.com/files/...][/rapidshare]',
'ABBCODE_RAPIDSHARE_TAG' => 'rapidshare',
'ABBCODE_RAPIDSHARE_NOTE' => 'Example: http://rapidshare.com/files/86587996/Ad ... .zip.html',
'RAPIDSHARE_GOOD' => 'File found on server !',
'RAPIDSHARE_WRONG' => 'File not found !',
// MOD : add-on rapidshare checker - END
#
#-----[ OPEN ]-------------------------------------------------------
# NOTE: You will have to make this change to ALL themes you have installed. I use "prosilver" as an example.
#
styles/prosilver/template/posting_abbcodes_buttons.html
#
#-----[ FIND ]-------------------------------------------------------
#
abbc_tip : "{L_BBCODE_STYLES_TIP}"
#
#-----[ BEFORE, ADD ]------------------------------------------------
# NOTE: Add these lines on a new blank line before the preceding line(s) to find.
#
/** MOD : add-on rapidshare checker - START */
abbc_rapidshare : "{L_ABBCODE_RAPIDSHARE_MOVER}" + "{L_ABBCODE_RAPIDSHARE_HELP}" ,
/** MOD : add-on rapidshare checker - END */
#
#-----[ FIND ]-------------------------------------------------------
#
case "ABBC_ed2k" :
#
#-----[ BEFORE, ADD ]------------------------------------------------
# NOTE: Add these lines on a new blank line before the preceding line(s) to find.
#
/** MOD : add-on rapidshare checker - START */
case "ABBC_rapidshare" :
var url_params = new Array()
url_params[0]=["{L_ABBCODE_RAPIDSHARE_MOVER}" , "rapidshare" , "/rapidshare", "{L_ABBCODE_RAPIDSHARE_NOTE}"] ;
url_params[1]=["{L_ABBCODE_LINK}{L_ABBCODE_RAPIDSHARE_TAG}" , "http://rapidshare.com/files/", "{L_ABBCODE_NOLINK}{L_ABBCODE_RAPIDSHARE_TAG}"] ;
url_params[2]=["" , "" , ""] ;
showPopWin( bbcode, null, generalwizards(url_params), 600, 220, true );
break;
/** MOD : add-on rapidshare checker - START */
#
#-----[ FIND ]-------------------------------------------------------
#
<!-- IF S_ABBC3_WEB -->
#
#-----[ BEFORE, ADD ]------------------------------------------------
# NOTE: Add these lines on a new blank line before the preceding line(s) to find.
#
<!-- // MOD : add-on rapidshare checker - START -->
<!-- IF S_ABBC3_RAPIDSHARE --> <img src="{T_IMAGESET_PATH}/bbcode_box/images/rapidshare.gif" class="postimage" type="image" name="abbc_rapidshare" onClick="bbstyle2('ABBC_rapidshare')" onMouseOver="helpline2('rapidshare')" onMouseOut="helpline2()" title="{L_ABBCODE_RAPIDSHARE_MOVER}" /><!-- ENDIF -->
<!-- // MOD : add-on rapidshare checker - END -->
I would do the same thing with vb but I have not idea where to start ... X I need to check some files on rapidshare... 1 if there was an alternative should the same good
Tnx in advance Luckid