TinyPortal

Development => Support => Topic started by: deef on February 02, 2007, 12:22:29 PM

Title: A way to insert html as code on a article in Tiny portal ?
Post by: deef on February 02, 2007, 12:22:29 PM
I wish to add on a article in tp some html code ... with not can be parsed ...

In a article I wish to promote a banner...

For example

<<Banner preview with htmlcode>>
Banner desciption:  Flashing banner
Banner dimensions: 250 x60
Banner code:
And here is the problem....

How to display simple html without it's beïng parsed ?

In the forum there is a tag [blabla_CODE] but this is not working in the article manager ?  Why is it missing there ?

grtz,

deef
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: bloc on February 02, 2007, 12:26:17 PM
I am not sure I follow but..if you turn off the WYSWYG editor, you can write pure HTML codes. Is that what you mean?
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: deef on February 02, 2007, 12:46:05 PM
Quote from: Bloc on February 02, 2007, 12:26:17 PM
I am not sure I follow but..if you turn off the WYSWYG editor, you can write pure HTML codes. Is that what you mean?

No ... lol I write it always in html.

But the problem is ....

Visitor of my site you can use this code:
<a href="http://www.myurl.com" target="blank">A link to my site</a>
yust copy & paste this code

in the forum it works like that way... but in the article manager you will see:

Visitor of my site you can use this code:
<a href="http://www.myurl.com" target="blank">A link to my site</a>
yust copy & paste this code

That's beacause the code tag there don't work

grtz,

deef

Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: bloc on February 02, 2007, 01:03:06 PM
oh, I see. :) Yes, thats correct..the code tag or any BBC tag doesn't work in HTML articles, it would make it impossible to write advanced HTML, since the BBC parser throw out anything it can't understand. :) Whats needed is a BBC type of article, coming up in future versions of TP.

How about trying the HTML codes for the same?
<pre><a href="http://www.myurl.com" target="blank">A link to my site</a></pre>

Does that work..?

...You can always replace < with the entity one..but its cumbersome. 
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: deef on February 02, 2007, 01:28:54 PM
Nope don't work...  I have already try'd to make a textfield but that's not working also:
He translate the urls to
Quote
_fcksavedurl='http://www.mysite.com'

It's realy strange....  But do you have a alternative way to show the html code to my users ?

I wish to make simple a article to my users...
Quote
If you wish to link to us use this code
Code plain HTML
For example code 1 plain html

Code Banner 1
For example code banner 1

Code Banner 2
For example code banner 2

So that the users who have sites can link to our site (link building).

grtx,

deef
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: deef on February 04, 2007, 06:23:32 PM
Is there a other way ? 

nobody ?
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: akulion on February 04, 2007, 06:37:40 PM
open the index.template.php of your themes

add this before </head>


<style>
.highlighttext{
background-color:yellow;
font-weight:bold;
}
</style>

<script language="Javascript">
<!--

/*
Select and Copy form element script- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

//specify whether contents should be auto copied to clipboard (memory)
//Applies only to IE 4+
//0=no, 1=yes
var copytoclip=1

function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
if (document.all&&copytoclip==1){
therange=tempval.createTextRange()
therange.execCommand("Copy")
window.status="Contents highlighted and copied to clipboard!"
setTimeout("window.status=''",1800)
}
}
//-->
</script>


then create a SCRIPT BLOCK and add this to it


<form name="test">
<a class="highlighttext" href="javascript:HighlightAll('test.select1')">Select All</a><br>
<textarea name="select1" rows=10 cols=35 >This is some text. This is some text. This is some text. This is some text.</textarea>
</form>

Replace This is some text. This is some text. This is some text. This is some text. with ur code


the above will work in a block, but in article you will just have to try it our

original reference to script: http://dynamicdrive.com/dynamicindex11/selectform.htm
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: bloc on February 04, 2007, 07:24:52 PM
I searched and found that <code > is supposed to show html codes..but I haven't tried it more, as it failed in the first attempt. :P
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: rebelrose on February 04, 2007, 07:45:14 PM
I just created an article, not a php article, and used the code that Bloc has posted above and it shows correctly.

code I used



<pre><a href="http://www.myurl.com" target="blank">A link to my site</a></pre>



what shows is "A link to my site" (it is a hyper link as it should be)

What is the problem your having, maybe I am not understanding what is wrong ???
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: TestMonkey on February 05, 2007, 09:54:58 AM
I believe he is wanting to be able to post a article that allows his users/members to copy/paste links // banners and such. To allow them to have links to his site on their site, they need to be shown the html to copy & paste..

Most sites use a textarea form for this type of thing:

<form>
<textarea name="site links" COLS=40 ROWS=6>
Copy and Paste the code below to link to MySite:
<a href="index.html" title="Mysitelink!">Link to my site!</a>
</textarea>
</form>


But as others have said you can play with:

<pre><a href="index.html" title="Mysitelink!">Link to my site!</a></pre>

and also

<code><a href="index.html" title="Mysitelink!">Link to my site!</a></code>
Title: Re: A way to insert html as code on a article in Tiny portal ?
Post by: Thurnok on February 06, 2007, 03:38:38 AM
Just create a php article and put in the following:

$otxtarea = '<textarea ';
$ctxtarea = '</textarea>';

echo '
<form>
'.$otxtarea.'name="My Links and Banners" cols=40 rows=8>
Copy and Paste the code below to link to MySite:
<a href="index.html" title="Mysitelink!">Link to my site!</a>
'.$ctxtarea.'
</form>
';


Modify the link info in there, add as many as you like, etc...