SOLVED: CG Calendar search not working
Posted: Tue Jun 12, 2012 10:34 am
Sorry for long post - just wanted to get it all down first time.
CMSMS 1.10.3 (recently upgraded)
CG Calendar:1.9.6
CG extensions:1.29.1
PHP: 5.2.11
on page smarty:
{cms_module module="CGCalendar" display="list"}
placed this at top of CGcalendar list template as would like on all pages:
{cms_module module="CGCalendar" action="search"}
Issue: I just need a category search above the list display. I have removed date selection from the search template. and am now left with input fields for text term, search type and category.
All combinations seem to return "no results found...".
Does the search rely on having a start and end date to work?
I have run the debug facility in the search script and can see the following being passed to the page:
{$search_category} 2
{$search_end_date} null
{$search_start_date} null
{$search_text} ""
{$searchprompt} "Search"
AND with the following errors...
Notice: Undefined variable: search_start_date in .../html/modules/CGCalendar/action.searchresults.php on line 115
Notice: Undefined variable: search_end_date in .../html/modules/CGCalendar/action.searchresults.php on line 115
Notice: Undefined variable: search_start_date in .../html/modules/CGCalendar/action.searchresults.php on line 122
Notice: Undefined variable: search_end_date in .../html/modules/CGCalendar/action.searchresults.php on line 122
Notice: Undefined variable: search_start_date in .../html/modules/CGCalendar/action.searchresults.php on line 326
Notice: Undefined variable: search_end_date in .../html/modules/CGCalendar/action.searchresults.php on line 327
Calendar Search Results
Search Words:
Start Date:
End Date:
Category:
Notice: Undefined variable: query in
.../html/modules/CGCalendar/CGCalendar.module.php on line 540
Notice: Undefined offset: 1 in .../html/lib/adodb_lite/adodbSQL_drivers/mysql/mysql_driver.inc on line 320
The template for the search results is currently default:
{* original search result template *}
{debug}
<h3>{$mod->Lang('search_results')}</h3>
<p>{$mod->Lang('search_words')}: {$search_text}</p>
<p>{$mod->Lang('start_date')}: {$search_start_date|cms_date_format}</p>
<p>{$mod->Lang('end_date')}: {$search_end_date|cms_date_format}</p>
<p>{$mod->Lang('category')}: {if $search_category == '-1'}{$mod->Lang('cal_any_category')}{else}{$mod->GetCategoryName($search_category)}{/if}</p>
{if !isset($events)}
{$mod->Lang('no_results_found')}
{else}
<br/>
{* pagination stuff *}
{if isset($firstpage_url) || isset($lastpage_url)}
<div style="text-align: center;">
{if isset($firstpage_url)}
<a href="{$firstpage_url}">{$mod->Lang('first_page')}</a>
<a href="{$prevpage_url}">{$mod->Lang('prev_page')}</a>
{/if}
{$mod->Lang('page_of',$pagenum,$numpages)}
{if isset($lastpage_url)}
<a href="{$nextpage_url}">{$mod->Lang('next_page')}</a>
<a href="{$lastpage_url}">{$mod->Lang('last_page')}</a>
{/if}
</div>
{/if}
{* display the output *}
{foreach from=$events key=key item=event}
<div class="calendar-event">
<h4>{$event.event_title}</h4>
{assign var=month_number value=$event.event_date_start|date_format:"%m"}
{assign var=end_month_number value=$event.event_date_end|date_format:"%m"}
{if $event.event_date_start == $event.event_date_end || $event.event_date_end == 0}
<div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y"}</div>
{else}
{if $event.event_date_start|date_format:"%d%m%Y" == $event.event_date_end|date_format:"%d%m%Y"}
<div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%H:%M"}</div>
{else}
<div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%d"} {$month_names[$end_month_number]} {$event.event_date_end|date_format:"%Y %H:%M"}</div>
{/if}
{/if}
{if $event.event_summary !="" && ($detail != 1 || ($event.event_details =="" || $event.event_details == "<br />"))}
<div class="calendar-summary"><span class="calendar-summary-title">{$lang.summary}: </span>{$event.event_summary}</div>
{/if}
{* optionally display detail information
{if $event.event_details !="" && $event.event_details != "<br />"}
<div class="calendar-details"><span class="calendar-details-title">{$lang.details}: </span>{$event.event_details}</div>
{/if}
*}
<a href="{$event.url}">{$mod->Lang('cal_more')}</a>
</div>
{/foreach}
{/if}
CMSMS 1.10.3 (recently upgraded)
CG Calendar:1.9.6
CG extensions:1.29.1
PHP: 5.2.11
on page smarty:
{cms_module module="CGCalendar" display="list"}
placed this at top of CGcalendar list template as would like on all pages:
{cms_module module="CGCalendar" action="search"}
Issue: I just need a category search above the list display. I have removed date selection from the search template. and am now left with input fields for text term, search type and category.
All combinations seem to return "no results found...".
Does the search rely on having a start and end date to work?
I have run the debug facility in the search script and can see the following being passed to the page:
{$search_category} 2
{$search_end_date} null
{$search_start_date} null
{$search_text} ""
{$searchprompt} "Search"
AND with the following errors...
Notice: Undefined variable: search_start_date in .../html/modules/CGCalendar/action.searchresults.php on line 115
Notice: Undefined variable: search_end_date in .../html/modules/CGCalendar/action.searchresults.php on line 115
Notice: Undefined variable: search_start_date in .../html/modules/CGCalendar/action.searchresults.php on line 122
Notice: Undefined variable: search_end_date in .../html/modules/CGCalendar/action.searchresults.php on line 122
Notice: Undefined variable: search_start_date in .../html/modules/CGCalendar/action.searchresults.php on line 326
Notice: Undefined variable: search_end_date in .../html/modules/CGCalendar/action.searchresults.php on line 327
Calendar Search Results
Search Words:
Start Date:
End Date:
Category:
Notice: Undefined variable: query in
.../html/modules/CGCalendar/CGCalendar.module.php on line 540
Notice: Undefined offset: 1 in .../html/lib/adodb_lite/adodbSQL_drivers/mysql/mysql_driver.inc on line 320
The template for the search results is currently default:
{* original search result template *}
{debug}
<h3>{$mod->Lang('search_results')}</h3>
<p>{$mod->Lang('search_words')}: {$search_text}</p>
<p>{$mod->Lang('start_date')}: {$search_start_date|cms_date_format}</p>
<p>{$mod->Lang('end_date')}: {$search_end_date|cms_date_format}</p>
<p>{$mod->Lang('category')}: {if $search_category == '-1'}{$mod->Lang('cal_any_category')}{else}{$mod->GetCategoryName($search_category)}{/if}</p>
{if !isset($events)}
{$mod->Lang('no_results_found')}
{else}
<br/>
{* pagination stuff *}
{if isset($firstpage_url) || isset($lastpage_url)}
<div style="text-align: center;">
{if isset($firstpage_url)}
<a href="{$firstpage_url}">{$mod->Lang('first_page')}</a>
<a href="{$prevpage_url}">{$mod->Lang('prev_page')}</a>
{/if}
{$mod->Lang('page_of',$pagenum,$numpages)}
{if isset($lastpage_url)}
<a href="{$nextpage_url}">{$mod->Lang('next_page')}</a>
<a href="{$lastpage_url}">{$mod->Lang('last_page')}</a>
{/if}
</div>
{/if}
{* display the output *}
{foreach from=$events key=key item=event}
<div class="calendar-event">
<h4>{$event.event_title}</h4>
{assign var=month_number value=$event.event_date_start|date_format:"%m"}
{assign var=end_month_number value=$event.event_date_end|date_format:"%m"}
{if $event.event_date_start == $event.event_date_end || $event.event_date_end == 0}
<div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y"}</div>
{else}
{if $event.event_date_start|date_format:"%d%m%Y" == $event.event_date_end|date_format:"%d%m%Y"}
<div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%H:%M"}</div>
{else}
<div class="calendar-date-from"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]} {$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to} {$event.event_date_end|date_format:"%d"} {$month_names[$end_month_number]} {$event.event_date_end|date_format:"%Y %H:%M"}</div>
{/if}
{/if}
{if $event.event_summary !="" && ($detail != 1 || ($event.event_details =="" || $event.event_details == "<br />"))}
<div class="calendar-summary"><span class="calendar-summary-title">{$lang.summary}: </span>{$event.event_summary}</div>
{/if}
{* optionally display detail information
{if $event.event_details !="" && $event.event_details != "<br />"}
<div class="calendar-details"><span class="calendar-details-title">{$lang.details}: </span>{$event.event_details}</div>
{/if}
*}
<a href="{$event.url}">{$mod->Lang('cal_more')}</a>
</div>
{/foreach}
{/if}