Jump to content

Script to alter an html tag


GNorrell

Recommended Posts

First, I'm not a programmer at all. My scripting experience is limited to setting up email and contact forms on some websites. I have a new photography forum, and we need a script to convert existing links to sales pages into code that will post in an SMF (2.0.6) forum.

 

So basically I need to allow members to input the code in the top tag, and output the code in the bottom tag.

 

//<a href='http://webaddress.html' size='20'><img src='webaddress2.html?id=5164335&width=250&height=166' alt='Photography Prints' title='Photography Prints' style='border: none;'</a>

 

 

//url=http://webaddress.html]alt=Photography Printshttp://webaddress2.html?id=5164335&width=250&height=166[/img][/url

 

I had to leave the enclosure brackets off in the bottom tag to keep the tag showing properly

Any help or suggestions would be greatly appreciated.

 

- Greg

Link to comment
https://forums.phpfreaks.com/topic/284305-script-to-alter-an-html-tag/
Share on other sites

Thank you for responding. The forum accepts BBC Code. Most of the forum members are from FineArtAmerica.  Every image on FAA has a sales page (5.8 million of them and growing) with a link box at the bottom for members to copy the link to post on their websites and blogs.  I will post one of mine as an example in the bottom.  It's possible to manually convert the existing code tags to BBC, but BY FAR, most of my forum members can't manage that. Some can, some try and give up, and some don't even try. Hence the need to either develop a mod package for SMF (which I've requested in their forum), or a script to simply convert the links. If SMF allowed regular members to use html in posts, there would be no problem But for security reasons, only admins can use html.

 

<a href='http://greg-norrell.artistwebsites.com/featured/eagle-landing-greg-norrell.html' size='20'><img src='http://greg-norrell.artistwebsites.com/displayartworkartistwebsites.html?id=6582693&width=250&height=166' alt='Sell Art Online' title='Sell Art Online' style='border: none;'></a>

Looks like the link got mangled. Will try again:

 

http://<a href='http://greg-norrell.artistwebsites.com/featured/eagle-landing-greg-norrell.html' size='20'><img src='http://greg-norrell.artistwebsites.com/displayartworkartistwebsites.html?id=6582693&width=250&height=166' alt='Sell Art Online' title='Sell Art Online' style='border: none;'></a>

 

That link is mostly correct except for the opening tag. Oops, looked right in preview. The correct link is in a box bottom right at the example page.

 

An example page from FAA is here:

You can enable basic HTML code in posts such as <a> and <img> within the AdminCP.

Go to Admin Control Panel -> Post and Topics -> Bulletin Board Code tab and check "Enable basic HTML in posts" 

 

http://wiki.simplemachines.org/smf/Posts_and_Topics#Post_Settings

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.