Adding a blog in vidiscript is not that hard really. It is just a matter of knowing the blog script. In this article, I will be discussing on how we can easily put up wordpress blog along with vidiscript. Although I am not going to cover the login integration, I am confident that this article will indeed help vidiscript powered website owners in adding their blog posts inside the vidiscript pages, or even assign an static page just for the showing of all the blog entries.
For the login integration, I will probably attempt to write an article about this in the future. I have an integration for joomla, wordpress, elgg. However, these integration scripts were written inside the vidiscript .inc files, so the process of going back through the steps I made, when I was writing it is not feasible at this moment, because of the time constraint.
Requirements: vidiscript all versions , wordpress latest version.
Step One
I am assuming that your vidiscript powered site is already installed on your server, and it is installed in the root directory of your domain. For example, yourDomainDotCom.
Download and unzip wordpress latest version on your desktop.
Using your FTP program, connect to your server to view the directory of your vidiscript. Inside this directory create a new directory or folder. Name this directory as blog.
Using the same FTP connection above, upload all of the wordpress unzipped files to the blog directory. Make sure to ONLY upload the content of the wordpress-3.0.1\wordpress and not the wordpress-3.0.1 or wordpress directory. We want the contents ONLY. Otherwise this is not going to work.
Step Two
Upon successful uploading of the files as mentioned above in Step One, we need to prepare the wordpress installation first, so that it can share the existing vidiscript database.
Connect your FTP program to your server. Open the includes directory, and look for the settings.inc. Load settings.inc to your html/text/php editor, and copy the php codes from there. The codes should be something like these ;
$db_host = “localhost”;
$db_user = “yourDatabaseUer”;
$db_password = “passwordHere”;
$db_database = “databaseHere”;
Direct your FTP file browser on the “blog” directory and look for the wp-config-sample.php Load wp-config-sample.php to your html/text/php editor, and on the very top of the page, just right after the <?php
Add;
$db_host = “localhost”;
$db_user = “yourDatabaseUer”;
$db_password = “passwordHere”;
$db_database = “databaseHere”;
Save your changes on the wp-config-sample.php. Please note that you will be asked to rename this wp-config.php during installation.
Step Three
Install WordPress as recommended by the readme file. After the installation, your wordpress and vidiscript should be sharing the same database. This is a lot easier to maintain than having them in separate database.
Step Four
This step will cover on how we can display the blog post on your vidiscript site. There are two options to accomplish this. I will briefly cover these options.
Option One
Right column only integration.
Connect to your server using your FTP program. Load the index.php of your vidiscript site on the editor. On the very top of the page find add;
|
1 2 3 4 |
<?php
define('WP_USE_THEMES', false);
require('blog/wp-blog-header.php');
?> |
Scroll down the page and look for these lines of codes
|
1 |
</div><?php } ?><? eval(menuBlocks()) ; ?> |
Just right after the codes above, add
|
1 2 3 4 5 6 7 |
<div id="right-col-content">
<div class="spacing">
<H2>Blog Entries</H2>
<?php query_posts('showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
<?php endwhile;?></div></div> |
Save your changes on index.php. The newly posted article title from the blog show appear now on the right column of vidiscript powered site.
Option Two
Static page integration. In static page integration (minimum only), the process is more tedious than the option one above. All the files modifications are in vidiscript files system only, and there is nothing we need from the wordpress side.
Connect to your website, find .htaccess file and index.php, load these files to your editor. Open the includes folder to find content.inc and load this file to your editor as well.
On your text/thml/php editor create a new file, and in this document paste the codes as shown below.
|
1 2 3 4 |
<?php query_posts('showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
<?php endwhile;?> |
Now, I will leave the styling of the above codes for your own taste. Save this new document as blogentries.module. Upload blogentries.module to your templates/defaulttemplates/modules/ directory. Defaulttemplates is the vidiscript templates your site is currently using. Now we are done with the static page creation. We will just have to include it in our tab menu.
Moving on to your content.inc file. Find this code;
|
1 2 3 4 |
case '31':
$c_file = 'modules/edit.module' ;
$c_header = 'Edit My Media' ;
break ; |
Just below it add;
|
1 2 3 4 |
case '39':
$c_file = 'modules/blogentries.module' ;
$c_header = 'Blog' ;
break ; |
Save your changes to content.inc.
Moving on to your .htacces file. In .htaccess file find
|
1 |
RewriteRule ^account/?$ index.php?id=56 [L] |
below it add;
RewriteRule ^blog/?$ index.php?id=39 [L] |
Save your changes to .htaccess file
Moving on to the index.php. Just like in option above, open your index.php and add these codes on the very top of the page.
|
1 2 3 4 |
<?php
define('WP_USE_THEMES', false);
require('blog/wp-blog-header.php');
?> |
Scroll down the page to find the entries for tab menu. Find,
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<ul id="tab-menu" class="no-format">
<li<?php if ($_GET['id'] == 1) { echo " class=\"crt\"" ; } ?>>
<span><a href="<?php echo $path;?>">Home</a></span>
</li>
<li<?php if ($_GET['id'] == 2) { echo " class=\"crt\"" ; } ?>>
<span><a href="<?php echo $path;?>top_rated">Top Rated</a></span>
</li>
<li<?php if ($_GET['id'] == 3) { echo " class=\"crt\"" ; } ?>>
<span><a href="<?php echo $path;?>most_viewed">Popular</a></span>
</li>
<li<?php if ($_GET['id'] == 88) { echo " class=\"crt\"" ; } ?>>
<span><a href="<?php echo $path;?>members">Members</a></span>
</li>
<li<?php if ($_GET['id'] == 19) { echo " class=\"crt\"" ; } ?>>
<span><a href="<?php echo $path;?>groups">Groups</a></span>
</li> |
just below the codes above add;
|
1 2 3 |
<li<?php if ($_GET['id'] == 39) { echo " class=\"crt\"" ; } ?>>
<span><a href="<?php echo $path;?>Blog">Blog</a></span>
</li> |
Save changes on index.php
Step Five
In order for the option two to work or become visible on the tab menu, we need to adjust the css file. Open your default template directory. Find skin1.css and load it to your editor.
In skin1.css, find
#tab-menu{
position: absolute;
height: 34px;
left: 15px;
top: 110px;
width: 960px;
overflow: hidden;
font-size: 20px;
font-weight: bold;
}
change the above code this
|
1 2 3 4 5 6 7 8 9 10 |
#tab-menu{
position: absolute;
height: 34px;
left: 15px;
top: 110px;
width: 960px;
overflow: hidden;
font-size: 14px;
font-weight: bold;
} |
Save your changes to skin1.css.
Added Later:
If you want to include an excerpt from the blog post, you can change the above codes to this;
|
1 2 3 4 5 |
<?php query_posts('showposts=3'); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
<?php the_excerpt()?>
<?php endwhile;?> |