|
05-31-2004, 03:57 PM | #16 |
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&query_string=".urlencode($my_query_strin g_link)."&site=".$content['site_id']."&limite=$limite&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&file=search&refine=1&q uery_string=".urlencode($my_query_string_link)."&site=".$content['site_id']."&limite=$limite&option=$option'>".$content['site_url']."</a>"; ----------------------- then find this line: $l_path = ", ".phpdigMsg('this_path')." : <a class='phpdig' href='".SEARCH_PAGE."?refine=1&query_string=".urlencode($my_query_strin g_link)."&site=".$content['site_id']."&path=".$content['path']."&limite=$limite&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&file=search&refine=1&q uery_string=".urlencode($my_query_string_link)."&site=".$content['site_id']."&path=".$content['path']."&limite=$limite&option=$option' >".ereg_replace('%20*',' ',$content['path'])."</a>"; ------------------------ then find this line: $url_bar = SEARCH_PAGE."?browse=1&query_string=".urlencode($my_query_string_link). "$refine_url&limite=$limite&option=$option&lim_start="; and replace (or comment it out) with: $url_bar = "modules.php?op=modload&name=phpdig&file=search&browse=1&query_ string=".urlencode($my_query_string_link)."$refine_url&limite=$limite&a mp;option=$option&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 |
06-03-2004, 03:37 AM | #17 |
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). |
06-03-2004, 02:12 PM | #18 |
Green Mole
Join Date: May 2004
Posts: 23
|
Great work for Postnuke but we were actually concerned with PHP-Nuke
|
06-03-2004, 02:29 PM | #19 |
Green Mole
Join Date: May 2004
Posts: 23
|
Hey InvalidResponse, that seems to work great!
|
06-03-2004, 09:08 PM | #20 |
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 |
06-10-2004, 07:28 PM | #21 |
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... |
06-11-2004, 01:31 PM | #22 |
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 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Green template after integration | mulanee | How-to Forum | 0 | 12-23-2006 05:46 AM |
phpnuke 7.5 question | chris44gw | Coding & Tutorials | 2 | 12-09-2004 11:36 AM |
PostNuke integration | Dreamory | How-to Forum | 1 | 11-22-2004 03:20 AM |
Integration with NetObjects Fusion or Dreamweaver | tuxcode | Coding & Tutorials | 3 | 02-19-2004 06:26 PM |