How do I hide the Trackbacks links?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
goshawk001
Posts: 1
Joined: Thu Aug 26, 2004 3:01 am

How do I hide the Trackbacks links?

Post by goshawk001 »

Newbie question here:
I want to hide all references to trackbacks as I think they would confuse the people who will use my blog.
What file(s) do I need to edit to remove all trackback references and what edits do I need to make in said files?

Thank you in advance!
Collectonian

Post by Collectonian »

To hide them on the main page, open serendipity_functions.inc.php. In the current version, around line 1260, comment out these lines:

Code: Select all

if (serendipity_db_bool($entry['allow_comments']) || !isset($entry['allow_comments']) || $entry['trackbacks'] > 0 ) {
                    if ( $serendipity['enablePopup'] || !isset($serendipity['GET']['id'])) {
                        $label = $entry['trackbacks'] == 1 ? TRACKBACK : TRACKBACKS;
                        if ($serendipity['enablePopup']) {
                            $uriExtra = ' onclick="window.open(this.href, \'comments\', \'width=480,height=480,scrollbars=yes\'); return false;"';
                            $trackbackUri = $serendipity['serendipityHTTPPath'] . 'comment.php?serendipity[entry_id]=' . (int)$entry['id'] . '&serendipity[type]=trackbacks';
                        } else {
                            $uriExtra = '';
                            $trackbackUri = $entryLink .'#trackbacks';
                        }

                        echo ' | <a href="' . $trackbackUri .'"'. $uriExtra . '>' . $label . ' (' . $entry['trackbacks'] . ')</a>';
                     }
                }
Then further down around line 1335, comment out these lines:

Code: Select all

<div class="serendipity_comments">
            <br />
            <a id="trackbacks"></a>
             <div class="serendipity_commentsTitle"><?php echo TRACKBACKS; ?></div>
                <div class="serendipity_center"><a style="font-weight: normal" href="<?php echo $tbu; ?>" onclick="alert('<?php echo htmlentities(TRACKBACK_SPECIFIC_ON_CLICK) ?>'); return false;" title="<?php echo htmlentities(TRACKBACK_SPECIFIC_ON_CLICK) ?>"><?php echo TRACKBACK_SPECIFIC; ?></a></div><br />
<?php
                    serendipity_printTrackbacks(serendipity_fetchTrackbacks($entry['id']));
?>
            </div>
<?php               } ?>
tomsommer
Core Developer
Posts: 240
Joined: Tue Sep 02, 2003 6:43 pm
Location: Denmark
Contact:

Post by tomsommer »

Or just enable the use of popups
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
Vince-umi

Above solution fails

Post by Vince-umi »

Hi,
I'm also trying to remove the link to trackbacks to display under an entry to avoid confusing users. The links to date and comments are quite enough...

I tried commenting out the lines of code mentionned above (and as many variants as I could invent) but I systematically come up with a parsing error in the same file I removed the lines from.

Any suggestions?

Thanks!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Above solution fails

Post by garvinhicking »

If you get parsing errors, you broke the file. Uncomment only SINGLE lines with a "//" before them. A single lines ends with a ";" and not with a newline (\n)...

If you copy+paste us the code you modified, we can tell you what error you made...

Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Vince-umi

Dreamweaver's fault!

Post by Vince-umi »

Got it!

I followed your instructions and double checked I had commented the right lines out (even though I don't know what a (\n) is) but it was still not working.

After much testing and trial and error I realised that even when I undid my changes to the file, it ended up with an extra 3 Kb! I suddenly remembered that Dreamweaver and FrontPage are known to change the code, so I went in and did my changes on a text editor instead.

Works like a charm! So well, in fact, that I am going to start another thread with questions about embedding the blog into an HTML file. :wink:

I hope the answer will be as simple...

Thankas again!
Brein

trackbacks removal

Post by Brein »

I have removed these lines below from the entries.tpl out of the /templates/default/ -folder:

{if $entry.has_trackbacks}
{if $use_popups}
| <a href="{$entry.link_popup_trackbacks}" onclick="window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;">
{$entry.label_trackbacks} ({$entry.trackbacks})</a>
{else}
| <a href="{$entry.link}#trackbacks">{$entry.label_trackbacks} ({$entry.trackbacks})</a>
{/if}
{/if}

{if $entry.is_entry_owner and not $is_preview}
| <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>
{/if}

{$entry.add_footer}
</div>
</div>
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description
rdf:about="{$entry.link_rdf}"
trackback:ping="{$entry.link_trackback}"
dc:title="{$entry.title}"
dc:identifier="{$entry.rdf_ident}" />
</rdf:RDF>
-->
{$entry.plugin_display_dat}

{if $is_single_entry and not $use_popups and not $is_preview}
{if $CONST.DATA_UNSUBSCRIBED}
<br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_UNSUBSCRIBED|@sprintf:$CONST.UNSUBSCRIBE_OK}</div><br />
{/if}

{if $CONST.DATA_TRACKBACK_DELETED}
<br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_TRACKBACK_DELETED|@sprintf:$CONST.TRACKBACK_DELETED}</div><br />
{/if}


{if $CONST.DATA_TRACKBACK_APPROVED}
<br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_TRACKBACK_APPROVED|@sprintf:$CONST.TRACKBACK_APPROVED}</div><br />
{/if}

{if $CONST.DATA_COMMENT_DELETED}
<br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_COMMENT_DELETED|@sprintf:$CONST.COMMENT_DELETED}</div><br />
{/if}

{if $CONST.DATA_COMMENT_APPROVED}
<br /><div class="serendipity_center serendipity_msg_notice">{$CONST.DATA_COMMENT_APPROVED|@sprintf:$CONST.COMMENT_APPROVED}</div><br />
{/if}

<div class="serendipity_comments">
<br />
<a id="trackbacks"></a>
<div class="serendipity_commentsTitle">{$CONST.TRACKBACKS}</div>
<div class="serendipity_center">
<a rel="nofollow" style="font-weight: normal" href="{$entry.link_trackback}" onclick="alert('{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape:htmlall}'); return false;" title="{$CONST.TRACKBACK_SPECIFIC_ON_CLICK|@escape}">{$CONST.TRACKBACK_SPECIFIC}</a>
</div>
<br />
{serendipity_printTrackbacks entry=$entry.id}
</div>
{/if}

and it worked quite well.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: trackbacks removal

Post by garvinhicking »

Bren, never modify the files in the default template folder. Always create your own template if you modify something.

For details, visit the Documentation section of our Wiki at www.s9y.org

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hugo H

Re: trackbacks removal

Post by Hugo H »

garvinhicking wrote:Bren, never modify the files in the default template folder. Always create your own template if you modify something.

For details, visit the Documentation section of our Wiki at www.s9y.org

Regards,
Garvin
I do agree it is not the way it should be, but I found the suggestion somewhere else in this forum.
And since my version(latest) doesn't have a serendipity-functions-inc.php
I had to find something.
mikezilla

Removing trackbacks link

Post by mikezilla »

The method listed at the top of this topic is outdated. For 0.8.2 I found the following to work:

In "include/function_entries.inc.php" I commented out these lines (631 to 634) and the link magically vanished!

Code: Select all

            /*if (serendipity_db_bool($entry['allow_comments']) || !isset($entry['allow_comments']) || $entry['trackbacks'] > 0) {
                $entry['has_trackbacks']    = true;
                $entry['label_trackbacks']  = $entry['trackbacks'] == 1 ? TRACKBACK : TRACKBACKS;
            }*/
I am totally new to the blogging scene, so if someone notices some other functionality that I am breaking by this, please let me know. But for now, this seems to be the way to do it.
mikezilla

Oops

Post by mikezilla »

Well, that last bit of work removed the link, but when you click to make comments, there is still stuff in there to allow trackbacks. I'm just a little too new to know where to look for that stuff.
gwilsonmail
Regular
Posts: 146
Joined: Tue Jul 12, 2005 9:12 pm
Location: Ottawa, Canada
Contact:

Post by gwilsonmail »

--
Last edited by gwilsonmail on Thu Jul 28, 2005 8:06 pm, edited 1 time in total.
gw
gwilsonmail
Regular
Posts: 146
Joined: Tue Jul 12, 2005 9:12 pm
Location: Ottawa, Canada
Contact:

Post by gwilsonmail »

if you don't want to see the comments or trackback links ar the end of the post you can turn off comments in the article entry and these two entries won't be displayed when the article is displayed.
gw
gwilsonmail
Regular
Posts: 146
Joined: Tue Jul 12, 2005 9:12 pm
Location: Ottawa, Canada
Contact:

Post by gwilsonmail »

Would it be possible to create a plugin and/or change the core so the entry status line:

Code: Select all

Posted by gizmocha in photo album at 22:54 | Comments (0) | Trackbacks (0) | Edit entry 
can be configured more fully?

I'd like to see options so that this info can be

-before
-after

the article

If an editor is logged-in then options to
- edit
- delete
- change category (supporting multiple categories)
- tags

would be displayed either as small text or as small icons.

Perhaps a simple font size sty;e change could also exist, so it's easy to configure the size of the entry relative to the body text. use a relative font directive - bigger, smaller (can't remember exact syntax).

The display text should be simple to change as well - so I can change edit entry to edit. Remember the text in this line comes from various places.

Future additions would be added to this core or plugin file rather than to multiple plugins as happens now - which is very confusing and inconsistent. As s9y has grown and improved it might be time to consider consolidating some plugins to the core.

example of inconsistency - the edit entry doesn't appear in the preview window, but the delete entry does. That's because the delete entry is in a seperate plugin.

Another problem with the current s9y is that once you get your blog setup and want to change something it's very easy to get lost - is that delete entry in a template or a plugin? If you weren't the blog developer you'd never know from looking at the output!

It's still the best blog software and the best supported product i've come across! Thanks for an excellent product.
gw
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

Post by MySchizoBuddy »

what do these commenting out code do.
Do they totally disable trackbacks,
or they disable "display" of trackbacks. I don't want to disable it completely, just don't display it on the page and perhaps add tracks in my administration area so i can view em.

gwilsonmail under entries.tpl u can move the position of all of these things and or delte em as well.

one thing that would be nice is if there r no comments then donn't show the comments section only show the addcomment section.
Post Reply