![]() |
|
full zenphoto functionality integration in a website - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: full zenphoto functionality integration in a website (/thread-2956.html) |
full zenphoto functionality integration in a website - uk81 - 24-05-2008 Hej folks. I have a idea and I was searching around for a long time for a really good gallery. First of all I found a very good german lightweight picture gallery, but really lightweight. Only one php-file, no sub galleries, no db, no comments and no polling. But I want more, I want comments and polling and - the important thing - I want a full php class structure so that I (more or less) can easy integrate the gallery into my website. I have a website programmed with the lightweight php framework codeigniter (http://codeigniter.com/). The most gallerys - ZP so, too - has a full closed system, with templates and database connection. maybe I call http://mydomain.de/index.php/pictures/xyz and this loads my website, my design and my selfprogrammed dynamic menu, but in my content-area I load ZP. So how can I get instances from ZP and load into my website what I need (without reprogramming it): - galleries (and gallery navigation - paging)
Provides ZP functions, modules and classes to get an instance of maybe a gallery or a picture back (as return statement or as an full object) instead of just publishing on the website (echo the whole content)?? Would be great if someone can give me some answers / ideas. Maybe someone has done this already and can help me?? That´s all ... I´m agog of your answers. Greetz [edit] If the rest is just that easy to integrate it is what I´ve dreamed from. full zenphoto functionality integration in a website - sbillard - 24-05-2008 Is this what you are looking for? http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin full zenphoto functionality integration in a website - uk81 - 25-05-2008 @sbillard I don´t know, but I think the problem is CodeIgniter. It is a full php framework with MVC pattern. Or have you another idea for a DB problem when using ZP as a plugin? full zenphoto functionality integration in a website - uk81 - 25-05-2008 I think about now and here is a list what I think I'll need for a full integration. Maybe one or some classes provide this functionality:
The paging I can do for myself, CI provides very good and easy to use helper for this. So I can write some functions for reading out the gallerys, show a overview and set my own links to show them. Why I do not program it for myself?
But! so I have to make sure, that:
But ZP provides this function in its core and when it provides it via a interface (like a API) ... I don´t have to program it all my way. full zenphoto functionality integration in a website - acrylian - 25-05-2008 I don't know codeigniter (but I know which "lightweight german gallery" you mean..:-)) We have a fairly large documentation including all the main classes on our site's user guide page. Maybe you already find there what you need. full zenphoto functionality integration in a website - uk81 - 25-05-2008 I hope so. But a general question (without took a look at the class documentations yet): So that I can let give me for example a list of gallery names or gallery informations without taking care for myself, if all privileges are fullfilled? full zenphoto functionality integration in a website - acrylian - 25-05-2008 The classes actually take care of these things like public etc. Zenphoto uses a set of global variables with class objects like $_zp_gallery (the gallery object), $_zp_current_album (the currently selected album object) and $_zp_current_image (well...:-)) To save a lot of work you also might consider just making a lookalike theme for zenphoto and run it separatly...:-) full zenphoto functionality integration in a website - sbillard - 25-05-2008 uk81: Maybe your framework has some confilct with zenphoto globals. The connection parameters are loaded from the zp-config.php file and end up in the array full zenphoto functionality integration in a website - zigmoo - 01-06-2008 Hey Guys, CodeIgniter, as a high-security measure, actively removes all global variables it finds, except the contents of $_COOKIE and $_POST. I found this VERY annoying when I was first getting used to CI, especially that it erases $_SESSION and creates its own! The reason that uk81's post (2008-05-24 23:44:28) describes a database error is that zf stores its database connection values (and a whole lot besides!) in globals, and even though uk81 wrote his CI wrapper code correctly, CI is trying to execute the zf code with no database configs variables. Furthermore, many other functions in zf depend on globals, not just the initial database connection. It seems to me that the only solution is to modify the way zf passes information to and from its functions, so that globals are not used. I think that initializing a special class in the config and then passing that in to functions that need its data might work. Sbillard and acrylian, would you guys be interested if some of us wanted to try and help out by modifying zf so that it would no longer rely on globals? Thanks, moo full zenphoto functionality integration in a website - sbillard - 02-06-2008 Certainly, but understand it is a BIG task. full zenphoto functionality integration in a website - acrylian - 02-06-2008 Yes, but sounds like a Zenphoto 2.0 project (at least) to me, since that will surely require a nearly complete rewrite of the code. full zenphoto functionality integration in a website - trisweb - 02-06-2008 It is my understanding that the global variables they refer to are not all globally scoped variables, but simply the globals referenced by register_globals (which would create global variables out of GPC data, eg: $_POST['test'] -> $test). These are highly insecure and should never be used. However, using global variables in general is not inherently insecure at all, and there should be no problem with it. It's controversial and debatable, but I look at it this way - Encapsulating the data (that needs global access) inside a class or object is simply adding overhead to the basic requirement, and where would you store that class or object to be most easily accessible globally? In a global variable, of course, so it's sort of hypocritical. I see a few (not tons, zenphoto only has a few, honestly) globally-scoped variables with good naming convention and usefulness as the logical solution for data that needs global scope. Don't see any reason to change this, but I'm willing to hear better arguments. |