Easy PHP Calendar - We really take care of your dates!


Go Back   Easy PHP Calendar > General Discussion > General Support

General Support Questions about using the Easy PHP Calendar. (Not installation or customizations)

Closed Thread
 
Thread Tools Search this Thread Display Modes

category filter w/ Smarty Template problem
Old 10-26-2007, 11:20 PM   #1
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default category filter w/ Smarty Template problem

I was trying to add the category filter and it's within a smarty template tag. The calendar and list is working fine with the following smarty php tag:

{php}$OL=1; require("calendar/calendar.php"){/php}


but when i try this, it does not work and gives me a blank area and doesn't even show the calendar either:
{php} require("calendar/plugins/filter.php"){/php}
 

Old 10-27-2007, 11:55 AM   #2
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,968
Default

Just to try, add this line at the top of filter.php

require("../config.inc.php");
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 10-27-2007, 09:22 PM   #3
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default

I tried that and didn't work. Same thing, the rest of the page (anything following the code) will not show up. I've also tried moving the filter.php file to the root of calendar and didn't work either. The legend.php file is the same... So it seem like anything in a sub directory is causing a problem.
 

Old 10-28-2007, 06:12 PM   #4
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,968
Default

One of the reasons why I stopped using Smarty. It's so complicated to make real PHP work inside of a template that it was just too much of a pain.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 10-28-2007, 10:09 PM   #5
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default

I just actually tried it in demo.php and it did the same thing. Anything following the code is gone, when I take out the code, it's back. So I guess it isn't a Smarty issue in this case.

Is there maybe some path setting?
 

Old 10-29-2007, 01:17 AM   #6
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,906
Default

The filter.php file may be corrupt. Try uploading it again and be sure to use binary mode.
__________________
-- Brian

Questions?

Instructions | FAQs | Errors FAQ | Forums | Support
| Web Site Hosting
 

Old 10-29-2007, 01:44 AM   #7
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default

I've tried uploading it again using binary mode and still the same. This occurs for the legend.php as well.
 

Old 10-29-2007, 01:57 AM   #8
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,906
Default

Can you attach the modified demo.php file so I can see what may be happening with it?
__________________
-- Brian

Questions?

Instructions | FAQs | Errors FAQ | Forums | Support
| Web Site Hosting
 

Old 10-29-2007, 02:05 AM   #9
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default

Here it is...his one has the legend code in it.
Attached Files
File Type: php demo.php (1.8 KB, 237 views)
 

Old 10-29-2007, 06:14 AM   #10
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,968
Default

That is because of the path you're using. The demo file is already inside of the /calendar folder, so your path should be "plugins/legend.php".
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 10-29-2007, 09:01 AM   #11
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default

oh right, I didn't change that. But for the one in Smarty, the path should be have the directory calendar in front, doesn't work the same as displaying the calendar and viewing...
 

Old 10-29-2007, 09:17 AM   #12
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default

hmmm.. I just put the code under the following and it worked, but the drop down below everything:


Code:
 {php}$LIST=1; 
$listMonths = 12;
$noOld=1;
$DF = "D - M d"; 
$template="monthly.php"; 
require ("calendar/calendar.php"){/php}  

 {php}
 

Old 10-29-2007, 04:14 PM   #13
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,968
Default

The reason why it won't display the legend (or the filter) is because of the templating engine...

When something is using the template, the variables are "segregated" from the rest of the code. So, if you look at the code for both the legend and the filter, it says if you don't find the categories described, exit. Since the categories have either not been defined yet, or that they have but are not accessible to the template, nothing is displayed.

That's why I asked you to add the require("../config.inc.php"); in the legend.php - it's what defines the categories.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 10-29-2007, 05:05 PM   #14
giggler
Calendar User
 
giggler is offline
Join Date: Sep 2007
Posts: 12
Default

Here is what worked to make the drop down above the calendar list. I added this on the top part of filter.php. This code is part of the code from calendar.php, but changing the functions/calendar.php to functions/categories.php. Now it works fine in Smarty (replace /var/path/domain.com/ with your domain path.) Maybe it doesn't need all this, but I'm not a coder:


Code:
error_reporting(E_ALL ^ E_NOTICE);



if ($epcGetInit!=1) {



// DETERMINE NAME OF CURRENT FILE

if (!isset($thisFile) || (isset($_GET['thisFile']) || isset($_POST['thisFile']))) {

  $thisFile = $_SERVER['SCRIPT_NAME'];

  $thisFile = explode("/",trim($thisFile)); 

  $thisFile = $thisFile[count($thisFile)-1];

  if (!file_exists($thisFile)) $thisFile = htmlentities($_SERVER['PHP_SELF']);

  }



// SERVER (ROOT) PATH TO ESCAL FOLDER

// This address should start and end with a "/" unless this is on a windows server where it will start with a drive letter;

if (!isset($serverPath) || $serverPath!="../" || $getPaths==1) {

$serverPath="/var/path/domain.com/httpdocs/calendar/";

}



// URL PATH TO ESCAL FOLDER

// This address should start and end with a "/". *

// It is usually the name of the directory this file is in (Example: "/escal/");

// * If you enter the full URL starting with "http://", this address will not be verified by the calendar script!

$urlPath="/calendar/";



}



if ($getPaths!=1 && $epcGetInit!=1) {



// GET HTML FUNCTIONS

require_once($serverPath."functions/functions.inc.php");



// CURRENT THEME

$currentTheme="default";







// DISPLAY CALENDAR

if ($CSS=="" && $OL!=1 && $LIST!=1 && $PCSS=="" && $TOC=="" && $MULTIX=="" && $EPCBLOG=="" && $EPCAJAX=="") {

  if (!file_exists($serverPath."config.inc.php")) die ("<font color=red>Server Path Error.</font><br />Please run the Setup Manager to correct this problem.<br /><br />");

  if ($license=="" || !isset($license) || !isset($gmt) || $gmt=="") {require ($serverPath."config.inc.php");}

  require ($serverPath."functions/categories.php");

  }



// UNSET MODE VARIABLES

unset ($CSS,$PCSS,$OL,$LIST,$TOC,$MULTI,$MULTIX,$EPCAJAX);

}

Last edited by giggler; 10-30-2007 at 12:51 AM.
 
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't Be Like Mike - and a Category question HoosierMike General Support 2 05-23-2006 09:42 AM
Filter and List Mode - How can I change the initial category displayed? m2m General Support 2 05-05-2006 03:52 PM
Problem with Category Filter jwalton General Support 7 07-21-2005 02:29 PM
displaying a single category problem Tod General Support 8 06-30-2005 08:46 AM
Category Filter Problem mcfatema@iowatelecom.net General Support 12 06-21-2005 11:03 AM



All times are GMT -4. The time now is 08:54 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2009 NashTech, Inc.

| Home | Register | Today's Posts | Search | New Posts |