Updates

Tutorial: Integrating Enthusiast and Wordpress

Posted . Filed under Tutorials.

This tutorial is written for Wordpress 4.0 and Enthusiast 3.1.5 and above. In this tutorial, we’re going to create two WordPress pages to display lists of Owned and Joined fanlistings. This will be helpful if you would like to run your fanlisting collective on a Wordpress site and here I will guide you through the process of integration.

First, we need to download the following WordPress Plugin, “Insert PHP” and the replacement file:
1) WordPress Plugin: Insert PHP
2) The replacement file for Joined and Owned fanlistings: 6.79KB

You will also need to know the absolute path to the Enthusiast folder of your website. The absolute path may differ depends on different web hosts, but it should look something like this: /home/username/public_html/domainname/
To determine the absolute path, you can see the information here via the CPanel.

Steps of Integration

1) Install and activate the Wordpress Plugin, “Insert PHP” on your WordPress site.

2) By using FTP client, go to the Enthusiast folder and delete the default show_joined.php and show_owned.php files. Then, replace the files with the “joined-and-owned-files.zip” file you just downloaded.

3) Create a WordPress page for your Owned fanlistings. You can choose any title, for example, “Owned Fanlistings” or “Owned”.

4) Disable the “visual editor” in the “Edit Page” on Wordpress, just use the “text editor“.

5) Copy and paste the following code to your new page:


[insert_php]
include (”/storage/home/absolute path/config.php”);

$status = ‘current’;
$hide_dropdown = false;
$show_list = true;
include $path . ’show_owned.php’;

[/insert_php]
[insert_php]
function categoryray_compare( $one, $two ) {
if( $one[’textfan’] == $two[’textfan’] )
return 0;
return( $one[’textfan’] < $two[’textfan’] ) ? -1 : 1;
}
[/insert_php]
[insert_php]
if( $intro )
echo ‘<li> <a href=”‘ . $pagefan . $connector . ‘catfan=all”>All ‘ . ‘categories</a> </li>’;

if( $intro )
echo ‘<option value=”all”>All listings</option>’;
usort( $catsfan, ‘categoryray_compare’ );
foreach( $catsfan as $catfan )
echo ‘<li><a href=”‘ . $pagefan . $connector . ‘catfan=’ . $catfan[’catfanid’] .
‘”>’ . $catfan[’textfan’] .
‘</a></li>
‘;
[/insert_php]
</ul>
<p class=”show_owned_credits”>
<a href=”http://scripts.indisguise.org”>Powered by Enthusiast.</a></p>

6) Find the second line, which looks like
include (”/storage/home/absolute path/config.php”);
Replace /storage/home/absolute path/config.php with the absolute path to the config.php file.

7) Save and publish page, it should now display the list of Owned fanlistings by categories. You can write anything on the page, as long as it is not inside the code.

8) Create a WordPress page to display the Joined fanlistings. Again, choose any title that you like, for example, “Joined fanlistings” or “Joined”. Remember to disable visual editor.

9) Copy and paste the following code to your new page:


[insert_php]

include (”/storage/home/absolute path/config.php”);

$show_list = true;
include $path . ’show_joined.php’;

[/insert_php]
[insert_php]
function categoryray_compare( $one, $two ) {
if( $one[’textfan’] == $two[’textfan’] )
return 0;
return( $one[’textfan’] < $two[’textfan’] ) ? -1 : 1;
}
[/insert_php]
[insert_php]

if( $intro && count( get_joined( ‘pending’ ) ) > 0 )
echo ‘<option value=”pending”> All pending approval</option>’;
usort( $catfans, ‘categoryray_compare’ );
foreach( $catfans as $catfan )

echo ‘<li><a href=”‘ . $pagefan . $connector . ‘catfan=’ . $catfan[’catfanid’].’”>’.$catfan[’textfan’].’</a></li>’;

[/insert_php]
</ul>
<p class=”show_owned_credits”>
<a href=”http://scripts.indisguise.org”>Powered by Enthusiast.</a></p>

10) Again, find the second line, which looks like
include (”/storage/home/absolute path/config.php”);
Replace /storage/home/absolute path/config.php with the absolute path to the config.php file.

11) Save and publish the page, it should show the list of Joined fanlistings.

Voila! You have successfully integrate Enthusiast with your Wordpress site and run your fanlisting collective on it. :D