vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   link checker.php (https://vborg.vbsupport.ru/showthread.php?t=171498)

luckid 02-26-2008 03:52 PM

link checker.php
 
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>&nbsp;{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]=["" "" ""] ;
showPopWinbbcodenullgeneralwizards(url_params), 600220true );
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 :rolleyes:


All times are GMT. The time now is 05:26 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01001 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete