1
cosmodrum
Re: Form Validation
  • 2006/5/28 21:46

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Hi

Im trying to integrate the smartyValidate into XOOPS 2.2.4, i got no errors but no validation progress also. Please look into my code and maybe you can help.

Im trying to port a directory script [phpLD]with smarty to xoops. The frontend is almost converted, but validation does not work
Here are the files:

templates.php

<?php
// $Id: template.php,v 1.21.6.16 2005/07/22 18:22:58 mithyt2 Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  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 //
//  ------------------------------------------------------------------------ //
// Author: Kazumi Ono (AKA onokazu)                                          //
// URL: http://www.myweb.ne.jp/, https://xoops.org/, http://www.xoopscube.jp/ //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //

if (!defined('SMARTY_DIR')) {
    exit();
}
/**
 * Base class: Smarty template engine
 */
require_once SMARTY_DIR.'Smarty.class.php';
require_once 
SMARTY_DIR.'SmartyValidate.class.php';

/**
 * Template engine
 *
 * @package        kernel
 * @subpackage    core
 *
 * @author        Kazumi Ono     <onokazu@xoops.org>
 * @copyright    (c) 2000-2003 The XOOPS Project - www.xoops.org
 */
class XoopsTpl extends Smarty
{

    
/**
     * Allow update of template files from the themes/ directory?
     * This should be set to false on an active site to increase performance
     */
    
var $_canUpdateFromFile false;

    
/**
     * Constructor
     **/
    
function XoopsTpl()
    {
        global 
$xoopsConfig;
        
$this->Smarty();
        
$this->compile_id null;
        if (
$xoopsConfig['theme_fromfile'] == 1) {
            
$this->_canUpdateFromFile true;
            
$this->compile_check true;
        } else {
            
$this->_canUpdateFromFile false;
            
$this->compile_check false;
        }
        
$this->left_delimiter =  '<{';
        
$this->right_delimiter =  '}>';
        
$this->template_dir XOOPS_THEME_PATH;
        
$this->cache_dir XOOPS_CACHE_PATH;
        
$this->compile_dir XOOPS_COMPILE_PATH;
        
$this->plugins_dir = array(XOOPS_ROOT_PATH.'/class/smarty/plugins');
        
$this->default_template_handler_func 'xoops_template_create';

        
// Added by goghs on 11-26 to deal with safe mode
        //if (ini_get('safe_mode') == "1") {
        
$this->use_sub_dirs false;
        
//} else {
        //    $this->use_sub_dirs = true;
        //}
        // END
    
}

    
/**
     * Set the directory for templates
     * 
     * @param   string  $dirname    Directory path without a trailing slash
     **/
    
function xoops_setTemplateDir($dirname)
    {
        
$this->template_dir $dirname;
    }

    
/**
     * Get the active template directory
     * 
     * @return  string
     **/
    
function xoops_getTemplateDir()
    {
        return 
$this->template_dir;
    }

    
/**
     * Set debugging mode
     * 
     * @param   boolean     $flag
     **/
    
function xoops_setDebugging($flag=false)
    {
        
$this->debugging is_bool($flag) ? $flag false;
    }

    
/**
     * Set caching
     * 
     * @param   integer     $num
     **/
    
function xoops_setCaching($num=0)
    {
        
$this->caching = (int)$num;
    }

    
/**
     * Set cache lifetime
     * 
     * @param   integer     $num    Cache lifetime
     **/
    
function xoops_setCacheTime($num=0)
    {
        
$num = (int)$num;
        if (
$num <= 0) {
            
$this->caching 0;
        } else {
            
$this->cache_lifetime $num;
        }
    }

    
/**
     * Set directory for compiled template files
     * 
     * @param   string  $dirname    Full directory path without a trailing slash
     **/
    
function xoops_setCompileDir($dirname)
    {
        
$this->compile_dir $dirname;
    }

    
/**
     * Set the directory for cached template files
     * 
     * @param   string  $dirname    Full directory path without a trailing slash
     **/
    
function xoops_setCacheDir($dirname)
    {
        
$this->cache_dir $dirname;
    }

    
/**
     * Render output from template data
     * 
     * @param   string  $data
     * @return  string  Rendered output  
     **/
    
function xoops_fetchFromData(&$data)
    {
        
$dummyfile XOOPS_CACHE_PATH.'/dummy_'.time();
        
$fp fopen($dummyfile'w');
        
fwrite($fp$data);
        
fclose($fp);
        
$fetched $this->fetch('file:'.$dummyfile);
        
unlink($dummyfile);
        
$this->clear_compiled_tpl('file:'.$dummyfile);
        return 
$fetched;
    }

    
/**
     * 
     **/
    
function xoops_canUpdateFromFile()
    {
        return 
$this->_canUpdateFromFile;
    }
    
    
/**
     * Get caching
     * 
     * @return int
     **/
    
function xoops_getCaching()
    {
        return 
$this->caching;
    }
    
    
    
/////////////////////////
    
      //
  
function validConnect()
  {
    
SmartyValidate::connect($this);   
  }
  
//
  
function validDisconnect()
  {
    
SmartyValidate::disconnect($this);
  }
  
//
  
function validate($post)
  {
    return 
SmartyValidate::is_valid($post);
  }
  
//
    
function redisplay($post)
  {
    
$this->assign($post);
    
//$this->display
  
}


    
/////////////////////////////////
    
    
    
    
}

/**
 * Smarty default template handler function
 * 
 * @param $resource_type
 * @param $resource_name
 * @param $template_source
 * @param $template_timestamp
 * @param $smarty_obj
 * @return  bool
 **/
function xoops_template_create ($resource_type$resource_name, &$template_source, &$template_timestamp, &$smarty_obj)
{
    if ( 
$resource_type == 'db' ) {
        
$file_handler =& xoops_gethandler('tplfile');
        
$tpl =& $file_handler->find('default'nullnullnull$resource_nametrue);
        if (
count($tpl) > && is_object($tpl[0])) {
            
$template_source $tpl[0]->getSource();
            
$template_timestamp $tpl[0]->getLastModified();
            return 
true;
        }
    } else {
    }
    return 
false;
}

/**
 * function to update compiled template file in templates_c folder
 * 
 * @param   string  $tpl_id
 * @param   boolean $clear_old
 * @return  boolean
 **/
function xoops_template_touch($tplfile$clear_old true)
{
    
$tpl = new XoopsTpl();
    
$tpl->force_compile true;
    if ( 
is_object($tplfile) ) {
        
$file $tplfile->getVar('tpl_file');
        if (
$clear_old) {
            
$tpl->clear_cache('db:'.$file);
            
$tpl->clear_compiled_tpl('db:'.$file);
        }
        
$tpl->fetch('db:'.$file);
        return 
true;
    }
    return 
false;
}

/**
 * Clear the module cache
 * 
 * @param   int $mid    Module ID
 * @return 
 **/
function xoops_template_clear_module_cache($mid)
{
    
$block_handler =& xoops_gethandler('block');
    
//note this uses backwards parameters for backwards compatibility - change that!
    
$block_arr =& $block_handler->getByModule($midtruefalse);
    if (
count($block_arr) > 0) {
        
$instance_handler =& xoops_gethandler('blockinstance');
        
$instances =& $instance_handler->getObjects(new Criteria('bid'"(".implode(','array_keys($block_arr)).")""IN"));
        
$count count($instances);
        if (
$count 0) {
            
$xoopsTpl = new XoopsTpl();
            
$xoopsTpl->xoops_setCaching(2);
            for (
$i 0$i $count$i++) {
                if (
$block_arr[$instances[$i]->getVar('bid')]->getVar('template') != '') {
                    
$xoopsTpl->clear_cache('db:'.$block_arr[$instances[$i]->getVar('bid')]->getVar('template'), 'blk_'.$instances[$i]->getVar('instanceid'));
                }
            }
        }
    }
}
?>



submit.php

<?php
/**
 * Project:     PHPLinkDirectory: Link exchange directory
 *
 * License: GNU GPL (http://www.opensource.org/licenses/gpl-license.html)
 * 
 * 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.
 *
 * 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
 *
 * For questions, help, comments, discussion, etc., please join the
 * PHP Link Directory Forum http://www.phplinkdirectory.com/forum/

 *
 * @link http://www.phplinkdirectory.com/
 * @copyright 2004-2005 NetCreated, Inc. (http://www.netcreated.com/)
 * @projectManager David DuVal <david@david-duval.com>
 * @author Bogdan Dumitru <dcb@insomniacsoft.com>
 * @mod developers and support
 *         Casey Wilson / Ap0s7le <at@ap0s7le.com>
 *         York Kie Tan / yktan <yktan@hotmail.com>
 * @package PHPLinkDirectory
 * @version 2.0.0 RC5.2
 **/

include '../../mainfile.php';
include(
XOOPS_ROOT_PATH '/header.php');
include(
"xoops_version.php"); 
$xoopsOption['template_main'] = 'submit.tpl';

require_once 
'init.php';

session_start();

//Evaluate payment options
if (PAY_ENABLE == '1' && PAYPAL_ACCOUNT != '') {
    
$price = array ();
    if (
FTR_ENABLE == '1' && PAY_FEATURED 0) {
        
$price['featured'] = PAY_FEATURED;
    }
    if (
PAY_NORMAL 0) {
        
$price['normal'] = PAY_NORMAL;
        if (
PAY_ENABLE_FREE) {
            
$price['free'] = 0;
        }
    }
    if (
PAY_RECPR 0) {
        
$price['reciprocal'] = PAY_RECPR;
    }
    
$xoopsTpl->assign('price'$price);

    if (isset (
$_REQUEST['LINK_TYPE'])) {
        
$link_type $_REQUEST['LINK_TYPE'];
        switch (
$link_type) {
            case 
'reciprocal' :
                
$recpr_required 1;
                break;
            case 
'free' :
                
$recpr_required REQUIRE_RECIPROCAL;
                break;
            default :
                
$recpr_required 0;
                break;
        }
    } else {
        
$recpr_required 0;
    }
    
$_SESSION['SmartyValidate']['submit_link']['validators'][6]['empty'] = $recpr_required 1;
    
$_SESSION['SmartyValidate']['submit_link']['validators'][7]['empty'] = $recpr_required 1;
} else {
    
$recpr_required REQUIRE_RECIPROCAL;
}
$xoopsTpl->assign('recpr_required'$recpr_required);
if (empty (
$_REQUEST['submit'])) {
    if (!empty (
$_SERVER['HTTP_REFERER']))
        
$_SESSION['return'] = $_SERVER['HTTP_REFERER'];
    
$cid get_category($_SERVER['HTTP_REFERER']);
    
$data = array ();
    
$data['CATEGORY_ID'] = $cid;
    
$data['RECPR_REQUIRED'] = $recpr_required;
    
SmartyValidate :: connect($xoopsTpl);
    
init_submission();
    
SmartyValidate :: register_form('submit_link'true);
    
SmartyValidate :: register_criteria('isValueUnique''validate_unique''submit_link');
    
SmartyValidate :: register_criteria('isNotEqual''validate_not_equal''submit_link');
    
SmartyValidate :: register_criteria('isURLOnline''validate_url_online''submit_link');
    
SmartyValidate :: register_validator('v_TITLE''TITLE''notEmpty'falsefalsefalse'trim''submit_link');
    
SmartyValidate :: register_validator('v_TITLE_U''TITLE:link:CATEGORY_ID''isValueUnique'falsefalsefalsenull'submit_link');
    
SmartyValidate :: register_validator('v_URL''URL''isURL'falsefalsefalse'trim''submit_link');
    
SmartyValidate :: register_validator('v_URL_ONLINE''URL''isURLOnline'falsefalsefalsenull'submit_link');
    
SmartyValidate :: register_validator('v_URL_U''URL:link::'. (ALLOW_MULTIPLE ':CATEGORY_ID' ''), 'isValueUnique'falsefalsefalsenull'submit_link');
    
SmartyValidate :: register_validator('v_CATEGORY_ID''CATEGORY_ID:0''isNotEqual'truefalsefalsenull'submit_link');
    
SmartyValidate :: register_validator('v_RECPR_URL''RECPR_URL''isURL', !$recpr_requiredfalsefalse'trim''submit_link');
    
SmartyValidate :: register_criteria('isRecprOnline''validate_recpr_link''submit_link');
    
SmartyValidate :: register_validator('v_RECPR_ONLINE''RECPR_URL''isRecprOnline', !$recpr_requiredfalsefalsenull'submit_link');
    
SmartyValidate :: register_validator('v_OWNER_NAME''OWNER_NAME''notEmpty'falsefalsefalse'trim''submit_link');
    
SmartyValidate :: register_validator('v_OWNER_EMAIL''OWNER_EMAIL''isEmail'falsefalsefalse'trim''submit_link');
    if(
count($price)>0){
        
SmartyValidate :: register_validator('v_LINK_TYPE''LINK_TYPE''notEmpty'falsefalsefalse'trim''submit_link');
    }
    if (
VISUAL_CONFIRM) {
        
SmartyValidate :: register_criteria('isCaptchaValid''validate_captcha''submit_link');
        
SmartyValidate :: register_validator('v_CAPTCHA''CAPTCHA''isCaptchaValid'falsefalsefalsenull'submit_link');
    }
} else {
    
SmartyValidate :: connect($xoopsTpl);
    
$data get_table_data('link');
    
$data['STATUS'] = 1;
    
$data['IPADDRESS'] = get_client_ip();
    
$data['VALID'] = 1;
    
$data['LINK_TYPE'] = $link_type;
    
$data['RECPR_REQUIRED'] = $recpr_required;
    if (
$recpr_required) {
        
$data['RECPR_VALID'] = 1;
        
$data['RECPR_LAST_CHECKED'] = gmdate('Y-m-d H:i:s');
    }

    if (
ENABLE_ID)
        
$data['RECPR_ID'] = $_SESSION['RECPR_ID'];

    
$data['LAST_CHECKED'] = gmdate('Y-m-d H:i:s');
    
$data['DATE_ADDED'] = gmdate('Y-m-d H:i:s');
    
$data['DATE_MODIFIED'] = gmdate('Y-m-d H:i:s');
    if (
strlen(trim($data['URL'])) > && !preg_match("`^http(s?)://`"$data['URL']))
        
$data['URL'] = "http://".$data['URL'];
    if (
strlen(trim($data['RECPR_URL'])) > && !preg_match("`^http(s?)://`"$data['RECPR_URL']))
        
$data['RECPR_URL'] = "http://".$data['RECPR_URL'];
    if (
VISUAL_CONFIRM) {
        
$data array_merge($data, array ('CAPTCHA' => $_REQUEST['CAPTCHA']));
    }
    if (
SmartyValidate :: is_valid($data'submit_link')) {
        if (
VISUAL_CONFIRM) {
            unset (
$data['CAPTCHA']);
        }
        if (
ENABLE_PAGERANK) {
            require_once 
'include/pagerank.php';
            
$data['PAGERANK'] = get_page_rank($data['URL']);
            if (!empty (
$data['RECPR_URL'])) {
                
$data['RECPR_PAGERANK'] = get_page_rank($data['RECPR_URL']);
            }
        }

        
$id $db->GenID($tables['link']['name'].'_SEQ');
        
$data['ID'] = $id;
        
$data['LINK_TYPE'] = $link_type_int[$link_type];
        switch(
$link_type){
            case 
'free':
                
$data['NOFOLLOW'] = 1;
                break;
            case 
'featured':
                
$data['FEATURED'] = 1;
                break;
        }
        
$data['OWNER_NOTIF'] = $price[$link_type] > 0?0:1;
        
$data['PAYED'] = $price[$link_type] > 0?0:-1;
        if (
$db->Replace($tables['link']['name'], $data'ID'true) > 0) {
            
$xoopsTpl->assign('posted'true);
            
send_submit_notifications($data);
            if(
$price[$link_type] > 0) { //Move to payment page
                
header("Location: payment.php?id=".$data['ID']);
                exit;
            }else{
                unset (
$data['TITLE']);
                unset (
$data['URL']);
                unset (
$data['DESCRIPTION']);
                unset (
$data['RECPR_URL']);

                if (
ENABLE_ID)
                    
init_submission();
            }
        } else {
            
$xoopsTpl->assign('error'true);
        }
    }
}
unset (
$_SESSION['CAPTCHA']);
$path = array ();
$path[] = array ('ID' => '0''TITLE' => _L(SITE_NAME), 'TITLE_URL' => DOC_ROOT'DESCRIPTION' => SITE_DESC);
$path[] = array ('ID' => '0''TITLE' => _L('Submit Link'), 'TITLE_URL' => '''DESCRIPTION' => _L('Submit a new link to the directory '));
$xoopsTpl->assign('path'$path);

if (
ENABLE_ID)
    
$xoopsTpl->assign('recpr_id'$_SESSION['RECPR_ID']);

$categs get_categs_tree($db0);
$xoopsTpl->assign('categs'$categs);
$xoopsTpl->assign($data);
$xoopsTpl->assign('LINK_TYPE'$link_type);
echo 
$xoopsTpl->fetch('submit.tpl'$id);

function 
validate_captcha($value$empty, & $params, & $form) {
    require_once 
'../../class/captcha/captcha.class.php';
    return isset (
$_SESSION['CAPTCHA']) && strtolower($_SESSION['CAPTCHA']) == strtolower($value);
}
function 
init_submission() {
    
mt_srand();
    
$_SESSION['RECPR_ID'] = mt_rand(00xFFFFFF);
}
$xoopsTpl->assign("xoops_module_header"'<link rel="stylesheet" type="text/css" href="module.css" />');
//echo $xoopsTpl->fetch('submit.tpl', $id);
include XOOPS_ROOT_PATH '/footer.php';
?>



submit.tpl
<{capture name="title"}> - Submit Link<{/capture}>
<{
capture assign="in_page_title"}>Submit Link<{/capture}>
<{
capture assign="description"}>Submit a new link to the directory<{/capture}>
<{include 
file="db:header.tpl"}>
<{include 
file="db:top_bar.tpl"}>

<{
strip}>
<{include 
file="admin/messages.tpl"}>

<
table border="0" class="formPage">
<{if 
$error}>
<
tr><td colspan="2" class="err">
An error occured while saving the link.
</
td></tr>
<{/if}>
<{if 
$posted}>
<
tr><td colspan="2" class="msg">
Link submitted and awaiting approval.<br />
Submit another link.
</
td></tr>
<{/if}>
<
form method="post" action="">
<{if 
count($price)>0}>
    <
tr><td colspan="2" class="price">
    <
b>Pricing:</b><br />
    <
table border="0" cellspacing="0" cellpadding="0">
    <{if 
$price.featured}>
        <
tr><td><input type="radio" name="LINK_TYPE" value="featured" <{if $LINK_TYPE eq 'featured'}>checked="true"<{/if}>>Featured links</td><td>$<{$price.featured}></td></tr>
    <{/if}>
    <{if 
$price.normal gt 0}>
        <
tr><td><input type="radio" name="LINK_TYPE" value="normal" <{if $LINK_TYPE eq 'normal'}>checked="true"<{/if}>>Regular links</td><td>$<{$price.normal}></td></tr>
    <{elseif 
$price.normal eq 0}>
        <
tr><td><input type="radio" name="LINK_TYPE" value="normal" <{if $LINK_TYPE eq 'normal'}>checked="true"<{/if}>>Regular links</td><td>free</td></tr>
    <{/if}>
    <{if 
$price.reciprocal gt 0}>
        <
tr><td><input type="radio" name="LINK_TYPE" value="reciprocal" <{if $LINK_TYPE eq 'reciprocal'}>checked="true"<{/if}>>Regular links with reciprocal</td><td>$<{$price.reciprocal}></td></tr>
    <{elseif 
$price.reciprocal eq 0}>
        <
tr>
          <
td><input type="radio" name="LINK_TYPE" value="reciprocal" <{if $LINK_TYPE eq 'reciprocal'}>checked="true"<{/if}>>Regular links with reciprocal</td>
          <
td>free</td></tr>
    <{/if}>
    <{if isset(
$price.free)}>
        <
tr><td><input type="radio" name="LINK_TYPE" value="free" <{if $LINK_TYPE eq 'free'}>checked="true"<{/if}>Links with nofollow attribute</td><td>free</td></tr>
    <{/if}>
    </
table>
    <{
validate form="submit_link" id="v_LINK_TYPE" message=$smarty.capture.field_link_type}>
    </
td></tr>
<{/if}>
  <
tr>
      <
td class="label"><span class='req'>*</span>Title:</td>
      <
td class="field">
          <
input type="text" name="TITLE" value="<{$TITLE}>" size="40" maxlength="100" class="text"/>
          <{
validate form="submit_link" id="v_TITLE" message=$smarty.capture.field_char_required}>
          <{
validate form="submit_link" id="v_TITLE_U" message=$smarty.capture.title_not_unique}>
      </
td>
  </
tr>
  <
tr>
      <
td class="label"><span class='req'>*</span>URL:</td>
      <
td class="field">
          <
input type="text" name="URL" value="<{$URL}>" size="40" maxlength="255" class="text"/>
          <{
validate form="submit_link" id="v_URL" message=$smarty.capture.invalid_url}>
          <{
validate form="submit_link" id="v_URL_ONLINE" message=$smarty.capture.url_not_online}>
          <{
validate form="submit_link" id="v_URL_U" message=$smarty.capture.url_not_unique}>
      </
td>
  </
tr>
  <
tr>
      <
td class="label">Description:</td>
      <
td class="field">
          <
textarea name="DESCRIPTION" rows="3" cols="37" class="text"><{$DESCRIPTION}></textarea>
      </
td>
  </
tr>
  <
tr>
      <
td class="label"><span class='req'>*</span>Your Name:</td>
      <
td class="field">
          <
input type="text" name="OWNER_NAME" value="<{$OWNER_NAME}>" size="40" maxlength="100" class="text"/>
          <{
validate form="submit_link" id="v_OWNER_NAME" message=$smarty.capture.field_char_required}>
      </
td>
  </
tr>
   <
tr>
      <
td class="label"><span class='req'>*</span>Your Email:</td>
      <
td class="field">
          <
input type="text" name="OWNER_EMAIL" value="<{$OWNER_EMAIL}>" size="40" maxlength="100" class="text"/>                  
      </
td>
  </
tr>
  <
tr>
      <
td class="label"><span class='req'>*</span>Category:</td>
      <
td class="field">
          <{
html_options options=$categs selected=$CATEGORY_ID name="CATEGORY_ID"}>
        <{
validate form="submit_link" id="v_CATEGORY_ID" message=$smarty.capture.no_url_in_top}>
      </
td>
  </
tr>
  <
tr>
      <
td class="label"><{if $recpr_required}><span class='req'>*</span><{/if}>Reciprocal Link URL:</td>
      <
td class="field">
          <
input type="text" name="RECPR_URL" value="<{$RECPR_URL}>" size="40" maxlength="255" class="text"/>
          <{
validate form="submit_link" id="v_RECPR_URL" message=$smarty.capture.invalid_url}>
<{if 
$recpr_required}>
          <{
validate form="submit_link" id="v_RECPR_ONLINE" message=$smarty.capture.recpr_not_found}>
<{/if}><
br />
        <
class="small">To validate the reciprocal link please include the<br />following HTML code in the page at the URL<br />specified abovebefore submiting this form:</p>
        <
textarea name="RECPR_TEXT" rows="2" readonly="true" cols="37" class="text"><a href="<{$smarty.const.SITE_URL}>"<{if $smarty.const.ENABLE_ID}> id="R<{$recpr_id|string_format:"%X"}>"<{/if}>><{$smarty.const.SITE_NAME}></a></textarea>
      </
td>
  </
tr>
<<{if 
$smarty.const.VISUAL_CONFIRM}>
  <
tr>
      <
td class="label"><span class='req'>*</span>Enter the code shown:</td>
      <
td class="field">
          <
input type="text" name="CAPTCHA" value="" size="10" maxlength="5" class="text"/>
        <{
validate form="submit_link" id="v_CAPTCHA" message=$smarty.capture.invalid_code}>
        <
br />
          <
class="small">This helps prevent automated registrations.</p>
          <
img src="<{$smarty.const.DOC_ROOT}>/captcha.php" class="captcha" />
      </
td>
  </
tr>
<{/if}>
  <
tr>
    <
td colspan="2" class="buttons"><input type="submit" name="submit" value="Continue" class="btn"/></td>
  </
tr>
</
form>
</
table>
<{include 
file="db:footer.tpl"}>
<{/
strip}>





Hope you can help me with this

1000 thanxxx in advance

cosmodrum



2
cosmodrum
Re: phpLD -> Xoops port
  • 2006/5/25 16:25

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Its more a directory script

nicelayout and tonns of features (show google rank ....)

Link to features list




3
cosmodrum
Re: phpLD -> Xoops port
  • 2006/5/25 12:46

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Hi,
yes, this script im talking about

any idea?



4
cosmodrum
phpLD -> Xoops port
  • 2006/5/25 11:27

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Hi,
is there somebody who already ported phpLD to XOOPS module?
I started myself but i got big problems with transfering the included smartysystem to XOOPS smarty.

Somebody to release a phpLD-module ?

thanxxxx
cosmo



5
cosmodrum
Re: solved
  • 2006/3/8 15:09

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Hi,
i got no response att all so i thought nobody is interested.
The solutin is here.
Sorry for not letting you know

I found out myself code here and in the next release:


Coder here:


<?php

if( ! defined( 'SITEMAP_ROOT_CONTROLLER_LOADED' ) ) {
if( ! empty( $_SERVER['REQUEST_URI'] ) ) {
$_SERVER['REQUEST_URI'] = str_replace( 'xml_google.php' , 'modules/sitemap/xml_google.php' , $_SERVER['REQUEST_URI'] ) ;
} else {
$_SERVER['REQUEST_URI'] = '/modules/sitemap/xml_google.php' ;
}
define( 'SITEMAP_ROOT_CONTROLLER_LOADED' , 1 ) ;
chdir( './modules/sitemap/' ) ;
require dirname(__FILE__).'/modules/sitemap/xml_google.php' ;
exit ;
} else {
require '../../mainfile.php' ;
}

$sitemap_configs = @$xoopsModuleConfig ;
$sitemap_configs['alltime_guest'] = true ;

require_once XOOPS_ROOT_PATH.'/class/template.php' ;

$myts =& MyTextSanitizer::getInstance() ;

$sitemap_configs['with_lastmod'] = true ;


if (function_exists('mb_http_output')) {
mb_http_output('pass');
}
header ('Content-Type:text/xml; charset=utf-8');

if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/modinfo.php'))
{
include_once(XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/modinfo.php');
}
else
{
if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/english/modinfo.php'))
{
include_once(XOOPS_ROOT_PATH . '/modules/system/language/english/modinfo.php');
}
}

include_once(XOOPS_ROOT_PATH . '/modules/sitemap/include/sitemap.php');

//$xoopsTpl = new XoopsTpl();

// for All-time guest mode (backup uid & set as Guest)
if( is_object( $xoopsUser ) && ! empty( $sitemap_configs['alltime_guest'] ) ) {
$backup_uid = $xoopsUser->getVar('uid') ;
$backup_userisadmin = $xoopsUserIsAdmin ;
$xoopsUser = '' ;
$xoopsUserIsAdmin = false ;
}

$sitemap = sitemap_show();

// for All-time guest mode (restore $xoopsUser*)
if( ! empty( $backup_uid ) && ! empty( $sitemap_configs['alltime_guest'] ) ) {
$member_handler =& xoops_gethandler('member');
$xoopsUser =& $member_handler->getUser( $backup_uid ) ;
$xoopsUserIsAdmin = $backup_userisadmin ;
}

// PM受信数を得る by Ryuji
// if(is_object($xoopsUser)){
// $pm_handler =& xoops_gethandler('privmessage');
// $criteria = new CriteriaCompo(new Criteria('read_msg', 0));
// $criteria->add(new Criteria('to_userid', $xoopsUser->getVar('uid')));
// $new_messages = $pm_handler->getCount($criteria);
// }else{
// $new_messages = 0;
// }

// ユーザメニュ用言語ファイルを読む
if(!defined("_MB_SYSTEM_VACNT")){
$lang_file = XOOPS_ROOT_PATH."/modules/system/language/".$xoopsConfig["language"]."/blocks.php";
if(file_exists($lang_file)){
include_once($lang_file);
}else{
$lang_file = XOOPS_ROOT_PATH."/modules/system/language/english/blocks.php";
include_once($lang_file);
}
}
$xoopsTpl->assign('lang', array(
'youraccount' => _MB_SYSTEM_VACNT,
'editaccount' => _MB_SYSTEM_EACNT,
'notifications' => _MB_SYSTEM_NOTIF,
'logout' => _MB_SYSTEM_LOUT,
// 'messages' => $new_messages,
'inbox' => _MB_SYSTEM_INBOX,
'adminmenu' => _MB_SYSTEM_ADMENU,
));

/// ユーザメニューブロックのブロックタイトルを取得
$sql = "SELECT title FROM " . $xoopsDB->prefix("newblocks") . " WHERE show_func = 'b_system_user_show'" ;
$result = $xoopsDB->query($sql);
list($usermenu) = $xoopsDB->fetchRow($result);

$myts =& MyTextSanitizer::getInstance();

$msgs = $sitemap_configs['msgs'];

$xoopsTpl->assign('usermenu', $myts->makeTboxData4Show($usermenu));

$xoopsTpl->assign('lastmod', gmdate( 'Y-m-d\TH:i:s\Z' ) ); // TODO
$xoopsTpl->assign('sitemap', $sitemap);
$xoopsTpl->assign('msgs', $myts->displayTarea($msgs,1));
$xoopsTpl->assign('show_subcategoris', $sitemap_configs["show_subcategoris"]);

$xoopsTpl->assign('this', array(
'mods' => $xoopsModule->getVar('dirname'),
'name' => $xoopsModule->getVar('name')
));

$xoopsTpl->display('db:sitemap_xml_google.html');


?>



6
cosmodrum
solved
  • 2006/3/3 22:58

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Problem solved,
thanxxx anyway



7
cosmodrum
xoops 2.2.4 sitemap 1.24 problem with xml_google.php
  • 2006/3/1 0:04

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Hi,
i run XOOPS 2.2.4 and the sitemap 1.24 module
the siteview is fine, but the xml_google.php shows some complete urls and some only in parts

see here:

http://www.drumnews.de/xml_google.php

any help

1000 thanxxx cosmo



8
cosmodrum
Re: myalbum - change order of subcats ?
  • 2006/2/18 19:23

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


hi,
thanxxx, i fount it




9
cosmodrum
myalbum - change order of subcats ?
  • 2006/2/17 20:59

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Hi everybody,
please help me find the place to change the order of the subcategories from
A --> Z
to
Z --> A

would be great

1000 thanxxx

cosmo



10
cosmodrum
Re: Xmonitor to trap user action
  • 2005/8/2 17:13

  • cosmodrum

  • Just popping in

  • Posts: 24

  • Since: 2004/8/30


Hi,
thanxxx for the module, i got the problem, i cannot view any details, on the
/xmonitor/admin/admin.php
it shows me pages view xxx and visits xxx,
but when i click visit details, i get 0 (no details at all)

any help ???

1000 thanxxx in advance

Error on debug:

Notice [PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 44
Notice 
[PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 94
Notice 
[PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 98
Notice 
[PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 118
Notice 
[PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 122
Notice 
[PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 138
Notice 
[PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 143
Notice 
[PHP]: Undefined variablevm in file modules/xmonitor/admin/user-visit.php line 163
Notice 
[PHP]: Use of undefined constant visitname assumed 'visitname' in file modules/xmonitor/index.php line 37
Notice 
[PHP]: Use of undefined constant temps assumed 'temps' in file modules/xmonitor/index.php line 38
Notice 
[PHP]: Use of undefined constant tempsf assumed 'tempsf' in file modules/xmonitor/index.php line 39




TopTop
(1) 2 »



Login

Who's Online

190 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 190


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