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

[ FREE PLUGIN ] ULTRAGlobals - Collection of Globals and routines

(Page 8 of 10)
> > > >
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
My mistake.

No I was not referring to emails or anything like that. My main concern was with Form Submissions in GLinks DB. So that would mainly mean

1. Description or other Text Area Fields while adding/editing Link is being submitted.
2. Text Area field in review & bookmark.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] [ ULTRAGlobals ] Ideas please In reply to
I know - but its not as simple as just a global =)

The emails still need to be accommodated for (otherwise, if someone uses those tags in the "Description", it will then show stuff like [b][/b] in the email) - trust me, I know what I'm talking about =)

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
In that case I suppose I will have to setup some javascript for this. I know TinyMCE has wonderful options, however didn't wanted to use ~170kb js file for this purpose.

Vishal
-------------------------------------------------------
Quote Reply
Re: [ ULTRAGlobals ] Ideas please In reply to
Hi Andy,

Im using your UltraGlobals and trying to include 8 random links from category 5 on my home.html

There is none that specificaly works on home.html, just inside the category.html

Ive tried several ways and when it works, I get links from all categories... All other ways, the site breaks.

Could you guide me please.

Thanks,

Juan Carlos
Quote Reply
Re: [Gorospe] Ideas please In reply to
Hi,

Are you using <%Plugins::ULTRAGlobals::Random_Links($ID,8)%>

?

If so, this should work fine for the homepage:


<%Plugins::ULTRAGlobals::Random_Links('',8)%>

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
The code will be implemented 7 times for 7 different categories. Thats why its not working. Its taking links from all categories.

The tabs will be ajax, and the links need to be specific for those 7 categories.. :)

That code pulls from all categories, right?
Quote Reply
Re: [Gorospe] Ideas please In reply to
This will pull from ALL categories:

<%Plugins::ULTRAGlobals::Random_Links('',8)%>

..and this will pull from category specific ones (i.e on category.html);

<%Plugins::ULTRAGlobals::Random_Links($ID,8)%>

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
On home, this code doesnt work:

<%Plugins::ULTRAGlobals::Random_Links($ID,8)%>
<%if Random_Loop.length%>
<%loop Random_Loop%>
<%include link-chiquito.html%>
<%endloop%>
<%endif%>

this also doesnt work:

<%Plugins::ULTRAGlobals::Random_Links(5,8)%>
<%if Random_Loop.length%>
<%loop Random_Loop%>
<%include link-chiquito.html%>
<%endloop%>
<%endif%>

Its on home.html Im talking about.. not category.html
It DOES work great on category.html
Quote Reply
Re: [Gorospe] Ideas please In reply to
On home.html, if you want it to find ALL links (i.e not category specific), and randomly select 8 records, this would be what you need:

Code:
<%Plugins::ULTRAGlobals::Random_Links('',8)%>
<%if Random_Loop.length%>
<%loop Random_Loop%>
<%include link-chiquito.html%>
<%endloop%>
<%endif%>

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
HAS to be category specific.

Your code works great, but it needs to be ONLY from category 5.
Quote Reply
Re: [Gorospe] Ideas please In reply to
Ok, so if it ONLY has to be from the category 5, then this is what you would need:

<%Plugins::ULTRAGlobals::Random_Links('5',8)%>

However, I see you have tried this before - what do you mean "it doesn't work" ? Are the link you expect actually in category ID 5, or sub-categories of it? (it *only* grabs links from the category Id you provide, not sub-categories)

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, maybe thats why it doesnt work.
There are no links on category 5, just subcategories under category 5.

Any way to get them from category 5 & its subcategories?
Quote Reply
Re: [Gorospe] Ideas please In reply to
Sure, will write a global for ya in a bit - having dinner atm =)

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
thanks andy.
Quote Reply
Re: [Gorospe] Ideas please In reply to
Hi,

Please try this:

rand_links_by_category
Code:
sub {

my $cat = $_[0];
my $limit = $_[1];
my $all_ids = $DB->table('Category')->children($cat);
push @$all_ids, $cat;

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

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

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;
}

return { rand_links_in_this_cat => \@cats }

}

Call with:

Code:
<%rand_links_by_category(5,8)%>
<%loop rand_links_in_this_cat%>
<%include link.html%>
<%endloop%>

Should do what you want =)

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: Jul 4, 2009, 9:22 AM
Quote Reply
Re: [Andy] Ideas please In reply to
Im getting this:

Unknown Tag: 'rand_links_by_category(5,8'
Quote Reply
Re: [Gorospe] Ideas please In reply to
Sorry - was a typo - should be:

<%rand_links_by_category(5,8)%>

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: [Gorospe] Ideas please In reply to
Ok, never mind... there was a ")" missing in the code to call it from home.html which I added and worked.

Im testing now.
Quote Reply
Re: [Gorospe] Ideas please In reply to
Hahahah yeah, thanks.

There was another thing.
my $cond2 = GT::SQL::Condition->new('isNew','=','Yes','isValidated','=','Yes');

Limits it to "new" only.
I took out that bit and now works great.

Thanks andy.
Might want to add it to the mega mighty all in one plugin.

Thanks again,

JC
Quote Reply
Re: [Gorospe] Ideas please In reply to
haha whoops - I just copied it from the "New links per category", and obviously forgot to remove that line =)

May add that in tomorrow - gone 8pm here now =)

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,

Version 2.3.8 is now avaiable from our site. This includes a new version of Trim_Field(), which lets you do cool stuff like.

Description (full):

Quote:
my test description my test description my test description my test description my test description my test description my test description my test description
my test description my test description my test description my test description my test description my test description my test description my test description
my test description my test description my test description my test description my test description my test description my test description my test description

...and then if you follow the new instructions, you can make it do:

Quote:
my test description my test description my test description ....more

..then when you click on "more", it will show the whole content, like so:

Quote:
my test description my test description my test description my test description my test description my test description my test description my test description
my test description my test description my test description my test description my test description my test description my test description my test description
my test description my test description my test description my test description my test description my test description my test description my test description

Simple idea, but just makes it better for users, as they dont have to goto the detailed page for a full description Smile

Chers

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
Still got 2.3.7 on your site download. Whistle
Quote Reply
Re: [MJB] Ideas please In reply to
Really? What page are you getting that version from? I just double checked, and should be 2.3.8 :/

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
I clicked the ULTRAGlobals link in your sig.

I've just done it again now and it's downloaded 2.3.8 but it definately was 2.3.7 earlier. Maybe it was cached or something. Unsure
Quote Reply
Re: [MJB] Ideas please In reply to
Ya maybe - as I definatly checked it yesterday, and it was 2.3.8 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!
> > > >