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

Add custom field or used something already here
Old 03-28-2012, 02:38 PM   #1
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default Add custom field or used something already here

I like to be able to add a picture LINK to a event. Here an example. Event : 12-03-2012, title : please visit us, text : bla bla bla. hosted : Linda

So it's a Linda event, i like, before the post list, to show a photo of Linda

How do i do that ?... add a custom field named : photo
or use a category, but i dont want that category listed under category

It's really a custom field i need....

how do i add this ?
 

Old 03-28-2012, 02:42 PM   #2
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

You can use an HTML img tag to add images/etc. to your descriptions.
__________________
-- Brian

Questions?

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

Old 03-28-2012, 03:31 PM   #3
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default

I like it to be a field that i can toggle on/off

If it's a piscture, i am force to see it....

i like to be able to use it to display it somewhere.. and ignore it elsewhere...

conditional <img> retreiving in template possible ?
 

Category
Old 03-28-2012, 03:42 PM   #4
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default Category

OK, i have tru category (not main, but under cat).. and it work fine... it's not display as the main list... but now, how do i retreive the second category of a event, and do a liitle login on that... If (cat='linda' then echo <img> ffdskfsd </img>
 

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

The only situation that I've seen this work was with the main category. Then you have to customize the $CSS output to replace the colors with images.

This client has an example of something similar - http://www.easyphpcalendar.com/forum...ad.php?t=10448
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Not main category
Old 03-28-2012, 05:34 PM   #6
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default Not main category

OK, i cannot get anything usefull from this conversation...

so here is loud and simple... the only question i have...

I like to know the function that get me not the main category but the second category... how do i retreive this ?.... i want the CODE... php, html, css... anything usefull.. no concept..

thnaks for your help, i appreciate
 

Old 03-28-2012, 05:39 PM   #7
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default

the link you give me is "perfect" it do exacly what i ask....

but something is missing : i cannot contact the guy (email) the code is not posted, and the solution is not commented...

how is it supposed to help me...
 

variables
Old 03-29-2012, 02:15 AM   #8
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default variables

i play a liitle with the templates.... and found some variable witten in bracket like :

[date], [time], [title], [descr], [categories], [category]

ok then, two question, how those bracket variable work ?
and second, where is the list of ALL the variable i can get ? (nope it's not in the online help)..

thanks in advance
 

Php
Old 03-29-2012, 02:40 AM   #9
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default Php

i try to include some php loginc (if) into a template.... and nothing work... can you tell me what framework do you use for templating and how to do a simple IF

IF [categories]=linda then echo ("<img> xxx </img>)

i will go crazy !
 

Old 03-29-2012, 09:55 AM   #10
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

There is no logic in the templates.

[date], [time], [title], [descr], [categories], [category] are exactly as they appear to be. There are also other options as detailed in the instructions:

http://docs.easyphpcalendar.com/sour...ger/Parser.htm
__________________
-- Brian

Questions?

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

templating
Old 03-29-2012, 12:43 PM   #11
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default templating

what templating system do you use ? or how to execute PHP into templating system or login (if)
 

Old 03-29-2012, 04:53 PM   #12
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

There is no template "system". It does not have logic code. It's a simple find/replace routine.
__________________
-- Brian

Questions?

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

php
Old 03-29-2012, 05:09 PM   #13
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default php

So can you explain to me how i make php code inside the template (php file) when doing this : <?php echo("allo"); ?> it's just do NOTHING ! why ?
 

Old 03-29-2012, 05:13 PM   #14
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

It is not a code file. It is just a text file. The file is read into a variable then parsed for the [XXXXX] listed above. It does not execute.
__________________
-- Brian

Questions?

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

help
Old 03-29-2012, 10:09 PM   #15
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Smile help

First, thanks Brian for the time you take to try to help me. Maybe i am stupid, maybe i dont explain myself clearly... let's try again. In the template folder the file : modern.php i like to add at line 59 something like that :

<?php
$myvar = [categories];
if ($myvar = "person: Lynda"){ echo ("it's Lynda !, yé")}
?>

I have written exactly that, an all the php code is IGNORED, why ?

please tell me what i am doing wrong , thnaks in advance
 

Old 03-29-2012, 10:14 PM   #16
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

modern.php is a text file only. It does not run under PHP when used with the calendar. Think of it as if it was named modern.txt. It's just a text file. It will not run code.
__________________
-- Brian

Questions?

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

text
Old 03-29-2012, 10:22 PM   #17
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default text

So that lead me to the next question, how do i do what i ask you to do ? execute php or make some logic
 

code
Old 03-29-2012, 10:51 PM   #18
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default code

here is some code

with : [categories]
i get the output : <div><strong>Personne:</strong> Paul</div>

i like a way to ONLY get Paul, i can put it a an <img> or a class

how do i do that ?
 

Old 03-30-2012, 09:57 AM   #19
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

You can't do it automatically. It's just not in the programming (no one has ever asked to do this).
__________________
-- Brian

Questions?

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

nobody
Old 03-30-2012, 10:53 AM   #20
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default nobody

Ok, nobody ask you that, is not really an answer, as a paid customer, i should be able to get help to do what i ask, or to modify the file to make it work... What file i can add to get the job done ?. I cannot modify the php file (encoded), i cannot put php in template, i cannot get sample of work done, and i cannot get answer....

please please please, i just want that to STOP. How is it possible to retreive the [categories] and do something usefull with it.

It's output like "blblabla: otherblabla" with div and stong add to it...

which file i can edit (PHP) and remove that, or make it work differently ?

help me, and after that i wont ask question here over and over... i will shut the **** up, and work ..

thanks

can you skype me, it will be faster, ans loosing that in the help forum wont miss to anybody, because nothing good come out from this conversation yet !..

my skype name : menardmam
 

Old 03-30-2012, 11:04 AM   #21
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

To do what you're asking, my best advice is that you would need to capture the output from the list mode (ob_start, etc.). Then you can manipulate the output any way you want by searching/replacing, etc.. This can/would not be a supported modification as it is beyond the scope of it's intended use.
__________________
-- Brian

Questions?

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

show me
Old 03-30-2012, 01:12 PM   #22
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default show me

OK, now we go somewhere... So next step, can you tell/show me how to capture that output ?, example of code ? step-by-step instruction
 

Old 03-30-2012, 04:05 PM   #23
Brian
EPC Developer
 
Brian's Avatar
 
Brian is offline
Join Date: Jun 2001
Location: Florida, USA
Posts: 10,878
Default

If you would like for us to create a custom script for you, please open a support ticket so we can work out the details.
__________________
-- Brian

Questions?

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

dev
Old 03-30-2012, 06:41 PM   #24
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default dev

I like you to do it FREE or tell me wich file i can modify to get some php. It's your code, but when i buy it, i must be able to do it myselft, not asking you to do it....
 

ticket-update
Old 03-30-2012, 09:31 PM   #25
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default ticket-update

I still running version 6. i see there is version 7.. how upgrading can help me ?
 

Old 03-31-2012, 08:01 AM   #26
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Ok, lets clear the air about a few things... You bought a license. This allows you the use of the product. You did not buy the code, which would allow you to modify the product. Think of it in the same way as Microsoft Windows, or Office. Do you think Microsoft is ever going to let you have the code so that you can modify stuff to your liking?

Having said that, the templating that is done in EPC does allow for some customization of the output of the calendar. The customization that you're asking for is simply not available. Like Brian said, you cannot have PHP in the template. If you want to modify the output of the template beyond that, you will have to "do it yourself".

In my previous post I made it clear that the example I was showing you required the use of the main category. Since you do not want to modify your setup to use the main category, Brian suggested you use ob_start() to capture the output. That should have put you on the right track.

We (note that I'm not associated with EPC) try to be as helpful as possible, however it is not our place to teach clients how to use PHP. There are plenty of resources online for that, that will do a better job than we could.

That being said, I will explain how to go about to get what you want... but you have to understand that this is absolutely not supported in any way, shape, or form... and if, when you decide to upgrade to V7, the thing breaks EPC is not responsible for fixing it. Now, I will explain, but I will not do it for you... you will have to work at this to implement it.

1. Prepare the CSS

Wherever you have your CSS, add the following class

HTML Code:
.epcFloatImg { float: right; }
2. Prepare your sub-category

If you haven't done so already, create a sub-category that will hold your different selections. In this example I'm going to use "Host" as the name of the category, so that it still makes sense if you want to display the text somewhere else on your site. Once the category created, add all the values that you want to be available. For this, I'm going to use "Linda", "Jane", and "Sophie" as examples.

3. Prepare your images

Upload the images to your site to a common location… /images is usually a good idea. And for simplicity, I'm only going to use the <host's name>.jpg for this example. So we have "/images/Linda.jpg", etc…

4. Capture the List output

Right now, you have a section of code that starts with $LIST=1; and ends with require("calendar.php"); [the path to calendar.php may be different]. This is what generates the List mode. To capture the output, we'll use output buffering. You do that by starting the capture just before the require(), and returning the output just after the require(), like so:

PHP Code:
ob_start();
require(
"calendar.php");
$epcOutput ob_get_clean(); 
5. Setting up the values for the replacement

Now that we've captured the output, we're going to process it. First, we must define what we're searching for, and what we're going to replace it with. You can find what you're searching for by looking at the web page source code and looking for the category. In this example's case, here's what we get for the "Linda" selection:

HTML Code:
<div><strong>Host:</strong> Linda</div>
So, from that we can define each selection that we want to replace in a variable that we'll use later

PHP Code:
$epcSearch = array("<div><strong>Host:</strong> Linda</div>""<div><strong>Host:</strong> Jane</div>""<div><strong>Host:</strong> Sophie</div>"); 
And now, we need to define what those are going to be replaced with

PHP Code:
$epcReplace = array("<img class='epcFloatImg' src='/images/Linda.jpg'>""<img class='epcFloatImg' src='/images/Jane.jpg'>""<img class='epcFloatImg' src='/images/Sophie.jpg'>"); 
Note that you need to match the position between the search and the replace.. Linda is the first in both, Jane is second in both, etc…

6. Replacing the values

Now, we'll use str_replace to actually do the replacing

PHP Code:
$epcReplaced str_replace($epcSearch$epcReplace$epcOutput); 
7. Final output

And, now the final step… outputting our modified List

PHP Code:
echo $epcReplaced
That's it. If you want the image to be to the right instead, just modify the CSS in step 1.

So... all together (except for the CSS), the code should look something like this

PHP Code:
$LIST=1;
$DF "M jS, Y (D)"
$template="modern.php";
ob_start();
require(
"calendar.php");
$epcOutput ob_get_clean();

$epcSearch = array("<div><strong>Host:</strong> Linda</div>""<div><strong>Host:</strong> Jane</div>""<div><strong>Host:</strong> Sophie</div>");
$epcReplace = array("<img class='epcFloatImg' src='/images/Linda.jpg'>""<img class='epcFloatImg' src='/images/Jane.jpg'>""<img class='epcFloatImg' src='/images/Sophie.jpg'>");
$epcReplaced str_replace($epcSearch$epcReplace$epcOutput);

echo 
$epcReplaced
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Finaly
Old 03-31-2012, 12:41 PM   #27
menardmam
Calendar User
 
menardmam's Avatar
 
menardmam is offline
Join Date: Aug 2009
Posts: 36
Default Finaly

OH BOY, it took me a week and 15 messages, but finally somebody answer something intelligent and useful. Thanks.

Can i ask you something. For sure the how-to guide should work fine, but i have read somewhere that you can add some plugin for some $$ and i am ready to pay 50-100$ for that...

Can you just add a feature where i write [categorie-id] in the template it will output just the "name" or the string of the subcategory, just as you do for the [category], it output something useful (a string) to use as class

So, it's already done for category, it's should be "kind of" simple to make a function for the [categorie]. if it's possible, i will be in heaven and i will transfer $ with PayPal in the day !

It's will get the code cleaner, because the templating system is SUPER easy, and having that little function will help a lot, not just me

So it will be <img src="../images/[categorie-id].jpg"> and the final html result will be : <img src="Lynda.jpg"> and everything will be keep simple and clean.

Thanks a million time for the great support and great help, and i still loving this plugin ! :-)
 

Old 03-31-2012, 03:41 PM   #28
ve9gra
Support Team
 
ve9gra's Avatar
 
ve9gra is offline
Join Date: Jun 2003
Location: New Brunswick, Canada
Posts: 4,965
Default

Plugins are 100% separate from the List mode... they live on their own. Building that feature would require modification to the source code. However, just like you, I do not have access to the source code, so no I cannot build you that option.

The problem with what you're asking is that it's impossible to know which category you would want to use... since you can have multiple sub-categories. That's why the system outputs text for all of the sub-categories.

And I understand what you want to do, but that would require building you a complete custom version of the calendar. I'm sure you can understand that it would be impossible to keep the code in sync and up-to-date if there was several thousand customized versions of the calendar.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 
Closed Thread

Tags
custom field

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
Add new event category filter k9barry General Support 2 01-08-2009 01:34 PM
Display Custom Fields allportpc Customizations (Themes / Templates) 1 08-11-2006 09:32 AM
Adding a field itsme2000lv General Support 1 12-19-2005 09:55 AM
Can't add events anymore ;( sagarsanghani General Support 3 06-21-2005 01:45 PM



All times are GMT -4. The time now is 08:18 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 |