Gossamer Forum
Home : General : Perl Programming :

Good bookshop software?

Quote Reply
Good bookshop software?
Anyone know of a (free - <g>) bookshop software, in perl, that handles templates well? I don't want to fiddle around with any HTML within perl files.

Cheers

- wil
Quote Reply
Re: [Wil] Good bookshop software? In reply to
Jeepers - there aren't any out there.

Funny that... I trawl through hotscripts.com and I notice how few few few few programs allow the use of 'templates'. Gossamer Threads got their priorities right from the start with their template system and it's sure appreciated.

- wil
Post deleted by Paul In reply to

Last edited by:

Paul: Mar 14, 2002, 3:10 AM
Quote Reply
Re: [Wil] Good bookshop software? In reply to
DBMan (flatfile) isn't template based... (wasn't that Alex's first script?) I don't know what the deal is with a lot of programs not being template based. It's not all that hard to do a simple parser.

--Philip
Links 2.0 moderator
Quote Reply
Re: [Paul] Good bookshop software? In reply to
Hmm maybe a little tricky. I was using it for my chat script so it has:

use ConfigData qw/$CFG/;

....at the top. You'll need to just add $CFG to the use vars qw/ /; line and remove the original to avoid errors and then scroll to the bottom to sub new() and change the include and root template path. Unsure

Last edited by:

Paul: Mar 14, 2002, 2:21 AM
Quote Reply
Re: [Paul] Good bookshop software? In reply to
Hi Paul

Thanks for that. I've got my own simple template parser. I say simple, because it is very simple. I don't paticulary see the need for a module overhead.

Code:
sub parse_template {
# --------------------------------------------------------------------------
# Sub to generate and print a template to the browser.
#

# check to see if we need to bypass printing a header. this is
# passed to use from the error_sub.

my $bypass_header = $_[1];
print $query->header() unless $bypass_header;

# find out which template should be displayed - this is either passed from
# another sub or from the browser.

my $pg = $_[0] || $query->param('pg');
my $file = $PATH_TEMPLATE . $pg;

# slurp the entire file into $HTML using $/ to enable slurp mode.

my $HTML;

{ local $/;

open (FILE,"<$file") || &error_html("Could not open $file. $!");
$HTML = <FILE>;
close FILE;
}

# do the template parsing. this replaces all <%..%> tags with the
# equivalent value in the hash %tmpl.

$HTML =~ s/<%(\w+)%>/$tmpl{$1}/g;

print $HTML;

}

Very very simple :-)

Now what I need is some e-commerce cookie thing as a replacement for my current bookshop:

http://www.fbagroup.co.uk/bookshop/

You know of any that support templates?

- wil
Quote Reply
Re: [Wil] Good bookshop software? In reply to
Hmm that looks pretty cool as it is (the bookshop).

You just want like a shopping cart type thing?
Quote Reply
Re: [Paul] Good bookshop software? In reply to
It is good, yeah. It just doesn't use templates which really bugs me. I hate having to dip into the code to change a page.

And the biggest problem I have is that it uses one internal template for all books. I want to use a different template for each book, so a template based system would be idea. I think..

- wil
Quote Reply
Re: [Wil] Good bookshop software? In reply to
You've probably checked here already but:

http://www.hotscripts.com/...erce/Shopping_Carts/
Quote Reply
Re: [Paul] Good bookshop software? In reply to
Yep. They're all absolutely awful. None of them support templates, well proper templates anyway. I want everything to be template~ized, and that means the ability to create templates for each page and just adding in <%.. tags ..%> anywhere I want.

I think I'll just have to write my own :-\

- wil
Quote Reply
Re: [Wil] Good bookshop software? In reply to
I'll write you one if you have some spare cha-ching Laugh
Quote Reply
Re: [Paul] Good bookshop software? In reply to
Hm, I don't mind writing one myself - it's just that it needs to go live by 5pm tonight for some launch at a 'World Books Day' conference. I need to apply a new design and add a feature where people can redem gift certificates - similar to amazon.com.

How much? <g>.

- wil

Last edited by:

Wil: Mar 14, 2002, 3:15 AM
Quote Reply
Re: [Wil] Good bookshop software? In reply to
Oh mmmm $100,000 it you need it by tonight Cool