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

Re: [Matthias70] Global: List where the users come from?

Quote Reply
Re: [Matthias70] Global: List where the users come from? In reply to
HI,

I'm just too darn nice Wink

I had to rewrite the whole thing - but it all tests ok my end:

Code:
sub {

my $ignore;
$ignore->{'Place'} = 1;
$ignore->{'Test'} = 1;


use lib '/home/user/domain.com/secure_data/lib';

my $NEWDB = new GT::SQL (
def_path => '/home/user/domain.com/secure_data/defs',
cache => 0,
debug => 0,
subclass => 0
);

my $db = $NEWDB->table('comm_users');
$db->select_options( "GROUP BY prof_city","ORDER BY city_count DESC");
my $sth = $db->select("prof_city", "COUNT(*) as city_count") or die "Query Error: $GT::SQL::error";

my @cities;
while (my ($s, $c) = $sth->fetchrow_array) {
if (length($s) < 2) { next; }
if ($c < 2) { next; }
if ($ignore->{$s}) { next; }
push @cities, { Name => $s, count => $c }
}

return { city_loop_count => \@cities }

}

Call it in the same way as before.

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!

Last edited by:

Andy: Dec 23, 2007, 4:13 AM
Subject Author Views Date
Thread; hot thread Global: List where the users come from? Matthias70 7811 Dec 23, 2007, 2:54 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7676 Dec 23, 2007, 3:23 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7661 Dec 23, 2007, 3:39 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7676 Dec 23, 2007, 3:47 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7716 Dec 23, 2007, 3:52 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7698 Dec 23, 2007, 3:58 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7709 Dec 23, 2007, 4:03 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7643 Dec 23, 2007, 4:05 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7779 Dec 23, 2007, 4:09 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7701 Dec 23, 2007, 4:14 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7701 Dec 23, 2007, 4:18 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7688 Dec 23, 2007, 4:19 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7667 Dec 23, 2007, 10:57 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Matthias70 7697 Dec 25, 2007, 12:33 PM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7655 Dec 26, 2007, 12:40 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7575 Dec 29, 2007, 12:14 PM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7594 Dec 29, 2007, 12:33 PM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7612 Dec 31, 2007, 6:25 AM
Post; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7568 Dec 31, 2007, 6:30 AM
Thread; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7556 Mar 23, 2008, 6:57 AM
Thread; hot thread Re: [Matthias70] Global: List where the users come from?
Andy 7539 Mar 23, 2008, 7:30 AM
Post; hot thread Re: [Andy] Global: List where the users come from?
Matthias70 7570 Mar 23, 2008, 8:37 AM