PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 02-07-2007, 12:17 PM   #1
dekortage
Green Mole
 
Join Date: Feb 2007
Posts: 2
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.
dekortage 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
auto re-indexing on shared hosting server mental cube How-to Forum 1 09-07-2004 05:10 PM


All times are GMT -8. The time now is 04:45 AM.


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