Author Topic: Quotes  (Read 10773 times)

0 Members and 1 Guest are viewing this topic.

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Quotes
« on: December 14, 2003, 15:02:24 »
Me again :)

Mike in your quotes script, right on the first page you have two links:
Add a new quote and Search for a quote.

I wanted to replace thos links with a button, button shows fine, link looks fine ..but is not , is not taking me anywhere, it is a dead link. help please?

your code:

Code: [Select]
   print <<HTML;
[ <a href="$::prog?function=add">Add a quote</a> ]
HTML
}

mine:
Code: [Select]
   print <<HTML;
<a href="$::prog?function=add"><input type="submit" value="add quote"></a>
HTML
}

what am I doing wrong?

also on the same page how do I add a block title, like on the others?

Thanks Mike.

BTW. Love that small feature!

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Quotes
« Reply #1 on: December 15, 2003, 09:47:41 »
Hi Felix,

I'd try something like this:

Code: [Select]
  print <<HTML;
<a href="$::prog?function=add"><img src="button.png" border="0"></a>
HTML
}

As for the block title, do you mean a title for the quotes box? You should be able to just insert that as HTML early on in the script...

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #2 on: December 15, 2003, 20:35:37 »
Hi Mike.

That code is no good. the script is looking for a button in the CGI directories. It will schow a button if I make one and save it in , but this is not the case, I have buttons flying left and right all over the board LOL. I was trying to do just a "form" button just like you have in the Quotes script:
Code: [Select]
<input type="text" name="string">
<input type="hidden" name="function" value="searchQuote">
&nbsp;;
<input type="submit" value="Search">
</form>

Do you know what I mean?

The code I came with for that button is not bad, but it has a broken link. Can you fix?

Thanks Mike.

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #3 on: December 15, 2003, 21:11:54 »
As far as the title is concerned, where exactly "earlier" in the page should I insert the HTML  routine?
I tried every place possible, they all give me errors or didnd show anything.
I just want to add

Code: [Select]
   
<div class="blocktitle">Todays Quote</div>
somewhere IN TOP of the random quote (# Print a random quote
print getQuote(); )

so easy this script though so dificult do edit!

help me out Mike, you made it, there is nobody better outthere!

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Quotes
« Reply #4 on: December 16, 2003, 09:26:12 »
I think something like this should work:

Code: [Select]
# Print a random quote

print "<div class=\"blocktitle\">Todays Quote</div>";
print getQuote();

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #5 on: December 16, 2003, 20:05:45 »
YESSS! that did it :)
Thanks Mike.

Can you help with these form buttons? a post up above?

Thank you Mike.

:)


Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Quotes
« Reply #6 on: December 16, 2003, 20:48:43 »
Do you mean use a button graphic instead of the "Add Quote" submit button? Try this:

Code: [Select]
<input type="image" src="http://server.com/img/search.jpg" border="0" name="submit" value="search" alt="Search Quotes">

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #7 on: December 16, 2003, 23:14:49 »
Mike, maybe I dont explain good, let me try again:

when I click on http://romanianational.com/cgi-bin/quotes.pl i get an window opening with a random quote and two links bellow:

[ Add a Quote ] [ Search a Quote]

I want to change those with a button but NOT a image button, just a code generated button like this:

Code: [Select]
<input type="submit" value="Upload">
or
Code: [Select]
<input type="submit" value="Search">
What I did is:
In your code:

Code: [Select]
  print <<HTML;
[ <a href="$::prog?function=add">Add a quote</a> ]
HTML
}

I tried:
Code: [Select]
 print <<HTML;
<a href="$::prog?function=add"><input type="submit" value="add quote"></a>
HTML
}

but wont work, it shows the button but I cant get the link to work.

understand what I mean?

thanks for your pacience.
:)


Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Quotes
« Reply #8 on: December 18, 2003, 09:02:23 »
Ahhh, I finally get it, but that's a whole other kettle of fish... You could try something like this:

http://romanianational.com/cgi-bin/quotes.pl?function=add

Code: [Select]
 print <<HTML;
<form>
<input type="hidden" name="function" value="add">
<input type="submit" value="add quote">
</form>
</a>
HTML
}

Haven't tested it, but it *should* work...

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #9 on: December 18, 2003, 20:28:10 »
of course it works :) you're the best!

Mike I cant get the buttons to line up! they are one on top the other.

this is whay I used:
Code: [Select]
# Show "add" link
if ($::allowadds)
{
    print <<HTML;
<form>
<input type="hidden" name="function" value="add">
<input type="submit" value="Adauga">
</form>
</a>
HTML
}
# Show "search" link
if ($::allowsearch)
{
        print <<HTML;
<form>
<input type="hidden" name="function" value="search">
<input type="submit" value="Cauta">
</form>
</a>
HTML
}

thanks Mike

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #10 on: December 18, 2003, 22:05:32 »
I tried everything! how do you make those buttons stay in line> Damn!

i tried this as well:
Code: [Select]
# Show "add" link
if ($::allowadds)
{

# Show "search" link
if ($::allowsearch)
{
   print <<HTML;
<form>
<input type="hidden" name="function" value="add">
<input type="submit" value="ADAUGA">&nbsp;
<input type="hidden" name="function" value="search">
<input type="submit" value=" CAUTA ">&nbsp;
</form>
HTML
}

doesnt work :(

what about these Mike? I need the same thing for them, and then I am finished, I promise!
Code: [Select]
<div class="footer">
[ <a href="$::prog">View Random Quote</a> ]
[ <a href="$::prog?function=search">Search Again</a> ]
</div>
HTML

thank you

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Quotes
« Reply #11 on: December 19, 2003, 22:03:34 »
The last 2 would be:

Code: [Select]
  print <<HTML;
<form>
<input type="submit" value="Random Quote">&nbsp;
<input type="hidden" name="function" value="search">
<input type="submit" value=" Search ">&nbsp;
</form>
HTML

As for stacking the buttons, they should already be on the same line. If not, use a "display: inline;" tag in their style class, by adding this to your style sheet:

Code: [Select]
input  { display: inline; }
Might work...

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #12 on: December 21, 2003, 23:46:45 »
Mike, I answered to you a couple of days ago but I dont know what happened with my post !?

the last 2 buttons ...code didnt work, they both have a 'search' function. thia is what works:

Code: [Select]
<form>
<input type="hidden" name="function" value="getQuote">
<input type="submit" value="Random Quote">&nbsp;
<input type="hidden" name="function" value="search">
<input type="submit" value=" New Search ">&nbsp;
</form>

as far as lining uo those two other buttons....no luck. I have 'inline' code in there but doesnt work. any other suggetsions that you might have?

this is the whole routine:
Code: [Select]
# Show "add" link
if ($::allowadds)
{
   print <<HTML;
[ <a href="$::prog?function=add">Add a Quote</a> ]
HTML
}

# Show "search" link
if ($::allowsearch)
{
   print <<HTML;
[ <a href="$::prog?function=search">Search Quotes</a> ]
HTML
}
I just want these two to be on line...:)

Thank you

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re:Quotes
« Reply #13 on: December 22, 2003, 14:35:16 »
For #1, try this code instead:

Code: [Select]
<form>
<input type="hidden" name="function" value="getQuote">
<input type="submit" value="Random Quote">&nbsp;
<form>
</form>
<input type="hidden" name="function" value="search">
<input type="submit" value=" New Search ">&nbsp;
</form>

It should be 2 forms, not just one... :)

Not sure why the buttons won't exist on the same line... maybe there's some sort of style override...?

Offline felix

  • album.pl Tester
  • **
  • Posts: 25
  • Karma: +0/-0
  • I forgot to change the default text.
    • Romanian Forum
Re:Quotes
« Reply #14 on: December 22, 2003, 20:56:57 »
You have
<form>
</form>

reversed but yes, this is it.

Guess what though! these two new buttons are the same, lining on the vertical! LOL

thanks Mike