how to add a link to the bottom of Coranto submit screen?

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

how to add a link to the bottom of Coranto submit screen?

Postby Esstee » Fri Jun 03, 2005 3:01 am

Is this hard to do?

I want to create a link like "Mutipart upload" etc. for my own image
editor script, it won't run in the coranto interface so all I need is a
link.

I know absolutely nothing about cgi so I'm hoping someone will help me.
I peered in to various haddons in hope of finding a piece of code I could
replicate but nothing jumps out.

Your help is appreciated.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Psykosys » Fri Jun 03, 2005 4:06 am

One way to do this would be a quick little addon...
Code: Select all
#! CRADDON 1
#! NAME My Script Link
#! DESCRIPTION Adds a link to the Quick Links bar
#! VERSION 0
#! HOMEPAGE http://coranto.org
#! DOC 1

my $addon = new Addon('My Script Link');
$addon->hook('CRHTMLFoot', 'myscriptlink', 10);

sub myscriptlink {

my $linkything = 'http://www.path.to/your/script.php';
# change this to reflect the path to the script you want to link to

my $linkytitle = 'Image Manager Script';
#change this to what you want the link to say   
   
print '&nbsp;<a href="' . $linkything . '">' . $linkytitle . '</a>&nbsp;';
   }
   
1;

It's late and I'm bad at Perl, but this hopefully works. Just copy and paste into a .pl file with a name beginning with "cra_", change the two variables noted, and put it in your Coranto folder and enable.
Psykosys
 
Posts: 252
Joined: Tue Apr 15, 2003 10:37 pm
Location: Ithaca, NY

Postby Esstee » Fri Jun 03, 2005 10:31 am

Well thank you Psykosys

I followed your instructions, the link does not appear - just yet
but we are close! I can feel it ;)

I changed the code as follows, tell me if there is anything that stands out:

Code: Select all
#! CRADDON 1
#! NAME My Script Link
#! DESCRIPTION Adds a link to the Quick Links bar
#! VERSION 0
#! HOMEPAGE http://coranto.org
#! DOC 1

my $addon = new Addon('Image manager');
$addon->hook('CRHTMLFoot', 'myscriptlink', 10);

sub myscriptlink {

my $linkything = 'http://www.mysite.com/news/imagemanager/manager.php';
# change this to reflect the path to the script you want to link to

my $linkytitle = 'Image manager';
#change this to what you want the link to say   
   
print '&nbsp;<a href="' . $linkything . '">' . $linkytitle . '</a>&nbsp;';
   }
   
I went deeper into the belly of Coranto and look! I found maginot.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Parahead » Sat Jun 04, 2005 7:54 am

Esstee wrote:I followed your instructions, the link does not appear - just yet
but we are close! I can feel it ;)
Just to make sure, have you enabled the addon at the Addon Manager page?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Esstee » Sat Jun 04, 2005 1:20 pm

yes I checkm it never aappeared there
I went deeper into the belly of Coranto and look! I found maginot.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby Parahead » Sat Jun 04, 2005 1:35 pm

Esstee wrote:yes I checkm it never aappeared there
What do you refer to, that the addon didn´t appear on the Addon Manager page? Well, then your top priority should be to figure out why that may be so, that the link doesn´t appear on the Main Page is comes second. Basically, if the addon isn´t running, it can´t be excepted to present a link... ;-)
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Esstee » Sat Jun 04, 2005 2:18 pm

it never appeared in the addon section :)
I went deeper into the belly of Coranto and look! I found maginot.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby msbzdragn » Sat Jun 04, 2005 2:42 pm

Esstee wrote:it never appeared in the addon section :)


Yup, and what he's saying is that your first priority should be to figure out *why* it didn't appear in the addon section (Addon Manager), because until it appears there you can't enable it - and until you enable it, it can't do anything.
Michael R. Tomkins
Administrator, 'Unofficial Coranto / NewsPro Forums'

Mitsubishi Diamante Forum

Do NOT send me instant messages asking for Coranto help without me telling you explicitly to do so. You WILL be placed on ignore if you do so; I don't have time to provide personal tech support to every person who IM's me. Sorry!
User avatar
msbzdragn
 
Posts: 2397
Joined: Mon Mar 11, 2002 4:51 pm
Location: Oak Ridge, TN

Postby Psykosys » Sat Jun 04, 2005 2:50 pm

Hmm... try adding the line:
Code: Select all
__END__
after all the rest of the addon code. And change it so that, instead of having:
Code: Select all
#! NAME My Script Link
and
Code: Select all
my $addon = new Addon('Image manager');

both names match. (Change the name to "Image manager", or change "new Addon('Image manager')" to "new Addon('My Script Link')" I am not sure if it is required for addons for both names to match or if this is just convention (I guess we'll see).

Update: I'm guessing the above isn't your problem though- I tested the addon on my install and it works fine. What's the filename of your addon (should follow format "cra_addonnname.pl" and be in the directory with all the other addons you're using)? It could also be a problem with cutting-and-pasting from the forum, could have added a linebreak somewhere where it shouldn't be. So try downloading the addon directly from here.
Psykosys
 
Posts: 252
Joined: Tue Apr 15, 2003 10:37 pm
Location: Ithaca, NY

Postby Esstee » Sat Jun 04, 2005 4:47 pm

fantastic!

Worked like a knife in butter :D

It has been placed 2'nd in line on the bottom Coranto function section
how could I move that?

Also there is a | at the begining but no | at the end so it looks like:
Main Page | Image Manager Submit News | Build News |...

I cannot find where are those | are defined in the script?
I went deeper into the belly of Coranto and look! I found maginot.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project

Postby kriko » Sat Jun 04, 2005 5:15 pm

Replace
Code: Select all
print '&nbsp;<a href="' . $linkything . '">' . $linkytitle . '</a>&nbsp;';

With:
Code: Select all
print '&nbsp;<a href="' . $linkything . '">' . $linkytitle . '</a>&nbsp;|';
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby Parahead » Sat Jun 04, 2005 5:35 pm

Esstee wrote:It has been placed 2'nd in line on the bottom Coranto function section how could I move that?
The location of the link depends on in which order your addon places the link in respect to other addons you have enabled. It isn´t really possible to finetune this part, but... Change the value 10 in this line:
Code: Select all
$addon->hook('CRHTMLFoot', 'myscriptlink', 10);
to a value between -10 and 10.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Esstee » Sat Jun 04, 2005 6:09 pm

Thanks kriko and Parahead

I have managed to get things just where I wanted them.
I would consider this challenge solved.

!>enter thumbsup here<!
I went deeper into the belly of Coranto and look! I found maginot.
User avatar
Esstee
 
Posts: 320
Joined: Thu Nov 25, 2004 4:13 pm
Location: Deep in some project


Return to Customization

Who is online

Users browsing this forum: No registered users and 1 guest

cron