TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 04:31:30 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 192
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 154
  • Total: 154

Affiliate snippet

Started by Moto, April 26, 2009, 03:41:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Moto

Hi im trying to find a code that produces this



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.

JPDeni

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.

Moto

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.

JPDeni

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.

Lesmond

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