1
kenogui
Need xoops developpers answer about the code
  • 2004/2/17 10:31

  • kenogui

  • Just popping in

  • Posts: 25

  • Since: 2004/1/19


Hi all,

I'm currently working on a mod rewrite full hack to allow search engine to crawl most important URLs in xoops.

I have finished with it, and everything works perfectly, articles, stories, downloads, weblinks and even IPBM module are completely rewritten into bot-friendly URLs.

To finish my job and do a tutorial + release of this mod, I have a minor pb to solve before.

URLs are rewritten correctly only when there is no cache on pages. It's due to the fact I open a buffer in the header, put all contents into, and close it in the footer. Then I parse all urls in this buffer with some regular expressions to turn them into friendly URLs.

BUT, when cache is enabled, I do not understand everything in the code, but the core process is slightly different, because it uses cached pages, and they have been generated without being parsed by my mod. So URLs are not rewritten.

So my question is : where are the variables which contains the "$content" which will be written into each modules cache HTML pages ... ?

This morning I have found where are the content of the sided blocks, I have "intercept" the content, and rewritten it correctly, so the pb of the side block is solved. But it still remains the "main area" of the page to be caught, the modules in fact.

so where is the code line which take the content of a given module, and write in into the cache file ?

To help you to understand my pb, here is the example of the side block content which is intercepted and rewritten by my parser:

--- in header.php ----
//HACK -- rewrite urls dans blocks cote avant mise en cache
                
$bcontent=replace_for_mod_rewrite($bcontent);
                
//--- fin hack --
                
switch ($block_arr[$i]->getVar('side')) {
                case 
XOOPS_SIDEBLOCK_LEFT:
                        
$xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
                        break;
                case 
XOOPS_CENTERBLOCK_LEFT:
                        if (!isset(
$show_cblock)) {
                                
$xoopsTpl->assign('xoops_showcblock'1);
                                
$show_cblock 1;
                        }
                        
$xoopsTpl->append('xoops_clblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
                        break;
                case 
XOOPS_CENTERBLOCK_RIGHT:
                        if (!isset(
$show_cblock)) {
                                
$xoopsTpl->assign('xoops_showcblock'1);
                                
$show_cblock 1;
                        }
                        
$xoopsTpl->append('xoops_crblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
                        break;
                case 
XOOPS_CENTERBLOCK_CENTER:
                        if (!isset(
$show_cblock)) {
                                
$xoopsTpl->assign('xoops_showcblock'1);
                                
$show_cblock 1;
                        }
                        
$xoopsTpl->append('xoops_ccblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
                        break;
                case 
XOOPS_SIDEBLOCK_RIGHT:
                        if (!isset(
$show_rblock)) {
                                
$xoopsTpl->assign('xoops_showrblock'1);
                                
$show_rblock 1;
                        }
                        
$xoopsTpl->append('xoops_rblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
                        break;
                }
                unset(
$bcontent);


I hope I'm clear enough, and I really hope someone familiar with XOOPS code will be able to answer this question.

Thanks a lot !

Login

Who's Online

237 user(s) are online (156 user(s) are browsing Support Forums)


Members: 0


Guests: 237


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits