Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 08-02-2006, 12:44 AM
Florid's Avatar
Florid Offline
pp regular
 
Join Date: Aug 2006
Location: Lugansk
Posts: 27
Send a message via ICQ to Florid Send a message via Skype™ to Florid
Post Addon: Random Banner (gif, jpg)

Random Banner (gif, jpg) addon for Pixelpost
Version 1.0
Displays random banner (gif, jpg) on your site.

Example here and here. download it!

================INSTALL=========================

1) UnZip archive
2) Copy your images in banner\ folder
3) Open banner\banner.txt file and edit it:

[url]|[image path]|[description]

for example

Code:
http://photoblogonline.com|banner/photoblogonline.gif|Photos of the most beautiful places of a planet
http://greatitaly.com|banner/italy.gif|Photos of Italy
4) Upload folder 'banner' in your root dir
5) Upload 'random_banner.php' in yor addons dir
6) Use <SHOW_BANNER> in your template.htm
7) Enjoy!

Addon works (see example). But there is one mistake (it is visible in addons menu):
Code:
Warning: file(banner/banner.txt): failed to open stream: No such file or directory in /var/www/vhosts/photoblogonline.com/httpdocs/addons/banner.php on line 19
Code:
line 19: $array_bann = file ('banner/banner.txt');
If it can correct somebody, write to me, I shall correct a code and re-upload this addon
ok, now addon work with no error message
__________________
I like France, Italy & Thailand photos. Random Banner (gif, jpg) addon for Pixelpost

Last edited by Florid; 08-07-2006 at 01:39 AM.
Reply With Quote
  #2  
Old 08-02-2006, 07:41 AM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Make some conditional statement for opening to use this file.

In 1.5 Final there should be global (for admin panel) variable $admin_panel set to 1 so it is enough to do it like that:
PHP Code:
if($admin_panel != 1$array_bann file ('banner/banner.txt'); 
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #3  
Old 08-02-2006, 12:06 PM
Florid's Avatar
Florid Offline
pp regular
 
Join Date: Aug 2006
Location: Lugansk
Posts: 27
Send a message via ICQ to Florid Send a message via Skype™ to Florid
Just replace this line? Has not helped :-(
__________________
I like France, Italy & Thailand photos. Random Banner (gif, jpg) addon for Pixelpost
Reply With Quote
  #4  
Old 08-03-2006, 06:58 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,613
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
Do you have PP 1.5 Final?

Oh and one more thing. If your addon is based on functions then you must add:
PHP Code:
global $admin_page 
at beginning of this function (otherwise this variable wont exist for function).
__________________
photoblog | portfolio | addons | Donate
Reply With Quote
  #5  
Old 08-04-2006, 02:47 PM
Florid's Avatar
Florid Offline
pp regular
 
Join Date: Aug 2006
Location: Lugansk
Posts: 27
Send a message via ICQ to Florid Send a message via Skype™ to Florid
Question

Again 'Has not helped' :-(
if I use
Code:
file ('../banner/banner.txt');
than error message don't show in admin addons panel, banner-image don't show too
maybe need to use $siteurl in file() ... or something like this?
On blog - OK, in admin addons - show error, not so it is terrible, but simply not beautifully looks :-)
__________________
I like France, Italy & Thailand photos. Random Banner (gif, jpg) addon for Pixelpost
Reply With Quote
  #6  
Old 08-05-2006, 09:29 AM
Florid's Avatar
Florid Offline
pp regular
 
Join Date: Aug 2006
Location: Lugansk
Posts: 27
Send a message via ICQ to Florid Send a message via Skype™ to Florid
I put '@' before 'file' and addon work with no error-massage
Code:
$array_bann = @file ('banner/banner.txt');
ZiP updated
__________________
I like France, Italy & Thailand photos. Random Banner (gif, jpg) addon for Pixelpost
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 04:17 PM.

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