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

[ FREE PLUGIN ] ULTRAGlobals - Collection of Globals and routines

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

Can you open up ULTRAGlobals.pm, and find (in the Last_Links_By_Category function, near the bottom of the file):


Code:
my $cond = GT::SQL::Condition->new('CategoryID', 'IN', $all_ids);
my $cond2 = GT::SQL::Condition->new('isValidated','=','Yes');
my $sth = $db_obj->select (['Links.*'], $cond, $cond2 ) || die $GT::SQL::error;
..add this after:

Code:
print $IN->header;
print $sth->query;

Then save, and refresh your page. What query is it showing?

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] [ ULTRAGlobals ] Ideas please In reply to
Andy wrote:

Then save, and refresh your page. What query is it showing?

That's the query

Code:
SELECT glinks_Links.* FROM glinks_CatLinks,glinks_Category,glinks_Links WHERE glinks_CatLinks.LinkID = glinks_Links.ID AND glinks_CatLinks.CategoryID = glinks_Category.ID AND ((glinks_CatLinks.CategoryID = '598') AND (glinks_Links.isValidated = 'Yes'))

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Try commenting out (in Last_Links_By_Category):

Code:
my $db_obj = $DB->table('Links','CatLinks','Category');
$db_obj->select_options ("ORDER BY ID DESC Limit $limit");

my $sth = $db_obj->select (['Links.*'], GT::SQL::Condition->new(['CategoryID', 'IN', $all_ids], ['isValidated', '=', 'Yes'] ) ) || die $GT::SQL::error;

Does that work then?

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

Try commenting out (in Last_Links_By_Category):

Code:
my $db_obj = $DB->table('Links','CatLinks','Category');
$db_obj->select_options ("ORDER BY ID DESC Limit $limit");

my $sth = $db_obj->select (['Links.*'], GT::SQL::Condition->new(['CategoryID', 'IN', $all_ids], ['isValidated', '=', 'Yes'] ) ) || die $GT::SQL::error;


Does that work then?

Cheers

That shows an error!
Global symbol "$db_obj" requires explicit package name

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Sorry, I mean't comment this line:

Code:
my $sth = $db_obj->select (['Links.*'], GT::SQL::Condition->new(['CategoryID', 'IN', $all_ids], ['isValidated', '=', 'Yes'] ) ) || die $GT::SQL::error;

..not the 2 lines before that - sorry about that (was multi-tasking :P)

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] [ ULTRAGlobals ] Ideas please In reply to
Hi Andy,
when I comment out this line, it's working fine Smile

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Cool, I'll get that fixed up. I guess the "LIMIT" is being accessed once, and then gets removed.

I'll get a fixed version up (and also fix up another function, which I based that global on - as that's prob got the same problem :))

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: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Version 2.2.3 is now available from our site. This includes the LIMIT bug fix.

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

I just spotted a pretty major flaw in the NL_2_BR() function <G> (I was using it on a clients site, and was wondering why the data wasn't being returned, yet the tag existed).

The solution is:

1) Update to the new version on our site (NB, I didn't bother updating the version number)
..or:
2) Open up /admin/Plugins/ULTRAGlobals.pm, and find:

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

..replace with:

Code:
sub NL_2_BR {
my $in = $_[0];
$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] [ ULTRAGlobals ] Ideas please In reply to
Don't know why you insist on escaping brackets. It's not needed.

Code:
sub NL_2_BR {
my $in = $_[0];
$in =~ s|\r?\n|<br />|sg;
return $in;
}
Quote Reply
Re: [Wychwood] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Yeah, not sure why I did either (in that global) .... normally I don't =) Appart from in stuff like:

Code:
if ($var =~ m/something/) {
...
}
..which doesn't seem to work using:

Code:
if ($var =~ m|something|) {
..
}

(at least, it doesn't seem to match values for me, in prior cases).

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] [ ULTRAGlobals ] Ideas please In reply to
The two examples you just gave are identical and should behave the same way. Anyhow I wasn't referring to that anyway, I was talking about stuff like:

\<br \/\>

It doesn't matter whenter you use m|| or m// or whatever, you don't need all the escapes infront of angledbrackets!!
Quote Reply
Re: [Wychwood] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Quote:
The two examples you just gave are identical and should behave the same way

Yeah, thats what I would have thought. Just didn't seem to like doing m|| from inside an if() statement - odd (maybe was just a bad regex then)

Regarding:

Quote:
Anyhow I wasn't referring to that anyway, I was talking about stuff like:

\<br \/\>

It doesn't matter whenter you use m|| or m// or whatever, you don't need all the escapes infront of angledbrackets!!

Yup, I know :P

I actually got that global from one of my old sites (which I did a few years ago - should have just re-written it, but was trying to get a nice collection of globals into version 1 of this plugin =))

Now, I just use the format you have (you should be able to see it being used in other parts of ULTRAGlobals, not to mention globals I provide for free on the forum =))

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] [ ULTRAGlobals ] Ideas please In reply to
Hi

Two new global that may help :) are
Counting word
Counting signs
Quote Reply
Re: [nir] [ ULTRAGlobals ] Ideas please In reply to
Hi,

With the word one, are you meaning something like:

Quote:
this is a test

...would return 4.

Quote:
Counting signs

Not sure what you mean by this?

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] [ ULTRAGlobals ] Ideas please In reply to
Sorry, It look like I forget to write it
Like you write
"this is a test" -- would return -- Counting word 4
"this is a test" -- would return -- Counting sings 11 (t+h+i+s+i+s…)
Quote Reply
Re: [nir] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Try the new version 2.3.0 (from our site)

This now has:

Code:
<%Plugins::ULTRAGlobals::Count_Words($Field)%>
<%Plugins::ULTRAGlobals::Count_Chars($Field)%>

As always, this is documented in the Readme 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: [nir] [ ULTRAGlobals ] Ideas please In reply to
nir wrote:
Sorry, It look like I forget to write it
Like you write
"this is a test" -- would return -- Counting word 4
"this is a test" -- would return -- Counting sings 11 (t+h+i+s+i+s…)

Hi nir,
for what are you using this globals?

Thanks

Matthias
gpaed.de
Quote Reply
Re: [ ULTRAGlobals ] Ideas please In reply to
 
Quote:
[/url]# Random_Links[/url]
[/url]

Random links without setting category ID is returning duplicate records if they are entered in more than one category. Don't know if there is a solution?
Quote Reply
Re: [Alba] Ideas please In reply to
Hi,

Mmm.. not easily :/

Would be possible to do it with DISTINCT(LinkID), *but* it would double the work - cos it would need to do something like:

Get list of Distinct ID's (random)
Get the record for each of the ID's grabbed

..instead of just:

get the list of ID's

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
OK, thanks. I'll make another category and call the random links dependent on them being in that category, that will be easier.
Quote Reply
Re: [Alba] Ideas please In reply to
Hi,

2.3.3 is now available from our site.

This includes AdCode_Randomly_In_Cat() .. which lets you show adverts randomly in a category (between a link).

Enjoy <G>

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
Suggestion:

Could you possibly put the 'add date' &/or 'modified date' against all the plugins in the download area? It would make it much simpler to see what was updated.

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

Do you mean in the "Members Area" - i.e for the paid 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] Ideas please In reply to
Quote:
Do you mean in the "Members Area" - i.e for the paid plugins?
Yes.
> > > >