xoops forums

young

Just popping in
Posted on: 2008/11/7 8:05
young
young (Show more)
Just popping in
Posts: 99
Since: 2006/1/16
#11

Re: Defacer 1.0 alpha is released for feature requests

trabis,

you got me! im just feel like want to request a module that apply diffirent theme on diffirent modules.

this is a very good module, i nearly miss out to test this module if there are no reply new on this forum.

just downloaded and testing, so far don't have any problem.

thanks.

trabis

Core Developer
Posted on: 2008/11/8 23:04
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#12

Re: Defacer 1.0 alpha is released for feature requests

OK, I will leave php_speedy for now because I´m founding some problems like compressing javascript, doh.

I´ll make this defacer 1.0 as simple as it can be.

You can download beta version at:
http://code.google.com/p/xuups/downloads/list

There are some improvements, and cleaning made:

Improved : More friendly admin area.
Improved : Less queries needed.
Improved : Less language definitions needed.
Added : Defacer in xoopsLogger.
Added : Settings to disable each Defacer actions.

You may start helping with translations now. I do not have intentions to add nothing more. Let's just test this and make it 'Final'.

Also want to thank those who have replied to this topic and Claudia and Giba that have been walking with me trough this one. You´re Great!

See ya

trabis

Core Developer
Posted on: 2008/11/9 0:15
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#13

Re: Defacer 1.0 alpha is released for feature requests

I have noticed a typo in a link(causing blank page when editing metadata) so I have reupload the files again.

kris_fr

Theme Designer
Posted on: 2008/11/9 15:44
kris_fr
kris_fr (Show more)
Theme Designer
Posts: 1009
Since: 2005/12/31
#14

Re: Defacer 1.0 alpha is released for feature requests

@ trabis : see for french translate --> http://www.frxoops.org/modules/newbb/ ... p?topic_id=27814&forum=12

trabis

Core Developer
Posted on: 2008/11/9 16:05
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#15

Re: Defacer 1.0 alpha is released for feature requests

Bravo et merci!

A big 'Salut' to the French community, thanks!

sarahmx

Quite a regular
Posted on: 2009/1/11 3:32
sarahmx
sarahmx (Show more)
Quite a regular
Posts: 378
Since: 2007/10/28
#16

Re: Defacer 1.0 alpha is released for feature requests

thanks trabis..this is what i'm looking for

nmshah

Just can't stay away
Posted on: 2009/1/13 8:38
nmshah
nmshah (Show more)
Just can't stay away
Posts: 556
Since: 2007/7/2 8
#17

Re: Defacer 1.0 alpha is released for feature requests

I am not able to use this module to create meta tags for pages. Modules tried mastop_publish and smartfaq.

I will write down the steps followed

1. Installed defacer as any other module from XOOPS admin
2. Added the lines as per the readme file in the module in header.php, the new header.php looks like this

<?php
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code 
 which is considered copyrighted (c) material of the original comment or credit authors.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
 * XOOPS global header file
 *
 * See the enclosed file license.txt for licensing information.
 * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html
 *
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
 * @license     http://www.fsf.org/copyleft/gpl.html& ... Public License (GPL)
 * @package     core
 * @since       2.0.0
 * @author      Kazumi Ono <webmaster@myweb.ne.jp>
 * @author      Skalpa Keo <skalpa@xoops.org>
 * @author      Taiwen Jiang <phppp@users.sourceforge.net>
 * @version     $Id: header.php 1491 2008-04-23 04:28:45Z phppp $
 */
 
defined("XOOPS_ROOT_PATH") or die( 'XOOPS root path not defined' );
include_once 
XOOPS_ROOT_PATH.'/modules/defacer/include/beforeheader.php';

include_once 
XOOPS_ROOT_PATH.'/class/xoopsblock.php';

//global $xoopsLogger;

if ( !isset( $xoopsLogger ) ) { $xoopsLogger =& $GLOBALS['xoopsLogger'];    }

$xoopsLogger->stopTime'Module init' );
$xoopsLogger->startTime'XOOPS output init' );


if (
$xoopsConfig['theme_set'] != 'default' && file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php')) {
    require_once 
XOOPS_ROOT_PATH '/include/xoops13_header.php';
} else {
    global 
$xoopsOption$xoopsConfig$xoopsModule;

    
$xoopsOption['theme_use_smarty'] = 1;

    
// include Smarty template engine and initialize it
    
require_once XOOPS_ROOT_PATH '/class/template.php';
    require_once 
XOOPS_ROOT_PATH '/class/theme.php';
    require_once 
XOOPS_ROOT_PATH '/class/theme_blocks.php';

    if ( @
$xoopsOption['template_main'] ) {
        if ( 
false === strpos$xoopsOption['template_main'], ':' ) ) {
            
$xoopsOption['template_main'] = 'db:' $xoopsOption['template_main'];
        }
    }
    
$xoopsThemeFactory =& new xos_opal_ThemeFactory();
    
$xoopsThemeFactory->allowedThemes $xoopsConfig['theme_set_allowed'];
    
$xoopsThemeFactory->defaultTheme $xoopsConfig['theme_set'];

    
/**
     * @var xos_opal_Theme
     */
    
$xoTheme =& $xoopsThemeFactory->createInstance( array(
        
'contentTemplate' => @$xoopsOption['template_main'],
    ) );
    
$xoopsTpl =& $xoTheme->template;

    
$xoTheme->addScript'/include/xoops.js', array( 'type' => 'text/javascript' ) );

    
// Temporary solution for start page redirection
    
if (defined("XOOPS_STARTPAGE_REDIRECTED")) {
        
$params $content $tpl $repeat null;
        
$xoTheme->headContent$params"<base href='" XOOPS_URL '/modules/' $xoopsConfig['startpage'] . "/' />"$tpl$repeat );
    }
    
    if ( @
is_object$xoTheme->plugins['xos_logos_PageBuilder'] ) ) {
        
$aggreg =& $xoTheme->plugins['xos_logos_PageBuilder'];

        
// Backward compatibility code for pre 2.0.14 themes
        
$xoopsTpl->assign_by_ref'xoops_lblocks'$aggreg->blocks['canvas_left'] );
        
$xoopsTpl->assign_by_ref'xoops_rblocks'$aggreg->blocks['canvas_right'] );
        
$xoopsTpl->assign_by_ref'xoops_ccblocks'$aggreg->blocks['page_topcenter'] );
        
$xoopsTpl->assign_by_ref'xoops_clblocks'$aggreg->blocks['page_topleft'] );
        
$xoopsTpl->assign_by_ref'xoops_crblocks'$aggreg->blocks['page_topright'] );

        
$xoopsTpl->assign'xoops_showlblock', !empty($aggreg->blocks['canvas_left']) );
        
$xoopsTpl->assign'xoops_showrblock', !empty($aggreg->blocks['canvas_right']) );
        
$xoopsTpl->assign'xoops_showcblock', !empty($aggreg->blocks['page_topcenter']) || !empty($aggreg->blocks['page_topleft']) || !empty($aggreg->blocks['page_topright']) );
    }

    if ( 
$xoopsModule ) {
        
$xoTheme->contentCacheLifetime = @$xoopsConfig['module_cache'][ $xoopsModule->getVar('mid''n') ];
    }
    if ( 
$xoTheme->checkCache() ) {
        exit();
    }

    if ( !isset(
$xoopsOption['template_main']) && $xoopsModule ) {
        
// new themes using Smarty does not have old functions that are required in old modules, so include them now
        
include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
        
// need this also
        
$xoopsTheme['thename'] = $xoopsConfig['theme_set'];
        
ob_start();
    }

$xoopsLogger->stopTime'XOOPS output init' );
$xoopsLogger->startTime'Module display' );


}

?>


and footer.php, the new footer.php reads as follows

<?php
// $Id: footer.php 1471 2008-04-20 14:49:37Z phppp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>  &nbs ... nbsp;   //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
if (!defined("XOOPS_ROOT_PATH")) {
    die(
"XOOPS root path not defined");
}
include_once 
XOOPS_ROOT_PATH.'/modules/defacer/include/beforefooter.php';

if ( !
defined("XOOPS_FOOTER_INCLUDED") ) {
    
define("XOOPS_FOOTER_INCLUDED",1);

    
$xoopsLogger->stopTime'Module display' );
    if (
$xoopsOption['theme_use_smarty'] == 0) {
        
// the old way
        
$footer htmlspecialchars$xoopsConfigMetaFooter['footer'] ) . '<br /><div style="text-align:center">Powered by XOOPS &copy; <a href="http://xoops.sourceforge.net/" rel="external">The XOOPS Project</a></div>';
        if (isset(
$xoopsOption['template_main'])) {
            
$xoopsTpl->xoops_setCaching(0);
            
$xoopsTpl->display('db:'.$xoopsOption['template_main']);
        }
        if (!isset(
$xoopsOption['show_rblock'])) {
            
$xoopsOption['show_rblock'] = 0;
        }
        
themefooter($xoopsOption['show_rblock'], $footer);
        
xoops_footer();
    } else {
        
// RMV-NOTIFY
        
include_once XOOPS_ROOT_PATH '/include/notification_select.php';
        
        if (!
headers_sent()) {
            
header('Content-Type:text/html; charset='._CHARSET);
            
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
            
//header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
            
header('Cache-Control: private, no-cache');
            
header('Pragma: no-cache');
        }
        
/*
        global $xoopsDB, $xoopsConfig;
        if ( !$xoopsConfig['theme_fromfile'] ) {
            session_write_close();
            $xoopsDB->close();
        }
        */
        //@internal: using global $xoTheme dereferences the variable in old versions, this does not
        
if ( !isset( $xoTheme ) )    $xoTheme =& $GLOBALS['xoTheme'];

        if ( isset( 
$xoopsOption['template_main'] ) && $xoopsOption['template_main'] != $xoTheme->contentTemplate ) {
            
trigger_error"xoopsOption[template_main] should be defined before including header.php"E_USER_WARNING );
            if ( 
false === strpos$xoopsOption['template_main'], ':' ) ) {
                
$xoTheme->contentTemplate 'db:' $xoopsOption['template_main'];
            } else {
                
$xoTheme->contentTemplate $xoopsOption['template_main'];
            }
        }
        
$xoTheme->render();
    }
    
$xoopsLogger->stopTime();
}
?>


3. updated defacer and system modules from xoopsadmin
4. went to xoopsadmin->defacer->pagemanager
5. added module faq (smartfaq renamed in moduleadmin to faq) as page module
6. copied page title from the title of the required page and pasted in the page title option
7. page url added ie faq.php?faqid=9
8. submit

9. Click on meta manager
10. clicked add
11. selected the faq page already added in page manager.
12. added necessary info in the meta manager
13. click submit.

Now there is no change in the page title or meta tags of the page.

Interestingly when i try to go to the added page by clicking on the view page link from page manager i reach the correct page i.e http://localhost/chii/modules/smartfaq/faq.php?faqid=9 but when i click on the view page link from the meta manager page the url that i reach is http://localhost/chii/faq.php?faqid=9.

Xoops version 2.3.2
php 5.2.8
mysql 5.1.3
xampp 1.7 local enviornment

trabis

Core Developer
Posted on: 2009/1/13 13:47
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#18

Re: Defacer 1.0 alpha is released for feature requests

Thanks for reporting that bug in meta manager page.
I can´t see what is wrong, I´ll have to take a closer look latter. You did not change nothing in defacer preferences, did you?

nmshah

Just can't stay away
Posted on: 2009/1/13 18:03
nmshah
nmshah (Show more)
Just can't stay away
Posts: 556
Since: 2007/7/2 8
#19

Re: Defacer 1.0 alpha is released for feature requests

No i have not changed anything in the preferences. One more question are the changes made in the codes correct. I ask because i am not sure.

Thanks for the work you have put in for all these great modules.

trabis

Core Developer
Posted on: 2009/1/13 19:33
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#20

Re: Defacer 1.0 alpha is released for feature requests

Code is correct. I do not have smartfaq so I used another module but I could not reproduce this. Please look at the sql debug and see if there is any queries related with defacer.

Also, in page admin, page status must be green.