Contact - Plugin install

Introduction

If the auto install (or uninstall) doesn't work or if you prefer install the plugin manualy, read the following instructions.

Warning : if you see the code is already modified or a file already exists, there's no need to do it again.

Installation

First of all let's create file backups.
Copy themes/default/template.php to themes/default/template.php.Contact.bak
And layout/lib.mod.php to layout/lib.mod.php.Contact.bak

Open the file themes/default/template.php with a text editor.
Look for a text block like this :

		<h3>Changer le commentaire</h3>
		<?php include dirname(__FILE__).'/form.php'; ?>
		
	<?php elseif ($mode != 'post') : /* Si aucune erreur et mode != post on affiche une liste de billets */?>
		<?php # Phrase affiché en cas de recherche (%s est le mot cherché)
		dcSearchString('<p>R&eacute;sultats de votre recherche de <em>%s</em>.</p>');
		?>

Then replace it with :

		<h3>Changer le commentaire</h3>
		<?php include dirname(__FILE__).'/form.php'; ?>
		
	<?php /* Code added by Contact plugin installation */
		elseif ($mode == 'contact') : /* Si le mode est 'contact' affichage du formulaire */
			include dirname(__FILE__).'/../../ecrire/tools/Contact/contact.php';
			/* End of the added code */ ?>
		
	<?php elseif ($mode != 'post') : /* Si aucune erreur et mode != post on affiche une liste de billets */?>
		<?php # Phrase affiché en cas de recherche (%s est le mot cherché)
		dcSearchString('<p>R&eacute;sultats de votre recherche de <em>%s</em>.</p>');
		?>

Now open the file layout/lib.mod.php.
Look for a text block like this :

	if (!empty($_GET['p'])) {
		return 'post';
	} elseif (!empty($_GET['d']) && strlen($_GET['d']) == 10) {
		return 'day';
	} elseif (!empty($_GET['d']) && strlen($_GET['d']) == 7) {
		return 'month';
	} elseif (!empty($_GET['cat'])) {
		return 'cat';
	} else {
		return 'home';
	}

Then replace it with :

	if (!empty($_GET['p'])) {
		return 'post';
	} elseif (!empty($_GET['d']) && strlen($_GET['d']) == 10) {
		return 'day';
	} elseif (!empty($_GET['d']) && strlen($_GET['d']) == 7) {
		return 'month';
	} elseif (!empty($_GET['cat'])) {
		return 'cat';
	/* Code added by Contact plugin installation */
	} elseif ((dc_url_scan == 'path_info' && $GLOBALS['dc_args'] == 'contact') || (!empty($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] == 'contact')) {
		return 'contact';
	/* End of the added code */
	} else {
		return 'home';
	}

Don't forget to upload the modified files on your server.
If you've correctly followed the instructions the plugin should should work well!
Else you can contact me here.

Uninstall

Pour la désinstallation il suffit de remettre les fichiers d'origine sauvegardés en .Contact.bak.

Supprimez donc themes/default/template.php et layout/lib.mod.php
puis copiez themes/default/template.php.Contact.bak en themes/default/template.php
et layout/lib.mod.php.Contact.bak en layout/lib.mod.php
Il ne reste plus qu'à supprimer les 2 fichiers en .Contact.bak.

N'oubliez pas d'uploader les fichiers restaurés sur le serveur.
Si vous avez bien suivi les instructions le plugin devrait être désinstallé.
Autrement vous pouvez me contacter ici.