phpnuke integration
Has anyone converted phpdig to reside as a module in phpnuke?
I would be interested if anyone has tried. I can't seem to get it working yet as it doesn't want to find the config file.
Any thoughts??
Thanks
Snorkpants.
I'll try to document it as easy as possible.. I was trying to go around the API, but found in some cases it was easier to mod it.
I also used a "post" method instead of "get" to hide the variables.. but you can opt to "get" them.
inclusion if the config.php file works fine for the UI (user interface), modularizing extends the core, so it doesn't mind.. the admin interface, won't cooperate being seperated from the core as it is..
it's a really cool little app.. v1.8.1 shows definite promise.
I thought I'd rewrite it into pnAPI compliance using smarty templating..but in comparing 1.8.0 and 1.8.1 I'm seeing some massive leaps in progress.
I'll type something up ASAP..
you can preview it @ http://www.mashdeco.com/phpdig.html
thanks..take care!
-IR
Here are my thoughts on this:
- Database Abstraction
- APIs
- Seperate out PHPDig in to Nuke mods:
-- Crawler
-- Search Engine
-- Search interface/API
===========================================
Abstraction Layer.
One of the things that bugs me about PHPDig is that it only works with MySQL. If we are porting this to Nuke, lets take advantage of the database abstraction layer in Nuke.
===========================================
API Abstraction Layer.
The more I think about it, the more I don't like the idea of trying to map PHPDig VARS to Nuke equivs. It's messy and problematic. Given the modular nature of the PHPDig code, if we are going to do this, lets do a rewrite with Nuke API's, and then rebuild a standalone option as well.
===========================================
Modules.
The more I think about this, the more I think that it makes good design sence to have the crawler and search engine as seperate modules. By doing this, we also make it possible for others to develop additional add-ons to this system that we have not yet thought of.
===========================================
Modules - The Crawler
PHPNuke has a lot of modules that would seem to act as natural starting places for the crawler to start (web links, news story links, etc), and more modules that are developed all the time. By seperating out the crawler, and providing a place to plug in, we can have the crawler automaticaly crawl these things (as set by admin)
===========================================
Modules - The Search Engine
The search engine itself should be as modular as possible. Thankfuly, PHPDig is very modular.
As we do this, lets remember that PHPNuke already has a seach engine used for the site itself. While well intentioned, I hate it. It does however, have a lot of things we can learn from it
1. Searching the existing tables, and linking to the proper module search feature. While a big part of me does not like how this works, its a lot better than having PHPDig reindex the whole site. What I would really like is a method of allowing you to choose (via drop down menu) what index you want to search. I know it will get more complex than that, but so be it.
2. Off site searching. Lets continue to make it real easy for other site to include a seach bar.
Other thoughts?
I've got it wrapped for PostNuke using the older method of coding.. more similar to phpNuke.. I will put together some documentation if you guys are interested.. it should fold right into phpNuke..
..I only wrapped an index & search page.. so you'll need to administer it in the same way..
..let me know.
-IR
I'll pack the source up asap andlet you know
Regards,
Snorkx
I want to change things like showing the summary and snippets but can't figure out how to get the admin mode of the module version... ;)
It's a kind of entire rewritting, some things are missing, see post about optimization
There's no problem for me to send you the code... (it's under GPL).
Will try to post summit soon.
..this hack works with PostNuke.. PHPNuke's URL's vary slightly.. make sure you match them appropriately..
..I used a nuke_dig_ prefix for the tables.. it'll make it easier to further integrate into the core of your CMS.
back-up your files first
my index.php:
++++++++++++++++++++++++++
if (!eregi("modules.php", $PHP_SELF)){// $_SERVER['REQUEST_METHOD'] != "POST") {
die ("You can't access this file directly...");
}
include ('header.php');
$relative_script_path = 'modules/phpdig';
if (is_file("$relative_script_path/includes/config.php")) {
include "$relative_script_path/includes/config.php";
}
else {
die("Cannot find config.php file.n");
}
if (is_file("$relative_script_path/libs/search_function.php")) {
include "$relative_script_path/libs/search_function.php";
}
else {
die("Cannot find search_function.php file.n");
}
// extract vars
extract(phpdigHttpVars(
array('query_string'=>'string',
'refine'=>'integer',
'refine_url'=>'string',
'site'=>'integer',
'limite'=>'integer',
'option'=>'string',
'lim_start'=>'integer',
'browse'=>'integer',
'path'=>'string'
)
));
$template = "$relative_script_path/templates/grey.html";
phpdigSearch($id_connect, $query_string, $option, $refine,
$refine_url, $lim_start, $limite, $browse,
$site, $path, $relative_script_path, $template);
include 'footer.php';
?>
========================
we're using the grey template for this example, but you can use any one you please.
========================
My search.php:
++++++++++++++++++++++++++
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
include ('header.php');
$relative_script_path = 'modules/phpdig';
if (is_file("$relative_script_path/includes/config.php")) {
include "$relative_script_path/includes/config.php";
}
else {
die("Cannot find config.php file.n");
}
if (is_file("$relative_script_path/libs/search_function.php")) {
include "$relative_script_path/libs/search_function.php";
}
else {
die("Cannot find search_function.php file.n");
}
// extract vars
extract(phpdigHttpVars(
array('query_string'=>'string',
'refine'=>'integer',
'refine_url'=>'string',
'site'=>'integer',
'limite'=>'integer',
'option'=>'string',
'lim_start'=>'integer',
'browse'=>'integer',
'path'=>'string'
)
));
$template = "$relative_script_path/templates/grey.html";
phpdigSearch($id_connect, $query_string, $option, $refine,
$refine_url, $lim_start, $limite, $browse,
$site, $path, $relative_script_path, $template);
include 'footer.php';
?>
========================
Open ../modules/phpdig/templates/grey.html
+++++++++++++++++++++++++++++
remove
find this line:
==============
http://www.yoursitename.com/modules/phpdig/admin
-IR
----------------------------------------------------------------------------
Steven Santos
Email : Steven@StevenSantos.com
Web : www.CircusNews.com
Postal: PO Box 620753
Newton, Ma. 02462
Xoops on the other hand is Object Oriented.. I'm not very familiar with the architecture, but it would take some tweeking (inclusion of classes..etc.).. Xoops and pn are both the offspring of PhpNuke, but neither maintain much of the original code.. I've been meaning to do an install of Xoops.. they've really grown a lot since my last preview.. even then it was an incredible project.
take care guys..
-IR
I suppose if there's a specific piece that isn't working I could debug that but I'm not sure I'm ready to tackle the whole thing yet. I could assist.. but not sure how much help I'd be. Anyone have a project set up anywhere for this?
#If you have any other info about this subject , Please add it free.# |