TinyPortal

Development => Resources => Topic started by: Moto on April 26, 2009, 03:41:33 PM

Title: Affiliate snippet
Post by: Moto on April 26, 2009, 03:41:33 PM
Hi im trying to find a code that produces this

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi35.photobucket.com%2Falbums%2Fd166%2Fxxxmotoxxx_%2Fhyper.gif&hash=d141f52e7879db857f9a612d5e658d9b46aa0ece)

Its an affiliate button,with the picture hyperlink code underneath,so members can copy and paste the code for there sites.Ive been looking but no luck as im probably using the incorrect search keywords..

thanks for any help.
Title: Re: Affiliate snippet
Post by: JPDeni on April 26, 2009, 03:55:28 PM
Use a php block.


echo '<img src="url/to/image.jpg">
<form>
<textarea>
code that you want people to be able to copy
</' . 'textarea>
</form>';


The reason that you need to use a php block is that there is an issue with the closing textarea tag. If you just put in a plain textarea, you'll have problems with your block.
Title: Re: Affiliate snippet
Post by: Moto on April 26, 2009, 04:14:11 PM
Thank you, thats nearly perfect.
Is there a way to have the scroll bar to the side of the block like on the shout box,instead of underneath..hope you follow me..

heres a link so you can see.

http://www.studioshop.us/index.php

many thanks.
Title: Re: Affiliate snippet
Post by: JPDeni on April 26, 2009, 04:24:38 PM
I really don't know. Formatting stuff isn't my strong suit.

You can try adding "wordwrap" to your textarea tag and playing around with size as far as rows and columns. All that would be basic html formatting and would be a matter of trial and error to see what looks good.
Title: Re: Affiliate snippet
Post by: Lesmond on April 26, 2009, 08:02:22 PM
I have used this javascript in the past, and works well for me

<script language="JavaScript">


function highlight(field) {
  field.focus();
  field.select();
}


</script>

<center><form name="myForm">
                    <p>
                        <img border="0" src="your-img.gif"></p>
<p>
                        <textarea name="myField" rows="7" cols="19"><center><!--Begin Code -->
<a title="your site name here" target="_blank" href="http://www.yoursite.com/"><img border="0" src="http://www.yoursite.com/your-img.jpg" width="150" height="35"></a></center>
</textarea>
                <br>
                <input type="button" value="Select All" onClick="highlight(this.form.myField)">
                </p>
                </FORM></center>

paste into a scriptblock change the values to suit your site