PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Mod Submissions (http://www.phpdig.net/forum/forumdisplay.php?f=24)
-   -   PDF Indexing Workaround on Shared Hosting (http://www.phpdig.net/forum/showthread.php?t=2743)

dekortage 02-07-2007 12:17 PM

PDF Indexing Workaround on Shared Hosting
 
I recently installed PHPdig for a client who has a shared hosting account with CheapCheap.biz. With only a shared account, there is no access to PDF converters on the server, and no way to install them. However, he still had a handful of PDFs that he wanted to include in search results. My workaround was this:

1. Open the PDFs and export the text to a plain-text file. If the PDF was called "newsletter-2006.pdf", then I named the text file "newsletter-2006_pdf.txt" in the exact same directory.

2. Index the text files with PHPdig (using direct URLs).

3. Add the following PHP code to PHPdig's /libs/search_function.php, around line 520, just before the line that begins "$table_results[$n] = ...":

$url = str_replace("_pdf.txt",".pdf",$url);


And there you go. This way, PHPdig has indexed the text of the PDF, but will return search links to the actual PDF file. It's not an ideal solution, but it works in a pinch.


All times are GMT -8. The time now is 05:19 PM.

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