Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 06-13-2006, 05:17 PM
jdleung Offline
pixelpost guru
 
Join Date: Feb 2006
Location: Foshan, China
Posts: 553
Smile Double functions error!

I have 2 addons. One for image_template.html, another for browse_template.html. They both have a same function inside. this causes the archive

page goes to blank. And when I delete the function in the addon for browse_template.html, it goes well and even can use the function of the addon for image_template.html.

the function turns global?
Does it mean PP reads all the addon first no matter which page you're bruwsing and even no addon tag in it?

Will this slow down the speed?

refer to some other addons, I insert the following before the first addon's codes
1. if ($_GET['x']=='' ) { ...... }

can anyone give a clear answer on this?

Thanks.
__________________
jdleung's.com @ flickr @ fotoblogs.cn & Addons:Month Calendar & Slideshow & Flickr comment & Modified Addon: Calendar

Last edited by jdleung; 06-13-2006 at 05:50 PM.
Reply With Quote
  #2  
Old 06-14-2006, 08:51 PM
jdleung Offline
pixelpost guru
 
Join Date: Feb 2006
Location: Foshan, China
Posts: 553
no answer?
you guys watching football game?
__________________
jdleung's.com @ flickr @ fotoblogs.cn & Addons:Month Calendar & Slideshow & Flickr comment & Modified Addon: Calendar
Reply With Quote
  #3  
Old 06-15-2006, 01:15 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
yeah. i've got a bet on ecuador right now - going well. also got the england game later so no time to really take the time to understand this right now. will come back here.
Reply With Quote
  #4  
Old 06-15-2006, 05:16 PM
jdleung Offline
pixelpost guru
 
Join Date: Feb 2006
Location: Foshan, China
Posts: 553
3:0. you win!
hope you can give me a reply after England win the game.;-D
__________________
jdleung's.com @ flickr @ fotoblogs.cn & Addons:Month Calendar & Slideshow & Flickr comment & Modified Addon: Calendar
Reply With Quote
  #5  
Old 06-16-2006, 11:32 AM
raminia's Avatar
raminia+ Offline
Team Pixelpost
 
Join Date: Jan 2005
Location: FL, US
Posts: 3,706
Send a message via Yahoo to raminia
I have your answer but you should hope that Iran won't lose too bad to Portugal tomorrow and then I'll give you the answer

Ok... you did! now here is the answer

before defining the function put this line
if ( !function_exists('function_name') ){

and at the end add
}

for example
PHP Code:
if ( !function_exists('my_function_name') )
{
  function 
my_function_name(blah,blah,blah)
  {
    
// do some good job out there
    
foo= ....;

    
// ... and return cool results ....

  
// end of function

// end of if function exit 
Quote:
Does it mean PP reads all the addon first no matter which page you're bruwsing and even no addon tag in it?
yes! all addons are included in the core index.php everytime! That's why you should be wise in writing addons and adding switches to turn them on when demanded. BTW, that's why we are considering the option to add workspaces to the front side as well as the admin side for the good of addon makers in future releases.
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7
Reply With Quote
  #6  
Old 06-16-2006, 07:07 PM
jdleung Offline
pixelpost guru
 
Join Date: Feb 2006
Location: Foshan, China
Posts: 553
Smile

Thanks Raminia.
I'm clear now. hope pp will update soon.

Quote:
I have your answer but you should hope that Iran won't lose too bad to Portugal tomorrow
I hope so. but...
__________________
jdleung's.com @ flickr @ fotoblogs.cn & Addons:Month Calendar & Slideshow & Flickr comment & Modified Addon: Calendar
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 08:58 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs