Automatic backlinks code

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
lib3rty1
Regular
Posts: 19
Joined: Mon May 03, 2010 1:07 am

Automatic backlinks code

Post by lib3rty1 »

Hello,

I am having small problem with puting code from www.automaticbacklinks.com on s9y. I wanted to place that code into fotter. As I have read content.tpl is main file but can`t really find it.

How should or where I shloud place that code ?

Here is the php code:

Code: Select all

http://tny.cz/f63b8c9a
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Automatic backlinks code

Post by Timbalu »

Into the footer of what?
Using the content.tpl is not advised as it is smarty code.
What you need is to copy and paste this code into your php document where you want your links to display. This is commonly the config.inc.php file of your template.
The easiest way (as a hint on how to do in general) could be:

Code: Select all

            ob_start();
            include '/full/path/to/backlinkscode.php';
            $bl_content = ob_get_contents();
            ob_end_clean();
            $serendipity['smarty']->assign('block_backlinks', $bl_content);
which then could be placed into your index.tpl file as {$block_backlinks}.

Or you may also could use the Plugin serendipity_event_externalphp.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
lib3rty1
Regular
Posts: 19
Joined: Mon May 03, 2010 1:07 am

Re: Automatic backlinks code

Post by lib3rty1 »

Into the footer of website. I mean the template I am using now. Just to place it in safe place.

Will try for first with plugin and then I if these won`t work I will try with your code as I don`t want to mess anything up.

How Can I check if I have set this up good ?
Post Reply