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

[ FREE PLUGIN ] ULTRAGlobals - Collection of Globals and routines

Quote Reply
[ FREE PLUGIN ] ULTRAGlobals - Collection of Globals and routines
Hi,

I'm working on a "toolkit" kind of thing, that will be a compilation of globals, all in a plugin - ready for use. The idea being, the main globals you would like to use / see, are all available in one package :) Over time this will be updated, and more added - but to start with, I'd like to know what kind of things you would like to see if this plugin?

OFFICIAL PAGE (including most up-to-date download) - http://www.ultranerds.com/...s/ULTRAGlobals_L217/

TIA

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: Nov 10, 2008, 9:09 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Please feel free to give this first version a go :)

So far - I've got these functions in place (all documented in the Readme);

Get_Image_URL() - get the URL to a FILE type field (designed for images, but will work for other types of attachments)
Trim_Field() - trim a value to a sect number of charachters
Get_Links_Categories() - gets a lopp of the categories a link is in. For example, if its listed in 2 categories - it will get those 2 categories, and also give the links to them.
Get_URL() - Simply gets a URL (some people need this feature =))
Format_Select_Field() - Lets you pre-populate a SELECT field on the add / modify form, so that if a value is pre-selected, it will auto-select for you.

Please let me know your feedback =)

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 17, 2007, 7:49 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Version 1.1 is attached now :)

This includes 4 more globals:

1) Load_Category_Dropdown() - create a SELECT box of your categories, indented - and with option of showing Number_of_Links too.
2) Last_Searched_Words() - global for loading the most recent searched queries (based on the built in searchlogger table)
3) Top_Search_Words() - global for loading the top search queries (based on the built in searchlogger table)
4) NL_2_BR() - converts new line breaks into <br /> tags, for formatting in HTML.

All of these are documented in the "Readme" section too - so should make more sense once you read 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!

Last edited by:

Andy: Dec 17, 2007, 7:49 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Code:
sub NL_2_BR {
my $in = $_[0];
$in =~ s/\n/\<br \/\>/sig;
return;
}

...would be better as....

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

There's no need for all the escaping nor the "i" seeing as you're not matching different cases. Depending on how the input is generated you might have carriage returns also, hence the \r.
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi Andy,
a really nice idea.
Unfortunately I have already installed these globals. Think I was to fast Pirate

But for new links owner your ultra globals would spare a lot of time.

What happens if I have these globals already installed and I'm installing your Ultraglobals, too?.
Are the first globals overwritten?

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi Andy,
forgot, you are looking for ideas

get links by owner
Code:
sub {

my $user = $_[0];

my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes', Build_Detailed_Page => 1 } ) || return $GT::SQL::error;

my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= qq|<p><a href="$CFG->{build_root_url}/Detailed/$hit->{ID}.html">$hit->{Title}</a></p>|;
}

return $back;
}

Sitemap
Code:
sub {
# -------------------------------------------------------------------
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY priority');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','ID','Name'] );
my $output=qq~<table><tr valign=top><td width="25%"><table>~;
my $i=0;
while (my ($root_cat,$ID,$heading) = $sth->fetchrow_array) {
$i++;
my $url1 = $cat_db->as_url($root_cat);
$output.= qq~<tr><td colspan=2><font size=-1><b><a href="$CFG->{build_root_url}/$url1/index.html" class="toc"><br/>$heading</a></b></font></td></tr>~;
$cat_db->select_options ('ORDER BY Full_Name');
my $sth2 = $cat_db->select ( { FatherID => $ID}, ['Full_Name','ID','Name'] );
while (my ($cat,$id,$heading1) = $sth2->fetchrow_array) {
# my $link_count = $DB->table('CatLinks')->count ( {CategoryID => $id});
my $url = $cat_db->as_url($cat);
$output .= qq~<tr><td>&nbsp;</td><td><font size=-2><a href="$CFG->{build_root_url}/$url/index.html" class="toc">$heading1</a></font></td></tr>~;
$cat_db->select_options ('ORDER BY Full_Name');
my $sth3 = $cat_db->select ( { FatherID => $id}, ['Full_Name','ID','Name'] );
while (my ($cat2,$id2,$heading2) = $sth3->fetchrow_array) {
}
}
if (($i eq '13')or ($i eq '19') or ($i eq '33') or ($i eq '40')){ $output.=qq~</table></td><td width="25%"><table align=top>~;}
}
$output.="</table></td></tr></table>";
return $output;
}

Top 100 Links
Code:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 100');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top100_loop => \@output };
}

User download Top
Code:
sub {

my $db = $DB->table('Links');
$db->select_options( "GROUP BY LinkOwner","ORDER BY hits_count DESC" );
my $sth = $db->select("LinkOwner", "SUM(Hits) as hits_count","Count(*) as link_count") or die "Query Error: $GT::SQL::error";

my $back;
while (my ($s, $h,$c) = $sth->fetchrow_array) {
if ($h < 500) { next; }
my $url = $CFG->{db_cgi_url} . "/search.cgi?query=;LinkOwner=$s";
$back .= qq|> <a href="$url">$s</a> - $h Downloads in $c Einträgen <br />|;
}

return $back;

}

User Review Top 10
Code:
sub {

my $db = $DB->table('Reviews');
$db->select_options( "GROUP BY Review_Owner","ORDER BY review_count DESC","LIMIT 5");
my $sth = $db->select("Review_Owner", "COUNT(*) as review_count") or die "Query Error: $GT::SQL::error";

my $back;
while (my ($s, $c) = $sth->fetchrow_array) {
my $url = $CFG->{db_cgi_url} . "/review.cgi?username=$s";
$back .= qq| <a href="$url">$s</a> ($c Kommentare) <br />|;
}

return $back;

}

User listings
Code:
sub {

# normal links
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY ID DESC','LIMIT 3') || die $GT::SQL::error;

my $sth = $link_db->select( { isValidated => "Yes", LinkOwner => $USER->{Username} } ) || die $GT::SQL::error;

my @links;

# just normal links.
while (my $link = $sth->fetchrow_hashref) {
push @links, $link;
}

# ratings
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Rating DESC', 'LIMIT 10') || die $GT::SQL::error;

my $sth = $link_db->select( { isValidated => "Yes", LinkOwner => $USER->{Username} } ) || die $GT::SQL::error;

my @links2;

# just top rated links.
while (my $link = $sth->fetchrow_hashref) {
push @links2, $link;
}

# ratings
my $link_db = $DB->table ('Links');
$link_db->select_options ('ORDER BY Hits DESC', 'LIMIT 10') || die $GT::SQL::error;

my $sth = $link_db->select( { isValidated => "Yes", LinkOwner => $USER->{Username} } ) || die $GT::SQL::error;

my @links3;

# just top rated links.
while (my $link = $sth->fetchrow_hashref) {
push @links3, $link;
}

return { user_links => \@links , user_links_by_hit => \@links3, user_links_by_rating => \@links2 }

}


random text
Code:
sub {
my @list = ('text1', 'text2');
return $list[rand @list];
}

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

Give the attached a go =)

I've now added:

# Get_Links_By_Owner()
# Get_Top_Links()
# User_Review_Top_10()
# Users_Listings()

Again, all documented in the plugins Readme :)

Quote:
What happens if I have these globals already installed and I'm installing your Ultraglobals, too?.
Are the first globals overwritten?

Nope, it doesn't touch your globals :) All you have to do is install it - and then just use whatever functions you want Smile

Quote:
Unfortunately I have already installed these globals. Think I was to fast Pirate

heheh --- thats fine =) I'm sure there will be some useful ones to you in the near future Cool

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 17, 2007, 7:49 AM
Quote Reply
Re: [Wychwood] [ ULTRAGlobals ] Ideas please In reply to
Wychwood wrote:
There's no need for all the escaping nor the "i" seeing as you're not matching different cases. Depending on how the input is generated you might have carriage returns also, hence the \r.

Thanks, I've updated the latest version with that change =)

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:


Quote:
Unfortunately I have already installed these globals. Think I was to fast Pirate


heheh --- thats fine =) I'm sure there will be some useful ones to you in the near future Cool

Cheers

Can't wait Blush


What about an ultra globals for g-community, too?
I have only one global for community. There must be some more?
Maybe something like this
http://www.gossamer-threads.com//perl/gforum/gforum.cgi?post=299123#p299123

Thanks
Matthias

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

Pease find version 1.3 attached =) Rather than just listing the new functions it has, I'll list all of them =)
  • Get_Image_URL()
  • Trim_Field()
  • Get_Links_Categories()
  • Get_URL()
  • Format_Select_Field()
  • Load_Category_Dropdown()
  • Last_Searched_Words()
  • Top_Search_Words()
  • NL_2_BR()
  • Get_Links_By_Owner()
  • Get_Top_Links()
  • User_Review_Top_10()
  • Users_Listings()
  • Get_Page_Referrer()
  • Get_Current_URL()
  • Get_Totals()
  • Load_Cookie()


I don't know when I'm going to next update this plugin - kinda spent too long on it over this weekend - but hey'ho =) If anyone has any ideas for new globals to add, please let me know.

Quote:
What about an ultra globals for g-community, too?
I have only one global for community. There must be some more?
Maybe something like this
http://www.gossamer-threads.com//perl/gforum/gforum.cgi?post=299123#p299123

Mmm.. not sure to be honest. Its a lot of work putting something like this together (more in terms of having to document it, so people know how to use it :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!

Last edited by:

Andy: Dec 17, 2007, 7:50 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Andy wrote:

Mmm.. not sure to be honest. Its a lot of work putting something like this together (more in terms of having to document it, so people know how to use it :P)


I can imagine the time you spent on this global plugin.
In fact the explanations are really good.

There are so many globals in glinks. It's a shame that there are no globals in gcommunity Frown
If you have any globals for gcommunity. I'll take them without explanations Wink

Some more of the globals I'm using:

Lastest 5 new links
Code:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', 'LIMIT 5');
my $sth = $table->select( { isNew => 'Yes', isValidated => 'Yes' });
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { Lastlinks5_loop => \@output };
}


Latest Reviews
Code:
sub {
my (@links,$sth,$link);
my $search_db = $DB->table('Links','Reviews');
$search_db->select_options ("ORDER BY Review_Date DESC","LIMIT $_[0]");
$sth = $search_db->select ( { Review_Validated => 'Yes' });
while (my $link = $sth->fetchrow_hashref()) {
if (length $link->{Title} > 70) {
$link->{Title} = substr($link->{Title}, 0, 50) . '...';}
$link = Links::SiteHTML::tags('link', $link);
push@links, $link;
}
return {Latest_Revs=>\@links};<br>
}



Random Link
Code:
sub {
my $tags = shift;
my $link_db = $DB->table('Links','CatLinks');
my $cat_id = $tags->{Random_CatID};
my $limit = $tags->{Random_Limit} || 3;
my (@output, $sth);
$link_db->select_options ('ORDER BY RAND()', "LIMIT $limit");
if ($cat_id) {
$sth = $link_db->select ( { CategoryID => $cat_id });
}
else {
$sth = $link_db->select;
}
while (my $hash = $sth->fetchrow_hashref) {
push @output, $hash;
}
return { Random_Loop => \@output }
}


Category Menu everywhere
Code:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ("ORDER BY priority");
my $sth = $cat_db->select (['Full_Name'], { FatherID => 0 });
my $output;
while ( my $root_cat = $sth->fetchrow_array) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<li><a href="$CFG->{build_root_url}/$url/index.html">$root_cat</a></li>~;
}
return $output;
}



By the way,
I'm using the global "user listings" in a different way than you are describing it in the plugin.
My way is just an overview on a user page:

Code:
<%users_listings%>

<h2>Your last 3 Entries</h2>

<%loop user_links%>
<ul style="list-style-type: none;">
<li><small><%row_num%>. <%if Build_Detailed_Page eq "1"%><a href="<%build_root_url%>/Detailed/<%ID%>.html"><%elsif URL ne 'http://' and isValidated eq 'Yes'%><a href="<%URL%>"><%endif%><%Title%></a> (<%Hits%> | <%Rating%>)</small></li>
</ul>
<%endloop%><br/><br/>

<h2>Your Top 10 Entries (Hits)</h2>

<%loop user_links_by_hit%>
<ul style="list-style-type: none;">
<li><small><%row_num%>. <a href="<%build_root_url%>/Detailed/<%ID%>.html"><%Title%> </a>(<%Hits%> | <%Rating%>)</small></li>
</ul>
<%endloop%><br/><br/>

<h2>Your Top 10 Entries (Rate)</h2>

<%loop user_links_by_rating%>
<ul style="list-style-type: none;">
<li><small><%row_num%>. <a href="<%build_root_url%>/Detailed/<%ID%>.html"><%Title%> </a>(<%Rating%> | <%Hits%>)</small></li>
</ul>
<%endloop%><br/><br/>


Thanks
Matthias

Matthias
gpaed.de

Last edited by:

Matthias70: Dec 17, 2007, 4:30 AM
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Heres version 1.4 <G> (getting through the version numbers - think I may have to start using stuff like 1.4.1, 1.4.2, etc Blush)

This version has the following added to it:

Latest_Reviews()
Latest_New_Links()
Random_Links()

I've used the globals you gave as a basis, but made some changes to them - so they will work with a few extra options (i.e instead of just 5 links, they can specify as many as they want).

Quote:
There are so many globals in glinks. It's a shame that there are no globals in gcommunity Frown
If you have any globals for gcommunity. I'll take them without explanations Wink

haha! I have to admit, I don't think there are many really at all (we have quite a few on our site, but thats because we are using GCommunity as our "Members Download System", so it has a heck of a lot of custom coding done to it =))


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 17, 2007, 7:51 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi Andy,
did you see my changes in the above post.
Some explanations to html I'm using in the global "user listing"

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Matthias70 wrote:
Hi Andy,
did you see my changes in the above post.
Some explanations to html I'm using in the global "user listing"

Matthias
Hi,

Yeah, just seen it :)

I'm using a bit of a different global to you (made some changes, so its more customizable).

They can either do:

Code:
<%Plugins::ULTRAGlobals::Users_Listings($LinkOwner)%>

..or if they want to show their links of the current logged in user (for example, maybe on login_success.html), they can use:

Code:
<%Plugins::ULTRAGlobals::Users_Listings()%>

I did notice a boo-boo in the Readme though - I had:


Code:
<h2>Users Links</h2>
<%if user_links.length%>
<%loop user_links%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>

<h2>Users Links By Hits</h2>
<%if user_links.length%>
<%loop user_links%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>

<h2>Users Links By Rating</h2>
<%if user_links_by_rating.length%>
<%loop user_links_by_rating%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>

instead of:

Code:
<h2>Users Links</h2>
<%if user_links.length%>
<%loop user_links%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>

<h2>Users Links By Hits</h2>
<%if user_links_by_hits.length%>
<%loop user_links_by_hits%>

<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>

<h2>Users Links By Rating</h2>
<%if user_links_by_rating.length%>
<%loop user_links_by_rating%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>


I've updated this in the latest version =)

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,
there is still something wrong with the user listings global.
Just tried it. There are some problems with links to detailed pages and "Users Links By Hits" are not shown at all

Matthias

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

Ah, whoops - see what you mean =) (just did a test locally)

That was a typo in the Readme. Should have read:

Code:
<h2>Users Links By Hits</h2>
<%if user_links_by_hit.length%>
<%loop user_links_by_hit%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>


..not:


Code:
<h2>Users Links By Hits</h2>
<%if user_links_by_hits.length%>
<%loop user_links_by_hits%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links.</p>
<%endif%>

I've also added in the function for proving the <%detailed_url%> tag =)

Version 1.4.1 attached.

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 17, 2007, 7:50 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi,

I've now made an official page for this plugin on our site =)

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

I'll be updating that page, instead of this thread (I've removed the attachments from this post, to stop people downloading old versions :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
Andy wrote:
Hi,

Ah, whoops - see what you mean =) (just did a test locally)

That was a typo in the Readme. Should have read:

I've also added in the function for proving the <%detailed_url%> tag =)

Cheers

Works fine now
Perhaps you can tell the users in the readme
that they don't have to use
<%include link.html%>
but more flexible code like below.
<ul>
<li><small><%row_num%>. <%if Build_Detailed_Page eq "1"%><a href="<%build_root_url%>/Detailed/<%ID%>.html"><%elsif URL ne 'http://' and isValidated eq 'Yes'%><a href="<%URL%>"><%endif%><%Title%></a> (<%Hits%> | <%Rating%>)</small></li>
</ul>

I did'nt know that, before you told me

Matthias

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

I've just released version 1.5.0.

You can get it from here:

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

It has the following extra functions:

1) Custom_Full_Name()
2) Convert_To_ASCII()
3) Load_Link()

Again, all of these functions are explained in more detail, in the Readme included.

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,

I've just released version 1.5.0.

You can get it from here:

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

Hi Andy,
you forgot to upload 1.5.0 Wink
There is still 1.4.1 on your site...

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Whoops, should be sorted 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] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Looks like I missed out some of the documentation for one of the functions =)

Commify()

This just lets you turn numbers like 1234567 into 1,234,567 - or 12345 into 12,345 - etc. I've added it into the current versions documentation 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: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi Andy,
a small typo
<%Plugins::ULTRAGlobals::Convert_To_ASCII('ID')%>
should be
<%Plugins::ULTRAGlobals::Load_Link('ID')%>

Thanks for this plugin
Matthias

Now there are 3 unknown and new globals for me.
Waiting for more Wink

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

Thanks - I've updated the Readme, and uploaded the fixed version :) (its still the same version - as it wasn't really worth increasing the version number =))

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,

To make things easier , I've also had it added to the "Plugins > Download > List All" section inside your GLinks area - so you can download the plugin directly from your Admin Panel :)

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've just released version 1.5.5.

This version now has a New_Image() function, for showing an image, depending on how old the link is.

It based on the Days_Old plugin (which , AFAIK - doesn't work with GLinks at all)

You can download the latest version from our site, here:

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

..or from the "Plugin Download" area, from within your GLinks admin area.

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:

Great set of globals to by the way - thanks for your efforts.

In relation to the New_Image sub, this doesn't appear to work in conjunction with subcategory.html ....

Also, in relation the some of the other subs, eg. New Listings, Most Popular etc, whilst being able to include these for all categories is very handy, is there some way to also use them for each category eg. if there is a Category of Health and 10 other sub-cats, it will only display the listings eg. new, for the Health Category and the sub-cats...?

I recall something about the use of fatherid or similar .... I recall Ian had something similar in his Toolbox compilation.

All the best,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Quote:
Great set of globals to by the way - thanks for your efforts.

No problem - I know what a mission it is trying to find the globals you want (not so much now - as I just write my own - but for the non-programmers, its a real PITA ;))

Quote:
In relation to the New_Image sub, this doesn't appear to work in conjunction with subcategory.html ....

Ah - thats because its not designed to work with subcategory.html :)

I'll see if I can make a routine to work with that though - shouldn't be hard.

Quote:
Also, in relation the some of the other subs, eg. New Listings, Most Popular etc, whilst being able to include these for all categories is very handy, is there some way to also use them for each category eg. if there is a Category of Health and 10 other sub-cats, it will only display the listings eg. new, for the Health Category and the sub-cats...?

I recall something about the use of fatherid or similar .... I recall Ian had something similar in his Toolbox compilation.

Mmm.. not sure what you mean on this one?

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've added the New_Image_Cat() function now in version 1.6 (on the site now);

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

Not sure what you are on about with the other stuff, but let me know, and I'll see what I can do Tongue

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:

Thanks for this - works like a charm.

What I am getting at is rather than showing new listings in ALL categories on any page .... show new listings ONLY in that category and the sub-categories.

eg. In the top category 'Health' using the global it would list the top 5 New Listings ONLY in that category and ALL sub-categories of the main Health category.....

Hope that makes sense.....

Thanks again for the update to ULTRAGlobals.


All the best,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Give the latest version a go :)

1.6.5

This has a new function:

Code:
<%Plugins::ULTRAGlobals::New_Links_By_Category()%>

<%loop new_links_in_this_cat%>
<%include link.html%>
<%endloop%>

You can get the new version from our site 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: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Geez you're quick!

Thanks a lot, I'll give it a go.

Regards,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Quote:
Geez you're quick!

Yeah, was a pretty simple one to write Smile

Quote:
Thanks a lot, I'll give it a go.

No problem.

Cheerrs

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:

Code:
<%loop new_links_in_this_cat%>
<%include link.html%>
<%endloop%>

Hi Andy,
when I'm using the above code, I get the following error?

Code:
GT::SQL::Table (11389): Wrong argument passed to this subroutine. No category id passed to children
Thanks
Matthias

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

Are you trying this in category.html, or home.html?

It *has* to be in category.html - otherwise it won't work.

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,

Are you trying this in category.html, or home.html?

It *has* to be in category.html - otherwise it won't work.

Cheers

Hi Andy
there is no output in category.html ?

Matthias

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

I've just released version 1.7.0 Smile

This now includes 2 new functions:

1) Format_Checkbox_Field()
2) Format_Radio_Field()

You can get the latest version from our site: http://www.ultranerds.com/...s/ULTRAGlobals_L217/

These 2 new functions let you vgenerate both "radio" and "checkbox" fields on your "add" and "modify" forms - with the data pre-filled in (i.e automatically selects the right ones)

An example of the checkbox one:


Code:
<%Plugins::ULTRAGlobals::Format_Checkbox_Field('Field_Name')%>

<%loop checkbox_loop%>
<input name="<%field_name%>" id="<%value%>" type="checkbox"value="<%value%>" <%if selected%>checked<%endif%> />
<label for="<%value%>"><%name%></label>
<%endloop%>

There is literally one parameter to pass in (in the first line) - and the rest is done for you :)

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,

Whoops, thats a documentation error :)

You need to use:

Code:
<%Plugins::ULTRAGlobals::New_Links_By_Category($ID)%>

...not:

Code:
<%Plugins::ULTRAGlobals::New_Links_By_Category()%>

I'll get the documentation updated.

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,

I've updated the v1.7.0 version, with the revised documentation for that function 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: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi,

I've just uploaded version 1.7.5. This has the Get_Domain_Name() function. Basically, it lets you get the domain name from the <%URL%> field in a link. i.e:

<%Plugins::ULTRAGlobals::Get_Domain_Name($URL,include_prefix,strip_www)%>

The 2 options need to be either 1 (true) or 0 (false)

Example usage for the domain http://www.test.com/foo_bar/index.html

<%Plugins::ULTRAGlobals::Get_Domain_Name($URL,1,1)%>
..would give:
http://www.test.com

<%Plugins::ULTRAGlobals::Get_Domain_Name($URL,1,0)%>
..would give:
http://test.com

<%Plugins::ULTRAGlobals::Get_Domain_Name($URL,0,0)%>
..would give:
www.test.com
The new version is available from our site 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: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Andy:

In respect of New_Links_By_Category it appears to display not only all the new links, but also some others, modified etc. Would it have anything to do with the following section ....?

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

I'm only guessing here ....

Regards,



Clint
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Are you sure its showing stuff other than isNew ? i.e are you just thinking that because its showing "new" "pop" etc next to you links? Could possibly be something to do with your link.html setup if thats the case.

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
I had the same problem.
I had two new links in a category, but the output was two new links and some older links?
Could'nt find a rule!

Matthias

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

Mmm.. very odd.

Seems that this:

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

is only doing:

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 IN (12194,12193,12192) AND glinks_Links.isValidated = \'Yes\') ORDER BY Add_Date DESC Limit 5

...instead of:

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 IN (12194,12193,12192)) AND (glinks_Links.isNew = \'Yes\' AND glinks_Links.isValidated = \'Yes\')) ORDER BY Add_Date DESC Limit 5

The fix is to change this line (in /admin/Plugins/ULTRAGlobals.pm):

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

..to:

Code:
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;

I'll get it fixed up in the main version 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] [ ULTRAGlobals ] Ideas please In reply to
Hi,

I've uploaded version 1.7.6 now - with this fix in;

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

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
Hey Andy,

May I link to your "ULTRAGlobals" download page from my template site?

Thanks,

SandraR
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi Andy:

This is a very useful function .... is there any way it can be modified to deal with multi-select values (including checkboxes). I have a couple of fields that I use checkboxes for but the columns can actually contain multiple values....

Hmmm .... seems like the Advanced Editor is broken ...


Regards,


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [SandraR] [ ULTRAGlobals ] Ideas please In reply to
SandraR wrote:
May I link to your "ULTRAGlobals" download page from my template site?

Sure thing Cool

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

Quote:
This is a very useful function .... is there any way it can be modified to deal with multi-select values (including checkboxes). I have a couple of fields that I use checkboxes for but the columns can actually contain multiple values....

It should work just fine with multi-checkbox values :) ( (I spent ages trying to get it to work <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] [ ULTRAGlobals ] Ideas please In reply to
Hi,

I've just released version 1.8.0. This version includes a new function, which I wrote as a global for Coyu here:

http://www.gossamer-threads.com/...?post=300033#p300033

You can use it like so:

Code:
<%if config.bookmark_enabled%>
<%if user.Username%>
<%Plugins::ULTRAGlobals::Check_If_Bookmarked($ID)%>
<%if isBookmarked%>
<%-- already bookmarked , show something here if you want --%>
<%else%>
<a href="<%config.db_cgi_url%>/bookmark.cgi?action=link_add;ID=<%ID%>">Bookmark It</a>
<%endif%>
<%endif%>
<%endif%>

This new version is available from our site.

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:

Doesn't seem to. I'll try it again, but when a user tries to Modify a listing it doesn't populate the checkboxes (works fine in add.cgi).

Regards,

Clint
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] [ ULTRAGlobals ] Ideas please In reply to
Mmm.. I'll have a look.

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

Ok, think I've nailed the problem.

Give version 1.8.1 a go, available from our site.

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:

You sure have!

Works like a charm. This is really handy when you add new values to a column .... don't have to update all the pages ...

Thanks...


Clint.
--------------------------
http://AffiliatesDirectory.com
The Affiliate Programs Directory
Quote Reply
Re: [Clint] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Quote:
Works like a charm. This is really handy when you add new values to a column .... don't have to update all the pages ...

Yeah, originally I wrote part of the code for my SuggestChanges plugin - but decided to make it into a global, as I needed to use it on my include_form.html - and get peeved off with having to update loads of SELECT and CHECKBOX fields =)

There were a coupe of globals around that used GT::SQL::HTML to format these fields, but I was never happy with the output (they didn't let you assign a class, or really have much control over the output).

Anyway - glad its working now <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] [ ULTRAGlobals ] Ideas please In reply to
Hi,

I've just released version 1.8.2, which has a new function in:

Code:
<%Plugins::ULTRAGlobals::Load_Reviews_Advanced(LIMIT,CAT_ID)%>

This lets you either get the 10 latest version from the whole of your site; or if a CAT_ID is specified - it will only get reviews from the category you passed in, and any of its sub-categories.

The new version is available from our site:

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

Enjoy =)

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,

Heres version 1.4 <G> (getting through the version numbers - think I may have to start using stuff like 1.4.1, 1.4.2, etc Blush)

This version has the following added to it:

Latest_New_Links()

Cheers

Have problem with this global. When they are displayed they are all have "new, updated, popular" icons besides them.

Also, I have detailed page on but this global doesn't recognize it.

Second thing, this global make problem when using with Count_impression because it uses link.html template so whenever you use this global, every link you displayed have Count_impression increased.

UnReal Network

Last edited by:

deadroot: Feb 21, 2008, 11:50 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Andy wrote:
Hi,

Version 1.1 is attached now :)

This includes 4 more globals:

1) Load_Category_Dropdown() - create a SELECT box of your categories, indented - and with option of showing Number_of_Links too.
2) Last_Searched_Words() - global for loading the most recent searched queries (based on the built in searchlogger table)
3) Top_Search_Words() - global for loading the top search queries (based on the built in searchlogger table)
4) NL_2_BR() - converts new line breaks into <br /> tags, for formatting in HTML.

All of these are documented in the "Readme" section too - so should make more sense once you read that :)

Cheers

Only suggestion. Use escape_html when displaying <%sloq_query%> from Last_Searched_Words or Top_Search_Words. It can be really nasty if some wannabe hacker find your site ;)

UnReal Network
Quote Reply
Re: [deadroot] [ ULTRAGlobals ] Ideas please In reply to
Quote:
Have problem with this global. When they are displayed they are all have "new, updated, popular" icons besides them.

I've fixed that up - will put up the new version in a minute :)

Quote:
Second thing, this global make problem when using with Count_impression because it uses link.html template so whenever you use this global, every link you displayed have Count_impression increased.

You need to tell Count_Impressions that you don't want to count. You can do this with something like:

Code:
<%Plugins::ULTRAGlobals::Latest_New_Links(5)%>
<%if Latest_Links_Loop.length%>
<%loop Latest_Links_Loop%>
<%set dont_increase_count = 1%>
<%include link.html%>
<%endloop%>
<%endif%>

Then, in link.html ... where you have:

Code:
<%Plugins::Count_Impressions::Count($ID)%>

..change it to:

Code:
<%if dont_increase_count < 1%>
<%Plugins::Count_Impressions::Count($ID)%>
<%endif%>

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: [deadroot] [ ULTRAGlobals ] Ideas please In reply to
Quote:
Only suggestion. Use escape_html when displaying <%sloq_query%> from Last_Searched_Words or Top_Search_Words. It can be really nasty if some wannabe hacker find your site ;)

Good point - I've updated those template calls to:

<li><a href="<%config.db_cgi_url%>/search.cgi?query=<%url_encode($slog_query)%>"><%escape_html($slog_query)%></a></li>

Cos ideally the URL should also be encoded :)

I've just uploaded version 1.8.5, which includes the bug fix of the Lastest_New_Links() function Smile (get it here)

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:

Good point - I've updated those template calls to:

<li><a href="<%config.db_cgi_url%>/search.cgi?query=<%url_encode($slog_query)%>"><%escape_html($slog_query)%></a></li>

Cos ideally the URL should also be encoded :)

I've just uploaded version 1.8.5, which includes the bug fix of the Lastest_New_Links() function Smile (get it here)

Cheers

I don't think url_encode is valide code (Got error Error: Variable 'url_encode' is not a code reference).

Also, this doesn't work <%escape_html($slog_query)%>. I'm using <%escape_html slog_query%>

Regards.

UnReal Network

Last edited by:

deadroot: Feb 22, 2008, 5:16 AM
Quote Reply
Re: [deadroot] [ ULTRAGlobals ] Ideas please In reply to
Ooops, its escape() Blush

I'll update 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!
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Ok, Readme is updated =) I haven't bothered changing the version number, as its only a Readme update 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: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Andy wrote:

Code:
<%Plugins::ULTRAGlobals::Latest_New_Links(5)%>
<%if Latest_Links_Loop.length%>
<%loop Latest_Links_Loop%>
<%set dont_increase_count = 1%>
<%include link.html%>
<%endloop%>
<%endif%>

Then, in link.html ... where you have:

Code:
<%Plugins::Count_Impressions::Count($ID)%>

..change it to:

Code:
<%if dont_increase_count < 1%>
<%Plugins::Count_Impressions::Count($ID)%>
<%endif%>

That should do the trick =)

Cheers

Ok. It's working. But is it possible that when displaying Latest_New_Links, link goes to detailed page, and not jump.cgi.

Regards.

UnReal Network
Quote Reply
Re: [deadroot] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Sure.

Just change:

Code:
sub Latest_New_Links {

my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', "LIMIT $_[0]");

my $sth = $table->select( { isNew => 'Yes', isValidated => 'Yes' }) || die $GT::SQL::error;
my @output;
while (my $hit = $sth->fetchrow_hashref) {

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 (@output, $hit);
}
return { Latest_Links_Loop => \@output };

}

..to:

Code:
sub Latest_New_Links {

my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', "LIMIT $_[0]");

my $sth = $table->select( { isNew => 'Yes', isValidated => 'Yes' }) || die $GT::SQL::error;
my @output;
while (my $hit = $sth->fetchrow_hashref) {

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

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


push (@output, $hit);
}
return { Latest_Links_Loop => \@output };

}

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: Feb 22, 2008, 6:01 AM
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Andy wrote:
Hi,


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


push (@output, $hit);
}
return { Latest_Links_Loop => \@output };

}[/code]
Cheers

if ($CFG->[build_detailed}) (bolded should be { ,

$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} ); (bolded should be $hit

Just for other users that want this Wink

Regards.

UnReal Network
Quote Reply
Re: [deadroot] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Whoops, I've updated my above post. Serves me right for posting too quick :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: [DeadMan] [ ULTRAGlobals ] Ideas please In reply to
hi
if ($CFG->{build_detailed}) {
$hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} );
}



on sub Latest_New_Links

$CFG->{build_root_url} sould be $CFG->{build_detail_url}
Quote Reply
Re: [dujardin] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Quote:
on sub Latest_New_Links

$CFG->{build_root_url} sould be $CFG->{build_detail_url}

Thanks for the heads up. I've added that fix to the new version (1.9.0).

You can get this from:

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

This new version also now includes:

See_If_User_Has_Reviews

Called with:

Code:
<%Plugins::ULTRAGlobals::See_If_User_Has_Reviews($LinkOwner)%>
<%if review_count_num > 0%>
<a href="<%config.db_cgi_url%>/review.cgi?username=<%LinkOwner%>">Reviews</a>
<%endif%>

This is per a request here: http://www.gossamer-threads.com/...?post=300959#p300959

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,

Seeing as I was working on this plugin, I thought I'd add another function <G>

Version 2.0 is now available from our site.

This has a new function Edit_Title_Full_Name

What this is aimed at, is making your title read better for both users, and search engines.

Heres my favorite example:

Code:
<%if CatDepth < 1%>
<%Name%>
<%else%>
<%Name%> - <%Plugins::ULTRAGlobals::Edit_Title_Full_Name($Full_Name,'reverse','&gt;','1')%>
<%endif%>

This would change:

Quote:
Computers/Internet/Buying

..to:

Quote:
Buying - Internet > Computers

The clever bit, is that if you are only in "Computers" (i.e 1 level deep), it would just show:

Quote:
Computers

.. and not run the plugin, otherwise it would come out like

Quote:
Computers -

..which looks rubbish =)

Anyway, Enjoy =) Its explained in a lot more detail on the Plugin Readme.

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've set this up on Ultranerds, so you can see the new title reformatting global in action =)

http://www.ultranerds.com/...L_Plugins/index.html

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'm using top search global on the home page
i have got this error
i'm using 3.2.0

Code:
<a href="http://localhost/cgi-bin/search.cgi?query=Error: Variable 'escape' is not a code reference">Unknown Tag: &#039;($slog_query)&#039;</a></li>

thx for this nice plugins
Quote Reply
Re: [dujardin] [ ULTRAGlobals ] Ideas please In reply to
Hi,

What happens if you use:

Code:
<li><a href="<%config.db_cgi_url%>/search.cgi?query=<%GT::CGI::escape($slog_query)%>"><%GT::CGI::escape_html($slog_query)%></a></li>

?

Quote:
thx for this nice plugins

No 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: [Andy] [ ULTRAGlobals ] Ideas please In reply to
this part:
search.cgi?query=<%GT::CGI::escape($slog_query)%>

OK :)

this part
<%GT::CGI::escape_html($slog_query)%>

NOK

Error:
Code:
Error: Unable to load module 'GT::CGI':Error: No subroutine 'GT::CGI::escape_html' in 'GT/CGI.pm'
Quote Reply
Re: [dujardin] [ ULTRAGlobals ] Ideas please In reply to
HI,

Sorry, it should be <%GT::CGI::html_escape($slog_query)%> - not escape_html :P

I'll get it fixed in the Readme.

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

A global to include home catégories on another pages.

Code:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','Name','Number_of_Links'] );
my $output="";
while (my ($root_cat,$full_name,$number_of_links) = $sth->fetchrow_array) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<li><a href="$CFG->{build_root_url}/$url/">&nbsp;$full_name</a>($number_of_links)</li>~;
}
return $output;
}
Quote Reply
Re: [dujardin] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Thanks, I'll add that in.

Think I'll change it so its a loop'able tag, i.e:

Code:
<ul>
<%loop main_categores%>
<li><a href="<%URL%>">&nbsp;<%Full_Name%></a>(<%Number_of_Links%></li>
<%endloop%>
</ul>
..as this will give more control over how you lay it out (because of it being in a Plugin , its not as easy as just editing a global, cos it will get overwritten when yougrade the plugin 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: [dujardin] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Version 2.1.0 is now available from our site Smile

Code:
<%Plugins::ULTRAGlobals::Get_Root_Categories()%>
<ul>
<%loop root_cat_loop%>
<li><a href="<%URL%>">&nbsp;<%Full_Name%></a>(<%Number_of_Links%></li>
<%endloop%>
</ul>

Enjoy =)

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
With the global Latest_New_Links

The date is displaying in wrong format.

the tag is <%Add_Date%>

in date setup:
i have date_user_format = %ddd% %dd% %mmm% %yyyy%

<%Add_Date%> look like Sun 10 Feb 2008
in all page displaying links.html template

but with the global Latest_New_Links

<%Add_Date%> look like 2008-02-10

thx
Quote Reply
Re: [dujardin] [ ULTRAGlobals ] Ideas please In reply to
Hi,

You should be able to just convert this in the templates:

Code:
<%GT::Date::date_transform($Add_Date,'%yyyy%-%mm%-%dd%',$date_user_format)%>

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

1. I just tried the new code with the escape_html but I get an error:

Unknown Tag: '($slog_query)'

Code:
<%Plugins::ULTRAGlobals::Top_Search_Words('10')%>
<%if search_logger_top_words.length%>
<ul>
<%loop search_logger_top_words%>
<li><a href="<%config.db_cgi_url%>/search.cgi?query=<%escape($slog_query)%>"><%escape_html($slog_query)%></a></li>
<%endloop%>
</ul>
<%else%>
No search terms yet
<%endif%>



2. Could you although please include the last links in a category.
There is already new links in a category

Code:
<%Plugins::ULTRAGlobals::New_Links_By_Category($ID)%>
<%loop new_links_in_this_cat%>
<%include link.html%>
<%endloop%>

But this would show nothing, when there is no new flag...

Thanks
Matthias

Matthias
gpaed.de

Last edited by:

Matthias70: Mar 30, 2008, 2:04 PM
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Matthias70 wrote:
Hi Andy,

1. I just tried the new code with the escape_html but I get an error:

Unknown Tag: '($slog_query)'

Code:
<%Plugins::ULTRAGlobals::Top_Search_Words('10')%>
<%if search_logger_top_words.length%>
<ul>
<%loop search_logger_top_words%>
<li><a href="<%config.db_cgi_url%>/search.cgi?query=<%escape($slog_query)%>"><%escape_html($slog_query)%></a></li>
<%endloop%>
</ul>
<%else%>
No search terms yet
<%endif%>

Thanks
Matthias

You should use something like this <%escape_html slog_query%> instead of <%escape_html($slog_query)%>.

Regards.

UnReal Network
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Quote:
2. Could you although please include the last links in a category.
There is already new links in a category

Not 100% sure what you are asking for me. Are you trying to make it so that if no new links exist, you can show something? If so, then this should work:

Code:
<%Plugins::ULTRAGlobals::New_Links_By_Category($ID)%>
<%if new_links_in_this_cat.length%>
<%loop new_links_in_this_cat%>
<%include link.html%>
<%endloop%>
<%else%>
Sorry, there are no new links.
<%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: [DeadMan] [ ULTRAGlobals ] Ideas please In reply to
DeadMan wrote:

You should use something like this <%escape_html slog_query%> instead of <%escape_html($slog_query)%>.

Regards.

Hi Deadman,
thanks for your help, now I'm using this code

Code:
<%Plugins::ULTRAGlobals::Top_Search_Words('5')%>
<%if search_logger_top_words.length%>
<%loop search_logger_top_words%>
<p><a href="<%config.db_cgi_url%>/search.cgi?query=<%escape_html slog_query%>"><%escape_html slog_query%></a></p>
<%endloop%>
<%else%>
No search terms yet
<%endif%>

@ Andy the wrong code in my post above is from the Ultra Globals Readme

Andy wrote:
Not 100% sure what you are asking for me. Are you trying to make it so that if no new links exist, you can show something?


Hi Andy,
I'm using this global, to show the last 5 links on my whole site.
Code:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', 'LIMIT 5');
my $sth = $table->select( { isNew => 'Yes', isValidated => 'Yes' });
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { Lastlinks5_loop => \@output };
}

It would be great, to have this for some categories.
Last links in category instead of new links in category

Cause when I use this global and there are no new links in this category, there is no output
Code:
<%Plugins::ULTRAGlobals::New_Links_By_Category($ID)%>
<%loop new_links_in_this_cat%>
<%include link.html%>
<%endloop%>

But if there are the last links shown, they are shown even, when they are older...

I hope you understand, what I mean.
Thanks
Matthias

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

I'm confused, thought you were using UltraGlobals, not your own global? Tongue

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,

I'm confused, thought you were using UltraGlobals, not your own global? Tongue

Cheers

Hi Andy,
the global was only an example (whole site), for what I would like to see for categories in the Ultra Globals :-)

Matthias

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

I'm still confused :/

Are you saying you would like to see the global you posted, added to UltraGlobals? Sorry, not being too bright today <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] [ ULTRAGlobals ] Ideas please In reply to
Andy wrote:
Hi,

I'm still confused :/

Are you saying you would like to see the global you posted, added to UltraGlobals? Sorry, not being too bright today <G>

Cheers

Cool O.K. Another try

I would like to see a global like this in ultra globals

Code:
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID)%>
<%loop last_links_in_this_cat%>
<%include link.html%>
<%endloop%>
Matthias

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

Ahhh- I get you now =)

I'll see what I can do.

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.1 now has this feature:

Code:
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID)%>

<%if last_links_in_this_cat.length%>
<%loop last_links_in_this_cat%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links were found</p>
<%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] [ ULTRAGlobals ] Ideas please In reply to
Andy wrote:
Hi,

Version 2.2.1 now has this feature:

Code:
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID)%>

<%if last_links_in_this_cat.length%>
<%loop last_links_in_this_cat%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links were found</p>
<%endif%>

Hi Andy,
I'm getting this error


Code:
GT::SQL::Table (17412): Wrong argument passed to this subroutine. No category id passed to children at admin/Links/Table/Category.pm line 476.


And can I show only 5 last links with
Code:
<%Plugins::ULTRAGlobals::Last_Links_By_Category(5,$ID)%>

Thanks
Matthias

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

Quote:
Hi Andy,
I'm getting this error


Code:

GT::SQL::Table (17412): Wrong argument passed to this subroutine. No category id passed to children at admin/Links/Table/Category.pm line 476.

How are you calling it? Also, which template.

Quote:
And can I show only 5 last links with
Code:
<%Plugins::ULTRAGlobals::Last_Links_By_Category(5,$ID)%>

Not with this version - I may add it in though (just wanna see what the bug above is (or isn't))

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,
I put it into the rightsidebar and was calling it with the category number of a subcategory

Code:
<h4>Headline</h4>
<%Plugins::ULTRAGlobals::Last_Links_By_Category($676)%>

<%if last_links_in_this_cat.length%>
<%loop last_links_in_this_cat%>
<%include link.html%>
<%endloop%>
<%else%>
<p>No links were found</p>
<%endif%

Thanks
Matthias

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

Looks like your trying to pass in a variable :P

<%Plugins::ULTRAGlobals::Last_Links_By_Category($676)%>

If 676 is a category number, just do:

<%Plugins::ULTRAGlobals::Last_Links_By_Category('676')%>

That should sort it.

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.2 now has the ability to pass in a number, as a second parameter. New version can be download from our site.

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!
Post deleted by Matthias70 In reply to
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi Andy,
I tried
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID,'3')%>
and
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID,3)%>
and
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID,"3")%>

but it still shows all links?

Matthias

Matthias
gpaed.de

Last edited by:

Matthias70: Mar 31, 2008, 11:25 AM
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Matthias70 wrote:
Hi Andy,
I tried
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID,'3')%>
and
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID,3)%>
and
<%Plugins::ULTRAGlobals::Last_Links_By_Category($ID,"3")%>

but it still shows all links?

Matthias


Hi Andy,
I still can't limit the number of last links in a category!

Thanks
Matthias

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

You definatly using the most recent version? I just looked at the file on our site, and the code should work fine.

Code:
sub Last_Links_By_Category {

my $cat = $_[0];
my $limit = $_[1] || 5;

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 ID DESC Limit $limit");


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

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;


# print $IN->header();
# use Data::Dumper;
# print Dumper($sth);

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 { last_links_in_this_cat => \@cats }

}

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,

You definatly using the most recent version? I just looked at the file on our site, and the code should work fine.

Hi Andy,
I just downloaded 2.2.2 again and the limit is not working at all.
It shows still all links :-(

Matthias

Matthias
gpaed.de
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.
Quote Reply
Re: [Alba] Ideas please In reply to
Hi,

Done.

Next to each download, you should see stuff like:

Quote:
last updated: Sat May 10 06:27:09 2008

Hopefully thats ok 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: [Andy] Ideas please In reply to
Quote:
Next to each download, you should see stuff like:

That is a great help, thanks.
Quote Reply
Re: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Version 3.3.4 has just been uploaded to our site.

http://www.ultranerds.com/...s/ULTRAGlobals_L217/

This includes a new feature - Split_Up_Paragraphs()

This lets you do any of 3 things:

1) Split the Description into Description1 (the first paragraph), and Description2 (the remaining paragraphs)
2) Split the Description into one tag per paragraph (i.e Description1,Description2,Description3,Description4, etc)
3) Split at the "half way" point of the Description, into Description1 and Description2.


Its all tested fine my end - but if anyone finds any problems, please let me know.

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,
perhaps I'm searching with the wrong searchwords,
but is there a global that shows the 10 most reviewed links?

Would be great to have this global in the ultra globals plugin!

Thanks

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

Nope, there isn't anything in there that does that. I'll try to add it in tomorrow/monday. Got a few other things that I need to get done first though =)

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,

I just wrote this - should work fine (tested it ok)


xx_reviews
Code:
sub {

my $db = $DB->table('Reviews');
$db->select_options( "GROUP BY Review_LinkID","ORDER BY review_count DESC","LIMIT 5");
my $sth = $db->select("Review_LinkID", "COUNT(*) as review_count") or die "Query Error: $GT::SQL::error";

my $back;
my @loop;
while (my ($s, $c) = $sth->fetchrow_array) {
# my $url = $CFG->{db_cgi_url} . "/review.cgi?username=$s";
my $link = $DB->table('Links')->get( { ID => $s } );

if (!$link->{isValidated}) { next; }

push @loop, { %$link, ReviewCount => $c }
#$back .= qq| <a href="$CFG->{db_cgi_url}/reviews.cgi?ID=$s">$link->{Title}</a> ($c reviews) <br />|;
}

# return \$back;
return { Most_Reviewed_Links => \@loop }

}


..then call in any template with:

Code:
<%xx_reviews%>

<%loop Most_Reviewed_Links%>
<a href="<%config.db_cgi_url%>/reviews.cgi?ID=<%ID%>"><%Title%></a> (<%ReviewCount%> reviews) <br />
<%endloop%>

I've gotta go out now - but will look at adding it to the plugin later on =)

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,
it's working perfect ;-)
Just one thing
Code:
<%xx_reviews%>

<%loop Most_Reviewed_Links%>
<a href="<%config.db_cgi_url%>/reviews.cgi?ID=<%ID%>"><%Title%></a> (<%ReviewCount%> reviews) <br />
<%endloop%>

should be
Code:
<%xx_reviews%>

<%loop Most_Reviewed_Links%>
<a href="<%config.db_cgi_url%>/review.cgi?ID=<%ID%>"><%Title%></a> (<%ReviewCount%> reviews) <br />
<%endloop%>


Thanks

Matthias
gpaed.de

Last edited by:

Matthias70: Sep 28, 2008, 9:57 AM
Quote Reply
Re: [Matthias70] [ ULTRAGlobals ] Ideas please In reply to
Hi,

Cool, I've released the new version (2.3.5), and this can be downloaded from our site 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] [ ULTRAGlobals ] Ideas please In reply to
Obviously you know nothing about relational queries. If you have the Link ID in the Reviews table then you should be using a RELATIONAL query to retrieve the link record and not selecting the ID from the Reviews table and then performing a second query to fetch the record from the Links table.
Quote Reply
Re: [Wychwood] [ ULTRAGlobals ] Ideas please In reply to
Well yeah, you COULD - but we don't want the review stuff in the loop! (only the link stuff, and review count)

Doing it the way I did it is perfectly fine!

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
The most popular categories In reply to
How to display i.e. top 10 categories or subcategories with most links, kind of:

Subcategory C - 45 links
Subcategory L - 30 links
Maincategory F - 25 links (without links in subcategories)

?
Quote Reply
Re: [katakombe] The most popular categories In reply to
Hi,

Sorry, I'm afraid I'm not sure what you are asking for :/

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] The most popular categories In reply to
Code:
$DB->relation('Reviews', 'Links')->select("Links.*")->fetchrow_hashref

Crazy

Last edited by:

Wychwood: Oct 2, 2008, 2:19 AM
Quote Reply
Re: [Andy] The most popular categories In reply to
Andy wrote:
Hi,

Sorry, I'm afraid I'm not sure what you are asking for :/

Cheers

Andy, let us say that we have only 2 main categories: A & B.

Category A has 2 subcategories: A1 & A2; Category B has 4 subcategories: B1, B2, B3 & B4.

Category A has 50 links in total, but when you click on it, there is no link at all - links are in A1: 40 and in A2: 10

Category B has 100 links in total and they all resist under the main category, all 4 subcategories are empty.

Now, the global should display the following:

B: 100 links
A1: 40 links
A2: 10 links

Note that there is no "A: 50 links" because in fact the main category is empty.
Quote Reply
Re: [katakombe] The most popular categories In reply to
Hi,

Ok, so let me just get this straight =)

Basically, if a link only 0 links in it (not including the sub-categories too), then you want to get the links from the sub-categories? Is that correct?

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] The most popular categories In reply to
Andy wrote:
Hi,

Ok, so let me just get this straight =)

Basically, if a link only 0 links in it (not including the sub-categories too), then you want to get the links from the sub-categories? Is that correct?

Cheers

Hello Andy!

Yes, that's right Cool

The global should list them in descending order sorted by the number of links in them, no matter if they are categories or subcategories. The only thing that counts is number of links - not total number including subcategories, just simple links visible after clicking on category/subcategory.
Quote Reply
Re: [katakombe] The most popular categories In reply to
Hi,

Ok, I'm confused again as to what you want?

I thought you just wanted a global - which would get the sub-links, in a category if it didn't have any links itself?

i.e

Test_Cat2 (0 links)
Test_Cat2/Sub 3 (1 link)
Test_Cat2/Sub 4 (3 link)
Test_Cat2/Sub 4/Test (1 link)

...so, if they were viewing the "Test_Cat" category (i.e which doesn't have any links in it, on its own level), then it would get the links from Test_Cat2/Sub 3, Test_Cat2/Sub 4 and Test_Cat2/Sub 4/Test (which would make a total of 5 links showing in "Test_Cat2")

Is that still what you are after?

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] The most popular categories In reply to
Hello Andy!

No, I want to display i.e. 10 links to those categories or subcategories which simply have most links. I don't care if on first place is a main category or a subcategory from -10 level in the directory.

The only thing which is important is that the first link goes to a category/subcategory with most links and so on in descending order.

I don't want to see i.e. "Category A: 250 links" and there is in fact only 5 links and 245 are in subcategories which belongs to that main category, in this case "Category A".

To clarify even more, those links will be displayed on a separate page produced by PageBuilder plugin and that page has nothing to do with the rest of directory. That's a page on it's own.
Quote Reply
Re: [katakombe] The most popular categories In reply to
Hi,

Sorry, been a bit busy over the last few days.

I still don't understand what you are after, sorry Pirate

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] The most popular categories In reply to
Hi Andy!

Here are categories and subcategories on the main page:

Category A: 20 links
--Category A-1: 5 links
--Category A-2: 12 links

Category B: 50 links
--Category B-1: 30 links
----Category B-1-1: 24 links
--Category B-2: 4 links

Now, the global should display the following:

1.) B-1-1: 24 links
2.) B: 16 links
3.) A-2: 12 links
4.) B-1: 6 links
5.) A-1: 5 links
6.) B-2: 4 links
7.) A: 3 links

Smile
Quote Reply
Re: [katakombe] The most popular categories In reply to
Ok, that still doesn't make any sense ://

Quote:
2.) B: 16 links

..but you have:

Quote:
Category B: 50 links

..and

Quote:
4.) B-1: 6 links

..but you have:

Quote:
--Category B-1: 30 links

What am I missing? =)

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] The most popular categories In reply to
If I understand correctly katakombe wants a "Top 10" of categories with the most links but if the top level category has no links then you look under the sub-categories etc. So it's not a Top 10 of top-level categories - it can include sub-categories too.

Last edited by:

Wychwood: Oct 6, 2008, 11:05 AM
Quote Reply
Re: [Wychwood] The most popular categories In reply to
Wychwood wrote:
If I understand correctly katakombe wants a "Top 10" of categories with the most links but if the top level category has no links then you look under the sub-categories etc. So it's not a Top 10 of top-level categories - it can include sub-categories too.

Finally!

SmileCool
Quote Reply
Re: [Andy] The most popular categories In reply to
Andy wrote:
Ok, that still doesn't make any sense ://

Quote:
2.) B: 16 links

..but you have:

Quote:
Category B: 50 links

..and

Quote:
4.) B-1: 6 links

..but you have:

Quote:
--Category B-1: 30 links

What am I missing? =)

Cheers

You are missing that i.e. B have 50 links in total, but 30 (B-1) + 4 (B-2) = 34 links in subcategories, so there are only 16 links directly in B etc ...
Quote Reply
Re: [katakombe] The most popular categories In reply to
Right ok - thanks for clearing that up Wychwood =)

I'm busy for today (got a few large jobs on), but I'll see if I can take a look tonight/tomorrow for you.

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: [katakombe] The most popular categories In reply to
Hi,

I've been having a think/look at this for you. I'm not really sure whats the best way to approach it. For example, its easy enough to just do:

SELECT * FROM glinks_Category WHERE CatDepth = 1 ORDER BY Number_of_Links DESC LIMIT 10

..which would grab the top level categories, with the highest number of links.

However, trying to "dig" into those sub-categories it quite a bit more difficult/confusing.

If you don't mind just a basic category list, with the top categories (at root level), then I can write you a global for that - but I don't really have time to play around with the other one =)

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] The most popular categories In reply to
Hi Andy!

Thanks, no problem ..

You can do as you want (if you have some spare time), but in my opinion, this version with subcategories is much better, because theoretically there can be 0 links when someone click on a main category - all "clickable" links can be hidden in subcategories. It will be much easier for visitors to go directly there where are most of the links.

Thanks again Smile
Quote Reply
Re: [katakombe] The most popular categories In reply to
Hi,

Untested, but give this a go;

get_top_cat_loop
Code:
sub {
my $tbl = $DB->table('Category');
$tbl->select_options("ORDER BY Number_of_Links DESC LIMIT 10");

my $sth = $tbl->select( GT::SQL::Condition->new('Direct_Links','>','0','FatherID,'=','0') ) || die $GT::SQL::error;

my @loop;
while (my $hit = $sth->fetchrow_hashref) {
$hit->{URL} = $CFG->{build_root_url} . '/' . $tbl->as_url($hit->{Full_Name}) . '/' . $CFG->{build_index};
push @loop, $hit;
}
return { top_cat_loop => \@loop }
}


..then call with:

Code:
<%get_top_cat_loop%>
<ul>
<%loop top_cat_loop%>
<li><a href="<%URL%>"><%Name%></a></li>
<%endloop%>
</ul>

Hopefully that'll work =)

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: Oct 8, 2008, 8:01 AM
Quote Reply
Re: [Andy] The most popular categories In reply to
Thanks Andy, as usual, it works Smile

The thing is that in this case there are categories with 0 "clickable" links, all are located in subcategories.

Anyhow, thanks again. Maybe you'll find another solution later.
Quote Reply
Re: [katakombe] The most popular categories In reply to
Hi,

Try the above modified version. I've made a little change to it (it will only get categories that have at least 1 clickable link at their own level :)

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] The most popular categories In reply to
Sorry Andy, there is no result at all now Unsure
Quote Reply
Re: [katakombe] The most popular categories In reply to
Oops, I think I see the error. Please change:

GT::SQL::Condition->new('Direct_Links','>','0','FatherID,'=','0')

..to:

GT::SQL::Condition->new('Direct_Links','>','0','FatherID','=','0')

(it was missing a ' =))

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] The most popular categories In reply to
Hi Andy!

Much better, but now there are only top-level categories with 1 (or 1+) link without subcategories.
Quote Reply
Re: [katakombe] The most popular categories In reply to
Just remove 'FatherID','=','0' - and 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] The most popular categories In reply to
Yap Wink

OK, this is good. Anyhow, the best solution is to count only links - i.e. I can see a category or a subcategory with "less" links above an another with "more" links which can be confusing, but that can wait Smile
Quote Reply
Re: [Andy] The most popular categories In reply to
Hello Andy

Just got to try your plug in.. pretty nice..

Several small globals that I use, they may be worth assing..

All user list

sub {
# Displays all Users.
my $tags=shift;
my $search_db= $DB->table('Users');
my $nh = (ref $tags->{nh} ? ${$tags->{nh}} : $tags->{nh});
my $mh = (ref $tags->{maxhits} ? ${$tags->{maxhits}} : $tags->{maxhits});
my $offset = ($nh-1) * $mh;
$search_db->select_options ('ORDER BY Username ASC',"LIMIT $offset, $mh");
my $sth = $search_db->select;
my $output;
while (my $user = $sth->fetchrow_hashref) {
$output .= qq~<li><a href="$CFG->{db_cgi_url}/page.cgi?page=user&user=$user->{Username}">$user->{Username}</a></li> ~;
}
return $output;
}


All links in a given category

sub {
# all links in a given category.
require Links::SiteHTML;
my $catID = $_[0];
my $catname = $DB->table('Category')->select( ['Full_Name'], { ID => $catID } )->fetchrow;
my $cond = GT::SQL::Condition->new(
Full_Name => '=' => "$catname",
Full_Name => 'LIKE' => "$catname/%"
);
$cond->bool('OR');
my $cat_tbl = $DB->table('Category');
$cat_tbl->select_options('ORDER BY Full_Name DESC');
my $sth = $cat_tbl->select( $cond ) || die $GT::SQL::error;
my $output;
while (my $hit = $sth->fetchrow_hashref) {
my $links_sth = $DB->table('CatLinks')->select( { CategoryID =>$hit->{ID} } ) || die $GT::SQL::error;
while (my $hit2 = $links_sth->fetchrow_hashref) {
my $hit3 = $DB->table('Links')->get($hit2->{LinkID});
$output .= Links::SiteHTML::display('link', $hit3);
}
}
return $output;
}





Random link from a given category

sub {
my ($output,$sth,$hash,$cond);
my $catid = $_[0];
my $limit = $_[1] || 4;
my $search_db = $DB->table('Links','CatLinks');
$search_db->select_options ("ORDER BY rand()", "LIMIT $limit");
my $all_ids = $DB->table('Category')->children($catid);
push @$all_ids, $catid;
$cond = GT::SQL::Condition->new('isValidated','=','Yes', 'CategoryID', 'IN', $all_ids);
$sth = $search_db->select ($cond);
while ($hash = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $hash);
}
return $output;
}



Directory map: a simple map of top few levels of directory
sub {
# will build a map for the directory.
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY Full_Name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','ID','Name'] );
my $output=qq~<table>~;
my $i=0;
while (my ($root_cat,$ID,$heading) = $sth->fetchrow_array) {
$i++;
my $url1 = $cat_db->as_url($root_cat);
$output.= qq~<tr valign=top><td width="100%" colspan="2"><h3><b><a href="$CFG->{build_root_url}/$url1">$heading</a></b></h3></td></tr>~;
$cat_db->select_options ('ORDER BY Full_Name');
my $sth2 = $cat_db->select ( { FatherID => $ID}, ['Full_Name','ID','Name'] );
while (my ($cat,$id,$heading1) = $sth2->fetchrow_array) {
# my $link_count = $DB->table('CatLinks')->count ( {CategoryID => $id});
my $url = $cat_db->as_url($cat);
$output .= qq~<tr valign=top><td width="25%">&nbsp;</td><td width="75%"><a href="$CFG->{build_root_url}/$url">$heading1</a></td></tr>~; }
}
$output.="</table>";
return $output;
}




grand_total_cat
sub { return $DB->table('Category')->count; }

grand_total_newlinks
sub { $DB->table('Links')->count( { isNew => 'Yes' } ) }


grand_total_users
sub { return $DB->table('Users')->count; }
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [ULTRAGlobals] The most popular categories In reply to
Hi,

Glad you like the plugin :)

Quote:
All user list

Cool, may add something like that.

Quote:
All links in a given category

Another interesting one :) I have "new links" in a given category, with the New_Links_By_Category() function.

Quote:
Random link from a given category

Weird, I thought I already had added something like that =) Maybe I was getting confused with AdCode_Randomly_In_Cat() <G>

Quote:
Directory map: a simple map of top few levels of directory

What does this one do? Something like:

Code:
Top Level Cat
Sub Level
Sub Level
Sub Level

Top Level Cat 2
Sub Level
Sub Level
Sub Level

Top Level Cat 3
Sub Level
Sub Level
Sub Level

..or something?

Quote:
grand_total_cat

This can already be done with:

<%Plugins::ULTRAGlobals::Get_Totals('Category')%>


Quote:
grand_total_newlinks
sub { $DB->table('Links')->count( { isNew => 'Yes' } ) }

Cool, will add that one in too =)

Quote:
grand_total_users
sub { return $DB->table('Users')->count; }

This can also be done with the Get_Totals function:

<%Plugins::ULTRAGlobals::Get_Totals('Users','registered')%>

Anyway, I'll try and get those bits added in at some point (maybe today, but not 100% sure - as I'm pretty bogged down with work today, so may not have enough time =+))

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

Version 2.3.6 is now available from here: http://www.ultranerds.com/...s/ULTRAGlobals_L217/

This has a few new functions:

User_List
All_Links_In_Category
Random_Link_In_Category
Number_of_New_Links

(this now brings the plugin to a total of 45functions 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: [Andy] [ULTRAGlobals] Version 2.3.6 In reply to
Whoo Hoo!

On your page I notice a link to make a donation, does sending you beer count?


Sandra Roussel
Chonsa Group Design - Fresh Start Housing

Last edited by:

SandraR: Oct 23, 2008, 7:14 AM
Quote Reply
Re: [SandraR] [ULTRAGlobals] Version 2.3.6 In reply to
Hi,

Quote:
Whoo Hoo!

<G>

Quote:
On your page I notice a link to make a donation, does sending you beer count?

hehe sure; ) (wish other people would consider donations too - as I put a lot of work into this plugin - I've only had one, maybe 2 donations since I released it :()

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] Version 2.3.6 In reply to
Since you only had 2 donations I donated - check your paypal page the closing page goes to: Acumendb


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Quote Reply
Re: [SandraR] [ULTRAGlobals] Version 2.3.6 In reply to
Thanks :)

Re acumendb - weird! Thats an old company I used to work for several years ago. Will have to check out whats going on there (may be a weird setting in paypal I did, when I was doing testing on coding). Thanks for the heads up =)

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] Version 2.3.6 In reply to
A cool addition to the globals list will be (if possible):

A global that will give a total count for all links with specific tags..
Example may be something like: <%Plugins::ULTRAGlobals::Get_Totals_links('has_author', 'not like', '')%>

Also a global that will list these links:
<%Plugins::ULTRAGlobals::List_links('is_Featured', 'eq', 'yes')%>
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [ULTRAGlobals] Version 2.3.6 In reply to
Hi,

I've just uploaded version 2.3.7. This now has those function included :) (all explained in detail in the documentation :))

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: [katabd] [ULTRAGlobals] Version 2.3.6 In reply to
Hello Andy

Three things here:

- The All Users List is not working and does not show anything..

- Also is it possible to use List_Links function to diplay a list of links based on the 'ExpiryDate'.

- I have a list links based on the author name (Not same as usersname).. on one page I list all authors linked to their listings.. when I use <%Plugins::ULTRAGlobals::List_Links('LinkAuthor','Not Like','','LinkAuthor ASC',10)%> I get the list of author with many duplicates.. can I use a distinct option to limit each author to one be displayed once?

Thank you again for the free plug in..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [ULTRAGlobals] Version 2.3.6 In reply to
Quote:
- The All Users List is not working and does not show anything..

Which function?

Quote:
- Also is it possible to use List_Links function to diplay a list of links based on the 'ExpiryDate'.

Not sure what you mean? You wanna look for "paid" links?

<%Plugins::ULTRAGlobals::List_Links('ExpiryDate','<','2147483647','Title ASC')%>

Quote:
- I have a list links based on the author name (Not same as usersname).. on one page I list all authors linked to their listings.. when I use <%Plugins::ULTRAGlobals::List_Links('LinkAuthor','Not Like','','LinkAuthor ASC',10)%> I get the list of author with many duplicates.. can I use a distinct option to limit each author to one be displayed once?

Mmm.. not really easily. If you wanna do more complex queries, then I would just use something like:

Custom_List_Links
Code:
sub {

my ($field,$operator,$val,$sort_order,$limit) = @_;

$sort_order ||= "Title ASC";

my $tbl = $DB->table('Links');
if ($limit) {
$tbl->select_options(qq|ORDER BY $sort_order LIMIT $limit|);
} else {
$tbl->select_options(qq|ORDER BY $sort_order|);
}

my $sth = $tbl->select( ['DISTINCT(LinkAuthor)'], GT::SQL::Condition->new('LinkAuthor','NOT LIKE','','') ) || die $GT::SQL::error;

my @loop;
while (my $hit = $sth->fetchrow_hashref) {

if ($CFG->{build_detailed}) {
$hit->{detailed_url} = $CFG->{build_detail_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 @loop, $hit;
}

return { cond_loop_link => \@loop }

}

...and call with:

Code:
<%Custom_List_Links('Field','=','Test','Title ASC',10)%>

(should work, but appologies if it doesnt - its 6:30am here =))

Quote:
Thank you again for the free plug in..

NP 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: [Andy] [ULTRAGlobals] Version 2.3.6 In reply to
Hi

- Hello

- <%Plugins::ULTRAGlobals::User_List('Username','100')%>
- Works great.
- Will test and let you know.
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [ULTRAGlobals] Version 2.3.6 In reply to
Hi,

Someone just made me aware that in the "Download Area" (via the GLinks admin panel), the version of this plugin was 1.5.0 (very old =)). I've just updated it to 2.3.6, which is the current version available 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: [Andy] [ ULTRAGlobals ] Ideas please In reply to
Hey Andy,

How about this idea.

Text area in forms (add link, review... etc forms) where users can only input html tags allowed by admin in template design. For example most admin would only want to allow submitters endusers to use tags like <b>, <p> </p> <br> <ol> </ol>, <li> </li>, <ul> </ul> and generally not the emails, link/image inserts..etc and many others.

Or in other words, Admin's ability to limit formatting in forms via only allowed tags would not only give admin an ability to have good looking detailed, review & other pages without having any real worries of end-users using unwanted tags & formatting.

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

Mmm, thats a bit more complex than it sounds =)

Doing stuff like [b][/b] isn't too hard - but when it comes to emails, it will be a PITA (as most are sent in plain text, so ALL HTML formatting would need to be removed, and replaced with just simple text)

I'll probably do this as a paid plugin (as its not just a "global") - but gotta find the time to do it though =)

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
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!
Quote Reply
Re: [Andy] Ideas please In reply to
Hi Andy,
with the following code I'm trying to print 3 random links of one category,
I don't want the whole include.html disyplayed, only the title and the image stored in the field "banner".
The url should be in title and in the image!

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

Can you tell me the the code?

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Ideas please In reply to
Why not just make a new template called link_basic.html, and change the "include" to use that template instead? Wink

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
It's only for a random image in the rightsidebar, and I don't want to have another link.thml for it :-)

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Ideas please In reply to
Ok, so why bother even doing an include then? Whistle

Just do something like:

Code:
<%Plugins::ULTRAGlobals::Random_Links(3,'672')%>
<%if Random_Loop.length%>
<%loop Random_Loop%>
<%Title%>
show whatever it is you want here

<%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
Yes I know, but the "show whatever it is you want here is the problem :-)
I want to show an image from the database field "banner" with the link from the database.


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

Ok, please explain more. Where is the banner "stored"? You havn't really explained that - I thought it was just another field in your glinks_Links table ;)

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
O.K. found a solution by myself.
Tell me, if it there are some senseless parts :-)

Code:
<%Plugins::ULTRAGlobals::Random_Links(1,'672')%>
<%if Random_Loop.length%>
<%loop Random_Loop%>
<a href="<%URL%>" target="_blank"><%Title%></a><br />
<a href="<%URL%>" target="_blank">
<img border="0" src="<%Banner%>" <%if Width%>width="<%Width%>"<%endif%> <%if Height%>height="<%Height%>"<%endif%> title="<%Title%> >"</a>
<%endloop%>
<%endif%>

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Ideas please In reply to
Quote:
<%Title%>
show whatever it is you want here
&
Quote:
<a href="<%URL%>" target="_blank"><%Title%></a><br />
<a href="<%URL%>" target="_blank">
<img border="0" src="<%Banner%>" <%if Width%>width="<%Width%>"<%endif%> <%if Height%>height="<%Height%>"<%endif%> title="<%Title%> >"</a>

Both quotes above are the same thing and exactly what Andy suggested.

Where he writes 'show whatever is you want here' means, you can use link properties to design the output you desire.

Hope this helps.

Vishal
-------------------------------------------------------
Quote Reply
Re: [Matthias70] Ideas please In reply to
Sure, thats fine (its what I suggested ;))

I'd change it a little bit though - as no point in having 2 <a href bits .. as it just adds more text than you need)

Try:

Code:
<%Plugins::ULTRAGlobals::Random_Links(1,'672')%>
<%if Random_Loop.length%>
<%loop Random_Loop%>
<a href="<%URL%>" target="_blank">
<%Title%><br />
<img border="0" src="<%Banner%>" <%if Width%>width="<%Width%>"<%endif%> <%if Height%>height="<%Height%>"<%endif%> title="<%Title%>" />
</a>
<%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
OK, Thanks for your help

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

I have a problem with List_Links.
I would like to obtain only the links validated.
isValidated => 'Yes'

A possible solution?

Still a great plugin! :)

Mick

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

Have you tried:

Code:
<%Plugins::ULTRAGlobals::List_Links('isValidated','=','Yes','Title ASC',10)%>
<%if cond_loop_link.length%>
<%loop cond_loop_link%>
<%include link.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
Hi Andy,

In Fact, I use already a condition.

Code:
<%Plugins::ULTRAGlobals::List_Links('City','LIKE','%MyCity%','Add_Date DESC',10)%>

Is It possible to use several conditions?

<%Plugins::ULTRAGlobals::List_Links('isValidated','=','Yes','City','LIKE','%MyCity%','Add_Date DESC',10)%>

Thanks again! :)

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

In /admin/Plugins/ULTRAGlobals.pm, find the function "sub List_Links", and replace the code with the following:
Code:
sub List_Links {

my ($sort_order,$limit) = (shift,shift);
my @fields_to_sort = @_;

$sort_order ||= "Title ASC";

my $tbl = $DB->table('Links');
if (defined $limit) {
$tbl->select_options(qq|ORDER BY $sort_order LIMIT $limit|);
} else {
$tbl->select_options(qq|ORDER BY $sort_order|);
}

my $cond = new GT::SQL::Condition;
foreach (@fields_to_sort) {
my ($field,$operator,$val) = split /::/;
$cond->add($field,$operator,$val);
}
$cond->bool('AND');

my $sth = $tbl->select( GT::SQL::Condition->new($field,$operator,$val) ) || die $GT::SQL::error;

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

return { cond_loop_link => \@loop }

}

Then try calling using:

Code:
<%Plugins::ULTRAGlobals::List_Links('Title ASC',10,'isValidated::=::Yes','Foo::LIKE::%bar%')%>

The 1st paramater is the "sort" order for the results. The 2nd paramater is the "limit" of how many results to get. The ones after that are the different field types you wanna add to the condition.

The above would do:

Code:
isValidated => Yes
Foo LIKE '%bar%'

Each condition needs to be given a new value... for example:

Code:
'Foo::=::bar','Test::<=::5'

..etc

Totally untested, but should work 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
Hi Andy,

I obtain the error:

Global symbol "$field" requires explicit package name at ULTRAGlobals.pm line 2106.
Global symbol "$operator" requires explicit package name at ULTRAGlobals.pm line 2106.
Global symbol "$val" requires explicit package name at ULTRAGlobals.pm line 2106.

line 2106 :

Code:
my $sth = $tbl->select( GT::SQL::Condition->new($field,$operator,$val) ) || die $GT::SQL::error;

An idea?

Thanks!

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

Code:
my $sth = $tbl->select( GT::SQL::Condition->new($field,$operator,$val) ) || die $GT::SQL::error;

to

Code:
my $sth = $tbl->select( $cond ) || die $GT::SQL::error;

That shouls fix it Wink

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 ! Thanks ! :)

I also try to use your upper_or_lower global with Edit_Title_Full_Name.

<%Plugins::ULTRAGlobals::Edit_Title_Full_Name(upper_or_lower('lower',$Full_Name,'normal','-','1')%>

Code:
sub {
my $action = $_[0];
if ($action eq "lower") { return lc($_[1]); }
elsif ($action eq "upper") { return uc($_[1]); }
elsif ($action eq "ucfirst") { return ucfirst($_[1]); }
else { return "Invalid action passed..."; }
}

But, that does not function.

Do You think that it is possible?

Thanks again!

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

With the other global, what exactly are you trying to do? You can't pass in global names into a plugin (or a global name, into another global name)

You probably want something more like:

Code:
<%set Full_Name_New = upper_or_lower('lower',$Full_Name,'normal','-','1')%>
<%Plugins::ULTRAGlobals::Edit_Title_Full_Name($Full_Name_New)%>

...or similar

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
It is exactly what I want to obtain!

Thanks for your invaluable help! :)

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

I modified Get_Links_Categories to use the value of build_index_include.

Code:
$cat->{URL} = $CFG->{build_root_url} . "/" . $DB->table('Category')->as_url( $cat->{Full_Name} ) . "/" . ($CFG->{build_index_include} ? $CFG->{build_index} : '');

Does That function, but do you think that it is correct?

Thanks!

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

I modified Get_Links_Categories to use the value of build_index_include.

Code:
$cat->{URL} = $CFG->{build_root_url} . "/" . $DB->table('Category')->as_url( $cat->{Full_Name} ) . "/" . ($CFG->{build_index_include} ? $CFG->{build_index} : '');

Does That function, but do you think that it is correct?

Thanks!

Mick

Looks fine to me :) I need to have a look at adding that kinda stuff in to the plugin at some point, so it takes that into consideration when making category URL'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
Hi Andy,

I would like to use the Commify function.

But, that it would be the good value for Column Type ?

I tried to use INT in include_form, but 250.000 gives 250 in database.

I use INT to make a search on the price (&price-ge=100&price-le=1000).

Thanks for your suggestion. :)

Mick

Last edited by:

MJ_: Aug 29, 2011, 5:43 AM
Quote Reply
Re: [MJ_] Ideas please In reply to
Oups ! My approach is not correct!
Iwill use Commify only on the pages of confirmation (success).

Mick

Last edited by:

MJ_: Aug 29, 2011, 5:49 AM
Quote Reply
Re: [MJ_] Ideas please In reply to
Hi,

You would need an INT for whole number, of FLOAT if you want to use decimals. Commify just uses a text string (so it could even be a CHAR), but the problem with that is that you can not do numerical searching ( -lt -gt etc ) with a CHAR field (it needs to be INT or FLOAT, depending on what kinda data its going to be used to store)

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
For the decimal (FLOAT), could the separator be the dot (.) or the comma (,) ?

Thanks again ! :)

Mick

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