351
trabis
Re: Unknown SEO method.
  • 2011/8/28 12:03

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Please close this thread an open another one.



352
trabis
Re: Banner admin
  • 2011/8/27 12:22

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Hi Voltan!

We(core team) are currently working on the bug tracker and would like to avoid any features requests for 2.5.2

There will be plenty opportunity for 2.5.3. If you could submit your request on the Features tracker we would appreciate.

Thank you!



353
trabis
Re: Xoops cache and stylesheets :-(
  • 2011/8/25 16:00

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


This callback solution works very good and was added to core.
It is a new feature but it was the only way to allow module developers to address this problem.

an example of how to fix publisher:

add this code in xoops_version.php
//Cache
$modversion['onCache']['file'] = "include/functions.php";
$modversion['onCache']['func'] = "publisher_onCache";


add this code on functions.php
function publisher_onCache()
{
    
$GLOBALS['xoTheme']->addStylesheet(PUBLISHER_URL '/css/publisher.css');
    
$GLOBALS['xoTheme']->addStylesheet(PUBLISHER_URL '/css/jquery.popeye.style.css');
    
$GLOBALS['xoTheme']->addStylesheet(PUBLISHER_URL '/css/jquery-ui-1.7.1.custom.css');

    
$GLOBALS['xoTheme']->addScript(XOOPS_URL '/browse.php?Frameworks/jquery/jquery.js');

    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/jquery.popeye-2.0.4.js');

    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/behavior.js');
    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/rating.js');

    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/ui.core.js');
    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/ui.tabs.js');

    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/ajaxupload.3.9.js');
    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/jquery.easing.js');
    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/script.easing.js');
    
$GLOBALS['xoTheme']->addScript(PUBLISHER_URL '/js/publisher.js');
}



354
trabis
Re: Xoops cache and stylesheets :-(
  • 2011/8/25 14:12

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Well, the above does not work with blocks :(
When block is cached the block file will not be included and there is no way of pushing js and css.

Other solution I'm working now is callback functions .declared in xoops_version.php

example:
$modversion['onCache']['file'] = "include/functions.php";
$modversion['onCache']['func'] = "publisher_onCache";
So everytime XOOPS hit a page cache or a block cache, it will call a module function.

This seems to work fine!

Imagine a module that has 3 pages and uses 3 different scripts
page 1 -> script 1
page 2 -> script 2
page 3 -> script 3
block1 -> script 1

There is no need to load script 1,2,3 for page one. I can use xoTheme in each page to assign the desired script as we usually do.(no changes needed for existing modules)

However, when module is cached it will not load any of this scripts and it will call this "onCache" function.
In this function I can use $xoTheme but I will have to load the 3 scripts because I'm not aware of the page I am at the moment.
Results when using cache:
page 1 -> script 1,2,3
page 2 -> script 1,2,3
page 3 -> script 1,2,3
block1 -> script 1,2,3


What do you think of this solution?





355
trabis
Re: Xoops cache and stylesheets :-(
  • 2011/8/25 0:29

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Maybe better to understand:

Instead of doing
include_once XOOPS_ROOT_PATH '/header.php';
$xoTheme->addScript(XOOPS_URL '/browse.php?Frameworks/jquery/jquery.js');


We do:
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('script''browse.php?Frameworks/jquery/jquery.js');        
include_once 
XOOPS_ROOT_PATH '/header.php';



356
trabis
Re: Xoops cache and stylesheets :-(
  • 2011/8/25 0:16

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


The solution I'm working on looks like this:
<?php
//bootstraping Xoops and module constants
include_once dirname(dirname(dirname(__FILE__))) . '/mainfile.php';
include_once 
dirname(__FILE__) . '/include/common.php';

//setting template for this page
xoopsOption['template_main'] = 'publisher_display_item.html';

//setting stylesheets, scripts and feed
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('stylesheet',PUBLISHER_URL '/css/publisher.css');
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('script''browse.php?Frameworks/jquery/jquery.js');
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('script'PUBLISHER_URL '/js/publisher.js');
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('script'PUBLISHER_URL '/js/ui.core.js');
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('script'PUBLISHER_URL '/js/ui.tabs.js');
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('script'PUBLISHER_URL '/js/ajaxupload.3.9.js');
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('stylesheet'PUBLISHER_URL '/css/jquery-ui-1.7.1.custom.css');
$GLOBALS['xoopsOption']['xoops_module_header'][] = array('link','alternate'PUBLISHER_URL '/backend.php',array(
            
'href' => PUBLISHER_URL '/backend.php','type'=>'application/rss+xml',
            
'title'=> 'My feed'
        
));


//starting template engine, render blocks and check cache
include_once XOOPS_ROOT_PATH '/header.php';

//logic code that is not executed when using cache;

//theme and template rendering
include_once XOOPS_ROOT_PATH '/footer.php';
?>


We need to type a little more but the interface/arguments are the same as when using $xoTheme.
I can implement this on 2.5.2 but I would like to know what do you think first.

Thanks.



357
trabis
Re: Restricting cache size
  • 2011/8/24 21:34

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Problem was with long file names. If generated file names were to big, the cache would not work and files would be generated hit after hit with random names, ie: xHjlkm3.tmp. Some sites could experience more problems then others, ie: sites with long urls.

The result was big Xoops Cache directory and your cached modules were not actually being cached.

This is now fixed on SVN.



358
trabis
Re: Xoops cache and stylesheets :-(
  • 2011/8/24 12:41

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

playsome wrote:

Could a xoops developer provide the absolute definate way to include an external css file in a modules php code?


Well, only way I see is to use
$GLOBALS['xoopsOption']['xoops_module_header'] = '<link rel=...

just before calling header.php

Any php code after the inclusion of header will be ignored when cache is used.


The problem with this solution is that you need to hard code the string and that it will not account for duplicate file inclusion. If you're adding jquery, and then a block from other module also adds jquery(using $xoTheme) they will both be loaded causing a conflict.

Future solution is make $GLOBALS['xoopsOption']['xoops_module_header'] accept an array of values(not full formated string)and then use $xoTheme to format those values, check for duplicates and assigning them to theme.

For now, there is not a 100% solution.



359
trabis
Re: Unknown SEO method.
  • 2011/8/24 10:16

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

chefry wrote:
Trabis, how can I stop the date from appearing beside each article in that New Items Block?


There is an option in the block to "show order", set it to 'NO'.



360
trabis
Re: Unknown SEO method.
  • 2011/8/24 1:42

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


After I reuploaded publisher and a cloned version(alchool) I was still getting 503 error.

I've changed "modules" folder permissions from 700 to 755 and now your site is running again perfectly.

I don't know what to tell you.

Have fun.





TopTop
« 1 ... 33 34 35 (36) 37 38 39 ... 190 »



Login

Who's Online

141 user(s) are online (78 user(s) are browsing Support Forums)


Members: 0


Guests: 141


more...

Donat-O-Meter

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

Latest GitHub Commits