RSS iconTwitter iconFacebook icon

The Trek BBS title image

The Trek BBS statistics

Threads: 138,413
Posts: 5,360,099
Members: 24,631
Currently online: 415
Newest member: vicky013


Welcome! The Trek BBS is the number one place to chat about Star Trek with like-minded fans. Please login to see our full range of forums as well as the ability to send and receive private messages, track your favourite topics and of course join in the discussions.

If you are a new visitor, join us for free. If you are an existing member please login below. Note: for members who joined under our old messageboard system, please login with your display name not your login name.


Go Back   The Trek BBS > Entertainment & Interests > Web Sites/Design

Web Sites/Design Talk about your websites here!

Reply
 
Thread Tools
Old May 1 2010, 12:29 AM   #1
subatoi
Lieutenant
 
Facebook's sharer on php?

I have a Trek-php site. I want to add the FB sharer:
http://www.facebook.com/facebook-widgets/share.php

but I get an HTML-tags error message. Can this be solved? I want to try this thing on my site.

Thanks!
subatoi is offline   Reply With Quote
Old May 1 2010, 01:31 AM   #2
Robert Maxwell
Not Your Toy
 
Robert Maxwell's Avatar
 
Location: A broken roof
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: Facebook's sharer on php?

What's the error message? Those are produced for a reason!
__________________
It's all false love and affection
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old May 1 2010, 12:12 PM   #3
subatoi
Lieutenant
 
Re: Facebook's sharer on php?

It simply says:
"The html tags you attempted to use are not allowed"

That's all.
subatoi is offline   Reply With Quote
Old May 1 2010, 05:03 PM   #4
Robert Maxwell
Not Your Toy
 
Robert Maxwell's Avatar
 
Location: A broken roof
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: Facebook's sharer on php?

That's going to be an issue with the site you're trying to deploy it on. Where are you trying to use this Facebook Share button?
__________________
It's all false love and affection
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old May 1 2010, 06:23 PM   #5
subatoi
Lieutenant
 
Re: Facebook's sharer on php?

Next to a text I upload.
I don't understand much in PHP, so keep it simple
subatoi is offline   Reply With Quote
Old May 1 2010, 09:15 PM   #6
Robert Maxwell
Not Your Toy
 
Robert Maxwell's Avatar
 
Location: A broken roof
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: Facebook's sharer on php?

Do you have a link or something? There are not many tags in this:

Code:
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
I suspect it's the "script" tag that is forbidden. Whatever PHP software you are using is filtering out certain HTML tags. That's why I'm asking what you're deploying this on. There may or may not be an easy way to get the "script" tag allowed, but I cannot determine that without knowing what PHP program you're using.
__________________
It's all false love and affection
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old May 2 2010, 01:20 PM   #7
subatoi
Lieutenant
 
Re: Facebook's sharer on php?

Oh, now I understand what you mean. That's the site:
www.Starbase972.com
subatoi is offline   Reply With Quote
Old May 2 2010, 02:00 PM   #8
Robert Maxwell
Not Your Toy
 
Robert Maxwell's Avatar
 
Location: A broken roof
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: Facebook's sharer on php?

Bingo! You're using PHP-Nuke.

Open your config.php file and look for "$AllowableHTML". You should see something like this:

Code:
$AllowableHTML = array("b"=>1,
         "i"=>1,
         "a"=>2,
         "em"=>1,
         "br"=>1,
         "strong"=>1,
         "blockquote"=>1,
         "tt"=>1,
         "li"=>1,
         "ol"=>1,
         "H1"=>1,
         "H2"=>1,
         "H3"=>1,
         "H4"=>1,
         "center"=>1,
         "img"=>2,
         "alt"=>1,
         "table"=>2,
         "tr"=>2,
         "td"=>2,
         "p"=>2,
         "div"=>2,
         "font"=>2,
         "p"=>1,
         "p"=>1,
         "ul"=>1);
In the middle of that block, add this line:

Code:
         "script"=>2,
Save your config.php file and try to add the Facebook Share button again.

Let me know if that works for you!
__________________
It's all false love and affection
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old May 3 2010, 06:40 PM   #9
subatoi
Lieutenant
 
Re: Facebook's sharer on php?

OK... now all I need to know is where to find that config.php file. Supposed to be on the site files somewhere?
(I got this site, I didn't build it myself... )
subatoi is offline   Reply With Quote
Old May 3 2010, 07:27 PM   #10
Robert Maxwell
Not Your Toy
 
Robert Maxwell's Avatar
 
Location: A broken roof
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: Facebook's sharer on php?

Yeah, just do a scan down your files for "config.php". There should be only one! If in doubt, use the one with the most recent timestamp on it.
__________________
It's all false love and affection
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old May 4 2010, 12:42 AM   #11
subatoi
Lieutenant
 
Re: Facebook's sharer on php?

In the latest of about 10-15 files, I've added that somwhere in the middle, and it still gives me the same message
Unless it changes where exactly I add it...?
subatoi is offline   Reply With Quote
Old May 4 2010, 03:52 AM   #12
Robert Maxwell
Not Your Toy
 
Robert Maxwell's Avatar
 
Location: A broken roof
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: Facebook's sharer on php?

No, it doesn't matter where in the array you add it. Very odd.

Could you possibly take a screenshot of the error you're getting and post it here, or PM it to me? I will see what else I can dig up. You should also go through your PHP-Nuke configuration and see if you are restricting HTML tags anywhere, because that's the source of your problem. You need to allow the "script" tag.
__________________
It's all false love and affection
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old May 4 2010, 08:37 AM   #13
subatoi
Lieutenant
 
Re: Facebook's sharer on php?

Robert Maxwell wrote: View Post
You should also go through your PHP-Nuke configuration and see if you are restricting HTML tags anywhere, because that's the source of your problem. You need to allow the "script" tag.
If I only knew where to start...
Maybe I'll try one of the other "config.php" files.


A screenshot:
http://forums.ort.org.il/files/213/2567819/7932889.JPG
subatoi is offline   Reply With Quote
Old May 4 2010, 12:37 PM   #14
Robert Maxwell
Not Your Toy
 
Robert Maxwell's Avatar
 
Location: A broken roof
View Robert Maxwell's Twitter Profile Send a message via ICQ to Robert Maxwell Send a message via AIM to Robert Maxwell Send a message via Windows Live Messenger to Robert Maxwell Send a message via Yahoo to Robert Maxwell
Re: Facebook's sharer on php?

Something else to make sure of: check the AllowableHTML array in your config.php, and make sure it has this:

Code:
"a"=>2,
The "2" is important, because that's what lets you have attributes on the link tag.

Also, in mainfile.php, look for this block of code:

Code:
foreach ($_GET as $secvalue) { 
    if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*object*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*style*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*form*\"?[^>]*>", $secvalue)) || 
        (eregi("\([^>]*\"?[^)]*\)", $secvalue)) || 
        (eregi("\"", $secvalue))) { 
   die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]"); 
    } 
} 

foreach ($_POST as $secvalue) { 
    if ((eregi("<[^>]script*\"?[^>]*>", $secvalue)) ||  (eregi("<[^>]style*\"?[^>]*>", $secvalue))) { 
        die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]"); 
    } 
}
Replace it with this:

Code:
foreach ($_GET as $secvalue) { 
    if ((eregi("<[^>]*object*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*style*\"?[^>]*>", $secvalue)) || 
        (eregi("<[^>]*form*\"?[^>]*>", $secvalue)) || 
        (eregi("\([^>]*\"?[^)]*\)", $secvalue)) || 
        (eregi("\"", $secvalue))) { 
   die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]"); 
    } 
} 

foreach ($_POST as $secvalue) { 
    if ((eregi("<[^>]script*\"?[^>]*>", $secvalue)) ||  (eregi("<[^>]style*\"?[^>]*>", $secvalue))) { 
        die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]"); 
    } 
}
(I just removed the security check for "script" tags.)
__________________
It's all false love and affection
The Journeyman - Buy it now! Maybe?
My world simulation project!
My blog
Robert Maxwell is offline   Reply With Quote
Old May 7 2010, 12:59 AM   #15
subatoi
Lieutenant
 
Re: Facebook's sharer on php?

Checked the two things. Nope.

Is there a point checking another config.php? There are some that are not on the main directory.
subatoi is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
FireFox 2+ or Internet Explorer 7+ highly recommended.