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

Need Help. Mixing easphp script with another php script
Old 11-25-2007, 12:57 AM   #1
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default Need Help. Mixing easphp script with another php script

Guys, a pretty straight forward question/problem here.

Bought 2 licenses of the program and I love it!

I have easy php calendar loaded on my root page (index.php) and its working great!

However, I also have a news script ("news script") that is embedded in a table below the "blog layout" of the easy php calendar.

Initially, they both work great, but when you change any date on the calender, the calendar does what it is supposed to do and takes you to that day's events...however my news script (underneath) doesn't display the news.. Instead I get "article not found"

I'm asking whats the best way to fix this?

URL = www.panhandleumpires.com

Thanks!
 

Old 11-26-2007, 05:49 PM   #2
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Hard to guess what's going on without getting my hands dirty... Are you using the same database for both scripts? If not, you should. If you are, then I'm stumped.

My guess is that the news script tries to look for articles with any of the variables that are passed through the URL... I suppose we could destroy the variables after the calendar is displayed, but without knowing what the news script is looking for it might be a hit-or-miss thing.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 11-26-2007, 06:13 PM   #3
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

Ok I'll try that. Makes sense. I didn't even think about that. I do have them in 2 separate databases. I'll just add a table to the calendar system.

That should take care of it hopefully?
 

Old 11-26-2007, 07:05 PM   #4
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

It is usually easier to add the calendar to whatever you are already using. The script can automatically create the table required. Just provide it with the database you want to use and the appropriate credentials. You could also move (export/import) the table you already have into the other database. The calendar uses a single table called epc_calendar.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 11-26-2007, 07:09 PM   #5
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

I'm going to try to mess with it shortly. I'll probably just import the calendar like you said.
 

Old 11-26-2007, 07:33 PM   #6
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

Ok buddy, I moved the calendar table to the same database as the news system (news_script) which btw only has 2 tables itself.

And its still a no go. Works initially, but when you click on a date the articles disappear.

The database "tab" under the admin control panel is also pointing at the news_script database now as well.

www.panhandleumpires.com

Where to go now you think?
 

Old 11-26-2007, 10:15 PM   #7
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

In all honesty, I wouldn't mind just switch to a different news system. One that just allows ad, edit delete with a time/date stamp when the article was posted. A tinyMCE feature or similar is only a bonus.

Any suggestions?
 

Old 11-27-2007, 09:10 AM   #8
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

I'm pretty sure it's the $mo variable that's causing this. After the last calendar require, try adding:

<?php
unset($mo);
?>
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 11-27-2007, 10:24 AM   #9
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

A fellow Floridian sure does appreciate the help. I hope you guys don't get upset for posting the whole code, but here is what I have added so far. Still a no go. I feel its my amateur php skills or something simple I'm doing wrong. I'm sorry!!


My sql table looks like this as well...

Database:
  • news_script
Tables:
  • epc_calendar
  • n2s_article
  • n2s_setting
I took out the css styles to make it smaller...

Quote:
Originally Posted by flump

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<?php include './include.php'; ?>

<html>

<head>

<title>Panhandle Umpires</title>
<meta http-equiv="l" content="text/html; charset=iso-8859-1"/>

<?php $CSS=1; require("calendar/calendar.php"); ?>

<style type="text/css">

</head>

<body>

<table width="800" border="1" align="center" cellpadding="10" cellspacing="0">
<tr>
<td colspan="2" align="center" valign="top" bgcolor="#006699"><img src="images/toplogo.jpg" alt="toplogo.jpg" width="800" height="80" border="0"><br>
<br>
<span class="style8"><a href="index.php" class="bottom_link">home</a><strong> :: </strong><a href="about_us.php" class="menu_link">about us</a><strong> :: </strong><a href="forms.php" class="menu_link">forms</a><strong> :: </strong><a href="links.php" class="menu_link">links</a><strong> :: </strong><a href="contact_us.php" class="menu_link">contact us</a><strong> :: </strong><a href="gallery/" class="menu_link">photo gallery</a><strong> :: </strong><a href="http://www.panhandleumpires.com/forums" target="_blank" class="menu_link">forums</a> <strong>:: </strong><a href="https://panhandle.assignby.net/" target="_blank" class="menu_link">assignbyweb</a><a href="assignbyweb.php" class="menu_link"></a></span></td>
</tr>
<tr>
<td width="205" align="center" valign="top" bgcolor="#FFFFFF">

<span class="local style12 style15"><a href="all_times_local.php" class="local">all times local</a></span><br>

<?php $EPCBLOG=1;

require("calendar/calendar.php");

?>

</td>
<td align="center" valign="top" bgcolor="#F2F2F2">

<?php

$EPCBLOG=2;
$template="blog.php";
$DF = "l, F j, Y";
require("calendar/calendar.php");

?>

<?php

unset($mo);

?>


</td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" bgcolor="#FFFFFF"><div align="left">
<p><?php echo $n2s_output; ?></p>
<p>&nbsp;</p>
<p><br>
</p>
</div></td>
</tr>
<tr>
<td height="20" colspan="2" align="center" valign="top" bgcolor="#006699"><div align="left" class="style10"><span class="body_link"><span class="style11">design by <a href="design_by.htm" class="bottom_link">wposey</a> <strong>:: </strong>Copyright 2007 All Rights Reserved :: </span><span class="style12"><a href="admin.php" class="admin_link">admin</a></span></span></div></td>
</tr>
</table>

</body>
</html>

Last edited by flump; 11-27-2007 at 10:34 AM. Reason: A little cleaner code
 

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

Ok, how does the news script work? All I see where the news are is an echo... That leads me to believe that the code is generated way before that. Is it possible it's done in the include.php?

If you could somehow move where the news are generated to right after the unset($mo), that might work.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 11-27-2007, 11:23 AM   #11
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

Quote:
Originally Posted by ve9gra View Post
Ok, how does the news script work? All I see where the news are is an echo... That leads me to believe that the code is generated way before that. Is it possible it's done in the include.php?

If you could somehow move where the news are generated to right after the unset($mo), that might work.
Doing this just spits the news under the blog window

http://www.panhandleumpires.com/index2.php for example.

the include.php for the news script is (which is located in index.php directory...?) OR should the calendar be in the same directory as the new_script...or vis versa?

Should I maybe move include.php to the calendar's director?

Quote:
Originally Posted by flump

<?php

/**
* GentleSource News Script
*
*/


define('N2S_ROOT', './news_script/');
define('N2S_FRONTEND_RESULT_NUMBER', 10);

require N2S_ROOT . 'news.php';


?>
 

Old 11-27-2007, 08:27 PM   #12
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

The directory shouldn't matter.

Try modifying the code at the top to this:

PHP Code:
<?php 
$moT 
$_REQUEST['mo'];
unset(
$mo);
include 
'./include.php'
$mo $moT;
?>
__________________
-- Brian

Questions?

Instructions: Version 6 - Version 7 | FAQ | Errors FAQ | Paths FAQ | Forums | Support
| Web Site Hosting
 

Old 11-27-2007, 08:56 PM   #13
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

Quote:
Originally Posted by Brian View Post
The directory shouldn't matter.

Try modifying the code at the top to this:

PHP Code:
<?php 
$moT 
$_REQUEST['mo'];
unset(
$mo);
include 
'./include.php'
$mo $moT;
?>
No unfortunately that doesn't work either.
 

Old 11-27-2007, 11:28 PM   #14
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

I looked a bit at how the script works and it simply looks at the Query String (at least in its default config). Since the calendar uses the query string to pass the day/month/year, it causes the news script to look for an article named ev=2454429&mo=11&yr=2007...

Change your configuration for the news script to use URL Parameter instead, that way it'll be looking for a parameter called "url" in the URL instead of just taking everything.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 11-27-2007, 11:58 PM   #15
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

Not following you Ve9gra. Could you explain it a little more thorough?
 

Old 11-28-2007, 12:48 AM   #16
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

anyone think that it may be something to do with the blog.php template files?
 

Old 11-28-2007, 08:35 AM   #17
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Sorry... I'll explain. I read the installation guide for the news script and they say there's three modes you can run it under:

- URL Parameter
(http://www.example.com/news/?url=Article-Title-42.html)

- Query String (default setting)
(http://www.example.com/news/?Article-Title-42.html)

- .htaccess Mod Rewrite
(http://www.example.com/ news/Article-Title-42.html)

As you can see, under the Query String setting, it uses the whole URI, so will look for anything you put in the query to match a title. If you change that setting to be URL Parameter, then it will look only for the "url" variable in the query.

The fact that the news script isn't working has technically nothing to do with the calendar. If you were to use the news script inside of a CMS (ie: Joomla, PHP-Nuke, many others) it would break just the same.

I've tested it using a similar configuration to yours (blog mode with the news script below) and I can confirm that changing the configuration to use URL Parameter fixes it. Go to the admin section of News Script and under Configuration > General Settings > URL Handling = URL Parameter.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Old 11-28-2007, 01:38 PM   #18
flump
Calendar User
 
flump is offline
Join Date: Nov 2007
Posts: 15
Default

Did I ever mention you guys are pretty smart?

I felt it was something simple. I feel so dumb.

ve9gra thank you so much for your help. I really appreciate the extra mile you went to fix this for me. It's not even your script. I really appreciate your effort and to all those who helped. Best $40 I've spent in a long time (2 x $20).

I will always use this script. I'll never even dream of buying another calendar system again.

Thanks a ton guys. That was the last thing until my site was ready for launch!
 
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
PHP Errors anthony General Support 2 02-07-2005 01:10 PM
What if my host refuses PHP loadable extensions (ioncube)? gmckenzi General Support 4 09-02-2004 04:52 PM
{Fixed} Problem adding an event ucb General Support 23 11-19-2003 06:31 PM
displaying calendar in php script via template file badmix General Support 0 01-08-2003 11:03 AM



All times are GMT -4. The time now is 03:04 PM.


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 |