PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Requests

Reply
 
Thread Tools
Old 05-31-2004, 02:57 PM   #16
InvalidResponse
Green Mole
 
Join Date: May 2004
Location: New York
Posts: 5
install PhpDig in ../modules/phpdig

..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:
++++++++++++++++++++++++++
<?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:
++++++++++++++++++++++++++
<?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 <phpdig:form_head/>
find this line:
==============
<div align="center"><b><phpdig:form_title/></b></div>
enter this:
<div align="center"><b><phpdig:form_title/></b></div>
<table width="100%" align="center">
<tr>
<td align="left" width="69%">
<div align="center"><b>
<form action='modules.php' method='post'> <!-- NOTICE THE POST METHOD.. YOU MAY OPT TO USE GET -->
<input type='hidden' name='op' value='modload'/>
<input type='hidden' name='name' value='phpdig'/>
<input type='hidden' name='file' value='search'/>
<input type='hidden' name='site' value='0'/>
<input type='hidden' name='path' value=''/>
<input type='hidden' name='result_page' value='modules/phpdig/search.php'/>
<input type='text' class='phpdiginputtext' size='15' maxlength='50' name='query_string' value=''/>
<input type='submit' class='phpdiginputsubmit' name='search' value='Go...'/>
<input type='hidden' name='limite' class='phpdigselect' value='10'>
===============
the above replaces:
<phpdig:form_field/><phpdig:form_button/>
================
the image path in the template needs to be changed too:
IE: background="modules/phpdig/tpl_img/g.gif">
================
Open ../modules/phpdig/includes/config.php
++++++++++++++++++++++++++
at the top:
if ((isset($relative_script_path)) && ($relative_script_path != ".") && ($relative_script_path != "..") &&
($relative_script_path != "modules/phpdig")) {
__exit();
}
===============
comment out the template variable:
//$template = "$relative_script_path/templates/phpdig.html";
=====================================
Open ../modules/phpdig/libs/search_function.php
+++++++++++++++++++++
find this line:
$l_site = "<a class='phpdig' href='".SEARCH_PAGE."?refine=1&amp;query_string=".urlencode($my_query_strin g_link)."&amp;site=".$content['site_id']."&amp;limite=$limite&amp;option=$option'>".$content['site_url']."</a>";

replace it (or comment it out) and add this:
$l_site = "<a class='phpdig' href='modules.php?op=modload&name=phpdig&amp;file=search&amp;refine=1&amp;q uery_string=".urlencode($my_query_string_link)."&amp;site=".$content['site_id']."&amp;limite=$limite&amp;option=$option'>".$content['site_url']."</a>";

-----------------------

then find this line:
$l_path = ", ".phpdigMsg('this_path')." : <a class='phpdig' href='".SEARCH_PAGE."?refine=1&amp;query_string=".urlencode($my_query_strin g_link)."&amp;site=".$content['site_id']."&amp;path=".$content['path']."&amp;limite=$limite&amp;option=$option' >".ereg_replace('%20*',' ',$content['path'])."</a>";

and replace (or comment it out) with this line:
$l_path = ", ".phpdigMsg('this_path')." : <a class='phpdig' href='modules.php?op=modload&name=phpdig&amp;file=search&amp;refine=1&amp;q uery_string=".urlencode($my_query_string_link)."&amp;site=".$content['site_id']."&amp;path=".$content['path']."&amp;limite=$limite&amp;option=$option' >".ereg_replace('%20*',' ',$content['path'])."</a>";

------------------------

then find this line:
$url_bar = SEARCH_PAGE."?browse=1&amp;query_string=".urlencode($my_query_string_link). "$refine_url&amp;limite=$limite&amp;option=$option&amp;lim_start=";

and replace (or comment it out) with:
$url_bar = "modules.php?op=modload&name=phpdig&amp;file=search&amp;browse=1&amp;query_ string=".urlencode($my_query_string_link)."$refine_url&amp;limite=$limite&a mp;option=$option&amp;lim_start=";

==========================

..I think that's the jist of it..hope it is anyway..

administer as a standalone.. it should work fine for the time being..I'd wait until it matures some before porting it..

a great, great product.. I was looking for something to spider my site for broken links, but got side-tracked

..I'll check back to see if there are any problems.

enjoy.
-IR
InvalidResponse is offline   Reply With Quote
Old 06-03-2004, 02:37 AM   #17
synnalagma
Green Mole
 
Join Date: Mar 2004
Posts: 22
I have done what you're suggesting but for e-xoops and xoops (wich are fork of phpnuke I think).

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).
synnalagma is offline   Reply With Quote
Old 06-03-2004, 01:12 PM   #18
ChadK
Green Mole
 
Join Date: May 2004
Posts: 23
Great work for Postnuke but we were actually concerned with PHP-Nuke
ChadK is offline   Reply With Quote
Old 06-03-2004, 01:29 PM   #19
ChadK
Green Mole
 
Join Date: May 2004
Posts: 23
Hey InvalidResponse, that seems to work great!
ChadK is offline   Reply With Quote
Old 06-03-2004, 08:08 PM   #20
InvalidResponse
Green Mole
 
Join Date: May 2004
Location: New York
Posts: 5
...good to hear Chad.. it's a temporary workaround, but will work fine for the time being..

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
InvalidResponse is offline   Reply With Quote
Old 06-10-2004, 06:28 PM   #21
ChadK
Green Mole
 
Join Date: May 2004
Posts: 23
My only bit of confusion InvalidResponse is how do I admin the php-nuke module version?
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...
ChadK is offline   Reply With Quote
Old 06-11-2004, 12:31 PM   #22
InvalidResponse
Green Mole
 
Join Date: May 2004
Location: New York
Posts: 5
..hi Chad.. I didn't do any integration for the admin area.. I just wanted to wrap the search results.. so you would need to access the admin area as a stand-alone:
http://www.yoursitename.com/modules/phpdig/admin

-IR
InvalidResponse is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Green template after integration mulanee How-to Forum 0 12-23-2006 04:46 AM
phpnuke 7.5 question chris44gw Coding & Tutorials 2 12-09-2004 10:36 AM
PostNuke integration Dreamory How-to Forum 1 11-22-2004 02:20 AM
Integration with NetObjects Fusion or Dreamweaver tuxcode Coding & Tutorials 3 02-19-2004 05:26 PM


All times are GMT -8. The time now is 03:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.