Author |
Message |
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Sat Jul 02, 2011 3:19 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
I don't really know where to look anymore, so it might not be as elegant, but I could offer a work-around.
First, revert to whatever gave you something like this:
http://www.mydomainroot.com/http://www.linkedin.com/pub/angel-rosado/1b/ab9/646
I don't have your exact code, but in viewtopic and viewprofile you probably have something that currently looks like this, except for LinkedIn:
facebook_profile_url ($profiledata['user_facebook'])
Let's try to add this to the line before that:
Code: | $linkedin = preg_replace ($_SERVER['$HTTP_HOST'] . '/', "", facebook_profile_url ($profiledata['user_facebook'])); // (edit to the actual function name and database entry for LinkedIn) |
Then replace the blue line above to
$linkedin
That will effectively remove your domain's URL from the string, thus allowing your users to post the entire URL. |
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Sat Jul 02, 2011 3:39 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
I have tried to use your snippet,
and to summarize, I have changed in viewtopic.php the parts involved according to your instructions, into this:
Code: | $linkedin = preg_replace ($_SERVER['$HTTP_HOST'] . '/', "", linkedin_profile_url ($postrow[$i]['user_linkedin']));
$linkedin_img = ( $postrow[$i]['user_linkedin'] ) ? '<a target="_blank" href="' . $linkedin . '"><img src="' . $images['icon_linkedin'] . '" alt="' . $lang['Profile_linkedin'] . '" title="' . $lang['Profile_linkedin'] . '" border="0" /></a>' : ''; |
...and in usercp_viewprofile.php into this:
Code: | $linkedin = preg_replace ($_SERVER['$HTTP_HOST'] . '/', "", linkedin_profile_url ($profiledata['user_linkedin']));
$linkedin_img = ( $profiledata['user_linkedin'] ) ? '<a target="_blank" href="' . $linkedin . '"><img src="' . $images['icon_linkedin'] . '" alt="' . $lang['Profile_linkedin'] . '" title="' . $lang['Profile_linkedin'] . '" border="0" /></a>' : ''; |
Now when I open my viewtopic I have this error:
Warning: preg_replace() [function.preg-replace]: No ending delimiter '/' found in /board/viewtopic.php on line 2623
Line 2623 in viewtopic.php is:
Code: | $linkedin = preg_replace ($_SERVER['$HTTP_HOST'] . '/', "", linkedin_profile_url ($postrow[$i]['user_linkedin'])); |
|
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Sat Jul 02, 2011 3:57 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
My bad, it's been a while.
Code: | $linkedin = preg_replace ("/http:\/\/" . $_SERVER['HTTP_HOST'] . "\//", "", linkedin_profile_url ($postrow[$i]['user_linkedin'])); |
Hopefully that will work. |
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Sat Jul 02, 2011 4:00 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
nothing,
I have just replaced the line with the new code, but still the same exact error... still in viewtopic.php, same line (
sorry to give you all these problems |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Sat Jul 02, 2011 4:07 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
Hmph, missing one slash. See above, I edited the code. |
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Sat Jul 02, 2011 4:15 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
A lot of credit to you Salvados!!!
PROBLEM SOLVED
board url not parsed anymore, and copy/paste url linkedin works with no problems
Thanks so so so much!!! |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Sat Jul 02, 2011 4:20 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
Well, it's really just a work-around, but I'm glad it's at least functional ^^ |
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Tue Jul 05, 2011 12:44 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
Hi Salvatos!
I am back here to make you a request..... where possible!
All these mods....based on the original facebook mod (and including this original one) have a problem.
Well, its not really a problem... I will try to explain you
When a user, in registration or inside the profile don't fill one or all the fields (facebook, myspace, twitter etc...)
these fields are showing up anyway (as EMPTY rows) when you look at these users profile. So Even if they are empty, they are showing up, as empty.
Is there any way to prevent this to happen? For example...put some "check" to phpbb which says:
If you don't fill the Facebook field, I will not show the Facebook field in your profile!
If you fill it, instead, it will be shown
I hope I have been clear enough
Thanks! |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Tue Jul 05, 2011 12:46 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
Hide Empty Fields in User Profile? _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Tue Jul 05, 2011 12:47 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
ohhhh thanks for this!
I will look at it later tonight |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Tue Jul 05, 2011 1:01 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
You will have to adjust the MOD a little bit for the new fields you added but that is easy. _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Wed Jul 06, 2011 10:05 am Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
dogs and things wrote: | You will have to adjust the MOD a little bit for the new fields you added but that is easy. |
All done! it was really simple
thanks again for your help |
|
Back to top |
|
|
ognitus. Board Member
Joined: 29 Sep 2013
Posts: 3
|
Posted: Sun Sep 29, 2013 8:53 pm Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
Hi,
I don't know if I'm gonna get any help on this, because this is old thread, but what a hell i'll try:
so I tried to install Facebook on Profile Hack.zip provided by dogs and things and everything up until uploading lang_main.php file to the server was okay and working. After i upload that file i get this error:
Quote: | On firefox:
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
On Chrome:
ERR_CONTENT_DECODING_FAILED
On IE:
This page can't be displayed
|
Any thoughts why? Because the hack works, I can add facebook ID and everything else shows up (the icon and etc.), the id adds also on sql database and etc., but after I upload the language file the forum crashes down. |
|
Back to top |
|
|
StarWolf3000 Board Member
Joined: 10 Jun 2010
Posts: 175 Location: Germany
|
Posted: Mon Sep 30, 2013 5:57 am Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
ognitus. wrote: | Hi,
I don't know if I'm gonna get any help on this, because this is old thread, but what a hell i'll try:
so I tried to install Facebook on Profile Hack.zip provided by dogs and things and everything up until uploading lang_main.php file to the server was okay and working. After i upload that file i get this error:
Quote: | On firefox:
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
On Chrome:
ERR_CONTENT_DECODING_FAILED
On IE:
This page can't be displayed
|
Any thoughts why? Because the hack works, I can add facebook ID and everything else shows up (the icon and etc.), the id adds also on sql database and etc., but after I upload the language file the forum crashes down. |
Do you have GZip enabled in the Board Settings? If yes, then disable it.
Also it could help to upload your current lang_main.php here as lang_main.php.txt (because .php is not allowed for attachments). |
|
Back to top |
|
|
ognitus. Board Member
Joined: 29 Sep 2013
Posts: 3
|
Posted: Mon Sep 30, 2013 8:33 am Post subject: Re: Twitter & LinkedIn integration... profile or signatu |
|
|
Thanks so much! I turned GZip off and now it's okay. What did that function do that it effected language file? |
|
Back to top |
|
|
|