Hacking Dolphin - Smart title tags for articles

by @ 9:44 pm on January 16, 2008.  Filed under Dolphin, PHP, Social Networking

Heres a Tip for you Dolphin hackers

The title tags for Dolphin articles do not reflect the actual article title. This is important for search engine indexing. So here’s how to fix it:

This hack requires modifying two files, first:

articles.php

line 33:
$_page_cont[$_ni]['page_main_code'] = PageCompArticles();

The PageCompArticles() function is responsible for calling subordinate code that displays the article, article list, etc. You can see in the code that it is called first before this:

$_page['header'] = _t( “_ARTICLES_H”, $site['title'] );

This line sets up the <title></title> tag of the page. What we want to do is move this line above line 33:
$_page['header'] = _t( “_ARTICLES_H”, $site['title'] );
$_page_cont[$_ni]['page_main_code'] = PageCompArticles();

Now, when PageCompArticles() is called, the title of the page is already set, so we can feel free to modify it inside the next file:

inc/classes/BxDolArticles.php

Depending on your code, we are looking for about line 230 for this line:

$aArticle = db_arr( $sArticleQuery );

It should be inside the getArticle function.

We want to add the following after the above line:
$sTitle = process_line_output( $aArticle['Title']);
global $_page;
$_page['header']=$sTitle .’ - ‘ .$_page['header'];

Now, when our users visit our article page it will have a page title like so:

Another great article title - mysite title

Also, I suggest that you always put yoursite.com as part of your site title. So if your actual site title is: Best Darn Website add on ” - bestdarnwebsite.com” to the site title (language settings)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists

4 Responses to “Hacking Dolphin - Smart title tags for articles”

  1. MonsterIdeas Says:

    Another great hack by the PitBoss! And it works too! :)

  2. SittingOut Says:

    This was lines 33 and 298 for me. It did not seem to change anything at all.

  3. kelvinq Says:

    Hi.

    Is it possible to allow me to take a look at your results in action?

    I’m from an NGO and we’re looking at building one from Dolphin. Thanks.

    Kelvin

  4. Pit Boss Says:

    I pretty much gave up on dolphin. The code base is hideous and I had to basically undo everything just to upgrade. Dolphin with the hack job Ray modules is not good software IMHO, buggy as hell and you don’t get support.

Post a Comment

Please click here to login to post a comment.

web·pit n. a place of discovery; a repository of information; where coders come for enlightenment; a programmers diary.

internal links:

categories:

search:

archives:

January 2008
M T W T F S S
« Dec   Mar »
 123456
78910111213
14151617181920
21222324252627
28293031  

other:

All content Copyright (c) 2008, Mark Williamson