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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 142
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 104
  • Total: 104

Code for linking 150x35 icons to other sites in TP side panel?

Started by antechinus, February 06, 2008, 11:50:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

antechinus

Ok, I can do this sort of thing in BBC but being still a bit of a mug I can't do it in html or php.
I want to set up a stack of nifty icons that link to related sites (like the ones you have here) and put it in the TP side panel.
Can some angel of mercy help a poor guy out and post up the code I need? Thanks.

PS. Yes, I did try searching first.

Zetan

Sure

To simply link an image in HTML:



<a href="http://www.linkhere.com/"><img src="http://imagesourceurlhere.gif" border="0" title="mouse over title here."></a>



To open in a new tab/window add the following inline:

target="_blank"




<a href="http://www.linkhere.com/" target="_blank"><img src="http://imagesourceurlhere.gif" border="0" title="mouse over title here."></a>



Check the block code snippets board, there are a few different menus in there that you could use.

antechinus

Nope, I can't get that to work, and I've tried going straight off the images folder in publc_html. I've got the image path right, I know the url of the target site, but all I'm getting in the side panel is the text I typed into the article.
Just in case I made another images folder under my test forum's directory and used that path. No luck there either.

Let me put this another way: what is the exact code string used for hooking up that SMF link icon in the side panel here?
I can probably understand that if I can see it. I looked through the block snippet board but there wasn't anything that seemed to relate directly to this. I don't know enough about html to modify something sort of similar unless it's screamingly obvious.

Zetan

Try a Script type block, not a BBC block.

For php, use an echo ' statement, which ends ';



echo ' <a href="http://www.linkhere.com/"><img src="http://imagesourceurlhere.gif" border="0" title="mouse over title here."></a>';


G6Cad

You cant get a more exact code string then the one ZTN posted.
Make sure your image path is writable and that you use a HTML Block

antechinus

I thought the TP article blocks were html by default. There's a box for changing them to php but I haven't checked that. I already know BBC doesn't work in them because I tried it just for the hell of it.

When you say "make sure the image path is writable", I'm using the  directory tree straight out of my FTP software, so it should be accurate.


antechinus

The echo statement? Yep, tried that. It displayed text only, presumably because the article is html.
Then I checked the "change to php" box and got an error message.

Parse error: syntax error, unexpected '&' in /home/cofexm/public_html/weaponstestingrange/Sources/Load.php(1735) : eval()'d code(101) : eval()'d code on line 1

I'm missing something really basic here. The path I'm trying to use is http://www.mysite.com/public_html/weaponstestingrange/images/linky.gif

Weaponstestingrange is the name of my test forum directory.

ETA: I changed the article back to html and now the image is showing up between the  echo '   and ' ; tags. It still doesn't link to anywhere though and now I can't see the code when I try to edit the article. The image is there even in edit mode.

Zetan

You are missing something simple. This is very basic stuff to be honest.
Article, Block?

Script type block.
php type block/Article?

Try an image from another site just as a test, I don't condone hotlinking.
You HAVE to use the correct type of block for the type of code/script you wish to use.

Use php in a php type block.
html is best used in a script block
BBCode in a BBC type block..

Best add a smiley.. sounds like I'm ranting now  :buck2:

keith021773

Don't put them in an article page..    Try using the above code in a side block HTML block..   

You beat me to it ZTN.   :)

This website is proudly hosted on Crocweb Cloud Website Hosting.