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


Go Back   Easy PHP Calendar > General Discussion > Customizations (Themes / Templates)

Customizations (Themes / Templates) Help with customizing the themes and templates. Post your own custom themes for others to enjoy.

Closed Thread
 
Thread Tools Search this Thread Display Modes

Category Display Parsing
Old 11-21-2007, 06:22 PM   #1
MadZebra
Calendar User
 
MadZebra is offline
Join Date: Nov 2007
Posts: 2
Default Category Display Parsing

I'm trying to customize the output of the [categories] display. I just want it to display the selection, not the actual category. For example, I have a selection named Youth Events under the category of Display Categories. When I parse [categories] is comes out as Display Categories: Youth Events.

I've tried leaving the category name blank. When I do this, it parses as : Youth Events. I just want is to say Youth Events with no extra text. Any suggestions?
 

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

It is not possible to actually modify the code that generates it, but with some crafty PHP, you can modify it after the fact.

Name your category with some weird characters like §¶£¤³ and make sure that it outputs properly in the HTML (not like &amp.

On the page where you're displaying your list, you'll need to use output buffering. So, in your $LIST section, this is how you'll want to have it.
PHP Code:
$LIST=1;
[
all of your options]
ob_start();
require(
"calendar/calendar.php");
$epcListOutput=ob_get_clean(); 
So, now we have the list output saved into a variable. We can now use the PHP text functions to go in a strip out what we don't want and then display the modified version. For this example, we'll say that you did name your category "§¶£¤³".
PHP Code:
$epcListOutput=ereg_replace("§¶£¤³: """$epcListOutput);
echo 
$epcListOutput
Note that the text you're looking for is the name of the category, plus ": " because you also want to remove the colon and the space.
__________________
-- Gervais
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here.
* Not affiliated with EasyPHPCalendar or NashTech Inc.
 

Minor tweak
Old 11-22-2007, 01:35 PM   #3
MadZebra
Calendar User
 
MadZebra is offline
Join Date: Nov 2007
Posts: 2
Smile Minor tweak

Thanks for the quick reply. After a little tweaking, I got the output to come out the way I wanted it to. One minor tweak was needed to get this working. Your code:

Code:
$epcListOutput=ereg_replace("§¶£¤³: ", "", $epcListOutput); 
echo $epcListOutput;  
Should read:
Code:
$epcListOutput=ereg_replace("§¶£¤³:", "", $epcListOutput); 
echo $epcListOutput;  
The space after the colon was throwing everything off. For those who are looking to do this, the random characters aren't needed for this to work, you just want to make sure that your new category name is unique and not "category."
 
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
Display Category Caption tonynoriega Customizations (Themes / Templates) 3 06-25-2007 02:07 PM
Category Display suzanne General 1 07-29-2006 08:24 AM
Don't Be Like Mike - and a Category question HoosierMike General Support 2 05-23-2006 09:42 AM
Category Display Code Error cwnorwalk Customizations (Themes / Templates) 9 02-06-2006 08:48 PM
Category colour doesn't display Toby Wallis General Support 7 11-22-2005 12:44 PM



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