Page 1 of 2

Anne Rice build 5

PostPosted: Tue Dec 23, 2003 11:53 pm
by plushpuffin
case-insensitive matching!
case-insensitive matching!
case-insensitive matching!

The replacement/reverse-replacement code has been optimized. It now constructs a regex and then evals it, instead of having if() statements inside of if() statements the way it used to...

(Don't use dollar signs in your patterns. They don't work now, if they ever did before)

If there are any problems, please let me know.

Oops, I just realized I put this in the wrong forum. Mods please move!

PostPosted: Wed Dec 24, 2003 12:25 am
by kriko
Moved since you requested. If some people don't know where they can find the wonderful addon then here is a link:

PostPosted: Thu Dec 25, 2003 4:55 pm
by faithless
I adore Anne Rice. er. The coranto addon. not the writer.
Er. naming an addon after a writer wouldn't pose any legal problems?
just a thought that came to mind.

and ur nick being partly the name of a book publisher, one can only imagine our darling plush poring over books. with vampire stories from rice being her favourites. :wink:

PostPosted: Fri Dec 26, 2003 6:21 am
by LoneOwl
Just go with the good ol' BDSM erotica novels.

And legal problems? Why? My only problem with the name is possible confusion it could cause. Guys and girls may be wanting something other than an advanced glossary addon.

PostPosted: Fri Dec 26, 2003 8:31 am
by officeslave
W00t. My site has become completely dependent upon Anne Rice's bbcoding abilities.

PostPosted: Thu Jan 01, 2004 11:00 am
by faithless
just thought i brought it up.
in build 5, when ever i post a news item which anne rices runs thru for replacing,

this chunk of text appears all over the coranto top screen.
Code: Select all
$$fn =~ s/\Q<br>\E/((annerice0))/g
$$fn =~ s/\Q<hr>\E/((annerice1))/g
$$fn =~ s~\Q[b]\E([^\[]+)\Q[/b]\E~\<strong\>$1\<\/strong\>~g;
$$fn =~ s~\Q[i]\E([^\[]+)\Q[/i]\E~\<em\>$1\<\/em\>~g;
$$fn =~ s~\Q[u]\E([^\[]+)\Q[/u]\E~\<strong\>\<em\>$1\<\/em\>\<\/strong\>~g;
$$fn =~ s~\Q[quote]\E([^\[]+)\Q[/quote]\E~\<\/p\>\<p\ class\=\"quote\"\>$1\<\/p\>\<p\>~g;
$$fn =~ s~\Q[url="\E([^\"]+)\Q"]\E([^\[]+)\Q[/url]\E~\<a\ href\=\"$1\"\>$2\<\/a\>~g;
$$fn =~ s~\Q[url]\E([^\[]+)\Q[/url]\E~\<a\ href\=\"$1\"\>$1\<\/a\>~g;
$$fn =~ s~\Q[img="\E([^\"]+)\Q"]\E([^\[]+)\Q[/img]\E~\<img\ src\=\"$1\"\ alt\=\"$2\"\ \/\>~g;
$$fn =~ s~\Q[img]\E([^\[]+)\Q[/img]\E~\<img\ src\=\"$1\"\ alt\=\"$1\"\ \/\>~g;
$$fn =~ s~\Q<img src="\E([^\"]+)\Q">\E~\<img\ src\=\"$1\"\ alt\=\"$1\"\ \/\>~g;
$$fn =~ s~\Q<img src="\E([^\"]+)\Q" alt="\E([^\"]+)\Q">\E~\<img\ src\=\"$1\"\ alt\=\"$2\"\ \/\>~g;

which seems to because of this line of code in various places of
Code: Select all
print '<h4>' . HTMLescape("$code") . '</h4>';

is it required? it looks unsightly with all that code running all over the top screen.

PostPosted: Mon Jan 05, 2004 3:22 am
by plushpuffin
No, it isn't required. That was just my debugging code, which I forgot to turn off. Sorry. I have uploaded a new Anne Rice build 5, without the debugging code. GG

PostPosted: Fri Jan 30, 2004 5:05 am
by bozoka45
I asked plushpuffin this question, but maybe someone else will know an answer.

Is there a way to make Anne Rice run the find and replace routine on all news items, without modifing them all? Apparently a full rebuild won't even do it. I guess Anne Rice is attached to the submit page?

I think this would be a great addition. It would help Coranto become more dynamic.

PostPosted: Sat Jan 31, 2004 6:54 pm
by plushpuffin
It could be done, but I'm not up to it right now. Anne Rice is open source, feel free to modify it and release a new version.

PostPosted: Tue Feb 03, 2004 6:20 am
by bozoka45
Well, I made it work when I do a full rebuild (or partial) when I added these two hooks:

Code: Select all
$addon->hook('BuildNews_PreLoop', \$ModifyNews_Edit_TopRow, 4);
$addon->hook('Build_GetData', \$AnneRice_SaveNews, 4);

Unfortunately, I think it really slows down the time of the Full Rebuild. Any ideas/sugestions to fix this? Maybe a button within Anne Rice itself that does the full rebuild? Thats probably beyond my expertise (which are next to none), but I will try and work out something.

I guess you could say AnneRice beta 5.1 is found here:

(View the source)

PostPosted: Tue Feb 03, 2004 6:27 am
by bozoka45
Also, just thinking out loud here:

But since AnneRice uses a glossdat.txt file to do the find and replace action, would it be possible to automatically add items to the glossdat.txt file using a profile?

PostPosted: Tue Feb 03, 2004 4:53 pm
by Joyrex
Possibly, if you can get the profile's style output to match the format of the glossdat.txt file. That's a pretty good idea, although the automatic part is a bit misleading - what part of it would be automatic? would you have custom fields set up to populate the glossdat file? That's no different than entering the data via the Admin section of Coranto, unless you wanted specifc fields you used when publishing an entry to also populate the glossdat...

PostPosted: Tue Feb 03, 2004 5:03 pm
by bozoka45
I have alot of entries I can add to Anne Rice, due to the nature of my website. All of these entires could be made from news posts, just by taking the subject, disecting it, and using the news id. The style wasn't hard to figure out.

It seems like it will work, I will update you shortly.

The only probably would be that if I ever wanted to add items besides news items to my Anne Rice database, I'd have to fudge the entry somehow. I'll cross that bridge when I come to it.

PostPosted: Tue Feb 03, 2004 10:02 pm
by bozoka45
I might use two versions of Anne Rice. I will just have to edit the Addon a little. The first version would be used to automatically update a glossary file based on a field name. The second version could be the version that would be editable by me.

PostPosted: Wed Feb 04, 2004 3:04 am
by plushpuffin

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...