Home Menu

Menu


Reply
Thread Tools Display Modes
  #1  
Old Aug 01, 2002, 08:16 AM
lotas lotas is offline
New Member
 
Member Since: Aug 2002
Location: Tallaght, Dublin, Ireland
Posts: 1
Im looking at the pod file and im not liking the way it uses templates. so i went and found some code that gets the template, looks for a specific peice of code in it and then changes the code to what you want to output. that way you can build the template around the peice of code. anyway, im having some problems. here is the code listing that does it:
{print &loadtemplate("template.html",{ pod => print $pod_po_output})};

sub loadtemplate{my ($filename,$text,%values,$name,$value);$filename=shift;$name=shift;%values=%$name;$text="";open(IN,"<$filename") or error("Cannot open $filename : Reason $!");while(<IN>){chomp;$text.=$_;}close IN;while($text =~ m/\<\%(.*?)\%\>/gsi) {$name=$1;if (exists($values{$name})) {$value=$values{$name};}else{$value="";}$text =~ s/<\%$name\%>/$value/g;}return $text;}
but im not totally sure where to put it. it now shows where the <%pod%> is on the template a 1 and before the temlate starts is the code. anyway, if anyone can help, i would be very happy!!! you can use the code for the script if you want. im not sure where i got it, but the code was open source i think. ill find out from looking at scripts on my page. thanks again if you can help!

Lotas T Smartman
www.lotas-smartman.net
www.the-hairy-one.com
__________________
Lotas T Smartman
www.lotas-smartman.net
www.the-hairy-one.com

advertisement
  #2  
Old Aug 01, 2002, 11:19 AM
DocJohn's Avatar
DocJohn DocJohn is offline
Founder & Your Host
Community Support Team
Chat Leader
 
Member Since: May 2001
Location: Greater Boston, MA
Posts: 13,794

It would probably help if you explained which program you're using and what it is exactly you're hoping to accomplish with the new code, because from your previous post it was not at all clear.

John

__________________
Don't throw away your shot.
Reply
Views: 334

attentionThis is an old thread. You probably should not post your reply to it, as the original poster is unlikely to see it.



Similar Threads
Thread Thread Starter Forum Replies Last Post
widget code SweetMelancholy Self Injury 5 May 02, 2008 07:34 PM
Can't see security code dgmorris Community Feedback & Technical Support 0 Nov 01, 2006 12:33 AM
Smilie, color, etc code changes dexter Other Mental Health Discussion 10 Sep 12, 2004 09:19 AM
POD - how to code out 2 lines richardw Community Feedback & Technical Support 0 Nov 01, 2002 07:07 PM


All times are GMT -5. The time now is 04:40 AM.
Powered by vBulletin® — Copyright © 2000 - 2025, Jelsoft Enterprises Ltd.




 

My Support Forums

My Support Forums is the online community that was originally begun as the Psych Central Forums in 2001. It now runs as an independent self-help support group community for mental health, personality, and psychological issues and is overseen by a group of dedicated, caring volunteers from around the world.

 

Helplines and Lifelines

The material on this site is for informational purposes only, and is not a substitute for medical advice, diagnosis or treatment provided by a qualified health care provider.

Always consult your doctor or mental health professional before trying anything you read here.