CGUserDirectory search error
CGUserDirectory search error
Hi. I've got a virgin install of cmsms with the newest building of CGUserDirectory (and dependencies).
I've created two test users with FEU. They display correctly in action=default mode
When I try to run {CGUserDirectory action="search"} I get the following error:
Parse error: syntax error, unexpected T_ENDFOREACH in /home/epugh/carrymeohio.com/1/tmp/templates_c/CGUserDirectory^%%66^66B^66BFE851%%module_db_tpl%3ACGUserDirectory%3Bsearchform_Sample.php on line 105
Any ideas?
Thanks
-Evan
I've created two test users with FEU. They display correctly in action=default mode
When I try to run {CGUserDirectory action="search"} I get the following error:
Parse error: syntax error, unexpected T_ENDFOREACH in /home/epugh/carrymeohio.com/1/tmp/templates_c/CGUserDirectory^%%66^66B^66BFE851%%module_db_tpl%3ACGUserDirectory%3Bsearchform_Sample.php on line 105
Any ideas?
Thanks
-Evan
Re: CGUserDirectory search error
Where would I go to check that?
I didn't mess with any settings after the default install.
I didn't mess with any settings after the default install.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: CGUserDirectory search error
You have an error in your search template in the CGUserDirectory module.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: CGUserDirectory search error
Should I reupload the file and try again? I am theoretically using the "sample" search template
EDIT: I reuploaded the module and the error is still occurring. Could the default search template be messed up in the latest repackaging?
EDIT: I reuploaded the module and the error is still occurring. Could the default search template be messed up in the latest repackaging?
Last edited by evancelt on Sat Apr 24, 2010 3:33 pm, edited 1 time in total.
Re: CGUserDirectory search error
I've given that a try and no beans.
Here is an empty page that only calls the search function: http://carrymeohio.com/1/index.php?page=search1
Any more ideas? It seems like the php isn't parsing the a foreach loop correctly
Here is an empty page that only calls the search function: http://carrymeohio.com/1/index.php?page=search1
Any more ideas? It seems like the php isn't parsing the a foreach loop correctly
Re: CGUserDirectory search error
Thanks for the suggestion, Vilkis, but the error remains after simply clearing cache and also after clearing cache and then resetting search script to default.
Has anyone else had a similar problem?
I'm running the script on dreamhost. Could that be part of the problem?
Has anyone else had a similar problem?
I'm running the script on dreamhost. Could that be part of the problem?
Re: CGUserDirectory search error
Here is the sample search template being used:
Code: Select all
{* search form template *}
{* valid fields are:
{$actionid}ud_submit - (string) for a submit button
{$actionid}ud_cancel - (string) for a cancel button
{$actionid}ud_username - (string) username expression
{$actionid}ud_propvalue - (string) property value
*}
<div id="ud_searchform">
{$formstart}
<div class="row">
<p class="col30">{$mod->Lang('username')}</p>
<p class="col70">
<input type="text" name="{$actionid}ud_username" size="20" maxlength="40"/>
</p>
</div>
{if isset($searchprops)}
{foreach from=$searchprops key='propname' item='data'}
{$data|@debug_display}
<div class="row">
<p class="col30">{$data.fielddefn.prompt}:</p>
<p class="col70">
{if $data.fieldtype == 'text'}
<input type="text" name="{$actionid}ud_propvalue[{$propname}]" size="20" maxlength="20"/>
{else if $data.fieldtype == 'select'}
<select name="{$actionid}ud_propvalue[{$propname}]">
{html_options options=$data.options}
</select>
{/if}
</p>
</div>
{/foreach}
{/if}
<div class="row">
<p class="col30">{$mod->Lang('results_all_any')}?</p>
<p class="col70">
<select name="{$actionid}ud_allany">
<option value="all">{$mod->Lang('all')}</option>
<option value="any">{$mod->Lang('any')}</option>
</select>
</p>
</div>
<div class="row">
<p class="col30"> </p>
<p class="col70">
<input type="submit" name="{$actionid}ud_submit" value="{$mod->Lang('submit')}"/>
</p>
</div>
{$formend}
</div>
{* search form template *}
{* valid fields are:
{$actionid}ud_submit - (string) for a submit button
{$actionid}ud_cancel - (string) for a cancel button
{$actionid}ud_username - (string) username expression
{$actionid}ud_propvalue - (string) property value
*}
<div id="ud_searchform">
{$formstart}
<div class="row">
<p class="col30">{$mod->Lang('username')}</p>
<p class="col70">
<input type="text" name="{$actionid}ud_username" size="20" maxlength="40"/>
</p>
</div>
{if isset($searchprops)}
{foreach from=$searchprop key='propname' item=$data}
<div class="row">
<p class="col30">{$data.fielddefn.prompt}:</p>
<p class="col70">
{if $data.fieldtype == 'text'}
<input type="text" name="{$actionid}ud_propvalue[{$propname}]" size="20" maxlength="20"/>
{else if $data.fieldtype == 'select'}
<select name="{$actionid}ud_propvalue[{$propname}]">
{html_options options=$ud_options}
</select>
{/if}
</p>
</div>
{/foreach}
{/if}
<div class="row">
<p class="col30">{$mod->Lang('results_all_any')}?</p>
<p class="col70">
<select name="{$actionid}ud_allany">
<option value="all">{$mod->Lang('all')}</option>
<option value="any">{$mod->Lang('any')}</option>
</select>
</p>
</div>
<div class="row">
<p class="col30"> </p>
<p class="col70">
<input type="submit" name="{$actionid}ud_submit" value="{$mod->Lang('submit')}"/>
</p>
</div>
{$formend}
</div>Re: CGUserDirectory search error
Could it be that short_open_tag is set to off in php.ini?
-
vilkis
Re: CGUserDirectory search error
what is content of file CGUserDirectory^%%66^66B^66BFE851%%module_db_tpl%3ACGUserDirectory%3Bsearchform_Sample.php ?
Check if it this file is deleted after delete cache.
vilkis
Check if it this file is deleted after delete cache.
vilkis
Re: CGUserDirectory search error
The content of that file is:
So, there is an extra endforeach in that code. Where did it come from, though? I'm using the default search template
EDIT: I've tried to manually delete this file and it comes back (in this same form) after reloading the page.
Code: Select all
<?php /* Smarty version 2.6.25, created on 2010-05-04 14:55:28
compiled from module_db_tpl:CGUserDirectory%3Bsearchform_Sample */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'debug_display', 'module_db_tpl:CGUserDirectory;searchform_Sample', 21, false),array('function', 'html_options', 'module_db_tpl:CGUserDirectory;searchform_Sample', 29, false),)), $this); ?>
<?php $this->_cache_serials['/home/epugh/carrymeohio.com/1/tmp/templates_c/CGUserDirectory^%%66^66B^66BFE851%%module_db_tpl%3ACGUserDirectory%3Bsearchform_Sample.inc'] = '3baefc008ec96625d1b05708ae472daa'; ?>
<div id="ud_searchform">
<?php echo $this->_tpl_vars['formstart']; ?>
<div class="row">
<p class="col30"><?php echo $this->_tpl_vars['mod']->Lang('username'); ?>
</p>
<p class="col70">
<input type="text" name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_username" size="20" maxlength="40"/>
</p>
</div>
<?php if (isset ( $this->_tpl_vars['searchprops'] )): ?>
<?php $_from = $this->_tpl_vars['searchprops']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
foreach ($_from as $this->_tpl_vars['propname'] => $this->_tpl_vars['data']):
?>
<?php echo debug_display($this->_tpl_vars['data']); ?>
<div class="row">
<p class="col30"><?php echo $this->_tpl_vars['data']['fielddefn']['prompt']; ?>
:</p>
<p class="col70">
<?php if ($this->_tpl_vars['data']['fieldtype'] == 'text'): ?>
<input type="text" name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_propvalue[<?php echo $this->_tpl_vars['propname']; ?>
]" size="20" maxlength="20"/>
<?php else: ?>
<select name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_propvalue[<?php echo $this->_tpl_vars['propname']; ?>
]">
<?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['data']['options']), $this);?>
</select>
<?php endif; ?>
</p>
</div>
<?php endforeach; endif; unset($_from); ?>
<?php endif; ?>
<div class="row">
<p class="col30"><?php echo $this->_tpl_vars['mod']->Lang('results_all_any'); ?>
?</p>
<p class="col70">
<select name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_allany">
<option value="all"><?php echo $this->_tpl_vars['mod']->Lang('all'); ?>
</option>
<option value="any"><?php echo $this->_tpl_vars['mod']->Lang('any'); ?>
</option>
</select>
</p>
</div>
<div class="row">
<p class="col30"> </p>
<p class="col70">
<input type="submit" name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_submit" value="<?php echo $this->_tpl_vars['mod']->Lang('submit'); ?>
"/>
</p>
</div>
<?php echo $this->_tpl_vars['formend']; ?>
</div>
<div id="ud_searchform">
<?php echo $this->_tpl_vars['formstart']; ?>
<div class="row">
<p class="col30"><?php echo $this->_tpl_vars['mod']->Lang('username'); ?>
</p>
<p class="col70">
<input type="text" name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_username" size="20" maxlength="40"/>
</p>
</div>
<?php if (isset ( $this->_tpl_vars['searchprops'] )): ?>
<div class="row">
<p class="col30"><?php echo $this->_tpl_vars['data']['fielddefn']['prompt']; ?>
:</p>
<p class="col70">
<?php if ($this->_tpl_vars['data']['fieldtype'] == 'text'): ?>
<input type="text" name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_propvalue[<?php echo $this->_tpl_vars['propname']; ?>
]" size="20" maxlength="20"/>
<?php else: ?>
<select name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_propvalue[<?php echo $this->_tpl_vars['propname']; ?>
]">
<?php if ($this->caching && !$this->_cache_including): echo '{nocache:3baefc008ec96625d1b05708ae472daa#0}'; endif;$_cache_attrs =& $this->_smarty_cache_attrs('3baefc008ec96625d1b05708ae472daa','0');echo smarty_function_html_options(array('options' => $this->_tpl_vars['ud_options']), $this);if ($this->caching && !$this->_cache_including): echo '{/nocache:3baefc008ec96625d1b05708ae472daa#0}'; endif;?>
</select>
<?php endif; ?>
</p>
</div>
<?php endforeach; endif; unset($_from); ?>
<?php endif; ?>
<div class="row">
<p class="col30"><?php echo $this->_tpl_vars['mod']->Lang('results_all_any'); ?>
?</p>
<p class="col70">
<select name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_allany">
<option value="all"><?php echo $this->_tpl_vars['mod']->Lang('all'); ?>
</option>
<option value="any"><?php echo $this->_tpl_vars['mod']->Lang('any'); ?>
</option>
</select>
</p>
</div>
<div class="row">
<p class="col30"> </p>
<p class="col70">
<input type="submit" name="<?php echo $this->_tpl_vars['actionid']; ?>
ud_submit" value="<?php echo $this->_tpl_vars['mod']->Lang('submit'); ?>
"/>
</p>
</div>
<?php echo $this->_tpl_vars['formend']; ?>
</div>EDIT: I've tried to manually delete this file and it comes back (in this same form) after reloading the page.
Re: CGUserDirectory search error
Hi all,
It's just a -big- typo : template is repeated twice.
Delete half of it and it should be ok.
It's just a -big- typo : template is repeated twice.
Delete half of it and it should be ok.
-
vilkis
Re: CGUserDirectory search error
yep, your code in template is doubled, but I thing that it is not the reason.
I do not use CGUserDirectory, but try to enter the following code to search template:
vilkis
I do not use CGUserDirectory, but try to enter the following code to search template:
Code: Select all
{* search form template *}
{* valid fields are:
{$actionid}ud_submit - (string) for a submit button
{$actionid}ud_cancel - (string) for a cancel button
{$actionid}ud_username - (string) username expression
{$actionid}ud_propvalue - (string) property value
*}
<div id="ud_searchform">
{$formstart}
<div class="row">
<p class="col30">{$mod->Lang('username')}</p>
<p class="col70">
<input type="text" name="{$actionid}ud_username" size="20" maxlength="40"/>
</p>
</div>
{if isset($searchprops)}
{foreach from=$searchprops key='propname' item='data'}
{$data|@debug_display}
<div class="row">
<p class="col30">{$data.fielddefn.prompt}:</p>
<p class="col70">
{if $data.fieldtype == 'text'}
<input type="text" name="{$actionid}ud_propvalue[{$propname}]" size="20" maxlength="20"/>
{elseif $data.fieldtype == 'select'}
<select name="{$actionid}ud_propvalue[{$propname}]">
{html_options options=$data.options}
</select>
{/if}
</p>
</div>
{/foreach}
{/if}
<div class="row">
<p class="col30">{$mod->Lang('results_all_any')}?</p>
<p class="col70">
<select name="{$actionid}ud_allany">
<option value="all">{$mod->Lang('all')}</option>
<option value="any">{$mod->Lang('any')}</option>
</select>
</p>
</div>
<div class="row">
<p class="col30"> </p>
<p class="col70">
<input type="submit" name="{$actionid}ud_submit" value="{$mod->Lang('submit')}"/>
</p>
</div>
{$formend}
</div>
Re: CGUserDirectory search error
I had the same problem as evancelt. There is a duplication in the orig._searchform_template.tpl file, but as Vilkis said, that doesn't seem to be the problem.
I created a new search form template called "test" and pasted in the code suggested by Vilkis. I specified this template in the module call {CGUserDirectory action="search" searchformtemplate="test"} and the search form appears correctly. So this appears to solve the problem. Evancelt?
I created a new search form template called "test" and pasted in the code suggested by Vilkis. I specified this template in the module call {CGUserDirectory action="search" searchformtemplate="test"} and the search form appears correctly. So this appears to solve the problem. Evancelt?

