Ok, I'll look at it and see what I can fudge out, I dont know Perl but I should be able to get it.
Thanks.
Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape
plushpuffin wrote:http://www.wwddfd.com/c/cra_annerice_b6.txt
Here's a shell of what you need. I've left the guts to you, because my server was bugging out on me. Dunno why.
I think what you need to do is call modifynews_toprow hook, and then call modifysave_3 hook. This will simulate editing and saving a news item, hopefully it will be compatible with all other addons. Who knows...
$Subs{'AnneRiceUpdate'} = << 'END_SUB';
sub AnneRiceUpdate {
my $addon = shift;
NeedCFG();
&AnneRiceLoadDB;
$addon->pageHeader('Anne Rice Running...', 1);
print qq~Starting Anne Rice MegaRun!<br>\n\n\n~;
my ($fh, $fh2) = EditNewsdat_Start();
my $stoppermnow = 0;
ARNDLOOP: while (<$fh>) {
$stoppermnow = 0;
$FileCount++;
chomp $_;
SplitDataFile($_);
if ($up <= 1 && $User ne $CurrentUser) {
# User doesn't have permission for this item
next ARNDLOOP;
}
# Addons: please only hook in here if you're restricting access to items based
# on permissions. If you're filtering/searching, your hook is later.
# HOOK: ModifyNews_Permissions
# if($Addons{'ModifyNews_Permissions'}){my $w;foreach $w (@{$Addons{'ModifyNews_Permissions'}}){my $addon=$w->[2];eval ${$w->[0]};AErr($addon,$@)if $@;};}
# BUG FIX: NDLOOP label not accessible from outside crcore.pl
if ($stoppermnow == 1){
next ARNDLOOP;
}
# let's make all other addons think that we're in modify news
# first we edit, then we save. taa-daa!
#
# note: I have no freaking clue what effect this will have on
# any other addons that might hook into Edit_TopRow or EditSave_3
# I hope it doesn't do anything super bad! ;)
print qq~Running Anne Rice on # $FileCount, $Subject / $newsid<br>\n~;
# HOOK: ModifyNews_Edit_TopRow
# if($Addons{'ModifyNews_Edit_TopRow'}){my $w;foreach $w (@{$Addons{'ModifyNews_Edit_TopRow'}}){my $addon=$w->[2];eval ${$w->[0]};AErr($addon,$@)if $@;};}
eval $ModifyNews_Edit_TopRow;
# HOOK: ModifyNews_EditSave_3
# if($Addons{'ModifyNews_EditSave_3'}){my $w;foreach $w (@{$Addons{'ModifyNews_EditSave_3'}}){my $addon=$w->[2];eval ${$w->[0]};AErr($addon,$@)if $@;};}
eval $AnneRice_SaveNews;
my $newsline = JoinDataFile();
print $fh2 $newsline, "\n";
$ItemCount++;
$CConfig{'LastBuildOverride'} = ($newstime - 1) if ($newstime - 1) < $CConfig{'LastBuildOverride'};
}
close($fh);
close($fh2);
EditNewsdat_Finish();
if ($CConfig{'AutoBuild_Modify'}) {
BuildNews();
}
print qq~\n\n\n<br>DONE.<br>\n~;
$addon->pageFooter();
exit;
}
END_SUB
#!/usr/bin/perl
print "Content-type: text/html\n\n";
my $eval = << 'END_CODE';
print "Hello!";
END_CODE
eval $eval;
1;
Return to Addon Release and Support
Users browsing this forum: Google [Bot] and 5 guests