Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Links to Facebook, Linkedin etc
Avatar
Stefano Prete
Melbourne, Australia
Member
Free Members
Offline
Jun 23, 2013 - 5:28 pm

Hi guys.

I have a small problem and I hope someone will help me to solve.

I have a plugin installed, called WP-Biographia. Really nice, it puts small icons to the bottom of each post/page. They are linked to Facebook, Linkedin and so on.

The links required must be like "http://www.facebook.com/stefano". They must be written inside the user profile. Unfortunately, SP reads those URL and the identities don't work. SP needs just "/stefano". But if I put "/stefano" in SP, the links in WP-Biographia don't work anymore! Pretty much, WP reads the links from SP.

Same thing with Linkedin, Google+ etc.

Is there a way to modify the system somewhat, so they will both work?

Thank you very much.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 23, 2013 - 7:06 pm

sorry, not really following you....  can you explain further what you are doing?

we already have identities like that in our profile... and displayed in the user info for each post...

are you saying that this other plugin is using the same data fields in a users db info for those fields?

Avatar
Stefano Prete
Melbourne, Australia
Member
Free Members
Offline
Jun 24, 2013 - 4:33 am

I don't know how it works, Steve...

Let's use my Linkedin account... The link is http://www.linkedin.com/in/stefanoprete

In the SP user profile we need to put only /in/stefanoprete and it works perfectly.

But in the WP user profile (that's where WP-Biography gets the link from) we need to put http://www.linkedin.com/in/stefanoprete

So I did that. But when I do, the links in the SP profiles return a 404, because the link shown becomes http://www.linkedin.com/proble.....efanoprete

So it's like SP already add http://www.linkedin.com automatically.

I hope I have been able to explain myself better this time...

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 24, 2013 - 1:34 pm

yes, we automatically add the base url in...  but that does mean what I asked... that somehow, that other plugin and simple press has chose the same db table and db entry name for the options...  not easy to occur. ;)

and no easy way around...  we wont be changing ours because way too many users already using it and we cannot break it for them...

best I can offer you currently, is to filter each of those urls to clean them up.  in other words, go ahead and require the full url in the sp profile... as you note, you end up with:

http://www.linkedin.com/problem-with-post-edit-buttonttp://www.linkedin.com/in/stefanoprete

the you can use the 'sph_PostIndexUserLinkedIn' filter to clean up the url for simple press...

there is a similar filter for each of the identities... see:  http://codex.simple-press.com/.....opic-view/

Avatar
Stefano Prete
Melbourne, Australia
Member
Free Members
Offline
Jun 25, 2013 - 6:35 am

Steve...Sorry, but I am really dumb...

I went there, looked at everything and I have NO IDEA about what I need to do...

I don't know which code i need to put and where...frown

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 25, 2013 - 2:40 pm

something like this for linked in...

add_filter('sph_PostIndexUserLinkedIn', 'my_ln_url');
function my_ln_url($content) {
    $content = str_replace('http://www.linkedin.com/problem-with-post-edit-buttonttp://www.linkedin.com/in/', 'http://www.linkedin.com/in/', $content);
    return $content;
}

then repeat (with proper hook) for other identities...

this would go in your spFunctions.php file of your sp theme...  as always, make sure you have your own sp theme and are not editing ours...

Avatar
Stefano Prete
Melbourne, Australia
Member
Free Members
Offline
Jun 25, 2013 - 5:04 pm

Steve, it doesn't work...

I have added this:

add_filter('sph_PostIndexUserLinkedIn', 'my_ln_url');
function my_ln_url($content) {
    $content = str_replace('http://www.linkedin.com/problem-with-post-edit-buttonttp://www.linkedin.com/in/', 'http://www.linkedin.com/', $content);
    return $content;
}

and the URL become http://www.linkedin.com/problem-with-post-edit-buttonttp://www.linkedin.com/in/stefanoprete

We need to find a way to remove the first http://www.linkedin.com
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 26, 2013 - 2:12 am

well sounds like that means the other plugin is running late.. after our stuff...  so you might try

add_filter('the_content', 'my_ln_url', 9999);
function my_ln_url($content) {
    $content = str_replace('http://www.linkedin.com/problem-with-post-edit-buttonttp://www.linkedin.com/in/', 'http://www.linkedin.com/in/', $content);
    return $content;
}

and catch it after everyone is done mucking with the content...  I have no way to test this, so kind of shooting in the dark...

Avatar
Stefano Prete
Melbourne, Australia
Member
Free Members
Offline
Jun 26, 2013 - 5:30 am

Nothing, Steve. Still the same. confused

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 26, 2013 - 10:10 am

then I am afraid I do not understand how they are getting the extra links in there...

are you sure the pattern you gave me is correct?  it must be exact, because we are searching for that string in the page content to replace it... not sure how it would not be found...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625