Results 1 to 7 of 7
  1. #1
    Casual Pligger The Humanaught's Avatar
    Joined
    Jun 2006
    Posts
    79

    Question Trackback Linkback Wrong

    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!!

  2. #2
    Casual Pligger The Humanaught's Avatar
    Joined
    Jun 2006
    Posts
    79

    Wait... wait... I figured it out.

    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.

  3. #3
    Pligg Developer/Admin kbeeveer46's Avatar
    Joined
    Jun 2006
    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/";


  4. #4
    New Pligger SeanW's Avatar
    Joined
    Jan 2007
    Posts
    13

    What about for long story names?

    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

  5. #5
    New Pligger SeanW's Avatar
    Joined
    Jan 2007
    Posts
    13

    Lightbulb a fix?

    I've been tracing this one further, is there any way of using getmyurl() instead of get_permalink from within libs/trackback.php?

  6. #6
    Pligg Developer/Admin kbeeveer46's Avatar
    Joined
    Jun 2006
    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

  7. #7
    New Pligger SeanW's Avatar
    Joined
    Jan 2007
    Posts
    13
    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

Similar Threads

  1. Trackback URL
    By sanoba in forum Questions & Comments
    Replies: 0
    Last Post: 09-18-2008, 01:15 AM
  2. What is trackback value mean?
    By bbrian017 in forum Questions & Comments
    Replies: 0
    Last Post: 06-06-2008, 11:51 AM
  3. Trackback
    By Geoserv in forum Questions & Comments
    Replies: 1
    Last Post: 02-03-2008, 03:49 PM
  4. No Trackback on 9.5?
    By paulocon in forum Questions & Comments
    Replies: 0
    Last Post: 08-17-2007, 12:39 AM
  5. TrackBack what it is for
    By dolec in forum Questions & Comments
    Replies: 1
    Last Post: 12-15-2006, 06:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting