Go Back   Pligg Forum > Pligg Help > General Help
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2006, 12:15 AM
The Humanaught The Humanaught is offline
Casual Pligger
 
Join Date: Jun 2006
Posts: 86
Downloads: 8
Uploads: 0
Thanks: 8
Thanked 12 Times in 6 Posts
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!!
__________________
The Hao Hao Report: The Best Stories About China
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-15-2006, 10:26 AM
The Humanaught The Humanaught is offline
Casual Pligger
 
Join Date: Jun 2006
Posts: 86
Downloads: 8
Uploads: 0
Thanks: 8
Thanked 12 Times in 6 Posts
Thumbs up 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.
__________________
The Hao Hao Report: The Best Stories About China
Reply With Quote
The Following 2 Users Say Thank You to The Humanaught For This Useful Post:
  #3 (permalink)  
Old 10-15-2006, 10:35 AM
kbeeveer46's Avatar
kbeeveer46 kbeeveer46 is offline
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,579
Downloads: 62
Uploads: 6
Thanks: 255
Thanked 651 Times in 515 Posts
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/";

__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
  #4 (permalink)  
Old 01-05-2007, 01:52 PM
SeanW SeanW is offline
Send a message via Skype™ to SeanW
New Pligger
 
Join Date: Jan 2007
Posts: 22
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 5 Times in 3 Posts
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
__________________
recipes and kitchen hints
Reply With Quote
  #5 (permalink)  
Old 01-07-2007, 10:42 AM
SeanW SeanW is offline
Send a message via Skype™ to SeanW
New Pligger
 
Join Date: Jan 2007
Posts: 22
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 5 Times in 3 Posts
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?
__________________
recipes and kitchen hints
Reply With Quote
  #6 (permalink)  
Old 01-07-2007, 01:24 PM
kbeeveer46's Avatar
kbeeveer46 kbeeveer46 is offline
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,579
Downloads: 62
Uploads: 6
Thanks: 255
Thanked 651 Times in 515 Posts
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
__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
The Following 2 Users Say Thank You to kbeeveer46 For This Useful Post:
  #7 (permalink)  
Old 01-07-2007, 02:14 PM
SeanW SeanW is offline
Send a message via Skype™ to SeanW
New Pligger
 
Join Date: Jan 2007
Posts: 22
Downloads: 0
Uploads: 0
Thanks: 2
Thanked 5 Times in 3 Posts
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
__________________
recipes and kitchen hints
Reply With Quote
Reply



Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Trackback identified as Anonymous boyles Bug Report 11 04-17-2008 06:24 PM
Trackback skiper General Help 11 01-13-2007 04:04 PM
Trackback Max "Mollio-Beat" 3 09-11-2006 09:40 PM
Use of trackback? agiacosa Suggestions 4 06-29-2006 05:14 AM
Trackback website-name missing cryptkeeper Bug Report 0 02-03-2006 12:56 AM


LinkBacks Enabled by vBSEO 3.0.0