Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Sub IncludeFile / IncludeCoin (Read 386 times)
ChiMoHe
Full Member
***
Offline


I love YaBB 2.2

Posts: 202
Joined: Apr 4th, 2007
Sub IncludeFile / IncludeCoin
Jun 9th, 2020 at 4:27pm
Print Post  
# One should never criticize his own work except in a fresh and hopeful mood. # The self-criticism of a tired mind is suicide. # - Charles Horton Cooley

IncludeFile (incomplete missing template code)
Code
Select All
sub IncludeFile { 	my $fname = shift; 	my $file; 	$fname =~ s/([\&;\`'\|\"*\?\~\^\(\)\[\]\{\}\$\n\r])//g; 	fopen(INCLUDE, $fname) || return '[an error occured while processing this directive]';  #' 	$file = join('', <INCLUDE>); 	fclose(INCLUDE); 	return $file; }
 



IncludeCoin uses same perl "routing" as includefile on Bitcoin server

Subs.pl
Code
Select All
sub IncludeCoin { my $fname = shift; my $file; $ETH; $BTC; $XB; $LTC; $NMC; $PPC; $XDG; $GRC; $XPM; $XPR; $NXT; $ARU; $DASH; $MZC; $NEO; $XMR; $XEM; $POT; $TIT; $XVC; $XLM; $EUR; $ATS; $BEF; $DEM; $ESP; $FIM; $FRF; $GRD; $IEP; $ITL; $LUF; $NLG; $PTE; $CYP; $MTL; $SIT; $AUD; $CHF; $HKD; $JPY; $USD; $fname =~ s/([\&;\`'\|\"*\?\~\^\(\)\[\]\{\}\$\n\r])//g; fopen(INCLUDE, $fname) || return '[an error occured while processing this directive]';  #' $file = join('', <INCLUDE>); fclose(INCLUDE); return $file; }

 


Template.pl
Code
Select All
## old tag template style decoding ##

 $output =~ s~<includecoin\s+(\w+)>~${"yy$1"}~g;

## new tag template style decoding ##

$output =~ s~{includecoin\s+(\w+)}~${"yy$1"}~g;

$output =~ s~<includecoin="(\S+)">~${\(IncludeCoin($1))}

$output =~ s~(a href\=\S+?action\=viewprofile\;username\;incudecoin\=.+?)(\>)~$1 rel=\"nofollow\"$2~isg;

 



Better coders have done more with less
« Last Edit: Jun 10th, 2020 at 1:35pm by ChiMoHe »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint