|
Page 1 of 2
|
batman
Karl
Joined: February 2011
Posts: 162
Location: Cornwall UK
|
Bbcode Web Tags?
Could anybody please tell me how to ad a web tag to the bbcode list so I can post web pages within a post.
On my other portal system that I want to convert to Icy I have the feature which includes the below tags, but obviously doesn't work on Icy as its not included
Insert web page: [web height=#]Page URL[/web]
Cheers
Karl
|
#1 Fri 18 Feb, 2011 01:28 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Bbcode Web Tags?
There's something in the docs about how to add bbcode tags etc - might not be anything specific to what you actually want to do? But I do know one thing, and that's Icy Phoenix doesn't use the standard phpBB bbcode script.
I've looked at how the Icy bbcode is applied - if you get stuck - yell out, and I may be able to help!
Edit:
Thinking about this after a couple of beers!
[web height=#]Page URL[/web] ?
Page Url would have to equate to <iframe src="Page URL" width X height etc, with the no-scrolling attribute applied or something very similar.?
Because I can't see how else one could import a url and open it in the text area - Unless I'm missing something?
And from what I've read here - Icy Phoenix has no provision to allow <iframes. - In fact it appears they are dead set against it and don't cater or allow for it.
Could be wrong - But that's how I read it!
|
#2 Fri 18 Feb, 2011 09:06 |
|
batman
Karl
Joined: February 2011
Posts: 162
Location: Cornwall UK
|
Re: Bbcode Web Tags?
The feature is used on integramod 2.
I was going to stick with them as have done since 06 i wanted to upgrade but integramod 3 has been in Beta for so long now and the actual download is deactivated due to upgrading or something, Ive been weighting about 2 years to up grade so had to make a decision and now here, its a shame as helter skelter on there works seriously hard and been a great help over the years
The web tags are a really useful tool as it means members don't navigate away from your site, ill have a nosy see what I can find..
Thanks for your input
Below is a pic of how it looks when you post a web page, if its not possible Ill seriously miss this feature as we use it a lot..
|
#3 Fri 18 Feb, 2011 18:50 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: Bbcode Web Tags?
actualy, the new long awaited Icy version( svn at the moment), includes an personalized BBcode option.
something like PhpBB
____________ Out of Order
|
#4 Fri 18 Feb, 2011 20:13 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Bbcode Web Tags?
@batman.
It does look useful!
Stand by because I think I can run something to test if this is going to work with Icy Phoenix?
I think!
|
#5 Fri 18 Feb, 2011 23:49 |
|
batman
Karl
Joined: February 2011
Posts: 162
Location: Cornwall UK
|
Re: Bbcode Web Tags?
Look forward to it cheers
|
#6 Sat 19 Feb, 2011 00:02 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Bbcode Web Tags?
Took 20 minutes - -
BINGO!
Have a play with this using the [flash] tags, see what you can come up with as the best optimal sizes etc, then it can be written up with its own bbcode script.
Find in includes/bbcode.php
Find:
if (($tag === 'flash') || ($tag === 'swf'))
{
$html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' . $width . '" height="' . $height . '"><param name="movie" value="' . $content . '"><param name="quality" value="high"><param name="scale" value="noborder"><param name="wmode" value="transparent"><param name="bgcolor" value="#000000"><embed src="' . $content . '" quality="high" scale="noborder" wmode="transparent" bgcolor="#000000" width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>';
Replace with:
if (($tag === 'flash') || ($tag === 'swf'))
{
$html = '<iframe src="' . $content . '" width="800" height="600" marginwidth="0" marginheight="0" frameborder="0" scrolling="yes"></iframe>';
A couple of links that will help.
CUSTOMIZATION - Adding Video BBCode And Buttons To The Editor.
http://www.icyphoenix.com/viewtopic.php?p=44061#p44061
Though this one advocates NO IFRAMES - It appears it's directed at adding script in iframes to the text area, rather than just linking.
BBCODE - CUSTOMIZATION - DANGEROUS - How To Allow IFRAME And Full HTML Parsing
http://www.icyphoenix.com/viewtopic.php?p=17045#p17045
Demo Pic.
Description: |
|
Filesize: |
72.33 KB |
Viewed: |
137 Time(s) |
|
|
#7 Sat 19 Feb, 2011 00:12 |
|
batman
Karl
Joined: February 2011
Posts: 162
Location: Cornwall UK
|
Re: Bbcode Web Tags?
Cheers ill have a nosy at that tomorrow
|
#8 Sat 19 Feb, 2011 01:43 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Bbcode Web Tags?
Hehehe!
I'm not doing much at the moment, so I'll probably have it written up by the time you get to it.
Will let you know.
|
#9 Sat 19 Feb, 2011 02:11 |
|
Yros
Joined: April 2009
Posts: 283
Location:
|
Re: Bbcode Web Tags?
Instead of modifying the flash bbcode (which may lead to errors while using the TRUE flash tag for real flash content), why not simply add a new bbcode or upgrade your version in order to use the " custom bbcodes " available ?
|
#10 Sat 19 Feb, 2011 03:35 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Bbcode Web Tags?
Instead of modifying the flash bbcode (which may lead to errors while using the TRUE flash tag for real flash content), why not simply add a new bbcode or upgrade your version in order to use the " custom bbcodes " available ?
Yros,
It wasn't intended to modify the Flash Code, it was ONLY used as an example to see if Icy Phoenix would parse <iframes.
I've asked MG for some help because I'm having trouble parsing any changes I make to pop-up prompts by way of width and height.
It doesn't matter how I add the variables or change the arrays in bbcode.php - They parse into the post, but I cannot get the changes to parse into the db with the string changes.
And I've just realised that I was ONLY Previewing them - Damn, maybe that's the problem!
Anyway - I'm open to any suggestions if anyone wants to add the extra code here while I'm trying to sort out bbcode.php.
This all works - But it's hard-code for height and width - That's what needs fixing!
Open : includes/bbcb_mg.php
Find:
'L_FLASH_H_ERROR' => $lang['s_flash_h_error'],
After Add:
'L_WEB_INSERT' => $lang['s_web_insert'],
'L_WEB_W_INSERT' => $lang['s_web_w_insert'],
'L_WEB_W_ERROR' => $lang['s_web_w_error'],
'L_WEB_H_INSERT' => $lang['s_web_h_insert'],
'L_WEB_H_ERROR' => $lang['s_web_h_error'],
Find:
'L_FLASH_HELP' => $lang['s_flash_help'],
After Add:
'L_WEB_HELP' => $lang['s_web_help'],
Open : includes/bbcode.php
Find:
'flash' => array('nested' => true, 'inurl' => true, 'allow_empty' => false),
After Add:
'web' => array('nested' => true, 'inurl' => true, 'allow_empty' => false),
Find:
($tag === 'flv')
Inline After Add: (Note the leading space)
|| ($tag === 'web')
Find:
elseif (($tag === 'emff') || ($tag === 'mp3'))
Before Add:
elseif ($tag === 'web')
{
$html = '<iframe src="' . $content . '" width="800" height="600" marginwidth="0" marginheight="0" frameborder="0" scrolling="yes"></iframe>';
}
Open: templates/common/js/bbcb_mg.js
Find:
var flash = 0;
After Add:
var web = 0;
Find:
'[swf width=200 height=200]','[/swf]',
After Add:
'[web width=800 height=800]','[/web]',
Find:
function BBCflash()
{
var FoundErrors = '';
var enterFURL = prompt(s_flash_insert, s_url_insert_tip);
if (!enterFURL)
{
FoundErrors += s_file_insert_error;
}
var enterW = prompt(s_flash_w_insert, "320");
if (!enterW)
{
FoundErrors += s_flash_w_error;
}
var enterH = prompt(s_flash_h_insert, "240");
if (!enterH)
{
FoundErrors += s_flash_h_error;
}
if (FoundErrors)
{
alert(s_gen_error + FoundErrors);
return;
}
var ToAdd = "[b]Video File[/b][spoiler][flash width="+enterW+" height="+enterH+"]"+enterFURL + "[/flash][/spoiler]";
PostWrite(ToAdd);
}
After Add:
function BBCweb()
{
var FoundErrors = '';
var enterFURL = prompt(s_web_insert, s_url_insert_tip);
if (!enterFURL)
{
FoundErrors += s_file_insert_error;
}
var enterW = prompt(s_web_w_insert, "800");
if (!enterW)
{
FoundErrors += s_web_w_error;
}
var enterH = prompt(s_web_h_insert, "800");
if (!enterH)
{
FoundErrors += s_web_h_error;
}
if (FoundErrors)
{
alert(s_gen_error + FoundErrors);
return;
}
var ToAdd = "[web width="+enterW+" height="+enterH+"]"+enterFURL + "[/web]";
PostWrite(ToAdd);
}
Open:
templates/default/bbcb_mg.tpl
Find:
<a href="javascript:BBCflash()"><img src="{BBCB_MG_IMG_PATH}flash{BBCB_MG_IMG_EXT}" name="flash" onmouseover="helpline('flash')" alt="L_BBCB_MG_FLSH}"
title="{L_BBCB_MG_FLSH}" class="bbimages" /></a>
Before Add:
<a href="javascript:BBCweb()"><img src="{BBCB_MG_IMG_PATH}web{BBCB_MG_IMG_EXT}" name="web" onmouseover="helpline('web')" alt="{L_BBCB_MG_WEB}"
title="{L_BBCB_MG_WEB}" class="bbimages" /></a>
Open: language/lang_english/lang_bbcb_mg.php
Find:
'bbcb_mg_flsh' => 'Flash',
After Add:
'bbcb_mg_web' => 'Web',
Find:
$js_lang['s_flash_h_error'] = 'You didn\'t specify Flash file height';
After Add:
$js_lang['s_web_insert'] = 'Please write Web file URL';
$js_lang['s_web_w_insert'] = 'Please specify Web file width';
$js_lang['s_web_w_error'] = 'You didn\'t specify Web file width';
$js_lang['s_web_h_insert'] = 'Please specify Web file height';
$js_lang['s_web_h_error'] = 'You didn\'t specify Web file height';
Find:
$js_lang['s_flash_help'] = 'Insert flash file: [flash width=# height=#]flash URL[/flash]';
After Add:
$js_lang['s_web_help'] = 'Insert file URL: [web width=# height=#]File URL[/web]';
Edit 1:
Well It's working in a fashion as I can adjust the width but not the height. Time to give it a break for a while I think.
But don't let that stop anyone who knows more than I do (Which is not much) from helping with this.
Edit 2:
This is the problem - [web width=450 height=450]http://www.gifbin.com[/web]
If I change either value above 450, the whole thing stuffs up - What's holding it down and where it is - I have not got a clue at this moment.
Edit 3:
This appears to be the maximum....
Anyone happy with that?
[web width=600 height=450]http://www.gifbin.com[/web]
But if I hard-code it with this - width="800" height="600" - That's what you get! Though 700x700 fits better.
Last edited by mort on Sat 19 Feb, 2011 09:11; edited 1 time in total |
#11 Sat 19 Feb, 2011 06:19 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7191
Location: Borgo San Michele
|
Re: Bbcode Web Tags?
Hi all,
Honestly I would not add such a BBCode unless in some way restricted to administrators or people you are trusting blindly.
The reason is that you can add almost anythin in an IFRAME even evil scripts which could harm your visitors... I wouldn't risk that honestly.
In dev version of Icy Phoenix it should be easier get what you need because I have coded (I hope properly, but not fully tested so far) an option to allow HTML to administrators... anyway, you are asking something for the old version.
Before going on in helping you I would like you to confirm that you are aware of the risks you are going to face...
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#12 Sat 19 Feb, 2011 09:09 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Bbcode Web Tags?
Hi MG,
I could always add the code to it <!-- IF S_ADMIN This <iframes code - <!-- Else Nothing etc or maybe echo ADMIN ONLY TAGS! etc, etc.
Maybe add S_ADMIN_MOD too
All in php of course - not constants.
Edit:
I think that this should do it:
elseif ($tag === 'web' && (($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD)))
{
$html = '<iframe src="' . $content . '" width="' . $width . '" height="' . $height . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="yes"></iframe>';
}
I also think I'll settle on this as the maximum because it's adjustable and it should be big enough!
[web width=600 height=450]http://www.mysite.com[/web]
Last edited by mort on Sat 19 Feb, 2011 09:41; edited 1 time in total |
#13 Sat 19 Feb, 2011 09:14 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7191
Location: Borgo San Michele
|
Re: Bbcode Web Tags?
Unfortunately it would not be that easy... I know it's tricky, I've dealt with it in the past.
You know what will be the result of your code? Everyone could insert IFRAMES but only admins will get thet when they visit the topic... and it is not what we wants.
We need to check the permission when adding the BBCode to DB and then display to all users... we just need to check that who added the content had the right permission for doing that.
Anyway, the topic you linked " BBCODE - CUSTOMIZATION - DANGEROUS - How To Allow IFRAME And Full HTML Parsing" should do the job properly (you can call it WEB if you don't like IFRAME, but the result is the same).
If you now just need help with the JS to add also Width and Height parameters, I'll have a look and report back.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#14 Sat 19 Feb, 2011 09:41 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: Bbcode Web Tags?
Don't know MG?
As an unauthorised logged-in person trying to hack the web tags.
If I quote Admin.
[web width=600 height=450]http://www.mysite.com[/web]
And strip the quote as well.
[web width=600 height=450]http://www.mysite.com[/web]
All I get in the post is.
Admin wrote: [View Post]
http://www.mysite.com
http://www.mysite.com
If I change the quoted url to:
[web width=600 height=450]http://www.hotscripts.com/category/cgi-perl/scripts-programs/[/web]
All I get in the post is.
Admin wrote: [View Post]
http://www.hotscripts.com/category/cgi-perl/scripts-programs/
If I click the [web button as a user (Which can be hidden anyway with <!-- IF S_blah blah in the .tpl file.) and try to add the [web tags
All I get in return for the post is.
http://www.hotscripts.com/category/cgi-perl/scripts-programs/
So I can't see how it's going to parse the <iframe html into the code tags when I'm anything other than an ADMIN or MOD.
You know what will be the result of your code? Everyone could insert IFRAMES but only admins will get thet when they visit the topic... and it is not what we wants.
I tried that too with the user both adding tags and quoting Admin.
When the "User" posts or quotes the [web tags, they are invalid because he or she can't call the $html to add the <iframes whether it's quoted or not?
Am I missing something?
Oh oh - Unless it's because I'm using 127.0.0.1 and being denied - but I have no way to test that live!
|
#15 Sat 19 Feb, 2011 11:00 |
|
|
Page 1 of 2
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|