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

how to make many links invisible

Quote Reply
how to make many links invisible
I have to change a lot of link entries, but I don't want to delete them.
At the moment I set them to non validated. But then the linkowners can not see them anymore.

So, is there a way to show non validated links to the linkowner with modify.cgi ???
Or are there other ways to make many links invisible for changes in the background???

Any advices how to manage this, are welcome :-)

Matthias
gpaed.de

Last edited by:

Matthias70: Jan 24, 2010, 10:45 AM
Quote Reply
Re: [Matthias70] how to make many links invisible In reply to
Mmmm.. thats a bit of a hard one.

In /admin/Links/Modify.pm, what happens if you comment this out:

Code:
unless ($link->{isValidated} eq 'Yes') {
return { error => Links::language('MODIFY_NOLINKS'), %ret };
}

The other option I guess, would be to make a "hidden" category and move them there. However, doing this is quite hard (you will have to mess around with your server feature, so it doesn't show the category - and also hack the category list. so it doesn't show the hidden category)

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] how to make many links invisible In reply to
Hi Andy, thanks for your answer.

I did not try your code yet,
but do you know if there is a mysql command to unvalidate all links in a CATEGORY and ALL SUBCATEGORIES

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] how to make many links invisible In reply to
To unvalidate all links in a category, its probably easiest to just do a simple global:

suib {
$DB->table('CatLinks','Links')->update( { isValidated => 'No' } , { 'CatLinks.CategoryID' => 1234 } );
}

..and call it on a page called test.html (then access it via page.cgi?p=test to run it)

OBVIOSULY backup your database first - in case it breaks your DB!

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] how to make many links invisible In reply to
Andy wrote:
suib {
$DB->table('CatLinks','Links')->update( { isValidated => 'No' } , { 'CatLinks.CategoryID' => 1234 } );
}

Hi Andy,
is this code for categories an it's subcategories?

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] how to make many links invisible In reply to
This would just be for the category Id you enter in the global.

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] how to make many links invisible In reply to
Hi Andy,
I am a step further in hiding things
in category.html this code works for me
Code:
<%if Full_Name contains "Category1"%>
text
<%else%>
show other categories
<%endif%>


do you know how to hide all detailpages of category1
The above code does not work on detailpages, cause there seems to be no Full_Name!!!

Matthias
gpaed.de

Last edited by:

Matthias70: Jan 25, 2010, 11:52 AM
Quote Reply
Re: [Matthias70] how to make many links invisible In reply to
To get the category name, you need to do something like:

get_cat_name_for_detailed
Code:
sub {
my $cat_id = $DB->table('CatLinks')->select( ['CategoryID'] , { LinkID => $_[0] } )->fetchrow;
my $cat_name = $DB->table('Category')->select( ['Full_Name'], { ID => $cat_id } )->fetchrow;
return { cat_name => $cat_name };
}

Then call with:

Code:
<%get_cat_name_for_detailed($ID)%>
Category name is: <%cat_name%>

Also, you need to take into consideration that search.cgi will also still pick these up ;) The best way I've found to do this - is to pass in "catid" with the query... for example:

<input name="catid" value="1213" type="hidden" />
<input name="catid" value="2213" type="hidden" />
<input name="catid" value="456" type="hidden" />

You would need to specify ALL the top-level categories you wanted to search (and just not enter the ones that you don't want to be searched. Hopefully it makes sense ;)

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] how to make many links invisible In reply to
Hi Andy,
your global works perfect in detail.html but I have a problem with changing the search.cgi
My search form looks like this
Code:
<form action="<%config.db_cgi_url%>/search.cgi" />
<input type="submit" name="suchen" value="Suche" class="submit" /> <input type="text" id="searchbox" name="query" value="<%if query%><%escape_html query%><%endif%>" class="text" />
in <select style="font-size: 11px" name="catid"><option value="0">all categories</option><%top_categories%></select>
</form>

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] how to make many links invisible In reply to
MMm, the problem with your search form, is that you already pass in a catid value.... what it needs to really look like - is:

<form action="<%config.db_cgi_url%>/search.cgi" />
<input type="submit" name="suchen" value="Suche" class="submit" /> <input type="text" id="searchbox" name="query" value="<%if query%><%escape_html query%><%endif%>" class="text" />
<input name="catid" value="1213" type="hidden" />
<input name="catid" value="2213" type="hidden" />
<input name="catid" value="456" type="hidden" />

</form>

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] how to make many links invisible In reply to
Hi Andy,
everything works perfect. Thanks for helping me out so fast.
I paypal you in a few minutes

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] how to make many links invisible In reply to
Hi

Thanks , glad it works 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!