Installing sape code on a wordpress blog. Installing sape on wordpress How to install sape code manually

I decided to bring up one very old one here, but, as time shows, current topic. Exchange Sape has existed for a very long time, but new users do not stop arriving there - and now it is one of the stable sources of income. Actually, from time to time, people knock on ICQ or write to me by email asking for help installing sape on a Wordpress blog. Of course, I don’t deny my referrals anything, but since the issue is relevant to a certain extent, I decided to consider it in this blog. In addition, it will be useful for beginners to read, I think. And so that advanced users do not get offended, the publication is published just on a day off. In general, everyone should be satisfied.

So, to install sape on Wordpress, go into the system or register there if you have not already done so. We will need a “Webmaster” section, which is responsible for operations and functions for making money on their advertising platforms. Click on the link on the right “Create a new site”.

On the page you will see a list of various recommendations for installation on different systems and in general on the use of Sapa. We need the first item from the list of installation instructions – “for hosting with PHP support”. When you click on the link you will see 4 steps to set the code:

  1. Download the zip archive required for the links to work.
  2. Unpack the archive on your computer; it includes a special folder.
  3. Then you need to copy this folder to your FTP, and directly to the root of your site.
  4. Next, we set access rights to 777 for this folder (but not for the sape.php file that is located in it). This is done so that the system can manage the file with the link database.

After these points there are 2 texts that tell you what changes need to be made to the WordPress templates to install sape. The first is used for simple hypertext links, and the second for contextual ones - which are placed in the text of the page itself, in the post. Therefore, if the installation description below seems unclear to you, you can always look it up on the Sape website.

So, since a WordPress template consists of several files that are connected to each other via include, you need to define the global variable $sape in the code. So let's go to the file header.php and immediately after opening the tag add:

"special_folder_name") ; ) require_once ($_SERVER [ "DOCUMENT_ROOT" ] . "/" . _SAPE_USER. "/sape.php" ) ; $o [ "charset" ] = "UTF-8" ; $sape = new SAPE_client($o) ; unset ($o) ; ?>

Here, by the way, the UTF-8 string specifies the encoding for the added site. Most WordPress blogs have UTF-8 encoding, so we indicate it in the code.

Next need to place Sape code in files wordpress template , where we will display links. Here, first you need to decide how many and where these links will be located. I would like to draw your attention to the fact that the system developers, like many webmasters advise, Firstly, distribute the display of links on the page across different blocks (zones)– on the right or left in the sidebar, footer, etc. Secondly, you need to understand that a large number of links on a page can lead to sanctions from search engines. Everyone chooses the optimal amount for themselves. I have no more than 3 links on one page, which are divided into 2 or 3 blocks depending on the template. The fewer links you sell, the less suspicion the PS will have (although this is not the main indicator, in the aggregate it can lead to sanctions).

To display a block of links in the right places (sidebar, footer) we use the code:

return_links(1); ?>

return_links(1); ?>

Please note that the number of links that will be displayed is indicated here in brackets. At the same time, Sape has a rule that the last function call must contain an empty value for return_links(). That is, for example, if you have 4 links on a page, which are displayed in a 1-2-1 ratio, then you first use return_links(1), because return_links(2), and for last function leave the field empty.

The next step is adding a site to the Sape system. Under all the installation instructions you will find a form where you will need to provide a link to the site and the subject of the project. Next, wait for “Add site” and go to the settings page.

Here you can select a separator for links, set a class for them (to then apply formatting via css). Then I personally leave the field “ hide url» empty so that when purchasing, users see the site and do not act blindly. In principle, there is nothing to hide, and there is more trust - they say, and so do purchases. About number of links I already said above - write how many of them will be displayed on the main page and pages of the 2nd and 3rd levels. I'm betting 3-3-3. At the end there are several additional parameters - use filters, do not accept links in Latin, etc. If you are interested in any options, you can select them, and then click “Save”.

Next, the site will be sent for moderation and the site pages where the code was found will be indexed. If everything goes well, you can set prices for links and start making money in the Sape link exchange. I choose the average according to the system plus round them up to a larger value. For example, at a price of 3.87 I put 4, etc. I must admit, I don’t have much experience in Sape, so I’m not sure how cool or bad it is, I personally am happy with it. Someone lowers prices, and then after the sale sets a higher price - but I reject this, as well as a sharp increase in price at +10 points. Here everyone does as he wants. By the way, after purchasing links, you can correct their display on the blog using ccs so that they fit organically into the design of the project.

There seems to be a special plugin for installing sape in Wordpress, but I personally prefer to act directly in the template code, since you can make the settings for displaying the code as flexible as possible - add links anywhere and set your own formatting for them. And besides, the process is not very complicated, I don’t see the point of using some kind of plugin.

If you have questions or advice, write in the comments.

The SAPE link exchange is a place where you can not only promote your website, but also make good money. To work with the SAPE link exchange, you need to install the SAPE code on your website. Beginning webmasters often have problems installing code. There are two ways to install code on a website - directly into the template and using an extension (module). In this article we will take a closer look at the first method - installing code in a template.

Installing SAPE code in Joomla template

6. Now you need to paste the code into the index.php template file. To do this, log into the administrative panel - Extension - Template Manager. Select your template and click on the "Edit HTML" button.

7. Paste the following code at the very beginning of the file as shown in the image below. Instead of a word your ID paste the code (the name of your folder installed in the root of the site)

if (!defined("_SAPE_USER"))(
define("_SAPE_USER", "your identifier");
}
require_once($_SERVER["DOCUMENT_ROOT"]."/"._SAPE_USER."/sape.php");
$o["fetch_remote_type"] = "curl";
$o["request_uri"] = getenv("REQUEST_URI");
$sape = new SAPE_client($o);
unset($o);
$o["charset"] = "UTF-8";
?>

8. To display links in the desired place in the template, use the following code (the number of links is indicated in brackets, you can change this number). This way you will create a block of two links. You can create 2-3 such blocks and place them in different places in the template

return_links(2); ?>

That's probably all. Yes, I would also like to add that if you want to place a block at the end of the article text, find it in the template next line and after it, insert a block, adding a style to it in template.css (“Edit CSS” in the template). The block will look like this:

In the same way, you can display links under the modules on the left or right. And finally, I want to give advice, do not place many links on the page. 4-5 links placed in 2-3 blocks, which should be located in different places in the template, are quite enough. In the next article I will show you how to install SAPE code using the .

For such popular engines as: wordpress, joomla, dle, ucoz and kasseler.

We type in the browser this treasured address http://www.sape.ru/, in the upper right corner there is a “registration” button.

Installing code for sites on .php

After successfully registering on the exchange, you should begin installing a special code on the site. The technology for installing code for sites using .php on all engines is almost the same.

1. The folder with the code archive should be downloaded to your computer and unzipped, then uploaded to the hosting in the root folder of the site (where the index.php file is located) and placed in this folder in file manager rights 777. For example, I do it all through Total Commander


If your site consists of static html pages, you need to look for the presence of the .htaccess file in the root directory. It should contain the following line: “Add Type application/х-httpd-рhp .phр.htm .html”. If there is no line, be sure to add it. If there is no .htaccess file itself, you need to create it. Otherwise, the exchange robot will not be able to work with your website.

2. Now on those pages where we will sell links you need to write the following code:


Now, to display the links that are being sold, let’s add the code

return_links($n); ?>
Where $n– the number of links you would like to display in this place pages.

Installing sape code on DLE

We repeat point 1, only now the code for calling links must be inserted not into the engine template, but into the index.php file.

1. Open the index.php file and look for the following line of code

$tpl->compile("main");
And before it we add:

if (!defined("_SAPE_USER"))( define("_SAPE_USER", "YOUR_HASH_CODE"); ) require_once(realpath($_SERVER["DOCUMENT_ROOT"]."/"._SAPE_USER."/sape.php")); $o["host"] = "your_site.ru"; // WITHOUT HTTP:// $sape = new SAPE_client($o); $tpl->set("(sape_links)", $sape->return_links());
Now, anywhere in your template you simply write (sape_links).

Installing sape code on WordPress

There is an option for placing code on the WordPress engine. Most best option This is a placement in the sidebar of your blog. And so let’s start by repeating the action in point 1 (download the archive to our server)
1. Open your template folder, by default it is wp-content/themes/default/
we find the file sidebar.php, and in it the line


after we add

return_links(); ?>
2. The second option is through the admin panel of the WordPress engine. We are in the admin panel, we go

Select Appearance=> Theme Editor => Sidebar Template


6. Paste the system code

return_links(); ?>
in the sidebar code. Save (Update file).
If your website/blog uses UTF-8 encoding of Russian letters, then you need the following line in the link output code:

$sape = new SAPE_client();
change to:

$o["charset"] = "UTF-8"; $sape = new SAPE_client($o); unset($o);
All code installation is complete.

Installing sape code on kasseler

And so, the archive was downloaded with the code, and the folder was placed at the root of the site. Open the blocks folder and create a file block-sape.php with the following content:

uri, "%") !== false AND kr_strpos($main->uri, "&") === false)( $base_file = basename($main->uri); $patch = str_replace($base_file, " ", $main->uri); $base_file = str_replace($main->config["file_rewrite"], "", $base_file); $o["request_uri"] = $patch.urlencode(urldecode($base_file) ).$main->config["file_rewrite"]; //$main->uri - displays the current page ) else $o["request_uri"] = $main->uri; //Next SAPE code $o["multi_site"] = true; //Indicates to the script the presence of multiple sites $sape = new SAPE_client($o); //Delete the array of parameters unset($o); //Receive links $content = $sape->return_links(); if(!empty($content))(//If links for the page were received, create a style block //open the style sheet open(); //Output links echo $content; //close the style sheet close(); ) else echo ""; //if there were no links, we simply do not create a style block //Return to the previous debugger settings $config["mode_debugging_php"] = $config_deb; ?>

Next, save, go to the admin panel of the “blocks and banners” tab, add a block and from the drop-down list select our created file block-sape.php, then select the placement of the block on the right, left or footer.

Connecting the site to the Sape exchange

Let's return to the exchange's control panel, select the tab for adding a site, select the theme of the site, enter the URL and click send.

If this step is completed correctly, your site will appear on the Sape exchange with the status “awaiting indexation”. After this, it is necessarily checked by the exchange robot, and then by moderators, as a rule, this happens within 24 hours. If the site is approved, you can safely start selling links, the cost of which should immediately be set higher than the recommended ones.

Please note that if you plan to sell more than 2 links from each page, then you should install a code that allows you to display links in a variety of places on the page. Of course, you need to install such a code on all selling pages of the site. Next, add your site to the system, enter its address and topic.

I received an email from a very good reader of mine asking me to help him figure out how to install Sape code on a WordPress site.

My surprise knew no bounds, because on the Sapa exchange website itself everything is written quite clearly what needs to be done and how.

Well, what can you do since they asked you to help, I won’t upset the guy. This was the background to the creation of this post.

Installing Sape Code on WordPress

First. First you need to become a member of the link exchange, so feel free to register. If you register using my referral link, then I will help you with all your questions and give you 3% of the profits.

I don’t understand at all those people who register not by referral. links, you still don’t lose anything, but you can only buy one poles.

Second. After registration, log into your newly created account and go to the “Webmaster” tab.

I want to warn you right away, do not rush to add a site to the system, you first need to install the sape code, and only then you can add it to the system.

The thing is that the exchange robots check the added site for presence in it established code, and if they don’t find it there, then you will have to send it for re-indexing.

For the very beginners, I will say that it works in PHP, so we select a link from PHP, where we will be offered to download a zip archive which will already contain a folder with your individual profile.

An example of its type is “ 7c6c592486761гe7920dfоl909tv0er988ba945"just a set of letters and numbers.

Upload the previously downloaded file to your hosting in the root folder of the site where the file is located wp-config.php. I upload using Total Commander, you can use any FTP client.

Have you loaded it? Great, now we need to set the access rights for this file 777 . Don't be confused, you don't need to change anything in the file itself.

Third. Now we need to add the php code that will display the links Sape exchanges. There is a lot of debate on the Internet about where they should be located, since search engines have long learned to recognize them and send such blogs under the filter.

Basically, webmasters place them in the footer and sidebar of their project (file sidebar.php And footer.php). And those who want to protect their site from the imposition of a search engine filter on it place them in the text.

Since we have a site on WordPress, I use a plugin ISape. It allows you to easily install the SAP code and even customize the link widget, and then insert it into the footer or sidebar of your blog.

You can use this plugin to sell contextual links (they are somewhat reminiscent of ), the prices for such links can be set a little higher. Let me remind you that we are installing the sape code for the WordPress engine.

Then go to the “Widgets” section in the blog admin panel and select the widget iSape Links, which you drag into the sidebar or footer of the site. You can name it “Friends of the site” or “Related links”.

Fourth. After installing and configuring all of the above, you can safely add the site to the system.

Now, clenching our fists, we begin to wait until the system indexes your site and the moderators approve it. If everything goes well, we activate the pages and set prices.

Good luck to everyone with the Sape exchange and easy installation code on wordpress. Bye!

This plugin is in Russian language only.

What's new in version 0.5

  • Possibility of placing links in block form - see widget settings
  • Correct output of the sape counter separately from the links in the site footer
  • Automatically hide a widget from a page if there are no links

SAPE Links plugin for webmasters

Screenshots

Installation

  1. Install and activate the plugin through your site's Console.
  2. Go to the SAPE Links settings page and follow the instructions

Frequently Asked Questions

What is sape.ru

Sape is an intelligent system for paid links placement on your website. Thanks to flexible settings, the system automatically selects suitable links, which you have the right to accept or reject.

How can I make money on my website?

After going through the sape system, your site can start making money right now.

Activate the SAPE Links widget in the sidebar (at the beginning and at the end) and in the footer of the site. Specify how many links to display. For example, '1' link at the beginning of the column, '1' link at the end of the column and 'All' in the footer.

Caching plugins WP Super Cache, W3 Total Cache, Hyper Cache, etc.

Set the cache to reset every 4-6 hours to ensure new sape links appeared on your website. During the initial installation of the SAPE Links plugin and adding a site to the sape system, it is recommended to disable the caching plugin.

I installed the plugin, but the system does not see the code on the site

For initial installation sape code and passing site moderation, it is necessary that the SAPE Links widget be installed ON HOME page site.

“All” links are displayed where ‘All’ is specified in the parameters (or in a macro without specifying the number of links). If all links are displayed, then the remaining widgets remain empty. Only the last widget should have the 'All' option to display the remaining links.

Disable wptexturize

The wptexturize filter processes the source text of the site, replacing some punctuation marks (for example, dashes) with special characters. As a result, contextual links containing these characters may not be recognized by the sape system and will be marked with an ERROR status. If a similar problem occurs on your site, disable wptexturize in the plugin settings. Otherwise, you shouldn't disable wptexturize.

Reviews

not bad. BUT!

hamsky

It is impossible to disable the terrible message " SAPE Links: The file needs to be updated... sape.php" Spreads across ALL admin pages! Horror! And the rest - ok! It can be cured by deleting (commenting) lines 166-169 of the plugin_admin.php file //if (@$sape->_version && $sape->_version< "1.2.7") { // $this->_error("

SAPE Links: File needs to be updated ".$file." to latest version. Download now.

"); // return; //)

Displaying the sape counter separately from the links in the footer of the site
  • Checking the version of sape.php v1.2.1
  • Added plugin icon
  • 0.3.1

    • Ability to disable wptexturize in plugin settings

    0.3

    • Optimized plugin code
    • Added CSS styles
    • FAQ section updated
    Share