Looking for NOBR

All new Coranto Addons, updates and patches to addons, will be released here...also, get support for addons within!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Looking for NOBR

Postby Jgold723 » Mon Mar 16, 2015 5:45 pm

I'm looking for a copy of the nobr addon by Aero Soul. I can't seem to find it anywhere. Does anyone have a copy that I could use? or is there an archive somewhere? I checked Parahead's place already.

Thanks,

John
Jgold723
 
Posts: 63
Joined: Wed Jan 10, 2007 6:44 pm

Re: Looking for NOBR

Postby Dale Ray » Sat Mar 21, 2015 9:12 pm

Here it is, it's a short one. Save as cra_nobr.pl

Code: Select all
#! CRADDON 1
#! NAME NoBR
#! DESCRIPTION Allows you to have true (\n) line brakes in your news items. To use, place the <nobr> and </nobr> tags around the text in which you want to use true line breaks (\n).
#! VERSION 1.0

my $addon = new Addon('NoBR');

my $hook1 = <<'END_CODE';
   for $i (@fieldDB) {
      $complete = '';
      if ($in{$i} =~ /<nobr>/i and $in{$i} =~ /<\/nobr>/i) {
         @brs = split /<\/nobr>/,$in{$i};
         for $j (@brs) {
            ($before,$after) = split /<nobr>/,$j;
            $after =~ s/\n/<!-- CORANTO: LINE BREAK -->/g;
            $complete .= "$before<nobr>$after</nobr>";
         }
         $complete =~ s/(<|\&lt;)nobr(\&gt;|>)(<|\&lt;)\/nobr(\&gt;|>)$//i;
         $in{$i} = $complete;
      }
   }
END_CODE

my $hook2 = <<'END_CODE';
   $fcode =~ s/(<|\&lt;)!-- CORANTO: LINE BREAK --(\&gt;|>)/\n/g;
END_CODE

my $hook3 = <<'END_CODE';
   $complete = '';
   if ($$fn =~ /<nobr>/i and $$fn =~ /<\/nobr>/i) {
      @brs = split /<\/nobr>/,$$fn;
      for $j (@brs) {
         ($before,$after) = split /<nobr>/,$j;
         $after =~ s/\n/<!-- CORANTO: LINE BREAK -->/g;
         $complete .= "$before<nobr>$after</nobr>";
      }
      $complete =~ s/(<|\&lt;)nobr(\&gt;|>)(<|\&lt;)\/nobr(\&gt;|>)$//i;
      $$fn = $complete;
   }
END_CODE

my $hook4 = <<'END_CODE';
   for $nobr (@fieldDB) {
      $$nobr =~ s/<!-- CORANTO: LINE BREAK -->/\n/g;
   }
END_CODE

$addon->hook('SaveNews_Pre',\$hook1);
$addon->hook('ModifyNews_Edit_Fields',\$hook2);
$addon->hook('ModifyNews_EditSave_2',\$hook3);
$addon->hook('BuildNews_StandardProfile',\$hook4);
$addon->hook('BuildNews_Filtered',\$hook4);
$addon->hook('BuildNews_SingleArchive',\$hook4);
$addon->hook('BuildNews_MultiArchive',\$hook4);

1;
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Re: Looking for NOBR

Postby SrNupsen » Sun Sep 27, 2015 1:40 pm

Whey, 1000 posts!! :shock:
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Addon Release and Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron