Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

[ FREE PLUGIN ] ULTRAGlobals - Collection of Globals and routines

(Page 10 of 10)
> >
Quote Reply
Re: [Andy] Ideas please In reply to
Hi Andy,

Type FLOAT would be correct for me (and in the DECIMAL ideal).

But, how to indicate the precision : FLOAT(7,4)?

I do not see how to do that in GL!

Thanks!

Mick
Quote Reply
Re: [MJ_] Ideas please In reply to
MySQLMan :)
Quote Reply
Re: [MJ_] Ideas please In reply to
Quote:
For the decimal (FLOAT), could the separator be the dot (.) or the comma (,) ?

By standard, it will format the number (FLOAT) as 1234456787.55.

The Commify function will change that to:

Code:
1,234,456,787.55

You can use a different delimited, with something like:

Code:
<%Plugins::ULTRAGlobals::Commify("123456778.54"," ")%>

Which would use a space as the delimiter (for countries like france etc)

If you wanna format something like:

Code:
123 123 1234,44

...then you would need to tweak the code a little. Find this line:

Code:
if ($delim) { s/,/$delim/g; }

..and add this after it:

Code:
if (/\.\d+$/) { s/\.(\d+)$/,$1/g; }

I just tested it, and that works well Smile

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: [MJ_] Ideas please In reply to
MJ_ wrote:
MySQLMan :)

Yup Smile

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] Ideas please In reply to
Great ! :)

I will associate it with http://www.decorplanit.com/plugin/

Thanks again!

Mick
Quote Reply
Re: [Andy] Ideas please In reply to
Hi Andy,

I use this solution with Plugins::ULTRAGlobals::NL_2_BR to escape Tags HTML:

<%set Description_New = escape_html $Description%>
<%Plugins::ULTRAGlobals::NL_2_BR($Description_New)%>

But, would it be possible to integrate directly the function in your code?

I tested with:

Code:
# <%Plugins::ULTRAGlobals::NL_2_BR($Description)%>
sub NL_2_BR {
my $in = $_[0];
$in = GT::CGI::html_escape($in);
$in =~ s/\r?\n/\<br \/\>/sg;
return $in;
}
...but that does not function...

Thanks again!

Mick
Quote Reply
Re: [MJ_] Ideas please In reply to
I think you probably want this, so it doesn't encode the charachters:

Code:
sub NL_2_BR {
my $in = $_[0];
$in = GT::CGI::html_escape($in);
$in =~ s/\r?\n/\<br \/\>/sg;
return \$in;
}

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] Ideas please In reply to
Great ! :)

I also added the function for Trim_Field:
$string = GT::CGI::html_escape($string);

Thanks!

Mick
Quote Reply
Re: [MJ_] Ideas please In reply to
Hi Andy,

I have a problem with Load_Link (<%detailed_url%>).

It gives me only the value of build_detail_format (in Build Options).

Whereas I use "build_detail_url/build_detail_format".

An idea?

Thank again!

Mick
Quote Reply
Re: [MJ_] Ideas please In reply to
Hi,

Mmm, shouldn't be a problem. Try changing this:

Code:
sub Load_Link {
my $link = $DB->table('Links')->select( { ID => $_[0] } )->fetchrow_hashref;
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
return $link;
}
..to:

Code:
sub Load_Link {
my $link = $DB->table('Links')->select( { ID => $_[0] } )->fetchrow_hashref;
$link = Links::SiteHTML::tags('link', $link);
return $link;
}

Hope that helps.

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] Ideas please In reply to
Hi Andy,

That functioned! :)

I have the same problem with Last_Links_By_Category.
I tried to add your code, but that does not function. :(

Thanks again.

Mick

Quote Reply
Re: [MJ_] Ideas please In reply to
Hi,

In the ULTRAGlobals.pm file, for that function - find:

Code:
my @cats;
while (my $hit = $sth->fetchrow_hashref) {

if ($CFG->{build_detailed}) { $hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} ); }

if ($hit->{isNew} eq "Yes") { $hit->{isNew} = 1; } else { $hit->{isNew} = 0; }
if ($hit->{isPopular} eq "Yes") { $hit->{isPopular} = 1; } else { $hit->{isPopular} = 0; }
if ($hit->{isChanged} eq "Yes") { $hit->{isChanged} = 1; } else { $hit->{isChanged} = 0; }

push @cats, $hit;
}

Try changing it to:

Code:
my @cats;
while (my $hit = $sth->fetchrow_hashref) {
$hit = Links::SiteHTML::tags('link', $hit);
push @cats, $hit;
}

That should do the trick.

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] Ideas please In reply to
Perfect! Smile
Quote Reply
User_List In reply to
Hello Andy!

I'm not sure whether I missed something or I did something wrong, but I can not get "User_List" to work?

Is there any difference if users register through the "Gossamer Community"?

Many thanks in advance.
Quote Reply
Re: [katakombe] User_List In reply to
Hi,

I'm afraid it won't work with GComm (as its using the glinks_Users table, not the community tables/database)

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] User_List In reply to
[
Andy wrote:
Hi,

I'm afraid it won't work with GComm (as its using the glinks_Users table, not the community tables/database)

Cheers

Frown oj ... sad, but okay Smile
> >