This is perhaps my largest hurdle to completing my conversion to WSN Directory. I need to be able to display entries from a specific category on a page outside the WSN directory - many different categories on many different pages. I have tried to do this, according to these instructions. I added a _GET with the category ID, as per the instructions here.
What I've gotten is a whole slew of error statements. 12, in fact. Below them, the category title and subcategories DO in fact output, but no listings display.
Here's the first error:
Error occurred at http://mtshastachamber.com/directory/test.php on 2011-05-07 04:45:18. Error text: Warning #512: 'Unparsed template variable(s) in config line attachments,time,50,ascending,type='link' AND objectid={LINKEFFECTIVEID} AND (filetitle LIKE '%.jpg' OR filetitle LIKE '%.jpeg' OR filetitle LIKE '%.png' OR filetitle LIKE '%.gif'),,,0,0,0,0,0,0,,0 of toplist #10 in template templates/default/dining.tpl!' in includes/commonfuncs.php on line 5401 Step 1 of backtrace: File: includes/commonfuncs.php Line: 5401 Function: trigger_error Arguments:
I just overwrote all of my template files with a brand new set from 6.0.25, only editing a few files that were customized, to see if that helped, but to no avail.
I have no idea what these errors mean - can anyone provide guidance? I am really lost...
This means the content of your test.php is wrong, in that it's not calling any specific categories, and thus you're not allowed to use the toplists that normally go on the 'show listings in category' page. What did you type?
I put "$_GET['catid'] = '400';" - that was the category id I was trying to retrieve listings for.
Here's the code I'm using on test.php:
<?php /* Supply the path to WSN and the name of your template on the lines as requested */
$pathtowsn = '/usr/www/users/mscoc/mtshastachamber.com/directory/'; // as listed on your settings->general configuation page but without the 'attachments/' part
$yourtemplatename = 'dining.tpl'; // the template, located in the 'custom' subdirectory of your templates directory, that you want to display
$usewrapper = 'no'; // set to 'no' if you don't want to show the WSN wrapper
I've also tried the first version of the custom template code, same errors:
<?php /* Supply the path to WSN and the name of your template on the lines as requested */
$pathtowsn = '/usr/www/users/mscoc/mtshastachamber.com/directory/'; // as listed on your settings->general configuation page but without the 'attachments/' part
$yourtemplatename = 'dining.tpl'; // the template, located in the 'custom' subdirectory of your templates directory, that you want to display
$usewrapper = 'no'; // set to 'no' if you don't want to show the WSN wrapper
$curr_path = getcwd(); chdir($pathtowsn);
require 'start.php'; if (!$template) $template = new template('custom/'. $yourtemplatename); require 'end.php';
mschamber wrote: I put "$_GET['catid'] = '400';" - that was the category id I was trying to retrieve listings for.
You need to use all the parameters that you see in the URL. Category URLs are of the form index.php?action=displaycat&catid=x, so you need $_GET['action'] = 'displaycat'; also.
<?php /* Supply the path to WSN and the name of your template on the lines as requested */
$pathtowsn = '/usr/www/users/mscoc/mtshastachamber.com/directory/'; // as listed on your settings->general configuation page but without the 'attachments/' part
$yourtemplatename = 'dining.tpl'; // the template, located in the 'custom' subdirectory of your templates directory, that you want to display
$usewrapper = 'no'; // set to 'no' if you don't want to show the WSN wrapper
Is there anything I can set or tweak to get the map to display?
I'm also trying to display these templates from within WordPress (using a WP template file). This seems to produce a completely different kind of error: http://visitmtshasta.com/dining/ (the code I'm using is the same as I posted previously, but with the $_GET['action'] = 'displaycat'; added.)
I realize I'm asking for some complicated things here...
The reason the maps don't work is that all of the WSN javascript is missing. This is a result of your suppressing the wrapper template. I'd suggest using a custom wrapper instead: $_GET['customwrapper'] = 'wrappertemplatename'; $_REQUEST['customwrapper'] = 'wrappertemplatename';
I'll look into if it's feasible to get the javascript included when suppressing the wrapper.
WordPress can presumably only use WordPress templates, not WSN templates.
Comments on Trying to "Show Custom Template"
Usergroup: Customer
Joined: Apr 20, 2011
Location: Mount Shasta, CA
Total Topics: 3
Total Comments: 10
This is perhaps my largest hurdle to completing my conversion to WSN Directory. I need to be able to display entries from a specific category on a page outside the WSN directory - many different categories on many different pages. I have tried to do this, according to these instructions. I added a _GET with the category ID, as per the instructions here.
Here is the page in question.
What I've gotten is a whole slew of error statements. 12, in fact. Below them, the category title and subcategories DO in fact output, but no listings display.
Here's the first error:
Step 1 of backtrace:
File: includes/commonfuncs.php
Line: 5401
Function: trigger_error
Arguments:
Step 2 of backtrace:
File: end.php
Line: 644
Function: runtoplist
Arguments:
Step 3 of backtrace:
File: index.php
Line: 225
Function: require
Arguments: end.php
Step 4 of backtrace:
File: /usr/www/users/mscoc/mtshastachamber.com/visitor/dining/test.php
Line: 34
Function: require
Arguments: index.php
The referring URL was .
I just overwrote all of my template files with a brand new set from 6.0.25, only editing a few files that were customized, to see if that helped, but to no avail.
I have no idea what these errors mean - can anyone provide guidance? I am really lost...
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
This means the content of your test.php is wrong, in that it's not calling any specific categories, and thus you're not allowed to use the toplists that normally go on the 'show listings in category' page. What did you type?
Usergroup: Customer
Joined: Apr 20, 2011
Location: Mount Shasta, CA
Total Topics: 3
Total Comments: 10
I put "$_GET['catid'] = '400';" - that was the category id I was trying to retrieve listings for.
Here's the code I'm using on test.php:
I've also tried the first version of the custom template code, same errors:
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
I put "$_GET['catid'] = '400';" - that was the category id I was trying to retrieve listings for.
You need to use all the parameters that you see in the URL. Category URLs are of the form index.php?action=displaycat&catid=x, so you need $_GET['action'] = 'displaycat'; also.
Usergroup: Customer
Joined: Apr 20, 2011
Location: Mount Shasta, CA
Total Topics: 3
Total Comments: 10
IT WORKED!! Thank you so much, you are my hero!
Usergroup: Customer
Joined: Apr 20, 2011
Location: Mount Shasta, CA
Total Topics: 3
Total Comments: 10
One thing I've noticed this morning, looking at it again, is that the Google map doesn't display:
No map: http://mtshastachamber.com/visitor/dining/test.php
Map: mtshastachamber.com/directo...ction=displaycat&catid=400
Is there anything I can set or tweak to get the map to display?
I'm also trying to display these templates from within WordPress (using a WP template file). This seems to produce a completely different kind of error: http://visitmtshasta.com/dining/ (the code I'm using is the same as I posted previously, but with the $_GET['action'] = 'displaycat'; added.)
I realize I'm asking for some complicated things here...
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
The reason the maps don't work is that all of the WSN javascript is missing. This is a result of your suppressing the wrapper template. I'd suggest using a custom wrapper instead:
$_GET['customwrapper'] = 'wrappertemplatename';
$_REQUEST['customwrapper'] = 'wrappertemplatename';
I'll look into if it's feasible to get the javascript included when suppressing the wrapper.
WordPress can presumably only use WordPress templates, not WSN templates.
Usergroup: Customer
Joined: Apr 20, 2011
Location: Mount Shasta, CA
Total Topics: 3
Total Comments: 10
Thanks for your help - I reformatted the template file and used the wrapper, that did the trick.
I appreciate your patience!