Gossamer Forum
Quote Reply
New pages
Whenever i need a new page i do the following: In nph_build i add some new lines to build cool pages

Code:
my $page = $CFG->{build_xyz_path} . "/" . "index.php";
my $url = $CFG->{build_xyz_url} . "/" . "index.php";

print $USE_HTML
? qq|Building <a href="$url" target="_blank">XYZ</a>...\n|
: qq|Building XYZ...\n|;

my $fh = _open_write($page);
print $fh Links::Build::build(xyz => {eng=>0});
close $fh;
my $perms = oct $CFG->{build_file_per};
chmod $perms, $page;

Here you can see eng=>0, because i buidl everything twice times for german/english.

Then i add a some new lines to build.pm

Code:
$COMPILE{build_xyz} = __LINE__ . <<'END_OF_SUB';
sub build_xyz{
# ------------------------------------------------------------------
# Generate the xyz page. Takes as options:
#
# Pass eng => 0/1

my $opts = shift;

if (ref $opts ne 'HASH') {
Links::debug("Invalid option passed to build_new: $opts") if $Links::DEBUG;
return;
}

if (! exists $opts->{eng}) {
$opts->{eng} = '0';
}

if ($opts->{eng} eq '0') {
return Links::SiteHTML::display('xyz', { });

} else {
return Links::SiteHTML::display('xyz2', { });

}
}
END_OF_SUB

Finally i said to myself, why the hell you do it again and again?

It should be enough to pass some vars, right?

nph-build:

print $fh Links::Build::build(xyz => {eng=>0, tpl => "name"});

build.pm

my $template = $opts->{tpl};

and

return Links::SiteHTML::display($template, { });



I have not tested now, but it should run. How much i love this old lady. :)
Quote Reply
Re: [Robert] New pages In reply to
Hi,

Is there any reason you are doing it like this, instead of using the PageCreator / PageBuilder plugins? :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New pages In reply to
I dont have such a plugin.
And for shure i like to play LEGO with my LSQL. :)
Quote Reply
Re: [Robert] New pages In reply to
Shurely you have one, Andy. :)

But i need this feature to build a page automatically two or more times just with template_name and template_name2 (or 3...) for different languages. I am happy to have it for my links and now i just need some more lines. But for the most people without that special thing your plug-in would be probably the better way to solve it.

But if someone needs my solution i will help.
Quote Reply
Re: [Robert] New pages In reply to
Hi,

I certainly do: http://gossamer.ultranerds.co.uk/...on/PageCreator_L218/

It would then build them on the normal build process Angelic

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New pages In reply to
This page looks nice. But your links in the signature seems to be outdated?
Quote Reply
Re: [Robert] New pages In reply to
Hi,

Any links in particular that don't work? I've just updated my sig (as its very out of date!). I think they should all be ok now. I did notice the images are broken on the category pages though, so I need to look into that

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!