PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 12-29-2003, 01:51 PM   #1
SavageNoName
Green Mole
 
Join Date: Dec 2003
Posts: 6
Problem whith inclute in template SSI blocks

Hi
Sorry my english.
I have truble with include in template SSI-blocks.
Link http://www.windowsfaq.ru/search/
What not work SSI?
SavageNoName is offline   Reply With Quote
Old 12-29-2003, 05:18 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. The search page is PHP, not SHTML, so SSI is not working. To get your includes into the template do the following.

First add the following function to the top of the search_function.php file:
PHP Code:
function get_my_includes($filename) {
  if (
file_exists($filename)) {
    
$buffer "";
    
$handle fopen($filename"r");
    while (!
feof($handle)) {
      
$buffer .= fgets($handle4096);
    }
    
fclose($handle);
    return 
$buffer;
  }

Next in search_function.php replace:
PHP Code:
if ($template == 'array' || is_file($template)) {
    
$phpdig_version PHPDIG_VERSION;
    
$t_mstrings compact('powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links');
    
$t_fstrings phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'template',$template);
    if (
$template == 'array') {
        return 
array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
    }
    else {
        
$t_strings array_merge($t_mstrings,$t_fstrings);
        
phpdigParseTemplate($template,$t_strings,$table_results);
    }

with the following:
PHP Code:
// check that the paths are correct or use full paths
$my_page_header get_my_includes("../../incl/header.html");
$my_page_metaword get_my_includes("../../incl/metaword.html");
$my_page_top get_my_includes("../../incl/top.html");
$my_page_menu get_my_includes("../../incl/menu.html");
$my_page_bottom get_my_includes("../../incl/bottom.html");

if (
$template == 'array' || is_file($template)) {
    
$phpdig_version PHPDIG_VERSION;
    
$t_mstrings compact('my_page_header','my_page_metaword','my_page_top','my_page_menu','my_page_bottom','powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links');
    
$t_fstrings phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'template',$template);
    if (
$template == 'array') {
        return 
array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
    }
    else {
        
$t_strings array_merge($t_mstrings,$t_fstrings);
        
phpdigParseTemplate($template,$t_strings,$table_results);
    }

Finally in the template replace:
Code:
<!--#include virtual="../../incl/header.html" -->
<!--#include virtual="../../incl/metaword.html" -->
<!--#include virtual="../../incl/top.html" -->
<!--#include virtual="../../incl/menu.html" -->
<!--#include virtual="../../incl/bottom.html" -->
with the following:
Code:
<phpdig:my_page_header/>
<phpdig:my_page_metaword/>
<phpdig:my_page_top/>
<phpdig:my_page_menu/>
<phpdig:my_page_bottom/>
Remember to remove any "word" wrapping in the above code.

Also, you are using Cyrillic. Did you do as shown in this thread, or how did you add Cyrillic support?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-30-2003, 03:53 AM   #3
SavageNoName
Green Mole
 
Join Date: Dec 2003
Posts: 6
Great Tnx
http://www.windowsfaq.ru/smiles/bounce.gif
http://www.windowsfaq.ru/search/

[code]
$phpdig_language = "ru";

define('PHPDIG_ENCODING','windows-1251');

$phpdig_string_subst['windows-1251'] = 'A:ÀÁÂÃÄÅ,a:*áâãäå,O:ÒÓÔÕÖØ,o:òóôõöø,E:ÈÉÊË,e: éêë,C:Ç,c:ç,I:ÌÍÎÏ,i:ì*îï,U:ÙÚÛÜ,u:ùúûü,Y:Ý,y:ÿý,N :Ñ,n:ñ';

$phpdig_words_chars['windows-1251'] = '[:alnum:]ðþß';

Last edited by SavageNoName; 12-30-2003 at 03:56 AM.
SavageNoName is offline   Reply With Quote
Old 12-30-2003, 04:00 AM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Does $phpdig_string_subst get all of these from C0 to FF?
Code:
Windows-1251 Characters (note A0 is a space):

A0-AF _ Ў ў Ј ¤ Ґ ¦ § Ё © Є « ¬ _ ® Ї
B0-BF ° ± І і ґ µ ¶ · ё № є » ј Ѕ ѕ ї
C0-CF А Б В Г Д Е Ж З И Й К Л М Н О П
D0-DF Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я
E0-EF а б в г д е ж з и й к л м н о п
F0-FF р с т у ф х ц ч ш щ ъ ы ь э ю я

Characters in extended ASCII (note A0 is a space):

A0-AF _ ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ _ ® ¯
B0-BF ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
C0-CF À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
D0-DF Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
E0-EF * á â ã ä å æ ç è é ê ë ì * î ï
F0-FF ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-30-2003, 04:17 AM   #5
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. A search for избежать gives no results. Try doing the following instead.

In the config.php file set the following:
PHP Code:
define('PHPDIG_ENCODING','windows-1251');

// give functions something trivial to do
$phpdig_string_subst['windows-1251'] = 'Q:Q,q:q';

// remove word wrapping in the below line
$phpdig_words_chars['windows-1251'] = '[:alnum:]ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß*áâãäåæçèéêëì*îïðñòóôõö÷øùúûüýþÿ'
In addition, in the robot_functions.php file is a phpdigIndexFile function.

In the phpdigIndexFile function replace:
PHP Code:
global $common_words,$relative_script_path,$s_yes,$s_no,$br
with the following:
PHP Code:
global $phpdig_words_chars,$common_words,$relative_script_path,$s_yes,$s_no,$br
Also, in the phpdigIndexFile function replace:
PHP Code:
        if (strlen($key) > SMALL_WORDS_SIZE and strlen($key) <= MAX_WORDS_SIZE and !isset($common_words[$key]) and ereg('^[0-9a-zßðþ]',$key)) 
with the following:
PHP Code:
        if (strlen($key) > SMALL_WORDS_SIZE and strlen($key) <= MAX_WORDS_SIZE and !isset($common_words[$key]) and ereg('^['.$phpdig_words_chars[PHPDIG_ENCODING].']',$key)) 
Remember to remove any "word" wrapping in the above code and use PhpDig 1.6.5 if not used already.

Also, you will need to reindex for the changes to take effect.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-30-2003, 05:14 AM   #6
SavageNoName
Green Mole
 
Join Date: Dec 2003
Posts: 6
Respect, all ok. Search èçáåæ*òü - 2 result.

Small bug.
From admin panel press Delete site. All table empty, except keywords. Why?
SavageNoName is offline   Reply With Quote
Old 12-30-2003, 05:23 AM   #7
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Click the Clean Dictionary link, or empty the table from phpMyAdmin or shell. The latter may be faster.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-30-2003, 07:00 AM   #8
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Now I search for избежать and get two results. Did you use the following code and make the other changes?
PHP Code:
define('PHPDIG_ENCODING','windows-1251'); 

// give functions something trivial to do 
$phpdig_string_subst['windows-1251'] = 'Q:Q,q:q'

// remove word wrapping in the below line 
$phpdig_words_chars['windows-1251'] =  '[:alnum:]ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß*áâãäåæçèéêëì*îïðñòóôõö÷øùúûüýþÿ'
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-31-2003, 01:25 AM   #9
SavageNoName
Green Mole
 
Join Date: Dec 2003
Posts: 6
Hi. I have made all corrections specified in message 1504. After that all works perfectly. Cyrillics everywhere is displayed and processed correctly.

One more small bug
After installation it is necessary in the table logs manually to create a field l_time (first letter L). Type of the data - TIME. If it to not make, the statistics in the admin-panel does not work.

Happy New Year
SavageNoName is offline   Reply With Quote
Old 12-31-2003, 01:28 AM   #10
SavageNoName
Green Mole
 
Join Date: Dec 2003
Posts: 6
P.S. After modification in a code, specified in the message 1504, it is necessary to re-index.
SavageNoName is offline   Reply With Quote
Old 12-31-2003, 01:35 AM   #11
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Great, glad it's working!

The l_time bug was fixed in version 1.6.3. Of course, if anyone created the tables prior to that, then they would need to do the following:
Code:
ALTER TABLE logs ADD l_time FLOAT DEFAULT '0' NOT NULL;
Please note it's FLOAT and not TIME.

>> Also, you will need to reindex for the changes to take effect.

Already there.

Can you tell me what version of MySQL you are running and what is your MySQL character set?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 12-31-2003, 01:59 AM   #12
SavageNoName
Green Mole
 
Join Date: Dec 2003
Posts: 6
Please note it's FLOAT and not TIME.
Ops! Tnx, fixed.

version of MySQL you are running and what is your MySQL character set?
4.0.16 and ru-win1251
SavageNoName 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
Including extra files (like ssi) does not work mikmedia How-to Forum 1 06-29-2006 05:35 AM
pdf indexing blocks when spidering sepult External Binaries 3 06-29-2006 05:24 AM
Spider problem, Search mb_ereg_replace problem. (Fixed?!) cpeter Troubleshooting 0 02-24-2006 01:56 PM
install problem can't write connexion template ENTHALPIE Script Installation 1 10-28-2005 04:15 AM
Enhanced template manfred Mod Submissions 2 09-01-2004 02:00 PM


All times are GMT -8. The time now is 08:53 AM.


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