Documentation for Link Server Command Center dfhu.org

Table of Contents

Basic Overview of CCenter (view fullscreen)

CCenter Described in One Paragraph

Ccenter is composed of a server which gets updates on new pages in your network of websites when pages are first viewed. The pages of your network have a bit of PHP code which calls the server to display links, snippets of HTML code or replace words in blocks of text with inline links. Using the server interface you can search through the URLs of your Network for pages with relevant keywords to add massive amounts of targeted links to your money making sites. Tagging as well as Globbing can also be used to further organize your links and pages.

Introduction to CCenter

CCenter is a tool for managing a large number of links or HTML snippets over many domains from one place. Think "SEO Empire." In this document we call the SEO Empire your "network." It is not an accident that the color scheme of CCenter is black, white, grey and blue (for the respective "Hats" of SEO).

CCenter is a server-client softwhere. The ccenter server runs on one domain where you control all the links on other client pages/domains. The ccenter clients are pages in your network that you place snippets of PHP code and/or PHP include files to serve links or snippets of code.

Links can be displayed on the client pages either as a series of links with before and after tags (i.e <br>, <li> and </li>) or links can be displayed "inline." With the inline usage, words within a block of text can be replaced with links. The inline method uses the matched words and the words around it as link anchor text. The inline method is truly powerful, covert and effective when it comes to SEO and monetization.

Links can be managed by "searching-and-propagating," "globing" or "tagging."

After a page on your network has been viewed it will show up in the command center. Once it shows up in the command center you can use searching-and-propagating to search through the urls of your sites' pages and for keywords used by browsers finding your site via Google™, Yahoo™. and MSN™. Links can then be propagated to these pages. This method should be used for fine grain control over the quality of links and to avoid site wide links.

Globbing is the ability to search for keywords in the url (including the domain name) of your network on the fly as the page is being served. The globbing charicter is "%" and matches any characters any number of times (i.e. honda%model%used%parts, would match "honda_model_626_used_and_refurbished_parts.php"). This method should be used for site wide links and to add links on pages with long, rare terms in their url. For sitewide links the glob should just be the domain name of the client site. .

Both the links you define in the command center "user links" and the pages in your network that show up in the command center can be Tagged. By tagging you can peform Tag to Tag and Tag to Glob. The Tag to Tag method propagates the tagged user links to the tagged pages in your network. Tag to Tag should be used for organizing mini-networks of pages and links. The Tag to Glob method is used to show links on pages with urls matching the given glob. Tag to Glob should be used when organize a group of sitewide links or a group of links to appear on with long, rare terms in their url.. The Tag to Glob method must be used for inline links.

Of course Tags, Links and Globs can be removed easily using the intuitive interface of ccenter.

Requirements

The Requirements are very basic more or less just the normal PHP/MySQL. The main server page works best when viewed with Firefox.

Server Requirements

  • PHP 4+
  • MySQL 5+

Client Requirments

  • PHP4+ With (Curl Enabled)

The current client code is written in PHP, but it would not be hard at all to translate ccenter_client.inc.php into ASP/RoR/Django etc.... The translation of ccenter_inline_top.php may require more skill, because it performs more sophisticated calculations, but is still very possible.

CCenter UI Browser Requirements

Of course the client pages can be viewed in any browser, but the UI for ccenter is written with a lot of Javascript/AJAX and is best viewed in Firefox or Opera.

  • Firefox3 or Opera 8+

Quick Start

You only need to set up the server once, each client domain can be done using include files or just with simple cut and paste.

Setting up the Server

  1. Create A MySQL Database on the server domain. (take note of the database name, your username and the password you choose, you will need the for the next step).
  2. Using your favorite text editor edit the configuration file ccenter_conf.inc.php for the following lines, replacing the letters in all caps with the appropriate settings.

    file: ccenter_conf.inc.php

    
    define('db_host','localhost');
    define('db_user','YOUR_DATABASE_USER_NAME');
    define('db_pass','YOUR_DATABASE_USER_PASSWORD');
    define('db_name','THE_NAME_OF_YOUR_DATABASE');
    
    	
  3. Point your browser at makedb.php. The page should read Congradulations All Databases Were Created Succesfully!.
  4. Then by going to ./index.php you should see the following:
    main page screenshot

If you have already set up the server with the steps above you can see a working example of ccenter in action by pointing your browser to example_client.php. You will need to add links. It will be informative to take a look at the example_client.php in a text editor, taking note of how the code is used.

Setting up a basic Client Using Cut and Paste

Although using the PHP include file method of setting up clients is thought by most to be easier to maintain, the copy and paste method is probably the quickest to get set up initially.

  1. Let us assume you wish to show links on the pages served by http://example.com/main.php which is served from /home/username/example.com/htdocs/main.php. After editing the line $cc_server_page="http://THE_URL_TO_THE_COMMAND_CENTER/server.php" to point to your command center place the following code at the place where you wish the links to show on main.php:

    file: /home/username/example.com/htdocs/main.php

    
    <?php // CCENTER CLIENT CODE
    
    // The full url for the command center server
    $cc_server_page="http://THE_URL_TO_THE_COMMAND_CENTER/server.php";
    
    // The link Group Name
    $cc_client_group="Main";
    
    // HTML code to put leading before each link
    $cc_link_leading_code="<br>";
    
    // HTML code to put trailing after each link
    $cc_link_trailing_code="<br>";
    
    /* -- do not edit below this line -- */
    
    if(!isset($cc_link_group)){
      $cc_link_group="Main";
    }
    if(!isset($cc_link_leading_code)){
     $cc_link_leading_code="<br>";
    }
    if(!isset($cc_link_trailing_code)){
     $cc_link_trailing_code="<br>";
    }
    $cc_this_domain=$_SERVER['HTTP_HOST'];
    if(!isset($cc_already_made_call_on_page)){
      $cc_already_made_call_on_page=0;
    }else{
      $cc_already_made_call_on_page+=1;
    }
    $cc_args=Array("title"=>urlencode(substr($_SERVER['REQUEST_URI'],1)),
    	       "this_domain"=>urlencode($cc_this_domain),
    	       "link_group"=>urlencode($cc_link_group),
    	       "link_leading_code"=>urlencode($cc_link_leading_code),
    	       "link_trailing_code"=>urlencode($cc_link_trailing_code),
    	       "already_made_call_on_page"=>$cc_already_made_call_on_page);
    foreach($cc_args as $k=>$v){ 
      $cc_data[] = $k.'='.$v; 
    }
    $cc_post_data=implode("&",$cc_data);
    $cc_ch = curl_init();
    $cc_useragent="CCenter/1.0 (Clear Text)";
    curl_setopt($cc_ch, CURLOPT_USERAGENT, $cc_useragent);
    curl_setopt($cc_ch, CURLOPT_URL,$cc_server_page);
    curl_setopt($cc_ch, CURLOPT_REFERER,$_SERVER['HTTP_REFERER']);
    curl_setopt($cc_ch, CURLOPT_POST, 6);
    curl_setopt($cc_ch, CURLOPT_POSTFIELDS, $cc_post_data);
    $cc_result= curl_exec($cc_ch);
    curl_close($cc_ch); 
    unset($cc_link_group);
    // CCENTER CLIENT CODE
    ?>
    
    	
    This code can also be found in ccenter_client.inc.php. NOTE: if you are already in a code block then you don't need the <?php and ?> adding them will give an error something like:

    Parse Error for '<?php' Blocks

    Parse error: syntax error, unexpected '<' 
    /home/username/example/htdocs/main.php on line 133
    	

Adding Links With Search and Propagate

Links are first added to the system by clicking on "Add New Link" button. Under each link is a button that says "Add," this will add the link under the "Propagate" filter ready for propagation or depropagation. Putting text in the page filter input element and pressing enter will search through URLs of your pages, the search terms used by users to your site and the domain names. Clicking Propagate will then add those links ready to be served to the client pages.

Using Tags

Both pages and links can be tagged. In this way you can group a collection of links and propagate them on a collection of pages. This method is known as Tag to Tag.

Tags can be added to links by first searching through the links using the "user links filter." The user links filter is located on the left as an input element. After you have searched the links, you click "Tag These Links" to input the given tags (separated by commas). Finally click "Add Tags." The similar process is used for tagging pages in your network, but instead use the appropriate filter input element and button.

Links can be propagated by using the "Tag to Tag" button. With this each page with given tag will have all the links with the given tag.

Additionally, you can point a collection of links at a glob (wildcard). This method is known as Tag to Glob. It is likely that you will wish to use Tag to Glob on sitewide links. The glob would then be the site name. Note that you MUST use this method when using Inline mode.

The wildcard character is '%' (percent sign). The glob character is automatically added to the start and end when you insert a word. You might add globs like 'example.com/' for site wide links, or 'example.com/blog/' for only pages on your blog or 'living%decorating' to match pages like "living_room_decorating.php," "living_on_a_showstring_decorating.php," etc...

Inline Mode

There is sufficient evidence to suggest that many search engines value links within blocks of text more highly than links desplayed in a list. This is because inline links have more context. Also sites without many sitewide links may look more "pure and innocent" to both users and search engines. In terms of monetization inline links tend to convert much better than sitewide links. To address this ccenter is able to perform inline substitutions on blocks of text using a special syntax. This also gives you the ability to consider more of the page's contents than just the url.

To add inline code you must use a special syntax in Add New Link -> Arbitrary Code. Inline ONLY works in Tag to Glob Mode!. It is assumed that the vast majority of uses for this will be sitewide or at least directory wide so this "restriction" is built into the system.

Example 1 of Inline Arbitray Code Syntax


http://sailing.faux sailing
http://vacation.faux odessa yalta

    

The substitution works by "word" of text. A "word" is defined by a series of characters surrounded by whitespace or some forms of punctuation. Matching is not case sensitive. Do NOT use inline mode across blocks of javascript (you should be using unobtrusive javascript anyways so this is not a major restriction). Finally, this only subs the first five matched words on a page as this seems to be a good way to avoid being spammy.

When a word is matched a link is subsituted using the matched word and some surrounding text, but stopping on punctuation. So for example, if you performed the inline subsitution on the following text:

Katya loves to visit Odessa in the summer. She walks along the beach and watches the sailing boats sail.

you might get,

Katya loves to <a href="http://vacation.faux" >visit Odessa</a> in the summer. She walks along the beach and watches the <a href="http://sailing.faux" >sailing boats sail.</a>

There is also syntax for matching only the start of the word (s:sail - sail, sailing, sailer, etc...), only the end of the word (e:sail - spritsail, Staysail, Spreadsail, etc...), anywhere contained in the word (c:sail - spiritsails, sailing, boatsails, etc...) or the default, the word exactly (sail - sail).

Example 2 of Inline Arbitray Code Syntax


http://sailing.faux scooner s:sail c:boat 

    

In general make sure to put whitespace around words when creating your content. This is important because "<b>bike wheel</b>" are the two words "<b>bike" and "wheel</b>" and not "bike" and "wheel." Testing has show that this has not been a major problem.

Setting up the Inline Client Code Using Include Files

It is generally much cleaner to use the include file method than to copy and paste the large blocks of text which are needed for inline mode.

Assuming you have your server up a live example can be found at example_inline.php

  1. Let us assume you wish to show links on the pages served by http://example.com/main.php which is served by /home/username/example/htdocs/main.php . After editing the line $cc_server_page="http://ccenter/server.php" to point to your command center place, the following code just above the block you want to insert links into on main.php:

    Example of Inline Code Block

    
    <?php
    include("./ccenter_inline_top.php");
    ?>
    
    Katya loves to visit Odessa in the summer. She walks along the
    beach and watches the sailing boats sail.
    
    <?php
    include("./ccenter_inline_bottom.php")
    ?>
    
    	

Understanding Groups

You may get into a situation where you wish to have two or more groups of links on the same client page. This can be accomplished by setting the group name in the "Add New Link" dialogue and then setting $cc_link_group variable in the client's PHP code.

Grouping can also be used as part of your localization sweet, to show different links to different users. By adding groups with country code suffix, and using Apaches' mod_geoip (pure PHP implementations are equally trivial). For instance:

Example of Localization On Apache with mod_geoip


<?php
function country_code_suffix($id){

  // requires mod_geoip installed
  if($country_code = apache_note("GEOIP_COUNTRY_CODE")){
    return "_$country_code";
  }
  return "";

}

$cc_center_group="Main" . country_code_suffix();
include("ccenter_inline_top.php");
?>

Katya loves to visit Odessa in the summer. She walks along the
beach and watches the sailing boats sail.

<?php
include("ccenter_inline_bottom.php")
?>

	

Grouping can be done for both the basic client and the inline client.

Advanced

Setting up a basic Client Using Include Files

Some may choose to use an include file instead of copying all the above code. This might be for easy edditing or easy disabling. If you are ok with the Cut and Paste method than you can safely ignore this section.

  1. First you will need to FTP the files named ccenter_client.inc.php to a domain on which you wish to display links. Place it in the home directory for the domain. For example your site is http://example.com which is is places its .php files in /home/username/example/htdocs then you should see /home/username/example/ccenter_client.inc.php
  2. Now lets assume you wish to show links on the pages served by http://example.com/main.php which is served by /home/username/example/htdocs/main.php . At the place where you wish to links to show place the following code:

    client include

    
    <?php
    include("ccenter_client.inc.php");
    ?>
    
    	
    If you wanted to show them on a deeper level you can use ../. For example if you wanted to show them on /home/username/example/htdocs/blog/posts.php.

    client include using ../

    
    <?php
    include("../ccenter_client.inc.php");
    ?>
    	  
    	
    NOTE: if you are already in a code block then you don't need the <?php and ?> adding them will give an error something like:

    Parse Error

    
    Parse error: syntax error, unexpected '<' /home/username/example/htdocs/main.php on line 133
    
    	

Caching

If you expect to get heavy traffic or have a very large network then you are strongly encouraged to used some form of caching on client pages. To reduce bandwidth usage.

It should be noted that the inline code uses the CPU of the client more than the basic mathod.

The server can do some caching beyond of what MySQL does by default. This caching will reduce the servers CPU load. You can change the cache time or turn it off by edditing with a text editor ccenter_conf.inc.php with a text editor. The two settings of interest are cache_enabled and cache_life. This form off caching is off by default.

During the time that you are working are adding or editing links in ccenter you can run the clear_cache.php script, which will make the cache only last 30 seconds, of course this only makes sense if cache_enabled is set to 1. If you don't see the clear_cache.php link at the bottom of the ccenter UI page, then you have cached disabled.

Where are the Stats?

The best way to add stats is to use your existing analytics system as arbitrary code in conjunction with globbing.

The presentation and flexibility of webstats is a very personal choice. Some don't want javascript, some need javascript, some want one pixile by one pixile images and so on. There are already wonderful analytics tools to use and it would only serve to clutter the code and tie up the server to add analytics to ccenter.

CCenter Plugins

As of now there is only a plugin for Wordpress, more will plugins will be created if there is enough demand.

Wordpress Plugins

There are Wordpress plugins for both inline (ccenter-inline.php) and basic mode (ccenter-blogroll.php). The basic mode plugin places links in the blogroll section, while the inline links are placed within post content.

The wordpress plugins are located in /path/to/ccenter/plugins/wordpress/.