Trackback Linkback Wrong

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2006, 01:15 AM
Casual Pligger
 
Join Date: Jun 2006
Posts: 79
Greetings all, day four of the Great Pligg Upgrade and I've found a problem that I think is easy to fix for someone with some PHP knowledge. That person, sadly, is not me.

Basically, the trackback is working fine in that when a user submits a new story, and the Trackback field is filled out properly in the submission, the PLIGG SITE sends a trackback to the original SOURCE site. This is particularly useful for sites that PLIGG a lot of blogs -- as the trackback often appears in the comments, giving viewers of the comments a chance to click over to the PLIGG SITE (added traffic,etc) via a linkback URL to the PLIG SITE's story page relating to the trackback'd post.

Ok, I know that's a bit confusing, as it literally goes in circles - but try following, as the problem comes next:

Whereas the setting in the Config2.php file gives a name to the commenter (say, PLIGG SITE NAME), it does nothing to change the commenter's URL (say, http://www.PLIGGSITE.com). The settings for this, I think, are in the libs/trackback.php file.

Currently it is set up as this:
[base_url]/story/story_id (ie. www.pliggsite.com/story/512)

But it should be:
[base_url]/[pligg_subdir]/story/story_id (ie. www.pliggsite.com/pliggsubdir/story/512)

It's currently not set up for sites that have installed Pligg in a subdirectory of their main site.

Can anyone suggest how to fix this? Confirm that it does indeed centre around the libs/trackback.php file?

Thanks a load!!
Reply With Quote
  #2 (permalink)  
Old 10-15-2006, 11:26 AM
Casual Pligger
 
Join Date: Jun 2006
Posts: 79
Hey, so if you're having problems with this too... here are the things I had to do to get Trackbacks working on my site - installed with v8.1.0.0.010.01.1.11.2.3.4..5.4 (alright... I made up everything after the 8.1.0 part... c'mon guys... get the darn thing out of Beta!).

1) In LIBS/TRACKBACK.PHP: I read someplace else that I needed to add
Code:
global $trackbackURL;
in around line 71 of libs/trackback.php.

Before:
PHP Code:
// Send a Trackback
    
function send() {
        if (empty(
$this->url))
                return; 


After:
PHP Code:
// Send a Trackback
    
function send() {
        global 
$trackbackURL;
        if (empty(
$this->url))
                return; 


2) In LIBS/UTILS.PHP: This was what was catching me up in the post above. #1 will get it so the trackbacks are sent to the source site, but if you're Pligg is installed in a subdir on your site, the linkback URLs will be wrong.

So, after staring at the computer and begging it to just work for hours... finally I followed the wires back to their sources and realized I just needed to change the permalink setting in the libs/utils.php file (in around line 162/163).

Before:
PHP Code:
function get_permalink($id) {
    return 
"http://".get_server_name()."/story/$id/";



After:
PHP Code:
function get_permalink($id) {
    return 
"http://".get_server_name()."/YOURPLIGGSUBDIR/story/$id/";



I've tested it on my site (see sig.) and it works. Hope that helps anyone else that might be staring at their monitor trying to fix this, and only getting a silent hum in return.
Reply With Quote
  #3 (permalink)  
Old 10-15-2006, 11:35 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
I haven't tested this but the second "after" box can be fixed by using a variable instead of hardcoding your subdirectory.

PHP Code:
function get_permalink($id) {
    return 
"http://".get_server_name() $my_pligg_base ."/story/$id/";

Reply With Quote
  #4 (permalink)  
Old 01-05-2007, 02:52 PM
New Pligger
 
Join Date: Jan 2007
Posts: 13
Send a message via Skype™ to SeanW
I just was tracing a problem and found that the url sent in the trackback is not the canonical url of the story.

ie

The real url of the story is http://pliggsite.com/cat/mystory

what gets pinged to the remote site is

http://pliggsite.com/story/42

This is fine for web users because anyone going to /story/42 gets 301'ed to /cat/mystory. However, some blogs will automatically request the url to make sure there is a backlink (as a spam check). In the case I was looking at, PHP Spam Karma got the 301 redirect but didn't follow it so it got dropped.

Sean
Reply With Quote
  #5 (permalink)  
Old 01-07-2007, 11:42 AM
New Pligger
 
Join Date: Jan 2007
Posts: 13
Send a message via Skype™ to SeanW
I've been tracing this one further, is there any way of using getmyurl() instead of get_permalink from within libs/trackback.php?
Reply With Quote
  #6 (permalink)  
Old 01-07-2007, 02:24 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
SeanW, are you talking about this line?
Code:
$url = urlencode(get_permalink($this->link));
We actually fixed the permalink function the other night http://pligg.svn.sourceforge.net/vie...89&pathrev=590
Reply With Quote
  #7 (permalink)  
Old 01-07-2007, 03:14 PM
New Pligger
 
Join Date: Jan 2007
Posts: 13
Send a message via Skype™ to SeanW
Quote:
Originally Posted by kbeeveer46 View Post
SeanW, are you talking about this line?
Code:
$url = urlencode(get_permalink($this->link));
We actually fixed the permalink function the other night http://pligg.svn.sourceforge.net/vie...89&pathrev=590
Thanks, that's the one!

Sean
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong Refferer Update eiro0701 Questions and Comments 17 08-20-2009 10:24 PM
Pligg 1.0.0 - Wrong Referrer Tembargo Questions and Comments 0 08-05-2009 03:35 AM
Trackback tip Geoserv Questions and Comments 11 07-31-2008 11:52 PM
trackback url auto discovery chrispian Questions and Comments 0 04-10-2007 09:54 PM
Use of trackback? agiacosa Questions and Comments 4 06-29-2006 06:14 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development